/* Saint Barth Gorilla Expeditions — shared site styles.
   Used by index.html and every subpage. Tokens mirror design-system/tokens/*.css. */

@font-face {
  font-family: "Bodoni Moda";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/bodoni-moda@latest/latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/bodoni-moda@latest/latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Work Sans";
  font-style: normal; font-weight: 300; font-display: swap;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/work-sans@latest/latin-300-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Work Sans";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/work-sans@latest/latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Work Sans";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/work-sans@latest/latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Work Sans";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/work-sans@latest/latin-600-normal.woff2") format("woff2");
}

/* ===== Tokens (mirrors the SBGE design system's tokens/*.css) ===== */
:root {
  --black-1: #0a0b0a;
  --green-1: #0f2119;
  --green-2: #16301f;
  --green-3: #1f3f29;
  --ivory-1: #f3ede0;
  --ivory-2: #d9d0bd;
  --ivory-3: #8f8a7c;
  --gold-1: #b6935b;
  --gold-2: #d8b781;
  --gold-3: #6e5636;
  --line-1: rgba(243, 237, 224, 0.14);
  --line-2: rgba(243, 237, 224, 0.08);
  --overlay-1: rgba(6, 7, 6, 0.55);
  --overlay-2: rgba(6, 7, 6, 0.78);
  --serif: "Bodoni Moda", "Times New Roman", serif;
  --sans: "Work Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
/* Ensure [hidden] always wins — custom display: values (e.g. grid) would otherwise override it */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  background: var(--black-1);
  color: var(--ivory-1);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--gold-1); text-decoration: none; }
a:hover { color: var(--gold-2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
p { margin: 0; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.label {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-1);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--gold-3);
  background: var(--green-1);
  color: var(--gold-1);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { background: var(--green-3); border-color: var(--gold-2); color: var(--gold-2); }
.btn-ghost { background: transparent; border-color: var(--line-1); color: var(--ivory-1); }
.btn-ghost:hover { border-color: var(--gold-1); color: var(--gold-1); }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Header ---------- */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem var(--gutter);
  background: rgba(10,11,10,0);
  border-bottom: 1px solid transparent;
  transition: padding 0.4s var(--ease), background 0.4s var(--ease), border-color 0.4s var(--ease);
}
header.scrolled {
  padding: 0.9rem var(--gutter);
  background: rgba(10,11,10,0.92);
  border-bottom: 1px solid var(--line-2);
}
/* LOGO SLOT — header lockup. Swap src for your hosted copy of the
   horizontal white-on-transparent SBGE lockup. */
header .logo img { height: 44px; width: auto; }
nav.primary-nav { display: flex; align-items: center; gap: 2.25rem; }
nav.primary-nav a.nav-link {
  font-size: 0.75rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ivory-2);
}
nav.primary-nav a.nav-link:hover { color: var(--gold-1); }
.menu-toggle { display: none; background: none; border: none; color: var(--ivory-1); font-size: 1.5rem; cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center; justify-content: center;
  overflow: hidden; text-align: center; background: #0a0b0a;
}
/* Hero background video — Vimeo background=1 mode (autoplay, loop, muted) */
.hero-video {
  position: absolute; inset: 0; overflow: hidden;
  /* gradient fallback while video loads or on browsers that block autoplay */
  background: radial-gradient(ellipse at 50% 30%, #1c3324 0%, #0a0b0a 62%), linear-gradient(160deg, #16301f 0%, #0a0b0a 85%);
}
.hero-video iframe {
  position: absolute;
  top: 50%; left: 50%;
  /* scale to cover any viewport while keeping 16:9 aspect ratio */
  width: max(100%, 177.78vh);
  height: max(100%, 56.25vw);
  transform: translate(-50%, -50%);
  pointer-events: none;
  border: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero-scrim { position: absolute; inset: 0; background: var(--overlay-1); }
.hero-content { position: relative; z-index: 2; padding: 0 1.5rem; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.hero-content .logo-mark img { height: 92px; width: auto; margin-bottom: 0.5rem; }
.hero-content .label { color: var(--gold-1); }
.hero-content h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 3rem); line-height: 1.2; color: var(--ivory-1); max-width: 780px; }
.hero-content .sub { font-size: 1.1875rem; color: var(--ivory-2); max-width: 540px; line-height: 1.6; }

/* ---------- Utilities ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Section shells ---------- */
section { padding: 6.5rem var(--gutter); }
.section-head { text-align: center; margin-bottom: 3.5rem; }
.section-head .rule { width: 48px; height: 1px; background: var(--gold-3); margin: 1rem auto 0; }
.section-head h2 { font-size: clamp(1.6rem, 1.4rem + 1vw, 2.25rem); color: var(--ivory-1); margin-top: 1.25rem; }

/* ---------- Journeys ---------- */
.journeys { background: var(--green-1); }
.journey-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; max-width: 1180px; margin: 0 auto; }
.journey-card { background: var(--green-1); border: 1px solid var(--line-1); }
/* PHOTO SLOTS 2–4 — one per journey card (Uganda, Rwanda, Tanzania). */
.journey-photo { aspect-ratio: 4 / 3; background-size: cover; background-position: center; }
.journey-photo.uganda  { background-image: url('../images/uganda-gorilla.jpg'); }
.journey-photo.rwanda  { background-image: url('../images/photos/home-rwanda-gorilla.jpg'); background-position: center 40%; }
.journey-photo.tanzania { background-image: url('../images/tanzania-migration.jpg'); }
.journey-body { padding: 1.5rem; }
.journey-body .country { font-size: 0.6875rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-1); margin-bottom: 0.6rem; }
.journey-body .rule { width: 32px; height: 1px; background: var(--gold-3); margin-bottom: 0.9rem; }
.journey-body h3 { font-size: 1.375rem; color: var(--ivory-1); margin-bottom: 0.6rem; }
.journey-body p { font-size: 0.9375rem; color: var(--ivory-2); line-height: 1.6; margin-bottom: 1.1rem; }

/* ---------- Contact ---------- */
.contact { background: var(--green-1); display: flex; justify-content: center; }
.contact .inner { max-width: 760px; width: 100%; }
.contact-intro { text-align: center; margin-bottom: 2.5rem; }
.contact-intro p { font-size: 1.0625rem; color: var(--ivory-2); margin-top: 0.75rem; }
.contact-intro a.tel { color: var(--gold-1); }
.form-panel {
  background: var(--surface-card, var(--green-1));
  background: #142a1e;
  border: 1px solid var(--line-1);
  box-shadow: 0 24px 64px -32px rgba(0,0,0,0.6);
  padding: 2.5rem;
}
form#inquiry-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-size: 0.6875rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ivory-3);
}
.field input, .field select, .field textarea {
  font-family: var(--sans); font-size: 0.9375rem; color: var(--ivory-1);
  background: var(--black-1); border: 1px solid var(--line-1); border-radius: 2px;
  padding: 0.8rem 0.9rem; width: 100%; min-width: 0;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--gold-1); outline-offset: 2px; border-color: var(--gold-1);
}
.field textarea { resize: vertical; }
.field .error { font-size: 0.75rem; color: var(--gold-2); min-height: 1.1em; }
.field-check { flex-direction: row; align-items: center; gap: 0.75rem; }
.field-check input { width: 1.1rem; height: 1.1rem; flex: none; padding: 0; accent-color: var(--gold-1); }
.field-check label { font-size: 0.875rem; letter-spacing: normal; text-transform: none; color: var(--ivory-2); cursor: pointer; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-direct .sep { color: var(--ivory-3); margin: 0 0.5rem; }
.form-submit { grid-column: 1 / -1; display: flex; justify-content: center; margin-top: 0.5rem; }
.form-confirm { text-align: center; padding: 2.5rem 1rem; }
.form-confirm .confirm-rule { width: 48px; height: 1px; background: var(--gold-3); margin: 0 auto 1.75rem; }
.form-confirm .confirm-head { font-family: var(--serif); font-size: 1.875rem; color: var(--ivory-1); margin-bottom: 0.75rem; }
.form-confirm .confirm-body { font-size: 0.9375rem; color: var(--ivory-2); line-height: 1.65; }

/* ---------- Footer ---------- */
footer {
  background: var(--black-1); border-top: 1px solid var(--line-2);
  padding: 3rem var(--gutter) 2.5rem;
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem; text-align: center;
}
/* LOGO SLOT — footer mark. */
footer .logo-mark img { height: 34px; width: auto; }
footer .tagline { font-size: 0.75rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold-1); }
footer .meta { font-size: 0.875rem; color: var(--ivory-3); line-height: 1.9; }
footer .meta a { color: var(--ivory-2); }
footer .meta a:hover { color: var(--gold-1); }
footer .copyright { font-size: 0.75rem; color: var(--ivory-3); opacity: 0.7; margin-top: 0.5rem; }

/* ---------- Nav: current page ---------- */
nav.primary-nav a.nav-link[aria-current="page"] { color: var(--gold-1); }

/* ---------- Subpages ---------- */
.page-hero {
  position: relative; min-height: 64svh; display: flex; align-items: flex-end; justify-content: center;
  text-align: center; padding: 9rem var(--gutter) 4.5rem;
  background: radial-gradient(ellipse at 50% 30%, #1c3324 0%, #0a0b0a 62%);
  background-size: cover; background-position: center;
}
.page-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--overlay-1) 0%, var(--overlay-2) 100%); }
.page-hero .inner { position: relative; z-index: 1; max-width: 780px; display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.page-hero h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); line-height: 1.15; color: var(--ivory-1); }
.page-hero .sub { font-size: 1.125rem; color: var(--ivory-2); line-height: 1.6; max-width: 600px; }
.page-hero.uganda   { background-image: url('../images/uganda-gorilla.jpg'); }
.page-hero.rwanda   { background-image: url('../images/rwanda-gorilla.jpg'); }
.page-hero.tanzania { background-image: url('../images/tanzania-migration.jpg'); }
.page-hero.non-profits { background-image: url('../images/rwanda-landscape.jpg'); }

.page-section { background: var(--green-1); }
.page-section.alt { background: var(--black-1); }
.page-section .inner { max-width: 1180px; margin: 0 auto; }
.lede { font-family: var(--serif); font-size: clamp(1.3rem, 1.15rem + 0.8vw, 1.75rem); line-height: 1.4; color: var(--ivory-1); max-width: 760px; margin: 0 auto; text-align: center; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.card { border: 1px solid var(--line-1); background: var(--green-1); display: flex; flex-direction: column; }
.page-section.alt .card { background: var(--black-1); }
.card .card-photo { aspect-ratio: 4 / 3; background-size: cover; background-position: center; }
.card img.card-photo { display: block; width: 100%; height: auto; object-fit: cover; border-bottom: 1px solid var(--line-1); }
.card .card-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; }
.card h3 { font-size: 1.25rem; color: var(--ivory-1); }
.card p { font-size: 0.9375rem; color: var(--ivory-2); line-height: 1.6; }

/* Content placeholders — visible on purpose so reviewers can see what is pending (#9) */
.placeholder {
  border: 1px dashed var(--gold-3); color: var(--ivory-3);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase; padding: 1rem;
}
.card .card-photo.placeholder { border-width: 0 0 1px 0; }
.placeholder-note { font-size: 0.8125rem; color: var(--ivory-3); font-style: italic; }
.placeholder-block { min-height: 220px; margin-top: 2.5rem; }

.page-cta { background: var(--green-2); text-align: center; }
.page-cta .inner { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.page-cta h2 { font-size: clamp(1.6rem, 1.4rem + 1vw, 2.25rem); color: var(--ivory-1); }
.page-cta p { color: var(--ivory-2); font-size: 1.0625rem; line-height: 1.6; }

.learn-more { display: inline-block; margin-top: 1.75rem; font-size: 0.75rem; letter-spacing: 0.24em; text-transform: uppercase; }

/* ---------- Experience pillars (home) ---------- */
.experience { background: var(--black-1); }
.experience .inner { max-width: 1180px; margin: 0 auto; }
.card-grid.four { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.experience .card { background: var(--green-1); }
.card .card-label { font-size: 0.6875rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-1); }
.safety { max-width: 760px; margin: 3rem auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.safety p { color: var(--ivory-2); font-size: 1.0625rem; line-height: 1.65; }
.safety .placeholder { min-height: 0; padding: 0.75rem 1.25rem; }

/* ---------- Feature block (Ultimate Journey, sample itineraries) ---------- */
.feature { max-width: 1180px; margin: 4rem auto 0; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-1); background: var(--black-1); }
.page-section.alt .feature { background: var(--green-1); }
.feature .feature-photo { min-height: 320px; }
.feature img.feature-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.feature .feature-body { padding: 2.5rem; display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.feature h3 { font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.9rem); color: var(--ivory-1); line-height: 1.25; }
.feature p { color: var(--ivory-2); line-height: 1.65; }
.route { list-style: none; margin: 0.25rem 0 0.5rem; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 0.55rem; }
.route li { counter-increment: step; display: flex; gap: 0.85rem; align-items: baseline; color: var(--ivory-1); font-size: 0.9375rem; }
.route li::before { content: counter(step, decimal-leading-zero); font-size: 0.6875rem; letter-spacing: 0.18em; color: var(--gold-1); min-width: 1.5rem; }
.fine { font-size: 0.8125rem; color: var(--ivory-3); }

/* ---------- Non-profit partners ---------- */
.partners-home { background: var(--black-1); text-align: center; }
.partners-home h2 { font-size: clamp(1.6rem, 1.4rem + 1vw, 2.25rem); color: var(--ivory-1); }
.partners-home .inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.partner-names { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem 1.75rem; }
.partner-names li { font-family: var(--serif); font-size: 1.125rem; color: var(--ivory-1); }
.partner-names li span { display: block; font-family: var(--sans); font-size: 0.625rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-1); margin-top: 0.2rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; align-items: center; }
.card .need { margin-top: auto; padding-top: 0.9rem; border-top: 1px solid var(--line-2); font-size: 0.875rem; color: var(--gold-2); }
.card .need.pending { color: var(--ivory-3); font-style: italic; }
.meet-list { list-style: none; padding: 0; margin: 0 auto; max-width: 760px; display: grid; gap: 1rem; }
.meet-list li { border-left: 1px solid var(--gold-3); padding: 0.25rem 0 0.25rem 1.25rem; color: var(--ivory-1); font-size: 1.0625rem; line-height: 1.55; }
.photo-pair { max-width: 760px; margin: 3rem auto 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.photo-pair img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--line-1); }
.donate { max-width: 760px; margin: 3rem auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem; }

/* ---------- Country map (T-20) ---------- */
.map-block { max-width: 1180px; margin: 3rem auto 0; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); border: 1px solid var(--line-1); background: var(--black-1); }
.map-canvas { min-height: 520px; background: #0f2119; position: relative; }
.map-side { padding: 2rem; display: flex; flex-direction: column; gap: 1rem; border-left: 1px solid var(--line-1); }
.map-summary { color: var(--ivory-2); line-height: 1.6; }
.place-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.place { width: 100%; display: flex; gap: 0.9rem; align-items: baseline; text-align: left; background: none; border: 0; border-top: 1px solid var(--line-2); padding: 0.7rem 0; cursor: pointer; font-family: var(--sans); color: var(--ivory-1); }
.place .num { font-size: 0.6875rem; letter-spacing: 0.18em; color: var(--gold-1); min-width: 1.5rem; }
.place .pname { font-size: 0.9375rem; line-height: 1.4; }
.place .pnote { display: block; font-size: 0.8125rem; color: var(--ivory-3); margin-top: 0.15rem; }
.place:hover .pname, .place[aria-current="true"] .pname { color: var(--gold-2); }
.place:focus-visible, .show-on-map:focus-visible { outline: 2px solid var(--gold-1); outline-offset: 2px; }
.map-legend { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--ivory-3); flex-wrap: wrap; }
.map-legend .leg { display: inline-block; width: 28px; height: 0; border-top: 2px solid var(--gold-1); margin-left: 0.5rem; }
.map-legend .leg:first-child { margin-left: 0; }
.map-legend .leg.flight { border-top: 2px dashed var(--gold-2); }
.map-failed { grid-template-columns: minmax(0, 1fr); }
.map-failed .map-canvas { display: none; }
.map-failed .map-side { border-left: 0; }

.map-marker { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--gold-1); background: var(--green-1); color: var(--gold-1); font: 500 11px/1 var(--sans); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.map-marker:not(.is-stop) { border-style: dashed; color: var(--ivory-2); border-color: var(--ivory-3); }
.map-marker.is-active { background: var(--gold-1); color: var(--black-1); border: 1px solid var(--gold-2); z-index: 2; }

.show-on-map { align-self: flex-start; margin-top: 0.25rem; background: none; border: 0; padding: 0; cursor: pointer; font: 500 0.6875rem var(--sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-1); }
.show-on-map:hover { color: var(--gold-2); }
.card.is-linked { border-color: var(--gold-1); box-shadow: 0 0 0 1px var(--gold-1); }
.card[id] { scroll-margin-top: 6rem; }

/* MapLibre chrome, restyled to tokens */
.map-block .maplibregl-ctrl-attrib { background: rgba(10, 11, 10, 0.85); color: var(--ivory-2); font-size: 10px; line-height: 1.5; padding: 2px 6px; max-width: 100%; }
.map-block .maplibregl-ctrl-attrib-inner { white-space: normal; }
.map-block .maplibregl-ctrl-attrib a { color: var(--ivory-1); }
.map-block .maplibregl-ctrl-group { background: var(--black-1); border: 1px solid var(--line-1); }
.map-block .maplibregl-ctrl-group button + button { border-top-color: var(--line-1); }
.map-block .maplibregl-ctrl-icon { filter: invert(0.85); }
.sbge-popup .maplibregl-popup-content { background: var(--black-1); color: var(--ivory-1); border: 1px solid var(--line-1); border-radius: 2px; padding: 0.75rem 0.9rem; font-family: var(--sans); font-size: 0.8125rem; display: flex; flex-direction: column; gap: 0.3rem; }
.sbge-popup .maplibregl-popup-content span { color: var(--ivory-3); }
.sbge-popup .maplibregl-popup-content a { font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase; }
.sbge-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--black-1); }
.sbge-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--black-1); }
.sbge-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--black-1); }
.sbge-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--black-1); }

@media print {
  .map-block { display: block; border: 0; }
  .map-canvas, .map-legend, .show-on-map { display: none !important; }
  .map-side { border: 0; padding: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .card-grid.four { grid-template-columns: repeat(2, 1fr); }
  header .btn.btn-ghost { padding: 0.6rem 1rem; font-size: 0.6875rem; letter-spacing: 0.16em; }
}
@media (max-width: 860px) {
  /* Header */
  header .logo img { height: 30px; }
  nav.primary-nav { position: fixed; top: 0; right: 0; bottom: 0; width: min(78vw, 320px);
    background: var(--black-1); border-left: 1px solid var(--line-1);
    flex-direction: column; align-items: flex-start; justify-content: flex-start;
    padding: 5.5rem 2rem 2rem; gap: 1.75rem; transform: translateX(100%);
    transition: transform 0.35s var(--ease); }
  nav.primary-nav.open { transform: translateX(0); }
  header .btn.btn-ghost { padding: 0.85rem 1.75rem; font-size: 0.8125rem; letter-spacing: 0.22em; white-space: normal; }
  /* Keep the toggle above the open drawer so it can close it */
  .menu-toggle { display: block; position: relative; z-index: 2; }

  /* Sections — tighter vertical padding on mobile */
  section { padding: 3.5rem var(--gutter); }
  .section-head { margin-bottom: 2rem; }

  /* Journey grid */
  .journey-grid { grid-template-columns: 1fr; }

  /* Contact form — iOS Safari won't clip overflow:hidden on a flex child;
     switch to block layout so overflow containment works correctly */
  .contact { display: block; }
  .contact-direct a { display: block; overflow-wrap: anywhere; }
  .contact-direct .sep { display: none; }
  .contact .inner { overflow-x: hidden; }
  .form-panel { padding: 1.5rem 1.25rem; overflow-x: hidden; }
  form#inquiry-form { grid-template-columns: 1fr; }
  .field { min-width: 0; }
  /* Submit button: nowrap + letter-spacing makes it ~420px wide; go full-width instead */
  .form-submit { display: block; min-width: 0; }
  .form-submit .btn { width: 100%; white-space: normal; letter-spacing: 0.14em; }


  /* Experience, features, partners */
  .card-grid.four { grid-template-columns: 1fr; }
  .feature { grid-template-columns: minmax(0, 1fr); margin-top: 2.5rem; }
  .feature .btn, .btn-row .btn { white-space: normal; text-align: center; letter-spacing: 0.16em; }
  .feature .feature-photo { min-height: 200px; }
  .feature img.feature-photo { height: auto; aspect-ratio: 4 / 3; }
  .photo-pair { gap: 0.75rem; margin-top: 2rem; }
  .feature .feature-body { padding: 1.5rem; }

  /* Country map */
  .map-block { grid-template-columns: minmax(0, 1fr); margin-top: 2rem; }
  .map-canvas { min-height: 340px; }
  .map-side { border-left: 0; border-top: 1px solid var(--line-1); padding: 1.5rem; }

  /* Subpages */
  .page-hero { min-height: 52svh; padding: 7rem var(--gutter) 3rem; }
  .card-grid { grid-template-columns: 1fr; gap: 1.25rem; }

  /* Footer */
  footer { padding: 2.5rem var(--gutter) 2rem; }
}
