/* ============================================================
   home.css — Landing page
   Sections: hero, collage marquee, Pop Quiz card, bmap teaser
   (Leaflet), bweb teaser (SVG mockup), newsletter.
   Class prefixes: .hc-* for page sections, .hd-* for the marquee.
   ============================================================ */

.hc {
  color: var(--text-color);
  background: var(--background-color);
  min-height: 100vh;
}

/* ─── HERO ───────────────────────────────────────────────── */

.hc-hero {
  text-align: center;
  padding: var(--space-6) var(--space-3) var(--space-3);
}
.hc-hero__brand {
  font-family: var(--brand-font);
  font-size: clamp(40px, 6.5vw, 68px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0 0 8px;
}
.hc-hero__tagline {
  font-family: var(--heading-font);
  font-size: clamp(16px, 1.6vw, 20px);
  color: var(--subhead-color);
  margin: 0;
}

/* ─── FEATURED CONNECTION — ticket-style card ────────────── */

.hc-featured {
  padding: var(--space-3) var(--space-3) var(--space-8);
  max-width: 780px;
  margin: 0 auto;
}
/* ── Editorial callout (simplified featured) ── */
.hc-callout {
  position: relative;
  text-align: center;
  padding: var(--space-3) var(--space-3) var(--space-2);
}
.hc-callout__arc {
  position: absolute;
  top: 0; left: 0; right: 0;
  width: 100%;
  height: 44px;
  pointer-events: none;
}
.hc-callout__body {
  position: relative;
  transition: opacity var(--duration-slow) ease;
  padding-top: var(--space-3);
}
.hc-callout__line {
  font-family: var(--heading-font);
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.25;
  color: var(--h1-color);
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  margin: 0 auto;
  max-width: 720px;
}
.hc-callout__place {
  font-weight: 700;
  color: var(--deep-maroon);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color var(--duration-fast), color var(--duration-fast);
}
.hc-callout__place:hover {
  color: var(--primary-color);
  border-bottom-color: var(--golden-ochre);
}
.hc-callout__topic {
  font-style: italic;
  font-weight: 500;
  color: var(--ink-soft);
}
.hc-callout__joiner {
  color: var(--golden-ochre);
  font-weight: 700;
  opacity: 0.85;
}
.hc-callout__reveal {
  font-family: var(--body-font);
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.65;
  color: var(--ink-soft);
  margin: var(--space-2) auto 0;
  max-width: 620px;
}

.hc-callout__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: var(--space-3);
}
.hc-callout__arrow {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(140, 47, 57, 0.3);
  background: transparent;
  color: var(--deep-maroon);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 11px;
  transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
}
.hc-callout__arrow:hover {
  background: var(--deep-maroon);
  color: #fff;
  border-color: var(--deep-maroon);
}
.hc-callout__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.hc-callout__dot-btn {
  width: 8px; height: 8px; border-radius: 50%;
  border: 0; padding: 0;
  background: rgba(140, 47, 57, 0.25);
  cursor: pointer;
  transition: all var(--duration-fast);
}
.hc-callout__dot-btn:hover { background: rgba(140, 47, 57, 0.5); }
.hc-callout__dot-btn.is-active {
  background: var(--primary-color);
  width: 22px; border-radius: 4px;
}

/* ─── WHAT IS BUNKABOP? (single unified visual) ──────────── */

.hc-what {
  padding: var(--space-8) var(--space-3);
  background:
    radial-gradient(ellipse at top,    rgba(217, 93, 57, 0.05), transparent 40%),
    radial-gradient(ellipse at bottom, rgba(224, 160, 47, 0.05), transparent 40%),
    white;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.hc-what__inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.hc-what__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--golden-ochre);
  font-weight: 700;
  margin-bottom: 8px;
  font-family: var(--body-font);
}
.hc-what__heading {
  font-family: var(--heading-font);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--h1-color);
  margin: 0 0 var(--space-2);
}
.hc-what__lead {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-color);
  max-width: 620px;
  margin: 0 auto var(--space-4);
}
.hc-what__figure {
  margin: 0 0 var(--space-4);
}
.hc-what__svg {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ── Collage of place + topic images ── */
.hc-collage {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 110px;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto;
}
.hc-collage__tile {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--soft-cream, #F5EBD4);
  background-size: cover;
  background-position: center;
  text-decoration: none;
  color: inherit;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.hc-collage__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44, 26, 14, 0.72) 0%, rgba(44, 26, 14, 0.15) 45%, transparent 70%);
  transition: opacity var(--duration-fast);
}
.hc-collage__tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.hc-collage__tile--textonly {
  background: linear-gradient(135deg, var(--deep-maroon), #A63D46);
  color: #FBE9CB;
}
.hc-collage__tile--textonly.hc-collage__tile--topic {
  background: linear-gradient(135deg, #116466, #0D4E50);
}
.hc-collage__tile--textonly::after { display: none; }

.hc-collage__label {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #fff;
  text-align: left;
}
.hc-collage__tile--textonly .hc-collage__label {
  top: 8px;
  bottom: 8px;
  justify-content: center;
  text-align: center;
}
.hc-collage__kind {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.85;
}
.hc-collage__tile--place .hc-collage__kind { color: var(--golden-ochre); }
.hc-collage__tile--topic .hc-collage__kind { color: #8FD8D8; }
.hc-collage__name {
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  color: #fff;
}

.hc-collage__tile:nth-child(1)  { grid-column: span 2; grid-row: span 2; }
.hc-collage__tile:nth-child(4)  { grid-column: span 2; }
.hc-collage__tile:nth-child(7)  { grid-row: span 2; }
.hc-collage__tile:nth-child(10) { grid-column: span 2; }

@media (max-width: 720px) {
  .hc-collage {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 96px;
  }
  .hc-collage__tile:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }
  .hc-collage__tile:nth-child(1)  { grid-column: span 2; grid-row: span 2; }
  .hc-collage__tile:nth-child(6)  { grid-column: span 2; }
}

.hc-what__caption {
  font-family: var(--body-font);
  font-size: var(--text-sm);
  color: var(--ink-soft);
  font-style: italic;
  max-width: 520px;
  margin: 8px auto 0;
  line-height: 1.55;
}
.hc-what__more {
  display: inline-block;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast);
}
.hc-what__more:hover { border-color: var(--primary-color); }

/* ─── POP QUIZ — mirrors bgame .qia-* card ──────────────── */

.hc-quiz {
  padding: var(--space-8) var(--space-3);
  background: var(--background-color);
  border-bottom: 1px solid var(--border-color);
}
.hc-quiz__inner { max-width: 480px; margin: 0 auto; }
.hc-quiz__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--golden-ochre);
  font-weight: 700;
  margin-bottom: 6px;
  font-family: var(--body-font);
  text-align: center;
}
.hc-quiz__heading {
  font-family: var(--heading-font);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--h2-color);
  margin: 0 0 var(--space-4);
  text-align: center;
}
.hc-quiz__no-quiz {
  color: var(--ink-faint);
  font-style: italic;
  text-align: center;
}

/* Note: the actual card visuals (.qia-paper, .qia-map, .qia-graphic, answers,
   reveal, etc.) live in static/css/components/qia_card.css so bgame and home
   stay visually in sync. The only home-specific piece is the footnote below. */

.hc-quiz__footnote {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(17, 100, 102, 0.18);
  font-family: var(--body-font);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  font-style: italic;
  text-align: center;
}

/* ─── BUNKAMAP (real Leaflet) ────────────────────────────── */

.hc-bmap {
  padding: var(--space-8) var(--space-3);
  background: var(--background-color);
  border-bottom: 1px solid var(--border-color);
}
.hc-bmap__inner {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-6);
  align-items: center;
}
.hc-bmap__preview {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: white;
}
.hc-bmap__map {
  width: 100%;
  height: 340px;
  background: var(--background-color);
  position: relative;
}
.hc-bmap__static {
  display: block;
  width: 100%;
  height: auto;
  background: var(--background-color);
}
.hc-bmap__map .leaflet-container { cursor: default; }
.hc-bmap__map-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.hc-bmap__map-caption {
  display: block;
  padding: 10px var(--space-2) 12px;
  font-family: var(--body-font);
  font-size: var(--text-xs);
  text-align: center;
  color: var(--ink-faint);
  border-top: 1px solid var(--border-color);
  background: white;
  text-decoration: none;
  transition: background var(--duration-fast);
}
.hc-bmap__map-caption:hover { background: #FDF6E3; }
.hc-bmap__map-caption strong {
  color: var(--h3-color);
  font-weight: 700;
  margin: 0 4px;
}
.hc-bmap__caption-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--golden-ochre);
}
.hc-bmap__tooltip {
  background: white !important;
  color: var(--ink) !important;
  border: 1px solid var(--border-color) !important;
  font-family: var(--heading-font) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  padding: 3px 7px !important;
  box-shadow: var(--shadow-sm) !important;
}
.hc-bmap__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--golden-ochre);
  font-weight: 700;
  margin-bottom: 6px;
  font-family: var(--body-font);
}
.hc-bmap__heading {
  font-family: var(--heading-font);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--space-2);
  color: var(--h2-color);
}
.hc-bmap__text {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-color);
  margin-bottom: var(--space-3);
}
.hc-bmap__cta {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 12px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-family: var(--body-font);
  transition: background var(--duration-fast);
}
.hc-bmap__cta:hover { background: var(--primary-color-dark); }

/* ─── BUNKAWEB (static SVG mockup) ───────────────────────── */

.hc-bweb {
  padding: var(--space-8) var(--space-3);
  background: var(--background-color);
  border-bottom: 1px solid var(--border-color);
}
.hc-bweb__inner {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-6);
  align-items: center;
}
.hc-bweb__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--golden-ochre);
  font-weight: 700;
  margin-bottom: 6px;
  font-family: var(--body-font);
}
.hc-bweb__heading {
  font-family: var(--heading-font);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--space-2);
  color: var(--h2-color);
}
.hc-bweb__text {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-color);
  margin-bottom: var(--space-3);
}
.hc-bweb__cta {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 12px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-family: var(--body-font);
  transition: background var(--duration-fast);
}
.hc-bweb__cta:hover { background: var(--primary-color-dark); }
.hc-bweb__preview {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: white;
}
.hc-bweb__figure {
  margin: 0;
  padding: 0;
  /* Paper-cream + subtle grain, matching .bwg-root / .bwg-grain in the real graph. */
  background-color: #F5EAD1;
  background-image: radial-gradient(rgba(141, 110, 99, 0.08) 1px, transparent 1.2px);
  background-size: 4px 4px;
}
.hc-bweb__svg {
  width: 100%;
  height: auto;
  display: block;
  padding: 12px;
  animation: hc-web-drift 30s ease-in-out infinite;
  transform-origin: 50% 50%;
}
@keyframes hc-web-drift {
  0%, 100% { transform: rotate(-0.4deg) scale(1); }
  50%      { transform: rotate(0.4deg)  scale(1.015); }
}
.hc-bweb__caption {
  padding: 0;
  font-family: var(--body-font);
  font-size: var(--text-xs);
  text-align: center;
  color: var(--ink-faint);
  border-top: 1px solid var(--border-color);
  background: white;
}
.hc-bweb__caption-link {
  display: block;
  padding: 10px var(--space-2) 12px;
  color: inherit;
  text-decoration: none;
  transition: background var(--duration-fast);
}
.hc-bweb__caption-link:hover { background: #FDF6E3; }
.hc-bweb__caption strong {
  color: var(--h3-color);
  font-weight: 700;
  margin: 0 4px;
}
.hc-bweb__caption-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--golden-ochre);
}
.hc-bweb__caption-sub { color: var(--ink-faint); }

/* ─── NEWSLETTER ─────────────────────────────────────────── */

.hc-newsletter {
  padding: var(--space-8) var(--space-3);
  background: linear-gradient(180deg, var(--background-color) 0%, var(--soft-cream) 100%);
  border-top: 1px solid var(--border-color);
}
.hc-newsletter__inner { max-width: 620px; margin: 0 auto; text-align: center; }
.hc-newsletter__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--golden-ochre);
  font-weight: 700;
  margin-bottom: 6px;
  font-family: var(--body-font);
}
.hc-newsletter__heading {
  font-family: var(--heading-font);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 12px;
  color: var(--h2-color);
}
.hc-newsletter__text {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-color);
  margin: 0 0 var(--space-3);
}
.hc-newsletter__form {
  display: flex;
  gap: 8px;
  max-width: 460px;
  margin: 0 auto;
}
.hc-newsletter__input {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 12px 20px;
  font-size: var(--text-sm);
  outline: none;
  font-family: var(--body-font);
  background: white;
  color: var(--ink);
  transition: border-color var(--duration-fast) ease;
}
.hc-newsletter__input:focus { border-color: var(--primary-color); }
.hc-newsletter__btn {
  background: var(--deep-maroon);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast);
  font-family: var(--body-font);
  font-size: var(--text-sm);
}
.hc-newsletter__btn:hover { background: var(--deep-plum); }

@media (max-width: 900px) {
  .hc-bmap__inner, .hc-bweb__inner { grid-template-columns: 1fr; gap: var(--space-3); }
  /* Promote copy children into the outer grid so we can slot the preview
     after the CTA via `order`. Mobile flow:
       eyebrow → heading → text → CTA (centered) → preview */
  .hc-bmap__copy, .hc-bweb__copy { display: contents; }
  .hc-bmap__cta, .hc-bweb__cta {
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
  }
  .hc-bmap__preview, .hc-bweb__preview { order: 5; }
  .hc-newsletter__form { flex-direction: column; }
  .hc-newsletter__btn { width: 100%; }
}
/* ============================================================
   Full-width collage marquee — 4-row grid, draggable + JS-driven
   auto-scroll (see home.html script).
   ============================================================ */

/* ─── Full-width marquee ─────────────────────────────────── */

.hd-marquee {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  padding: 32px 0;
  background: transparent;
  isolation: isolate;
  cursor: grab;
  touch-action: pan-y; /* allow vertical page scroll, capture horizontal drag */
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.hd-marquee.is-dragging { cursor: grabbing; }

/* Track holds two identical grid "passes" side by side. Making each pass a
   self-contained grid guarantees its cursor starts fresh (row 1 col 1),
   which keeps the wraparound seamless. */
.hd-marquee__track {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: max-content;
  will-change: transform;
  user-select: none;
}

/* 4-row grid, columns auto-flow with dense packing. Sizes are chosen so
   each column of 4 cells fills cleanly. Total height ≈ 4×112 + 3×6 = 466px. */
.hd-marquee__pass {
  display: grid;
  grid-template-rows: repeat(4, 112px);
  grid-auto-flow: column dense;
  grid-auto-columns: 130px;
  gap: 6px;
  flex-shrink: 0;
}

/* ─── Card base ─────────────────────────────────────────── */

.hd-marquee__card {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  min-height: 0;
  min-width: 0;
  position: relative;
  /* Tiles are clickable — override the marquee's `grab` cursor so hover on
     any individual card shows the pointer/hand affordance. During an actual
     drag the marquee still swaps to `grabbing` via .is-dragging below. */
  cursor: pointer;
}
.hd-marquee.is-dragging .hd-marquee__card { cursor: grabbing; }

/* Data-attribute driven size spans (deterministic, set server-side). */
.hd-marquee__card[data-cols="1"] { grid-column: span 1; }
.hd-marquee__card[data-cols="2"] { grid-column: span 2; }
.hd-marquee__card[data-cols="3"] { grid-column: span 3; }
.hd-marquee__card[data-rows="1"] { grid-row: span 1; }
.hd-marquee__card[data-rows="2"] { grid-row: span 2; }
.hd-marquee__card[data-rows="3"] { grid-row: span 3; }
.hd-marquee__card[data-rows="4"] { grid-row: span 4; }

/* Prevent images inside from being drag-selected while grabbing */
.hd-marquee__card, .hd-marquee__card * { -webkit-user-drag: none; }

/* ─── Image tile ─────────────────────────────────────────── */

.hd-marquee__card--tile {
  background-color: var(--soft-cream, #F5EBD4);
  background-size: cover;         /* crop to fill the cell */
  background-position: center;
  background-repeat: no-repeat;
}
/* Bottom scrim only — the label (kind + name) sits together at the bottom
   of the tile. Top portion of the tile stays as the unobscured photo. */
.hd-marquee__card--tile::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top,
    rgba(15, 9, 4, 0.92) 0%,
    rgba(15, 9, 4, 0.70) 30%,
    rgba(15, 9, 4, 0.35) 60%,
    rgba(15, 9, 4, 0.10) 85%,
    transparent 100%);
}
.hd-marquee__card--textonly {
  background: linear-gradient(135deg, var(--deep-maroon), #A63D46);
  color: #FBE9CB;
}
.hd-marquee__card--textonly.hd-marquee__card--topic {
  background: linear-gradient(135deg, #116466, #0D4E50);
}
.hd-marquee__card--textonly::after { display: none; }

.hd-tile__label {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  /* Above the scrim pseudo-element. */
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #fff;
  text-align: left;
}
.hd-marquee__card--textonly .hd-tile__label {
  top: 10px;
  justify-content: center;
  text-align: center;
}
.hd-tile__kind {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 1;
  /* Dual dark halo: a soft blur for depth + a tight halo so the small mono
     letters keep their edges over any background pixel. */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85),
               0 0 3px rgba(0, 0, 0, 0.75);
}
/* Lightened kind-label colors — brighter/higher-lightness variants of the
   golden-ochre and teal accents so they pop against the dark scrim. */
.hd-marquee__card--place .hd-tile__kind { color: #FFD97A; }
.hd-marquee__card--topic .hd-tile__kind { color: #C9F0F0; }
.hd-tile__name {
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  color: #fff;
  /* Layered shadow for the primary name — a tight halo for crisp edges plus
     a wider blur for weight against any bright detail in the image. */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95),
               0 2px 6px rgba(0, 0, 0, 0.75),
               0 0 1px rgba(0, 0, 0, 0.85);
}
/* Larger tiles get bigger labels */
.hd-marquee__card--tile[data-cols="2"] .hd-tile__name,
.hd-marquee__card--tile[data-rows="2"] .hd-tile__name { font-size: 15px; }
.hd-marquee__card--tile[data-cols="2"][data-rows="2"] .hd-tile__name { font-size: 17px; }
.hd-marquee__card--tile[data-rows="4"] .hd-tile__name { font-size: 18px; }
.hd-marquee__card--tile[data-cols="2"][data-rows="4"] .hd-tile__name { font-size: 22px; }

/* ─── Fact card ─────────────────────────────────────────── */

.hd-marquee__card--fact {
  /* Cream base + 20×20 grid overlay — matches .qia-map in bgame cards.
     Two 1px linear-gradients (horizontal + vertical) reproduce the grid
     without needing an SVG asset. */
  background-color: #F2E2BE;
  background-image:
    linear-gradient(to right,  #E3D2A0 1px, transparent 1px),
    linear-gradient(to bottom, #E3D2A0 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 4px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hd-marquee__card--fact[data-rows="2"] { padding: 6px 18px; }
.hd-marquee__card--fact[data-rows="3"] { padding: 8px 22px; }
.hd-marquee__card--fact[data-rows="4"] { padding: 12px 24px; }

.hd-fact__reveal {
  /* Same typography as .qia-qline / .qia-reveal-text in bgame */
  font-family: 'Lora', Georgia, serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.55;
  color: #2A1F18;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hd-marquee__card--fact[data-rows="2"] .hd-fact__reveal {
  font-size: 15.5px;
  -webkit-line-clamp: 8;
}
.hd-marquee__card--fact[data-rows="3"] .hd-fact__reveal {
  font-size: 17px;
  -webkit-line-clamp: 12;
}
.hd-marquee__card--fact[data-rows="4"] .hd-fact__reveal {
  font-size: 18px;
  -webkit-line-clamp: 18;
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 720px) {
  .hd-marquee { padding: 24px 0; }
  .hd-marquee__track { gap: 5px; }
  .hd-marquee__pass {
    grid-template-rows: repeat(4, 80px);
    grid-auto-columns: 104px;
    gap: 5px;
  }
  .hd-tile__name { font-size: 11px; }
  .hd-marquee__card--tile[data-cols="2"] .hd-tile__name,
  .hd-marquee__card--tile[data-rows="2"] .hd-tile__name { font-size: 13px; }
  .hd-marquee__card--fact { padding: 4px 12px; }
  .hd-marquee__card--fact[data-rows="2"] { padding: 5px 14px; }
  .hd-marquee__card--fact[data-rows="3"] { padding: 6px 16px; }
  .hd-fact__reveal { font-size: 12.5px; -webkit-line-clamp: 3; }
  .hd-marquee__card--fact[data-rows="2"] .hd-fact__reveal { font-size: 13.5px; -webkit-line-clamp: 6; }
  .hd-marquee__card--fact[data-rows="3"] .hd-fact__reveal { font-size: 14.5px; -webkit-line-clamp: 9; }
}

/* ─── Collage tile popups (place / topic / fact) ─────────── */

.hd-tile-popup {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 12, 6, 0.55);
  animation: hd-tile-popup-fade 180ms ease-out;
}
.hd-tile-popup.is-open { display: flex; }
@keyframes hd-tile-popup-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.hd-tile-popup__card {
  position: relative;
  background: var(--background-color, #FDF6E3);
  border: 1.5px solid rgba(17, 100, 102, 0.14);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  padding: 28px 24px 24px;
  max-width: 460px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  animation: hd-tile-popup-pop 240ms cubic-bezier(0.2, 0.9, 0.25, 1.15);
}
.hd-tile-popup__card--wide { max-width: 560px; }
/* Fact popup renders a full bmap-style ticket card — strip the outer
   card's chrome so the rct handles its own background/border/shadow. */
.hd-tile-popup__card--fact {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}
.hd-tile-popup__card--fact .rct {
  margin: 0;   /* override .rct's default 0 20% */
}
.hd-tile-popup__card--fact .hd-tile-popup__close {
  top: 8px;
  right: 10px;
  color: #FBE9CB;   /* readable on the maroon places header */
}
.hd-tile-popup__card--fact .hd-tile-popup__close:hover {
  background: rgba(255, 255, 255, 0.12);
}
@keyframes hd-tile-popup-pop {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.hd-tile-popup__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft, #4A3B30);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 120ms;
  z-index: 1;
}
.hd-tile-popup__close:hover { background: rgba(0, 0, 0, 0.06); }

/* ── Simple (place / topic) variant ── */
.hd-tile-popup__kind {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--golden-ochre, #E0A02F);
  text-align: center;
  margin-bottom: 6px;
}
.hd-tile-popup__kind--topic { color: #116466; }
.hd-tile-popup__title {
  font-family: var(--heading-font, 'Playfair Display', Georgia, serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--h2-color, #2C1A0E);
  text-align: center;
  margin: 0 0 18px;
  line-height: 1.2;
}
.hd-tile-popup__image {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  aspect-ratio: 16 / 10;
}
.hd-tile-popup__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hd-tile-popup__cta {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: var(--primary-color, #D95D39);
  color: #ffffff !important;
  border: none;
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  font-family: var(--body-font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.hd-tile-popup__cta:hover { background: var(--primary-color-dark, #BF360C); }
.hd-tile-popup__cta--topic { background: #116466; }
.hd-tile-popup__cta--topic:hover { background: #0D4E50; }

/* ── Fact (place1 ↔ topic ↔ place2) variant ── */
.hd-tile-popup__triple {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 20px;
}
.hd-tile-popup__pt {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hd-tile-popup__pt-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
}
.hd-tile-popup__pt-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.hd-tile-popup__pt-name {
  font-family: var(--heading-font, 'Playfair Display', Georgia, serif);
  font-weight: 700;
  font-size: 14px;
  color: var(--h2-color, #2C1A0E);
  text-align: center;
  line-height: 1.25;
  border-bottom: 1px dashed transparent;
  transition: border-color var(--duration-fast);
}
.hd-tile-popup__pt:hover .hd-tile-popup__pt-name { border-bottom-color: var(--primary-color, #D95D39); }
.hd-tile-popup__pt--topic {
  padding-top: 12px;
}
.hd-tile-popup__pt--topic .hd-tile-popup__pt-img {
  border-radius: 50%;
  box-shadow: 0 0 0 3px #116466;
  max-width: 90px;
  margin: 0 auto;
}
.hd-tile-popup__pt--topic .hd-tile-popup__pt-name {
  color: #116466;
  font-style: italic;
  font-size: 13px;
}
.hd-tile-popup__pt-label {
  display: block;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #116466;
  margin-bottom: 2px;
}
.hd-tile-popup__reveal {
  font-family: 'Lora', Georgia, serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft, #4A3B30);
  margin: 0 0 4px;
}

@media (max-width: 500px) {
  .hd-tile-popup__triple {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .hd-tile-popup__pt--topic .hd-tile-popup__pt-img { max-width: 100px; }
}
