:root {
  --brand-navy: #0b1f3a;
  --brand-navy-dark: #071427;
  --brand-navy-light: #16305a;
  --brand-navy-soft: #eef1f6;
  --brand-gold: #a9791a;
  --brand-gold-bright: #e6c565;
  --brand-gold-soft: #fbf3e0;

  /* The header's palette: white on navy, with the brand gold as its accent.
     Pale heroes swap these below until the page scrolls. */
  --header-glass: rgba(11, 31, 58, 0.94);
  --header-shadow: 0 6px 18px rgba(11, 31, 58, 0.14);
  --header-accent: var(--brand-gold-bright);
  --header-link: rgba(255, 255, 255, 0.86);
  --header-link-active: #fff;
  /* Lifts the logo's mid gold so it holds up against the navy. */
  --header-logo-filter: brightness(1.28) saturate(1.05);

  --header-gutter: clamp(16px, 2.4vw, 40px);
  --header-topbar-h: 34px;
  --header-row-h: 88px;
  --header-compact-h: 76px;
  --site-header-h: calc(var(--header-topbar-h) + var(--header-row-h));

  /* What a hero adds to its top so its content clears the header. */
  --nav-h: var(--site-header-h);
}

@media (max-width: 991.98px) {
  :root {
    /* 40px keeps the topbar links at the tap size mobile.css gives them. */
    --header-topbar-h: 40px;
    --header-row-h: 60px;
    --header-compact-h: 60px;
  }
}

/* The header is fixed, with the page pushed down by its full height, so folding
   it on scroll (header.js -> .is-scrolled) never changes the document's height. */
body {
  padding-top: var(--site-header-h);
}

/* Pages that open with a photo hero: the hero runs up behind the whole header,
   which is see-through until the page scrolls, so the two read as one. */
body:has(:is(.flight-hero, .hotel-hero, .tour-hero, .visa-hero, .sightseeing-hero, .cruise-hero, .destinations-hero, .lst-hero, .td-hero, .sd-hero, .cd-hero, .vd-hero, .cp-hero, .svc-hero, .legal-hero, .acc-hero)) {
  padding-top: 0;
  --header-merged-bg: transparent;
  --header-merged-blur: none;
  --header-merged-shadow: none;
  /* On the text only, for the photo heroes whose brightness nobody controls. */
  --header-merged-text-shadow: 0 1px 6px rgba(4, 12, 26, 0.5);
}

/* The heroes that carry a navy headline are pale at the top, so until the page
   scrolls the header takes the same navy rather than white. */
body:has(:is(.flight-hero, .hotel-hero, .visa-hero, .sightseeing-hero, .cruise-hero, .destinations-hero)) .site-header:not(.is-scrolled) {
  --header-link: var(--brand-navy);
  --header-link-active: var(--brand-navy);
  --header-accent: var(--brand-gold);
  --header-logo-filter: brightness(0.78) saturate(1.25) drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
  --header-merged-text-shadow: none;
}

/* ---------- Shell ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: var(--header-glass);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
  box-shadow: var(--header-shadow);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header:not(.is-scrolled) {
  background: var(--header-merged-bg, var(--header-glass));
  -webkit-backdrop-filter: var(--header-merged-blur, blur(14px) saturate(130%));
  backdrop-filter: var(--header-merged-blur, blur(14px) saturate(130%));
  box-shadow: var(--header-merged-shadow, var(--header-shadow));
  text-shadow: var(--header-merged-text-shadow, none);
}

/* ---------- Top utility bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  height: var(--header-topbar-h);
  color: var(--header-link);
  font-size: 13px;
  overflow: hidden;
  opacity: 1;
  transition: height 0.3s ease, opacity 0.25s ease, color 0.3s ease;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: var(--header-gutter);
}

.topbar-contact {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
  margin-left: auto;
  /* overflow-x alone is a trap: the spec computes the other axis from `visible`
     to `auto` as soon as one axis is not `visible`, so this row became a scroll
     container vertically too. The hover underline below hangs a few pixels past
     the link box, which was enough overflow to render a vertical scrollbar —
     and inside a 40px topbar that draws as a pair of stacked arrow buttons
     sitting next to "Log in". Both axes have to be declared. */
  overflow-x: auto;
  overflow-y: hidden;
  /* Hides the horizontal scrollbar too. The row scrolls by swipe on the narrow
     screens that need it; a visible track in a 40px bar looks like a defect. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.topbar-contact::-webkit-scrollbar {
  display: none;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  /* Reserves the underline's gap inside the link's own box. It used to sit at
     bottom:-3px, outside the box, which is what overflowed the row above — and
     now that the row clips vertically, an outside underline would simply be
     cut off. 3px keeps the same visual gap without leaving the box. */
  padding-bottom: 3px;
  transition: color 0.2s ease;
}

.topbar-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.topbar-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  /* Inside the padding reserved above, not hanging below the box. */
  bottom: 0;
  height: 1px;
  background: var(--header-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.topbar-link:hover {
  color: var(--header-link-active);
}

.topbar-link:hover::after {
  transform: scaleX(1);
}

.topbar-link .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.topbar-link:hover .icon {
  transform: scale(1.15);
}

/* ---------- Main nav row ---------- */
.main-nav {
  /* static, not Bootstrap's relative: the logo and the mobile menu panel are
     positioned against the whole fixed header, not just this row. */
  position: static;
  height: var(--header-row-h);
  padding: 0;
  transition: height 0.3s ease;
}

.main-nav > .container-fluid {
  height: 100%;
  padding-left: var(--header-gutter);
  padding-right: var(--header-gutter);
}

/* ---------- Logo ----------
   Spans both rows of the header. The artwork is gold on transparent, so it sits
   straight on the hero or the navy bar. */
.navbar-brand.logo-card {
  position: absolute;
  top: 8px;
  left: var(--header-gutter);
  z-index: 3;
  display: block;
  height: calc(var(--site-header-h) - 16px);
  aspect-ratio: 412 / 300;
  margin: 0;
  padding: 0;
  transition: height 0.3s ease, top 0.3s ease;
}

.brand-favicon {
  display: none;
}

.brand-logo-full {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  filter: var(--header-logo-filter);
  transition: filter 0.3s ease;
}

/* ---------- Custom animated toggler ---------- */
.custom-toggler {
  border: none;
  background: transparent;
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 0.4rem;
  transition: background-color 0.2s ease;
}

.custom-toggler:hover {
  background-color: rgba(128, 128, 128, 0.16);
}

.custom-toggler:focus {
  outline: 2px solid var(--header-accent);
  outline-offset: 2px;
  box-shadow: none;
}

.custom-toggler .toggler-bar {
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--header-link-active);
  transition: transform 0.3s ease, opacity 0.25s ease, background-color 0.3s ease;
}

.custom-toggler[aria-expanded="true"] .toggler-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  background: var(--header-accent);
}

.custom-toggler[aria-expanded="true"] .toggler-bar:nth-child(2) {
  opacity: 0;
}

.custom-toggler[aria-expanded="true"] .toggler-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  background: var(--header-accent);
}

/* ---------- Service nav ----------
   Selectors carry .main-nav so they outrank Bootstrap's own
   .navbar-expand-lg .navbar-nav .nav-link padding. */
.main-nav .service-nav {
  flex-wrap: nowrap;
  gap: clamp(14px, 2.2vw, 40px);
}

.main-nav .service-nav .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 0;
  color: var(--header-link);
  font-size: clamp(12.5px, 1vw, 15px);
  font-weight: 500;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.main-nav .service-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--header-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.main-nav .service-nav .nav-link .icon-chip {
  display: flex;
  flex-shrink: 0;
}

.main-nav .service-nav .nav-link .icon {
  width: 16px;
  height: 16px;
}

.main-nav .service-nav .nav-link:hover,
.main-nav .service-nav .nav-link:focus-visible,
.main-nav .service-nav .nav-link.active {
  color: var(--header-link-active);
}

.main-nav .service-nav .nav-link:hover::after,
.main-nav .service-nav .nav-link:focus-visible::after,
.main-nav .service-nav .nav-link.active::after {
  transform: scaleX(1);
}

.main-nav .service-nav .nav-link.active {
  font-weight: 600;
}


.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---------- Mobile-only contact block inside the collapsed menu ---------- */
.mobile-contact {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e9edf3;
}

.mobile-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--brand-navy);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.mobile-contact-link:hover {
  color: var(--brand-gold);
}

.mobile-contact-link .icon {
  width: 18px;
  height: 18px;
  color: var(--brand-gold);
}

/* ---------- Interactive per-icon micro-animations ---------- */
.icon-mail polyline {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.25s ease;
}

.topbar-link:hover .icon-mail polyline,
.mobile-contact-link:hover .icon-mail polyline {
  transform: translateY(-1.5px) scale(1.05);
}

.topbar-link:hover .icon-phone,
.mobile-contact-link:hover .icon-phone {
  animation: iconPhoneRing 0.5s ease;
  transform-origin: center;
}

@keyframes iconPhoneRing {
  0%,
  100% {
    transform: rotate(0);
  }
  20% {
    transform: rotate(-14deg);
  }
  40% {
    transform: rotate(12deg);
  }
  60% {
    transform: rotate(-8deg);
  }
  80% {
    transform: rotate(6deg);
  }
}

/* ---------- Flight path (header.js) ----------
   The brand's plane, used as the menu's marker: it flies to the link under the pointer and back to
   the current page. Each link's own underline stays until the script has taken over. */
.nav-flight,
.header-journey {
  display: none;
}

@media (min-width: 992px) {
  .main-nav .service-nav {
    position: relative;
  }

  .main-nav .service-nav.has-flight .nav-link::after {
    display: none;
  }

  .nav-flight {
    position: absolute;
    left: 0;
    bottom: 0;
    display: block;
    width: var(--flight-w, 0);
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--header-accent) 45%);
    color: var(--header-accent);
    opacity: 0;
    pointer-events: none;
    transform: translateX(var(--flight-x, 0));
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1), width 0.6s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.25s ease;
  }

  .nav-flight.is-parked {
    transition: none;
  }

  .nav-flight.is-showing {
    opacity: 1;
  }

  .nav-flight-craft {
    position: absolute;
    right: -9px;
    bottom: -7px;
    display: block;
    width: 16px;
    height: 16px;
    transform: rotate(90deg);
    transition: transform 0.25s ease;
  }

  /* Heading back along the menu, nose first. */
  .nav-flight.is-westbound .nav-flight-craft {
    transform: rotate(-90deg);
  }

  .nav-flight-craft svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
  }

  .nav-flight.is-flying .nav-flight-craft svg {
    animation: nav-flight-climb 0.6s ease-in-out;
  }

  /* A soft pass of light across the logo, once on arrival and again on hover. */
  .navbar-brand.logo-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 42%, rgba(255, 248, 225, 0.95) 50%, transparent 58%) no-repeat;
    background-size: 260% 100%;
    background-position: 130% 0;
    -webkit-mask: url("../logo/wtlogo-full.png") center / 100% 100% no-repeat;
    mask: url("../logo/wtlogo-full.png") center / 100% 100% no-repeat;
    animation: logo-glint 1.5s ease 0.5s 1 both;
  }

  .navbar-brand.logo-card:hover::after {
    /* The arrival sweep stays listed, or moving off the logo would restart it. */
    animation: logo-glint 1.5s ease 0.5s 1 both, logo-glint-again 1.1s ease 1 both;
  }
}

/* Sideways drift the plane makes in climbing, seen from above: it leaves the line and settles back. */
@keyframes nav-flight-climb {
  50% {
    transform: translateX(7px) scale(1.2);
  }
}

@keyframes logo-glint {
  from { background-position: 130% 0; }
  to { background-position: -30% 0; }
}

@keyframes logo-glint-again {
  from { background-position: 130% 0; }
  to { background-position: -30% 0; }
}

/* The journey line: how far down the page you are, along the bottom of the scrolled bar. */
.header-journey {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  height: 2px;
  background: rgba(230, 197, 101, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.site-header.is-scrolled .header-journey {
  opacity: 1;
}

.header-journey-trail {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--brand-gold), var(--brand-gold-bright));
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.header-journey-craft {
  position: absolute;
  bottom: -6px;
  left: 0;
  display: block;
  width: 14px;
  height: 14px;
  color: var(--brand-gold-bright);
  transform: rotate(90deg);
  will-change: transform;
}

.header-journey-craft svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* ---------- Scroll-compact state (toggled via header.js) ----------
   The topbar folds away and the header settles into one navy bar. */
.site-header.is-scrolled .topbar {
  height: 0;
  opacity: 0;
}

.site-header.is-scrolled .main-nav {
  height: var(--header-compact-h);
}

.site-header.is-scrolled .navbar-brand.logo-card {
  top: 7px;
  height: calc(var(--header-compact-h) - 14px);
}

/* ---------- Below lg: hamburger menu ---------- */
@media (max-width: 991.98px) {
  /* Phones swap the logo for the small app icon, centred in the nav row and in
     the compact bar once scrolled. */
  .navbar-brand.logo-card {
    top: calc(var(--header-topbar-h) + (var(--header-row-h) - 44px) / 2);
    left: 14px;
    width: 44px;
    height: 44px;
    aspect-ratio: auto;
  }

  .site-header.is-scrolled .navbar-brand.logo-card {
    top: calc((var(--header-compact-h) - 44px) / 2);
    height: 44px;
  }

  .brand-logo-full {
    display: none;
  }

  .brand-favicon {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    box-shadow: 0 3px 10px rgba(11, 31, 58, 0.28);
  }

  .main-nav .custom-toggler {
    margin-left: auto;
  }

  /* The menu opens as its own solid panel below the whole header. */
  .main-nav .navbar-collapse {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--site-header-h));
    overflow-y: auto;
    background: #fff;
    box-shadow: 0 16px 28px rgba(11, 31, 58, 0.18);
    border-radius: 0 0 0.9rem 0.9rem;
    padding: 0.75rem 1rem 1rem;
  }

  .main-nav .service-nav {
    gap: 0.5rem;
  }

  .main-nav .service-nav .nav-link {
    height: 52px;
    gap: 0.75rem;
    padding: 0 1rem 0 0.4rem;
    border-radius: 999px;
    background: #fff;
    color: #13213a;
    font-size: 1rem;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: 0 2px 8px rgba(8, 28, 58, 0.1);
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
  }

  .main-nav .service-nav .nav-link::after {
    display: none;
  }

  .main-nav .service-nav .nav-link .icon-chip {
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(11, 31, 58, 0.04), 0 1px 4px rgba(11, 31, 58, 0.1);
  }

  .main-nav .service-nav .nav-link .icon {
    width: 20px;
    height: 20px;
    color: var(--ic, #1d3b66);
  }

  /* One accent per service. */
  .main-nav .service-nav .nav-item:nth-child(1) { --ic: #e8890c; }
  .main-nav .service-nav .nav-item:nth-child(2) { --ic: #16a085; }
  .main-nav .service-nav .nav-item:nth-child(3) { --ic: #7c5cdb; }
  .main-nav .service-nav .nav-item:nth-child(4) { --ic: #e5484d; }
  .main-nav .service-nav .nav-item:nth-child(5) { --ic: #d6336c; }
  .main-nav .service-nav .nav-item:nth-child(6) { --ic: #1e88e5; }
  .main-nav .service-nav .nav-item:nth-child(7) { --ic: #0b8f6b; }

  .main-nav .service-nav .nav-link:hover,
  .main-nav .service-nav .nav-link:focus-visible {
    color: #13213a;
    box-shadow: 0 4px 12px rgba(8, 28, 58, 0.18);
  }

  .main-nav .service-nav .nav-link:hover .icon-chip,
  .main-nav .service-nav .nav-link:focus-visible .icon-chip {
    background: color-mix(in srgb, var(--ic, #1d3b66) 12%, #fff);
  }

  .main-nav .service-nav .nav-link.active {
    background: #fdf1d7;
    color: #0b1f3a;
    font-weight: 700;
  }

  .main-nav .service-nav .nav-link.active .icon-chip {
    background: rgba(255, 255, 255, 0.45);
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header *,
  .site-header *::after,
  .site-header *::before {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Heroes owned by other stylesheets ----------
   Detail-page heroes have a fixed height and bottom-aligned copy, so adding
   --nav-h to the height extends the photo upward without moving the text.
   `body` raises specificity so these win regardless of stylesheet order. */
body .td-hero,
body .sd-hero { height: calc(440px + var(--nav-h)); }
body .cd-hero { height: calc(480px + var(--nav-h)); }
body .vd-hero { height: calc(420px + var(--nav-h)); }
body .acc-hero { height: calc(190px + var(--nav-h)); }

body .cp-hero { padding-top: var(--nav-h); }
body .cp-hero--compact,
body .cp-hero--plain { padding-top: calc(3.5rem + var(--nav-h)); }
body .cp-hero--article { min-height: calc(380px + var(--nav-h)); }
body .svc-hero { padding-top: calc(3.5rem + var(--nav-h)); }
/* Privacy/legal band was inset inside the page container; the header now sits
   over it, so it must run edge to edge like every other hero. */
body .legal-hero {
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
  padding-top: calc(3rem + var(--nav-h));
}

@media (max-width: 991.98px) {
  body .td-hero,
  body .sd-hero { height: calc(420px + var(--nav-h)); }
  body .cd-hero { height: calc(460px + var(--nav-h)); }
  body .vd-hero { height: calc(400px + var(--nav-h)); }
}

@media (max-width: 575.98px) {
  body .td-hero,
  body .sd-hero { height: calc(400px + var(--nav-h)); }
  body .cd-hero { height: calc(420px + var(--nav-h)); }
}

@media (max-width: 560px) {
  body .acc-hero { height: calc(150px + var(--nav-h)); }
}
