/* Trip detail /aventure/{slug} (spec 5.3, 4.17 to 4.19). Page-only rules; components come from app.css. */
@layer pages {

/* ---- 1-2. Header block ------------------------------------------------------------------------- */
.w-detail { padding-bottom: var(--w-section-y); }
.w-detail__head { margin-bottom: 20px; }
/* eyebrow row (5.3 title block): category icon + « RANDONNÉE » · destination, teal-ink 12px/800 .14em */
.w-detail__eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 12px;
  font-size: var(--w-fs-eyebrow); font-weight: 800; line-height: 1.3; letter-spacing: .14em; text-transform: uppercase; color: var(--w-teal-ink);
}
.w-detail__eyebrow .w-icon { width: 16px; height: 16px; flex-shrink: 0; }
.w-detail__sep { letter-spacing: 0; }
/* Caps in em, not ch: 21.5em / 44em match the 30ch / 60ch of Plus Jakarta Sans (924 / 747 px at d1440), but
   they do not shrink with the fallback font (its "0" is 15 % narrower while its words are as wide), so the H1
   and the subtitle keep their line count when the web font swaps in (measured: layout shift 0.034 -> 0). */
.w-detail .w-h1-trip { max-width: 21.5em; }
.w-detail__sub { margin-top: 10px; max-width: 44em; font-size: 17px; line-height: 1.5; color: var(--w-slate); }
.w-detail__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 16px; font-size: 14px; }
.w-detail__from { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--w-slate); }
.w-detail__from .w-icon { width: 16px; height: 16px; color: var(--w-teal-ink); flex-shrink: 0; }
.w-detail__actions { display: flex; gap: 8px; margin-left: auto; }
@media (max-width: 767px) {
  .w-detail__sub { margin-top: 8px; font-size: 16px; }
  .w-detail__meta { gap: 8px 16px; margin-top: 12px; }
}
/* Heart + share never sit alone on a row: they take the right of the rating block (+ "Départs de …") when the
   row cannot hold everything: trips without pickup points on phones (Toubkal, Aguelmam), every trip 600-767. */
@media (max-width: 767px) {
  .w-detail__meta--solo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; }
  .w-detail__meta--solo .w-detail__actions { margin-left: 0; }
}
@media (max-width: 599px) {
  /* the rating wraps in that narrower column: no "·" left at the start of its second line */
  .w-detail__meta--solo .w-rating__label > [aria-hidden="true"] { display: none; }
}
@media (min-width: 600px) and (max-width: 767px) {
  .w-detail__meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; }
  .w-detail__meta > .w-rating, .w-detail__from { grid-column: 1; }
  .w-detail__actions { grid-column: 2; grid-row: 1; margin-left: 0; }
  .w-detail__from + .w-detail__actions { grid-row: 1 / span 2; }
}

/* ---- 3. Layout: main + 360 px sidebar from 1200 ----------------------------------------------- */
.w-detail__layout { display: grid; gap: 40px; align-items: start; }
.w-detail__main { min-width: 0; }
@media (min-width: 1200px) {
  .w-detail__layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .w-detail__side { align-self: stretch; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
}

/* a. gallery: the component sizes it (2/1 >= 1200, 3/2 tablet, 16/11 phone); empty = forest placeholder */
.w-detail__noimg { position: relative; }

/* b. fact chips: wrap from 768, one scrolling row (bleed, proximity snap) below */
.w-detail__facts { margin: 16px 0 24px; }
.w-detail__facts-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.w-detail__facts .w-chip--fact { max-width: 100%; }
@media (max-width: 767px) {
  .w-detail__facts {
    margin: 10px calc(var(--w-gutter) * -1) 18px; padding: 6px var(--w-gutter);
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: var(--w-gutter);
    scrollbar-width: none;
  }
  .w-detail__facts::-webkit-scrollbar { display: none; }
  .w-detail__facts:focus-visible { outline-offset: -3px; }
  .w-detail__facts-list { flex-wrap: nowrap; width: max-content; }
  .w-detail__facts .w-chip--fact { max-width: min(80vw, 320px); scroll-snap-align: start; }
}

/* c / c2 / f. booking cards and the compact "Infos pratiques" below 1200 */
.w-detail__info-wrap { margin-top: 16px; }
.w-detail__book--mirror { margin-top: 32px; }
.w-detail__cards { margin-top: 24px; }
@media (min-width: 1200px) { .w-detail__cards { margin-top: 0; } }

/* d. content cards */
.w-detail__prose > h3:first-child { margin-top: 4px; }
@media (min-width: 768px) {
  .w-detail__prose ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 32px; }
  .w-detail__prose ul > li + li { margin-top: 0; }
}
.w-detail__incl--one { grid-template-columns: minmax(0, 1fr); }
.w-detail__pdf { margin-top: 16px; padding-top: 8px; border-top: var(--w-border); }
.w-detail__pdf .w-link-arrow .w-icon:first-child { color: var(--w-teal-ink); }
.w-detail__pdf-tail { white-space: nowrap; }
.w-detail__pdf-tail .w-icon { width: 16px; height: 16px; margin-left: 6px; vertical-align: -3px; transition: transform var(--w-dur-fast) var(--w-ease-out); }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .w-detail__pdf .w-link-arrow:hover .w-detail__pdf-tail .w-icon { transform: translateX(3px); }
}
.w-detail__know { display: grid; gap: 12px; }
.w-detail__legal { background: var(--w-paper); border: var(--w-border); }
.w-detail__faq-all { margin-top: 12px; }

/* e. reviews, and the blog row below 1200 (after the reviews, before the mirror card) */
.w-detail__avis, .w-detail__blog-row { margin-top: 40px; padding-top: 32px; border-top: var(--w-border); }
.w-detail__avis .w-sec-head, .w-detail__blog-row .w-sec-head { margin-bottom: 20px; }
@media (min-width: 768px) { .w-detail__avis-foot { margin-top: 24px; } }
@media (max-width: 767px) {
  .w-detail__avis, .w-detail__blog-row { margin-top: 32px; padding-top: 28px; }
}

/* ---- Sidebar (>= 1200): booking card and blog module in flow, then "Infos pratiques" ------------ */
/* The card is sticky only while it fits under the header and the booking bar (aventure.js sets .is-sticky):
   a card taller than the screen would stick by its bottom edge and hide its own title and meters. */
.w-detail__stack { display: grid; gap: 16px; }
.w-detail__stack.is-sticky { position: sticky; top: calc(var(--w-header-h) + 24px); transition: top var(--w-dur-move) var(--w-ease-out); }
html.has-bookbar .w-detail__stack.is-sticky { top: calc(var(--w-header-h) + var(--w-bookbar-h) + 24px); }

/* "Infos pratiques" card */
.w-detail__info { padding: 20px; background: var(--w-white); border: var(--w-border); border-radius: var(--w-r-card); }
.w-detail__info-title { font-size: 18px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
.w-detail__info-body { display: grid; gap: 16px; margin-top: 14px; }
/* compact card (768 to 1199): rows | rendez-vous side by side; a card with only one of them spreads it instead
   of leaving the right half empty (rows in 2 columns, rendez-vous in up to 3) */
@media (min-width: 768px) and (max-width: 1199px) {
  .w-detail__info-body--split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; align-items: start; }
  .w-detail__info-body:not(.w-detail__info-body--split) .w-detail__rows { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .w-detail__info-body:not(.w-detail__info-body--split) .w-detail__rdv ul { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
}
.w-detail__rows { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.w-detail__row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 32px; font-size: 14px; line-height: 1.35; }
.w-detail__row--meter { grid-template-columns: 32px minmax(0, 1fr) auto auto; }
.w-detail__row-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--w-r-sm); background: var(--w-teal-tint); color: var(--w-teal-ink); }
.w-detail__row-ico .w-icon { width: 16px; height: 16px; }
.w-detail__row-k { color: var(--w-slate); font-weight: 600; }
.w-detail__row-v { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-detail__meter { display: inline-flex; gap: 4px; }
.w-detail__meter > span { width: 28px; height: 6px; border-radius: var(--w-r-pill); background: var(--w-sand-2); }
.w-detail__meter > span.is-on { background: var(--w-teal-ink); }
@media (max-width: 374px) { .w-detail__meter > span { width: 20px; } }
@media (forced-colors: active) {
  .w-detail__meter > span { border: 1px solid CanvasText; }
  .w-detail__meter > span.is-on { background: CanvasText; }
}
.w-detail__rdv-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--w-ink); }
.w-detail__rdv-title .w-icon { width: 16px; height: 16px; color: var(--w-teal-ink); }
.w-detail__rdv ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.w-detail__rdv li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 12px; border-radius: var(--w-r-md); background: var(--w-paper); border: var(--w-border); }
.w-detail__rdv-name { min-width: 0; font-size: 14px; font-weight: 700; line-height: 1.3; }
.w-detail__rdv-name span { display: block; font-size: 12px; font-weight: 500; color: var(--w-muted); }
.w-detail__rdv-more { margin-top: 8px; font-size: 13px; color: var(--w-muted); }

/* "Bien préparer votre départ" module (1 post per view, 36 px arrows with 44 px hit areas) */
.w-detail__blog { padding: 18px; background: var(--w-white); border: var(--w-border); border-radius: var(--w-r-card); }
.w-detail__blog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.w-detail__blog-head .w-eyebrow { margin-bottom: 6px; }
.w-detail__blog-title { font-size: 18px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.w-detail__blog-arrows { display: flex; gap: 8px; flex-shrink: 0; }
.w-detail__blog-arrows .w-btn--icon { width: 36px; min-width: 36px; height: 36px; min-height: 36px; }
.w-detail__blog-arrows .w-btn--icon::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.w-detail__blog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.w-detail__blog-foot .w-carousel__count { text-align: left; min-width: 0; }

/* ---- 4. D'autres aventures à vivre (full-bleed sand) ------------------------------------------ */
.w-detail__related .w-trip { height: 100%; }

/* ---- 5. Sticky bars (4.19) ---------------------------------------------------------------------- */
/* Desktop bar: the date popover, pax and CTA styles of the bar come from app.css (4.19) */
.w-detail__bar-id { min-width: 0; }
.w-detail__bar-note { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 15px; font-weight: 700; }
.w-detail__bar-note .w-book__tile { flex-shrink: 0; }

/* Mobile bottom bar: only below 1200 */
@media (min-width: 1200px) { .w-detail__bottombar { display: none; } }
.w-detail__bb-info { min-width: 0; }
/* tablets: the bar's price and CTA line up with the page content edge (31 / 41 px gutters), not 16 px */
@media (min-width: 768px) {
  .w-detail__bottombar { padding-left: max(var(--w-gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--w-gutter), env(safe-area-inset-right, 0px)); }
}
.w-detail__bottombar .w-btn--wa { min-width: 0; }
/* 320 to 359 px (WCAG reflow): "13 800 MAD au total" and "1 850 MAD / pers." stay on one line */
.w-detail__bottombar .w-bottombar__l2 small { white-space: nowrap; }
@media (max-width: 359px) {
  .w-detail__bottombar { gap: 10px; }
  .w-detail__bottombar .w-btn { min-width: 0; padding: 0 16px; }
  .w-detail__bottombar .w-btn--wa .w-icon { display: none; }
  .w-detail__bottombar .w-bottombar__l2 { font-size: 18px; }
}
}
