/* ==========================================================================
   Site header
   File:   css/blocks/header.css
   Markup: navigation.php

   Transparent sticky bar: logo, inline nav, then two pill actions. Collapses
   to a toggle and a drop-down panel below the tablet breakpoint.
   ========================================================================== */

.site-header {
  --sh-height: var(--vir-header-height);
  --sh-max-width: 1182px;
  --sh-logo-height: 69px;
  --sh-nav-offset: 206px;
  --sh-link-size: 15px;
  --sh-button-width: 160px;

  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  border-bottom: 1px solid rgba(11, 44, 95, 0.1);
  /* Held at cream deliberately - the header was asked to stay as it was,
     and --vir-page is now navy. */
  background-color: var(--vir-cream);
}

.site-header__inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: var(--sh-max-width);
  height: var(--sh-height);
  margin: 0 auto;
  padding: 0 var(--vir-gutter);
  box-sizing: border-box;
}

/* --- Logo ---------------------------------------------------------------- */

.site-header__logo {
  display: block;
  flex: 0 0 auto;
  line-height: 0;
  text-decoration: none;
}

.site-header__logo img {
  display: block;
  width: auto;
  height: var(--sh-logo-height);
}

/* --- Nav ----------------------------------------------------------------- */

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: var(--sh-nav-offset);
}

.site-header .site-header__link {
  position: relative;
  padding: 6px 2px;
  color: var(--vir-navy);
  font-family: var(--vir-font-body);
  font-size: var(--sh-link-size);
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.4s ease;
}

/* Gold underline grows from the left on hover and stays for the current page. */
.site-header .site-header__link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--vir-gold);
  transition: width 0.4s ease;
}

.site-header .site-header__link:hover::after,
.site-header .site-header__link.is-active::after {
  width: 100%;
}

.site-header .site-header__link:hover,
.site-header .site-header__link.is-active {
  color: var(--vir-navy);
  text-decoration: none;
}

/* --- Actions ------------------------------------------------------------- */

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.site-header .site-header__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sh-button-width);
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--vir-gold);
  border-radius: 50px;
  background-color: var(--vir-gold);
  color: var(--vir-navy);
  font-family: var(--vir-font-body);
  font-size: 14px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background-color 0.4s;
}

.site-header .site-header__button:hover {
  border-color: var(--vir-navy);
  background-color: var(--vir-navy);
  color: var(--vir-white);
  text-decoration: none;
}

/* --- Toggle -------------------------------------------------------------- */

.site-header__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0 10px;
  border: 0;
  background: none;
  cursor: pointer;
  box-sizing: border-box;
}

.site-header__toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--vir-navy);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.site-header__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.site-header__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Drop-down panel ----------------------------------------------------- */

.site-nav-panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 99;
  width: 100%;
  max-height: calc(100vh - var(--vir-header-height));
  overflow-y: auto;
  border-bottom: 2px solid var(--vir-gold);
  background-color: var(--vir-navy);
  transform: translateY(-100%);
  visibility: hidden;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.2s ease, visibility 0.3s;
}

.site-nav-panel.is-open {
  transform: translateY(0);
  visibility: visible;
  opacity: 1;
}

.site-nav-panel__inner {
  display: flex;
  flex-direction: column;
  padding: 24px var(--vir-gutter) 32px;
}

.site-nav-panel .site-nav-panel__link {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--vir-white);
  font-family: var(--vir-font-body);
  font-size: 16px;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav-panel .site-nav-panel__link:hover {
  text-decoration: none;
  opacity: 0.8;
}

.site-nav-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.site-nav-panel .site-nav-panel__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 160px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--vir-white);
  border-radius: 50px;
  color: var(--vir-white);
  font-family: var(--vir-font-body);
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  box-sizing: border-box;
}

.site-nav-panel .site-nav-panel__button:hover {
  background-color: var(--vir-white);
  color: var(--vir-navy);
  text-decoration: none;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 1249px) {
  .site-header {
    --sh-nav-offset: 60px;
    --sh-max-width: 100%;
  }
}

@media (max-width: 991px) {
  .site-header {
    --sh-logo-height: 52px;
  }

  .site-header__nav,
  .site-header__actions {
    display: none;
  }

  .site-header__toggle {
    display: flex;
  }
}

@media (max-width: 575px) {
  .site-header {
    --sh-logo-height: 44px;
  }
}
