/* =========================================================================
   Secret Destinations - Responsive breakpoints
   (base styles in style.css are desktop-first; these adapt down)
   ========================================================================= */

/* Mobile-only breaks: hidden by default, shown inside the 768 px block */
.br-m { display: none; }

/* Ride Outside CT: centre Adventure image caption on all viewports */
.page-cape-town-outside #overview .cap { text-align: center; }

/* ---- Large tablets / small laptops -------------------------------------- */
@media (max-width: 1024px) {
  .hl-grid { grid-template-columns: repeat(2, 1fr); }
  .person-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Tablet ------------------------------------------------------------- */
@media (max-width: 900px) {
  /* Nav → hamburger */
  .nav-toggle { display: flex; }
  .main-nav { position: static; }
  .nav-links {
    position: fixed; inset: 0 0 0 auto; width: min(320px, 82vw);
    flex-direction: column; align-items: flex-start; gap: .4rem;
    background: #fff; padding: 6rem 2rem 2rem; box-shadow: -20px 0 60px rgba(20,40,38,.18);
    transform: translateX(100%); transition: transform .4s var(--ease); z-index: 190;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-link { color: var(--ink) !important; font-size: .82rem; padding: .6rem 0; width: 100%; }
  .nav-link::after { display: none; }
  .nav-cta-item { margin-top: .8rem; width: 100%; }
  .nav-cta { width: 100%; }
  .nav-toggle span { background: #fff; }
  .scrolled .nav-toggle span { background: var(--teal-deep); }
  .nav-toggle[aria-expanded="true"] span { background: var(--teal-deep) !important; }

  /* Trip strip: six-in-a-row is too tight here → two rows of three */
  .tripbar-inner { grid-template-columns: repeat(3, 1fr); gap: .35rem 0; }
  .tripbar-item::after { content: none; }
  .tripbar-item:not(:nth-child(3n+1))::after {
    content: ""; position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 1px; background: rgba(255,255,255,.18);
  }

  /* Grids collapse */
  .facts-inner { grid-template-columns: 1fr; }
  .fact + .fact::before { display: none; }
  .fact { border-top: 1px solid var(--line-2); }
  .fact:first-child { border-top: none; }

  .adventure-grid { grid-template-columns: 1fr; }
  .adventure-visual { min-height: 340px; }
  .info-cards { grid-template-columns: 1fr; }

  .experience, .experience--reverse { grid-template-columns: 1fr; }
  .experience--reverse .experience__media, .experience__media { order: 0; }
  .experience__media img { max-height: 320px; }

  .route-layout { grid-template-columns: 1fr; }
  .route-map { position: static; }
  .route-map__img { max-width: 520px; margin: 0 auto; }

  .itin { grid-template-columns: 1fr; }
  .itin-tabs { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; position: static; padding-bottom: .5rem; gap: .5rem; -webkit-overflow-scrolling: touch; }
  .itin-tab { flex-direction: column; align-items: center; min-width: 62px; gap: .1rem; }

  .person, .person--reverse { grid-template-columns: 1fr; gap: 2rem; }
  .person--reverse .person__media, .person__media { order: 0; }
  .person__media img { max-height: 460px; }

  .pricing-grid { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem 1.8rem; }
  .footer-col--brand { grid-column: 1 / -1; }
  .footer-bottom-inner { justify-content: flex-start; }

  .brochure { flex-direction: column; align-items: flex-start; text-align: left; }
}

/* ---- Decorative line breaks: desktop layout only ------------------------ */
/* .br-d breaks are tuned for wide multi-column text; drop them once the
   layout narrows so copy reflows naturally on tablets and phones. */
@media (max-width: 768px) {
  br { display: none; }
  .br-m { display: inline; }
  .br-d { display: none; }
  .hero--home .hero-actions { margin-top: 10rem; }
  .pillars { grid-template-columns: 1fr; }

  /* Hero eyebrow + metabar: dash stays visible but takes zero flow width so wrapped lines centre evenly */
  .hero .eyebrow { display: block; text-align: center; }
  .hero .eyebrow::before { display: inline-block; vertical-align: middle; margin-right: .8rem; margin-left: calc(-30px - .8rem); }
  .hero-metabar__text { display: block; text-align: center; }
  .hero-metabar__text::before { display: inline-block; vertical-align: middle; margin-right: .7rem; }


  /* ---- Mobile nav panel: full-width, centred, with visible header ---- */
  .nav-links {
    width: 100vw; left: 0; right: 0;
    height: 100vh; height: 100dvh;
    align-items: center; text-align: center;
    padding: 25vh 2rem 2rem;
    overflow-y: auto;
    background: #fff;
  }
  .site-header:has(.nav-links.open) {
    background: #fff;
    box-shadow: none;
  }
  .site-header:has(.nav-links.open) .brand-tag { color: var(--teal-2); border-color: var(--line); }
  .site-header:has(.nav-links.open) .nav-toggle span { background: var(--teal-deep) !important; }
  .brand { position: relative; z-index: 195; }
  .nav-toggle { position: relative; z-index: 195; }
  .nav-link { justify-content: center; }
  .nav-sub-toggle { right: 1.5rem; }
  .nav-dropdown { padding: .4rem 1.5rem; text-align: center; }
  .nav-dropdown__link { justify-content: center; text-align: center; padding: .55rem .4rem; }
  .nav-subdropdown { border-left: none; padding: 0 1rem; margin-left: 0; text-align: center; }
  .nav-subdropdown .nav-dropdown__link { justify-content: center; font-size: .74rem; }

  /* Where to next — centre card content, keep footer row left-aligned */
  .trip-card__body { text-align: center; }
  .trip-card__foot { text-align: left; }

  /* In Pictures — separator below each card except the last */
  .gallery-preview__card:not(:last-child) .gallery-preview__label {
    border-bottom: 1px solid var(--line-2);
    padding-bottom: 1rem;
    margin-bottom: .4rem;
  }

  /* The Story — centred heading + organised creds, stacked buttons */
  .experience--story .experience__body { text-align: center; }
  .experience--story .eyebrow { display: block; text-align: center; }
  .experience--story .title { text-align: center; }
  .story-creds { grid-template-columns: 1fr; gap: .5rem; text-align: left; }
  .story-btns { flex-direction: column; }
  .story-btns .btn { width: 100%; text-align: center; }

  /* Ready When You Are — lower buttons */
  .cta-band .hero-actions { margin-top: 3.5rem; }

  /* About — Where we go centred, How we work eyebrow+title only */
  .about-split > .reveal:first-child { text-align: center; }
  .about-split .eyebrow { display: flex; justify-content: center; }
  .about-split > .reveal:last-child .title { text-align: center; }

  /* About — Founder centred heading, no dash, organised byline */
  #founder .eyebrow { display: flex; justify-content: center; }
  #founder .title { text-align: center; }
  .person__byline { display: block; text-align: center; line-height: 2.2; }
  .person__byline::before { display: none; }

  /* About — Your Local Expert centred heading */
  section[aria-label="Your local expert"] .eyebrow { display: flex; justify-content: center; }
  section[aria-label="Your local expert"] .title { text-align: center; }

  /* Madagascar: centre Adventure eyebrow, title & image caption */
  .page-madagascar #overview .eyebrow { display: flex; justify-content: center; }
  .page-madagascar #overview .title { text-align: center; }
  .page-madagascar #overview .cap { text-align: center; }

  /* Peru: centre Adventure image caption */
  .page-peru #overview .cap { text-align: center; }

  /* Peru: shift hero image left so the rider is visible */
  .page-peru .hero-slide { background-position: 30% center; }

  /* Cape Town: shift hero image left */
  .page-cape-town .hero-slide { background-position: 30% center; }

  /* Dest-card: neutralise sticky :hover so .is-open tap-toggle works */
  .dest-card:hover { transform: none; box-shadow: none; }
  .dest-card:hover .dest-card__label { opacity: 1; }
  .dest-card:hover .dest-card__veil { opacity: 0; }
  .dest-card:hover .dest-card__line { width: 0; }
  .dest-card:hover .dest-card__hint-dot { background: transparent; transform: none; }
  .dest-card.is-open .dest-card__label { opacity: 0; }
  .dest-card.is-open .dest-card__veil { opacity: 1; }
  .dest-card.is-open .dest-card__line { width: 46px; }

  /* Route map: hint that it's tappable */
  .route-map img { cursor: zoom-in; }

  /* Madagascar: move "Accommodation…" list item to bottom */
  .page-madagascar #included .ie-list.inc { display: flex; flex-direction: column; }
  .page-madagascar #included .ie-list.inc li:nth-child(3) { order: 99; }

  /* Kili 2 Sea: move "Accommodation…" (inc) and "International flights…" (exc) to bottom */
  .page-kili2c #included .ie-list.inc { display: flex; flex-direction: column; }
  .page-kili2c #included .ie-list.inc li:nth-child(2) { order: 99; }
  .page-kili2c #included .ie-list.exc { display: flex; flex-direction: column; }
  .page-kili2c #included .ie-list.exc li:nth-child(1) { order: 99; }

  /* Itinerary panels — centre text above image */
  .itin-panel__text { text-align: center; }
  .itin-tagrow { justify-content: center; }

  /* Footer — centre everything */
  .site-footer { text-align: center; }
  .footer-col { display: flex; flex-direction: column; align-items: center; }
  .footer-brand { margin: 0 auto; }
  .footer-bottom-inner { flex-direction: column; align-items: center; gap: .8rem; }
  .footer-legal { justify-content: center; }
  .footer-credit { margin-top: .6rem; font-size: .72rem; color: rgba(205,221,217,.45); letter-spacing: .06em; }

  /* Ride Outside CT: centre day tabs */
  .page-cape-town-outside .itin-tabs { justify-content: center; }

  /* Ride Outside CT: move list items to bottom */
  .page-cape-town-outside #included .ie-list.inc { display: flex; flex-direction: column; }
  .page-cape-town-outside #included .ie-list.inc li:nth-child(2) { order: 99; }
  .page-cape-town-outside #included .ie-list.inc li:nth-child(5) { order: 99; }
  .page-cape-town-outside #included .ie-list.exc { display: flex; flex-direction: column; }
  .page-cape-town-outside #included .ie-list.exc li:nth-child(1) { order: 99; }

  /* Zanzibar: carousel — hide arrows, tap-to-advance on mobile */
  .page-zanzibar .carousel-arrow { display: none; }
  .page-zanzibar .carousel-viewport { cursor: pointer; }
  .page-zanzibar #momentsCarousel::before {
    content: 'Tap image for next →';
    display: block;
    text-align: center;
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: .45;
    margin-bottom: .75rem;
  }

  /* Zanzibar: CTA band eyebrow dash — hide on mobile */
  .page-zanzibar .cta-band .eyebrow::before { display: none; }

  /* Zanzibar: centre map legend box */
  .page-zanzibar .route-legend { text-align: center; }
  .page-zanzibar .legend-grid { justify-items: center; }

  /* Zanzibar: centre pricing column headings */
  .page-zanzibar .pricing-col-head { text-align: center; }

  /* Zanzibar: spacing + separator between pricing columns */
  .page-zanzibar .pricing-note { margin-top: 1.5rem; }
  .page-zanzibar .pricing-col + .pricing-col { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }

  /* Zanzibar: centre brochure / trip pack section */
  .page-zanzibar .brochure { text-align: center; align-items: center; }

  /* Trips: shift hero image left on mobile */
  .page-trips .hero-slide { background-position: 35% center; }

  /* Gallery tabs: equal-width stacked pills on mobile */
  .gallery-tabs { flex-direction: column; align-items: center; gap: .4rem; }
  .gallery-tab { width: 70%; text-align: center; }

  /* Trans Lesotho gallery: shift hero image right on mobile */
  .page-gallery-lesotho .hero-slide { background-position: 65% center; }

  /* Contact: shift hero image left on mobile */
  .page-contact .hero-slide { background-position: 35% center; }

  /* Contact: Reach us — stack items on mobile */
  .contact-list--row { flex-direction: column; align-items: center; gap: .9rem; }
  .contact-list--row li + li::before { display: none; }
}

/* ---- Mobile ------------------------------------------------------------- */
@media (max-width: 600px) {
  .hero h1 { font-size: clamp(2.6rem, 12vw, 3.6rem); }
  .hero--home h1 { white-space: normal; font-size: clamp(2.2rem, 10vw, 3.2rem); }
  .hero-actions { gap: 1rem; }
  .hero-actions .btn { width: 100%; }
  .hero-scroll { display: none; }

  .bike-list { grid-template-columns: 1fr; }
  .legend-grid { grid-template-columns: 1fr; }
  .inc-exc { grid-template-columns: 1fr; }
  .hl-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .person-stats { grid-template-columns: 1fr 1fr; }

  .price-card { padding: 1.6rem; }

  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }

  .tripbar-inner { grid-template-columns: repeat(2, 1fr); }
  .tripbar-item { font-size: .64rem; letter-spacing: .14em; }
  .tripbar-item::after { content: none; }
  .tripbar-item:not(:nth-child(2n+1))::after {
    content: ""; position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 1px; background: rgba(255,255,255,.18);
  }
}

/* ---- Fine tuning small phones ------------------------------------------- */
@media (max-width: 380px) {
  .brand-tag { display: none; }
  .person-stats { grid-template-columns: 1fr; }
}

/* =========================================================================
   MULTI-PAGE COMPONENTS — responsive (added in restructure)
   ========================================================================= */

@media (max-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  /* Nav dropdown → inline accordion inside the mobile panel */
  .nav-item--has-dropdown { width: 100%; position: relative; }
  .nav-caret { display: none; }
  .nav-sub-toggle {
    display: block; position: absolute; right: 0; top: 4px;
    width: 40px; height: 34px; background: transparent; border: none; color: var(--ink);
  }
  .nav-sub-toggle::before,
  .nav-sub-toggle::after {
    content: ""; position: absolute; top: 50%; left: 50%; width: 12px; height: 2px;
    background: currentColor; transform: translate(-50%, -50%); transition: transform .25s var(--ease);
  }
  .nav-sub-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
  .nav-item--has-dropdown.open .nav-sub-toggle::after { transform: translate(-50%, -50%) rotate(0); opacity: 0; }
  .nav-dropdown {
    position: static; transform: none; opacity: 1; visibility: visible;
    box-shadow: none; border: none; min-width: 0; background: transparent;
    padding: 0 0 0 .8rem; margin: 0; max-height: 0; overflow: hidden;
    transition: max-height .3s var(--ease);
  }
  .nav-item--has-dropdown.open .nav-dropdown { max-height: 360px; }
  .nav-dropdown__link { color: var(--ink-2); padding: .55rem .4rem; font-size: .8rem; }

  .about-split { grid-template-columns: 1fr; gap: 2.5rem; }
  .value-grid { grid-template-columns: 1fr; }
  .region-grid { grid-template-columns: repeat(2, 1fr); }
  .founder-bio__media { float: none; width: 100%; max-width: 420px; margin: 0 auto 1.8rem; }
  .contact-layout { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .photo-grid--full { grid-template-columns: repeat(2, 1fr); }
  .photo-grid--portrait { grid-template-columns: repeat(3, 1fr); }
  .photo-grid--masonry { column-count: 2; }
  .section-head--between { align-items: flex-start; }
  .ghero__grid { grid-template-columns: 1fr; min-height: 0; }
  .ghero__media { min-height: 260px; order: -1; }
}

@media (max-width: 600px) {
  .feature-grid { grid-template-columns: 1fr; }
  .gtk-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid--full { grid-template-columns: repeat(2, 1fr); }
  .photo-grid--portrait { grid-template-columns: repeat(2, 1fr); }
  .photo-grid--masonry { column-count: 2; }
  .photo-grid--trio { grid-template-columns: 1fr; }
  .gallery-preview { grid-template-columns: 1fr; gap: 1.6rem; }
  .trip-grid--duo { grid-template-columns: 1fr; }
  .stage { grid-template-columns: 1fr; gap: .3rem; }
  .stage__day { color: var(--coral); }
  .tailor-note { text-align: left; }
  .tailor-note .btn { width: 100%; }
  .trip-card__name { font-size: 1.55rem; }
}

/* ---- Offerings restructure: nested nav + new cards (responsive) ---------- */
@media (max-width: 900px) {
  /* Second-level fly-outs render inline & always-open inside the mobile panel */
  .nav-dropdown__item--has-sub > .nav-dropdown__link { justify-content: flex-start; }
  .nav-dropdown__caret { display: none; }
  .nav-subdropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; min-width: 0; background: transparent;
    padding: 0 0 .2rem .9rem; margin: .1rem 0 .3rem; border-left: 2px solid var(--line-2);
  }
  .nav-subdropdown .nav-dropdown__link { font-size: .76rem; padding: .5rem .4rem; }
}

@media (max-width: 768px) {
  /* Re-declare after the 900px blocks so these win the cascade */
  .nav-dropdown { padding: .4rem 0; }
  .nav-item--has-dropdown.open .nav-dropdown { max-height: 600px; }
  .nav-dropdown__item--has-sub > .nav-dropdown__link { justify-content: center; }
  .nav-subdropdown { border-left: none; padding: 0; margin-left: 0; }
  .nav-subdropdown .nav-dropdown__link { justify-content: center; font-size: .74rem; }

  /* Kill the desktop hover transform that shifts the dropdown left by 50% */
  .nav-item--has-dropdown:hover .nav-dropdown,
  .nav-item--has-dropdown:focus-within .nav-dropdown { transform: none; }

  /* Category headers inside the dropdown — bold + spaced */
  .nav-dropdown__item--has-sub > .nav-dropdown__link {
    font-weight: 700; font-size: .82rem; letter-spacing: .06em;
    text-transform: uppercase; margin-top: .8rem; padding-bottom: .2rem;
    border-bottom: 1px solid var(--line-2);
  }
  .nav-dropdown__item--has-sub:first-child > .nav-dropdown__link { margin-top: .2rem; }
  .nav-subdropdown .nav-dropdown__link { font-weight: 400; }
}

@media (max-width: 560px) {
  .ride-card__head { flex-direction: column; align-items: flex-start; }
  .explore-grid { grid-template-columns: 1fr; }
}
