/* Layout: skip link, top line, header + main menu (desktop and mobile), footer.
   Markup: templates/partials/{header,footer,logo}.html.twig. Rules ported from V6. */

/* --- Skip link: hidden until focused with the keyboard --- */
.skip-link {
  position: absolute;
  z-index: 200;
  left: var(--gutter);
  top: -100px;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;

  &:focus { top: 10px; }
}

main:focus { outline: none; }

/* --- Logo --- */
.logo {
  display: block;
  flex-shrink: 0;

  & img { width: auto; height: 100%; }
}

/* --- Top line --- */
.topline {
  background: var(--navy);
  color: #c6d7dd;
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;

  & .topline__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 32px;
  }

  & span:last-child { color: #96bfcc; }

  @media (max-width: 520px) {
    & .topline__inner { justify-content: flex-end; }
    & span:first-child { display: none; }
  }
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  border-bottom: 1px solid #e5edef;
  background: rgb(255 255 255 / .97);
  backdrop-filter: blur(16px);

  & .site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
    height: 84px;
  }

  /* stacked logo: 120 px source shown at 60 px = sharp on 2× screens */
  & .site-header__logo { height: 60px; }

  & .site-header__nav {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  & .site-header__menu {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;

    & a {
      position: relative;
      font-size: 12px;
      font-weight: 750;
      white-space: nowrap;
      color: #3e5a67;
      text-decoration: none;
    }

    & a:hover, & a[aria-current] { color: var(--teal); }

    & a[aria-current]::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      bottom: -10px;
      height: 2px;
      background: var(--teal);
    }
  }

  & .site-header__cta {
    gap: 10px;
    padding: 13px 14px;
    font-size: 11px;
    white-space: nowrap;
  }

  & .site-header__toggle {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--navy);
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
  }

  /* hamburger drawn in CSS; turns into × when open */
  & .site-header__toggle-icon {
    position: relative;
    width: 18px;
    height: 2px;
    background: currentColor;
    transition: background .2s;

    &::before, &::after {
      content: '';
      position: absolute;
      left: 0;
      width: 18px;
      height: 2px;
      background: currentColor;
      transition: transform .2s;
    }

    &::before { top: -6px; }
    &::after { top: 6px; }
  }

  & .site-header__toggle[aria-expanded="true"] .site-header__toggle-icon {
    background: transparent;
    &::before { transform: translateY(6px) rotate(45deg); }
    &::after { transform: translateY(-6px) rotate(-45deg); }
  }

  @media (max-width: 1240px) {
    & .site-header__nav, & .site-header__menu { gap: 13px; }
    & .site-header__menu a { font-size: 11px; }
  }

  /* Mobile: menu becomes a vertical list. Without JS it is always shown under the logo;
     with JS (html.js) it is collapsed behind the toggle button. */
  @media (max-width: 1050px) {
    & .site-header__inner { flex-wrap: wrap; gap: 0 16px; height: auto; min-height: 70px; padding-block: 8px; }
    & .site-header__logo { height: 52px; }

    & .site-header__nav {
      flex-basis: 100%;
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      padding-bottom: 16px;
    }

    & .site-header__menu {
      flex-direction: column;
      align-items: stretch;
      gap: 0;

      & a { display: block; padding: 13px 0; border-bottom: 1px solid #eaf1f3; font-size: 15px; }
      & a[aria-current]::after { display: none; }
    }

    & .site-header__cta { align-self: flex-start; margin-top: 15px; }
  }
}

@media (max-width: 1050px) {
  /* no JS: the open menu list would stay stuck over the page while scrolling */
  html:not(.js) .site-header { position: static; }

  .js .site-header__toggle:not([hidden]) { display: inline-flex; }

  .js .site-header__nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    padding: 12px var(--gutter) 20px;
    border-bottom: 1px solid var(--line);
    background: var(--white);
    box-shadow: 0 18px 24px #12364613;
    max-height: calc(100vh - 100%);
    overflow-y: auto;
  }

  .js .site-header__nav.is-open { display: flex; }
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--white);
  font-size: 13px;
  color: #5a7380;

  & a { color: inherit; text-decoration: none; }
  & a:hover { color: var(--teal); }

  & .site-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 50px;
    padding-block: 58px 45px;
  }

  & .site-footer__logo { height: 72px; margin-bottom: 22px; }
  & .site-footer__brand p { margin: 0 0 12px; color: var(--muted); }
  & .site-footer__social { display: flex; gap: 16px; font-weight: 700; }

  & .site-footer__title {
    margin: 2px 0 14px;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: var(--ink);
  }

  & ul { display: flex; flex-direction: column; gap: 11px; margin: 0; padding: 0; list-style: none; }

  & .site-footer__bottom {
    display: flex;
    justify-content: space-between;
    gap: 9px 24px;
    padding-block: 18px;
    border-top: 1px solid var(--line);
    font-size: 11px;
    color: var(--muted);
  }

  & .site-footer__bottom-links { display: flex; gap: 20px; }

  @media (max-width: 800px) {
    & .site-footer__grid { grid-template-columns: 1fr 1fr; }
    & .site-footer__brand { grid-column: 1 / -1; }
  }

  @media (max-width: 520px) {
    & .site-footer__grid { grid-template-columns: 1fr; gap: 36px; }
    & .site-footer__bottom { flex-direction: column; }
  }
}
