/* Shared chrome: preloader, header, full-screen menu, footer, page-transition
   overlay. All fixed-position pieces live OUTSIDE #smooth-wrapper (see
   index.html) — ScrollSmoother transforms its wrapper via translate3d,
   which would break `position: fixed` descendants otherwise. */

/* ---- Preloader (build-spec-v2.md section 3.1) ---- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: var(--z-preloader);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.preloader__logo img {
  height: 44px;
  width: auto;
}

.preloader__count {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  color: var(--warm-white);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.preloader__count::after {
  content: '%';
  font-size: 0.5em;
  color: var(--sunset);
  margin-left: 0.15em;
}

/* JS animates this element's clip-path to sweep away once loading
   completes — a wipe, not a fade (section 3.1). Reduced motion collapses
   it to a plain opacity fade, handled in JS, not here. */
.preloader {
  clip-path: inset(0 0 0 0);
}

/* No-JS / JS-failed safety net: never trap real content behind a
   preloader that nothing will ever dismiss. */
html:not(.js) .preloader {
  display: none;
}

/* ---- Header ---- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  padding-block: 1.1rem;
  background: rgba(10, 37, 64, 0.42);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 32px rgba(10, 37, 64, 0.1);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.site-header--solid {
  background: rgba(10, 37, 64, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 36px rgba(10, 37, 64, 0.24);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header {
    background: rgba(10, 37, 64, 0.9);
  }

  .site-header--solid {
    background: var(--navy);
  }
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo img {
  display: block;
  height: 56px;
  width: auto;
  transition: height 320ms var(--ease-out);
}

.site-header--solid .site-logo img {
  height: 46px;
}

/* Language switcher (EN · FR · ES) — only rendered by the generator on
   pages that actually have translated alternates; see scripts/generate-
   tours.js langSwitchHtml(). Pushed flush right, just before the burger
   (the navbar's WhatsApp CTA was removed; the floating WhatsApp button
   and the one inside the slide-out menu panel still cover that). */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  margin-right: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.lang-switch a,
.lang-switch span {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  padding: 0.15rem 0.05rem;
}

.lang-switch a:hover,
.lang-switch a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.lang-switch .is-current {
  color: #fff;
  border-bottom: 2px solid currentColor;
}

@media (max-width: 640px) {
  .site-logo img {
    height: 48px;
  }

  .site-header--solid .site-logo img {
    height: 40px;
  }

  .lang-switch {
    font-size: 0.72rem;
    margin-right: 0.75rem;
  }
}

/* Hamburger / close morph target */
.menu-toggle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.menu-toggle:hover {
  background: rgba(251, 248, 242, 0.12);
}

.menu-toggle__box {
  position: relative;
  width: 22px;
  height: 14px;
}

.menu-toggle__line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--warm-white);
  border-radius: 2px;
  transform-origin: center;
}

.menu-toggle__line:first-child {
  top: 0;
}

.menu-toggle__line:last-child {
  bottom: 0;
}

/* ---- Full-screen menu overlay (section 3.10: clip-path wipe, not fade) ---- */
.site-menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  display: none;
  clip-path: circle(0% at calc(100% - 40px) 40px);
}

.site-menu__backdrop {
  position: absolute;
  inset: 0;
  background: var(--navy);
}

.site-menu__panel {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(5rem, 12vh, 7rem) var(--container-pad) 3rem;
  max-width: var(--container-max);
  margin-inline: auto;
  overflow-y: auto;
  /* A short viewport (small laptops, landscape mobile) can't fit six
     large links + the WhatsApp footer centered — let it scroll rather
     than clip content above/below the fold with no way to reach it. */
}

.site-menu__list {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.site-menu__item {
  overflow: hidden;
}

.site-menu__item a {
  display: inline-block;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--warm-white);
  line-height: 1.08;
  padding-block: 0.18em;
  transition: color var(--dur-instant) var(--ease-out);
}

.site-menu__item a:hover {
  color: var(--sunset);
}

.site-menu__brand {
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
  display: flex;
  align-items: center;
}

/* Sized off the menu links' own font-size (clamp(1.75rem, 4vw, 3rem)) so
   the logo reads as part of the same list, not a leftover header sliver.
   10% larger than the initial size per client request. */
.site-menu__logo {
  height: clamp(2.42rem, 5.5vw, 4.125rem);
  width: auto;
}

body.menu-open {
  overflow: hidden;
}

@media (max-height: 620px) {
  .site-menu__panel {
    padding-block: 4.5rem 1.5rem;
  }

  .site-menu__item a {
    font-size: clamp(1.5rem, 5vh, 2.15rem);
  }

  .site-menu__brand {
    margin-bottom: 1rem;
  }
}

/* ---- Floating WhatsApp shortcut ---- */
.whatsapp-float {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: calc(var(--z-header) - 1);
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 10px 28px rgba(10, 37, 64, 0.24);
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    opacity var(--dur-fast) var(--ease-out);
}

.whatsapp-float img {
  display: block;
  width: 100%;
  height: 100%;
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 34px rgba(10, 37, 64, 0.3);
}

body.menu-open .whatsapp-float {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 560px) {
  .whatsapp-float {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
  }
}

/* ---- Footer ---- */
.site-footer {
  background: var(--navy);
  color: var(--warm-white);
  padding-block: var(--section-pad) 2rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr 1fr;
  gap: 2.5rem;
}

.site-footer h3 {
  color: var(--warm-white);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1em;
}

.site-footer__brand img {
  display: block;
  width: 180px;
  height: auto;
  margin-bottom: 1rem;
}

.site-footer__brand p {
  color: rgba(251, 248, 242, 0.7);
  max-width: 32ch;
}

.site-footer__nav ul,
.site-footer__legal ul {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}

.site-footer__nav a,
.site-footer__legal a {
  color: rgba(251, 248, 242, 0.85);
  transition: color var(--dur-instant) var(--ease-out);
}

.site-footer__nav a:hover,
.site-footer__legal a:hover {
  color: var(--sunset);
}

.site-footer__contact address {
  font-style: normal;
  color: rgba(251, 248, 242, 0.7);
  margin-bottom: 0.6em;
}

.site-footer__contact p {
  margin-bottom: 0.4em;
  color: rgba(251, 248, 242, 0.7);
}

.site-footer__contact a {
  color: rgba(251, 248, 242, 0.85);
}

.site-footer__contact a:hover {
  color: var(--sunset);
}

.site-footer__bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(251, 248, 242, 0.15);
}

.site-footer__bottom p {
  color: rgba(251, 248, 242, 0.55);
  font-size: var(--fs-caption);
}

@media (max-width: 860px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Page-transition overlay (Barba wipe, section 5.6 / v2 keeps a wipe
   but skips Barba entirely over file:// — see js/transitions.js) ---- */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-transition);
  background: var(--navy);
  clip-path: inset(100% 0 0 0);
  pointer-events: none;
}
