/* ============================================================================
 * ja_voyara — Home 2 (Itemid 278) page overlay.
 * Pixel-parity fixes vs .pen Page/Home 2 (kJ93D / dark ive4n / mobile s301gG).
 * Loaded by index.php only on the Home 2 menu item, after template.css.
 * Var-driven so darkmode.css auto-remaps in dark.
 * ========================================================================== */

/* ── §1  EDITORIAL HERO (section-1, mod 420, pen eJBNM) ──────────────────
 * .pen: pt 44 / pb 40 (not the 88 base). Inner gap 32 ✓.
 * Featured panel: 720px wide in 1140 grid (not auto 1.4fr).
 * Featured title: 40px / lh 1.12 (ACM CSS has 32/1.15). Pill: pad 6/12.
 * Dispatch label: 11px / ls 1px (inherits 12px from .voy-eyebrow).
 * Side row cat: 10px / ls 0.5px. Side row title: 17px / lh 1.25.
 * Side row byline: 12px.
 * Container inner padding removed (pen inner is 1140 flush).
 * ────────────────────────────────────────────────────────────────────── */

/* Section padding override */
body.layout-home-2 .acm-news-featured {
  padding-top: 44px;
  padding-bottom: 40px;
}

/* Remove default container padding so inner is exactly 1140px.
   (Global .ja-acm>.container is now max-width:1180/pad20 → content 1140; with pad:0 here we must
   pin max-width:1140 so the flush editorial-hero inner stays exactly 1140, not 1180.) */
body.layout-home-2 .acm-news-featured .container {
  max-width: 1140px;
  padding-inline: 0;
}

/* Featured panel: fix width to 720px (pen: Featured=720 in gap:32/total:1140) */
body.layout-home-2 .acm-news-featured .acm-nf-grid {
  grid-template-columns: 720px 1fr;
}

/* Featured title: 40px / lh 1.12 */
body.layout-home-2 .acm-news-featured .acm-nf-feat-title {
  font-size: 40px;
  line-height: 1.12;
}

/* Featured pill padding: 6/12 (ACM has 5/12) */
body.layout-home-2 .acm-news-featured .acm-nf-pill {
  padding-top: 6px;
  padding-bottom: 6px;
}

/* Featured inner padding: 36px all sides (pen h0vWet padding:36; ACM default has 32px) */
body.layout-home-2 .acm-news-featured .acm-nf-feat-inner {
  padding: 36px !important;
}

/* Featured title width constraint: pen X8Yxa width:560 inside 720px panel (padding 36 each side → content = 720-72 = 648; pen text node fixed 560) */
body.layout-home-2 .acm-news-featured .acm-nf-feat-title {
  max-width: 560px;
}

/* "LATEST DISPATCHES" label: 11px / ls 1px / muted (#8A7E72) — pen yCcUI.
 * .voy-eyebrow sets color to --voy-secondary (teal); override to muted. */
body.layout-home-2 .acm-news-featured .acm-nf-list-title {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--voy-muted);
}

/* Side row category pill: 10px / ls 0.5px (ACM has 11px/0.6px) */
body.layout-home-2 .acm-news-featured .acm-nf-row-cat {
  font-size: 10px;
  letter-spacing: 0.5px;
}

/* Trending card cat letter-spacing: 0.5px (pen c0fcs8 LS:0.5; global scss has 0.6px) */
body.layout-home-2 #t4-trending .voy-card__cat {
  letter-spacing: 0.5px;
}

/* Trending card title line-height: 1.25 (pen W9YLW lh:1.25; global has 1.14) */
body.layout-home-2 #t4-trending .voy-card__title {
  line-height: 1.25;
}

/* Side row title: 17px / lh 1.25 (ACM has 18px/1.2) */
body.layout-home-2 .acm-news-featured .acm-nf-row-title {
  font-size: 17px;
  line-height: 1.25;
}

/* Side row byline: 12px (ACM has 13px) */
body.layout-home-2 .acm-news-featured .acm-nf-row-by {
  font-size: 12px;
}

/* Side story dividers: pen S0/S1/S2 each carry a TOP border (incl. above the
 * first row). ACM uses border-bottom + last-child:0 → no divider above row 1.
 * Add the missing top hairline on the first row to match pen J2fW8. */
body.layout-home-2 .acm-news-featured .acm-nf-list-title + .acm-nf-row {
  border-top: 1px solid var(--voy-border);
}

/* ── §2  TOPICS BAR (section-2, mod 421, pen xwrUP) ──────────────────────
 * .pen: pt/pb 20 (ACM has 22). Pill: 13px/500/pad 8/16 ✓ (home2.css §2).
 * "BROWSE" label: 11px (inherits .voy-eyebrow 12px).
 * ────────────────────────────────────────────────────────────────────── */

body.layout-home-2 .acm-topics {
  padding-block: 20px;
}

/* "BROWSE" label: Geist Mono 11px/#8A7E72 (inherits muted color ✓, fix size) */
body.layout-home-2 .acm-topics .acm-topics-label {
  color: var(--voy-muted);
  font-size: 11px;
  letter-spacing: 1px;
}

/* Topics pills: Inter 13 / weight 500, pad 8px 16px.
   .pen uich1 row height is ~32px (text uses Inter's natural ~1.2 line-height);
   live inherited the 1.65 body line-height → pill 39px, topics band +9. Pin it. */
body.layout-home-2 .acm-topics .voy-chip {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  line-height: 1.2;
}

/* ── §3  TRENDING (section-3, mod 422, mod_articles_category) ────────────
 * .pen: jL9m5 fill=#FAF6F0, pt/pb=72, inner max-width=1140 centered.
 * Section head: eyebrow "TRENDING THIS WEEK" (Mono 12/ls1/#C2562F) +
 *   title "What readers are loving" (Playfair 34/700 lh1.15 #1A1512).
 * head→grid gap: 32px.
 * mod_articles_category renders raw voy-news-grid with no wrapper — we
 * inject the section wrap, bg, padding, and head via CSS + a generated
 * ::before title block (structural approach).
 * Card body: 20px all sides (ACM has pb:24).
 * ────────────────────────────────────────────────────────────────────── */

/* Position wrapper provides bg + padding — pen jL9m5 fill:#FAF6F0 = --voy-bg */
body.layout-home-2 #t4-trending {
  background: var(--voy-bg);
}

/* The voy-news-grid without wrap (fallback if layout=default) gets padding+maxW */
body.layout-home-2 #t4-trending > .voy-news-grid {
  max-width: 1140px;
  margin-inline: auto;
  padding-top: 72px;
  padding-bottom: 72px;
  padding-inline: 0;
}

/* Trending section head wrap — rendered by trending-layout.php */
body.layout-home-2 #t4-trending .voy-trending-wrap {
  max-width: 1140px;
  margin-inline: auto;
  padding-top: 72px;
  padding-bottom: 72px;
  padding-inline: 0;
}

/* Override the grid inside the wrap (already covered by .voy-trending-wrap) */
body.layout-home-2 #t4-trending .voy-trending-wrap .voy-news-grid {
  max-width: none;
  margin-inline: 0;
  padding-top: 0;
  padding-bottom: 0;
  padding-inline: 0;
}

/* Trending head: eyebrow + title side-by-side with "All stories" link */
body.layout-home-2 .voy-trending-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
}
body.layout-home-2 .voy-trending-head__left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Trending eyebrow: Geist Mono 12/ls1/#C2562F/normal — pen KEdoK */
body.layout-home-2 .voy-trending-eyebrow {
  font-family: var(--voy-font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  font-weight: normal;
  color: var(--voy-primary);
  text-transform: uppercase;
}

/* Trending title: Playfair 34/700/#1A1512 lh1.15 — pen EREh4 */
body.layout-home-2 .voy-trending-title {
  font-family: var(--voy-font-head);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--voy-heading);
  margin: 0;
}

/* Trending "All stories" link — pen cY4tD: Inter 15/600/#C2562F + arrow */
body.layout-home-2 .voy-trending-link {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--voy-font-base);
  font-size: 15px;
  font-weight: 600;
  color: var(--voy-primary);
  text-decoration: none;
  white-space: nowrap;
}
body.layout-home-2 .voy-trending-link svg {
  stroke: var(--voy-primary);
  flex-shrink: 0;
}

/* Card body: 20px all sides (pen bYLB0 body pad 20; ACM default has pb:24) */
body.layout-home-2 #t4-trending .voy-card__body {
  padding: 20px !important;
}

/* Card cover: fixed 200px (pen bYLB0 C5a7D height:200; global card uses
 * aspect-ratio 16/10 → ~226px on a 362px card = 26px too tall). */
body.layout-home-2 #t4-trending .voy-card__media {
  height: 200px !important;
  aspect-ratio: auto !important;
}

/* ── §4  DESTINATION PICKS (section-4, mod 423, pen N1Mk2) ──────────────
 * .pen: pt/pb 72 (inherits 88 from voy-section base).
 * Heading 34px/700 ✓ (home2.css already set). Eyebrow suppressed ✓.
 * ────────────────────────────────────────────────────────────────────── */

body.layout-home-2 .acm-destinations {
  padding-top: 72px !important;
  padding-bottom: 72px !important;
}

/* Destination Picks heading: Playfair 34/700 (no eyebrow) */
body.layout-home-2 .acm-destinations .acm-dest-head h2 {
  font-size: 34px;
  line-height: 1.15;
}

/* Suppress eyebrow (Destinations ACM has "FEATURED TRIPS" eyebrow by default) */
body.layout-home-2 .acm-destinations .voy-eyebrow {
  display: none;
}

/* Suppress the "Browse all destinations" link: pen FK0AZ Picks head has ONLY
 * the title (moq2L) + grid — no right-side link (unlike Trending which keeps
 * its "All stories" link). */
body.layout-home-2 .acm-destinations .acm-dest-browse {
  display: none;
}

/* Destination card image height: 220px (pen MXX3l h:220; ACM uses aspect-ratio:16/11 → ~177px) */
body.layout-home-2 .acm-destinations .acm-dest-card .voy-card__media {
  height: 220px !important;
  aspect-ratio: unset !important;
}

/* Destination card body: padding 18px all sides, gap 8px (pen UPgLl padding:18, gap:8; global has 20/22/24 and gap:10) */
body.layout-home-2 .acm-destinations .acm-dest-card .voy-card__body {
  padding: 18px !important;
  gap: 8px !important;
}

/* Picks head→grid gap: 32px (pen FK0AZ gap:32; ACM default .acm-dest-head has margin-bottom:40px) */
body.layout-home-2 .acm-destinations .acm-dest-head {
  margin-bottom: 32px !important;
}

/* Destination grid: 3 columns on Home 2 (pen FK0AZ l8kvQ shows 3 cards; module sets $cols=3 → voy-grid--3) */
/* Already handled by module columns param; this ensures CSS cols match */
body.layout-home-2 .acm-destinations .voy-grid--4 {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* Rating badge padding: 6px/11px (pen B4z6e padding:[6,11]; global scss has 4px/10px) */
body.layout-home-2 .voy-rating-badge {
  padding: 6px 11px !important;
}

/* Rating star fill: pen C0ZC3l #E8B66F. Global --voy-accent is #E0A458 in
 * LIGHT (a duller gold) but #E8B66F in dark; the pen star is #E8B66F in both.
 * Scoped Home2 fix; the proper fix is --voy-accent:#E8B66F in light _voyara.scss
 * (recorded for orchestrator — shared token affects every card site-wide). */
body.layout-home-2 .acm-destinations .voy-rating-badge svg {
  color: #E8B66F;
}

/* Loc pin icon: pen OCVSr 13px; ACM template hardcodes width/height 14 → 1px
 * too big. CSS box beats the SVG attribute. */
body.layout-home-2 .acm-destinations .acm-dest-loc svg {
  width: 13px;
  height: 13px;
}

/* ── §5  NEWSLETTER CTA (section-5, mod 424, pen ibuiO) ─────────────────
 * .pen: pt/pb 72 ✓ (acm-cta.style-4 uses voy-section--news which has 72px).
 * Title: Playfair 38/700/lh1.15/#FFF ✓. Sub: 16px/lh1.6 ✓.
 * Inner width 720px ✓. Field width 440px ✓. Btn: #C2562F ✓.
 * ────────────────────────────────────────────────────────────────────── */

/* CTA sub: pen y8pJVi width:560 (wraps to 2 lines centered). Live has no cap
 * → renders on one 709px line. Cap at 560 + center. */
body.layout-home-2 .acm-cta.style-4 .acm-cta4-sub {
  max-width: 560px;
  margin-inline: auto;
}

/* ── §6  DARK MODE overrides for Home 2 ─────────────────────────────────
 * Handled by darkmode.css token remaps. The following home2.css rules
 * use var() tokens so they auto-flip in dark. No hard-coded hex needed.
 * Topics pills dark: bg #211B16, stroke #352C24, text #E8DFD4 (pen kyoXI).
 * "BROWSE" label dark: #9C9085 (pen h1fTZ).
 * Side row border dark: #352C24 (pen stroke on S0,S1,S2 = #352C24).
 * ────────────────────────────────────────────────────────────────────── */

/* ── §7  MOBILE (390px, pen s301gG) ─────────────────────────────────────
 * Section 1 (Editorial Hero): not in s301gG — mobile uses separate layout.
 * Section 2 (Topics): horizontal → vertical list (pen oyNn1 LabelWrap / rows).
 * Section 3 (Trending): mobile stack, padding 44/20 (pen SVGvr).
 * Section 4 (Picks): mobile stack, padding 44/20 (pen UxM3K).
 * Section 5 (Newsletter CTA): mobile stack, padding 48/48 (pen RUSUB).
 * ────────────────────────────────────────────────────────────────────── */

@media (max-width: 767.98px) {

  /* S1 mobile: collapse to single column (ACM's own @991px already does this).
   * Fix featured hero min-height to 440px (pen s3raj height:440). */
  body.layout-home-2 .acm-news-featured .acm-nf-grid {
    grid-template-columns: 1fr;
  }
  body.layout-home-2 .acm-news-featured .acm-nf-feat {
    min-height: 440px;
  }

  /* S1 mobile feat title: pen Z6L4i 30px (desktop 40px). */
  body.layout-home-2 .acm-news-featured .acm-nf-feat-title {
    font-size: 30px;
    max-width: none;
  }

  /* S1 mobile dispatch thumb: pen vYrKg 96×72 (desktop 110×84). */
  body.layout-home-2 .acm-news-featured .acm-nf-thumb,
  body.layout-home-2 .acm-news-featured .acm-nf-row-thumb {
    flex: 0 0 96px;
    width: 96px;
    height: 72px;
  }

  /* S2: Topics bar is OMITTED from the pen mobile frame s301gG (Hero →
   * Latest Dispatches → Trending → Picks → CTA, no Topics). Hide on mobile. */
  body.layout-home-2 .acm-topics {
    display: none;
  }

  /* S3: Trending mobile (pen SVGvr): pt/pb 44, padding-inline 20 */
  body.layout-home-2 #t4-trending .voy-trending-wrap {
    padding-top: 44px;
    padding-bottom: 44px;
    padding-inline: 20px;
  }
  body.layout-home-2 #t4-trending > .voy-news-grid {
    padding-top: 44px;
    padding-bottom: 44px;
    padding-inline: 20px;
  }
  body.layout-home-2 #t4-trending .voy-news-grid {
    grid-template-columns: 1fr; /* single column on mobile */
  }

  /* S3 mobile trending title: pen VlhFQ 28px (desktop 34px). */
  body.layout-home-2 .voy-trending-title {
    font-size: 28px;
  }

  /* S3 mobile: pen LF6zY head has NO "All stories" link (desktop-only). */
  body.layout-home-2 .voy-trending-link {
    display: none;
  }
  body.layout-home-2 .voy-trending-head {
    display: block; /* head collapses to stacked eyebrow+title without the link */
  }

  /* S1 mobile: "Latest Dispatches" list — pen AJHv4 fill:#F2EBE1 / padding:[40,20] / gap:4 */
  body.layout-home-2 .acm-news-featured .acm-nf-list {
    background: var(--voy-elevated, #F2EBE1);
    padding: 40px 20px !important;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  /* S4: Picks mobile (pen UxM3K): pt/pb 44, padding-inline 20 */
  body.layout-home-2 .acm-destinations {
    padding-top: 44px !important;
    padding-bottom: 44px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  /* Remove container default 16px horizontal padding on mobile to avoid double indent */
  body.layout-home-2 .acm-destinations .container {
    padding-inline: 0 !important;
  }

  /* S4 mobile picks title: pen C8LgaL 28px (desktop 34px). */
  body.layout-home-2 .acm-destinations .acm-dest-head h2 {
    font-size: 28px;
  }

  /* S5: CTA mobile (pen RUSUB): pt/pb 48, padding-inline 20 */
  body.layout-home-2 .acm-cta.style-4 {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  /* Remove container default inline padding on mobile */
  body.layout-home-2 .acm-cta.style-4 .container {
    padding-inline: 0 !important;
  }

  /* S5 inner gap: 14px (pen RUSUB gap:14; global/desktop is 18px) */
  body.layout-home-2 .acm-cta4-inner {
    gap: 14px !important;
  }

  /* S5 title mobile: 28px (pen nezRi fs:28) */
  body.layout-home-2 .acm-cta4-title {
    font-size: 28px !important;
  }

  /* S5 sub mobile: 15px (pen h9iZJ fs:15; desktop is 16px) */
  body.layout-home-2 .acm-cta4-sub {
    font-size: 15px !important;
  }

  /* S5 CTA button mobile: padding 11px/20px (pen QQtp0 padding:[11,20]; desktop is 22px) */
  body.layout-home-2 .acm-cta4-btn {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}
