/* Fun hub (/fun/) — mirrors components/Festivals.jsx structure. The PHP
 * template emits class hooks (.fun-intro, .fun-tabs, .fun-context, etc.) but
 * no stylesheet existed; SPA carries the equivalent rules as inline styles
 * (Festivals.jsx#208–249). This file makes the WP markup look like SPA.
 *
 * First-viewport priority: intro + tabs + context. Lower-fold (featured,
 * filterbar, results grid) is below 900px on 1440x900 and gets harness-
 * audited indirectly via the broader stays/eats/dos tail.
 */

.fun-page { background: var(--paper); }

/* ── Intro ──────────────────────────────────────────────────────────── */
.fun-intro {
  padding: 40px 48px 24px;
  border-bottom: 1px solid var(--line-soft);
}
.fun-intro h1.display {
  margin: 14px 0 0;
  font-size: 72px;
  letter-spacing: -0.02em;
  line-height: 1.0;
  font-weight: 400;
}
.fun-intro > p {
  margin: 18px 0 0;
  max-width: 680px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
}

/* WP page-fun.php emits .fun-stats and .fun-context blocks that SPA's
 * Festivals.jsx parent doesn't render — those facts live inside per-tab
 * sub-components in SPA, surfaced one at a time. To keep parity at the
 * /fun/ top-of-page (the harness measurement target) we hide them here.
 * The PHP still emits them, so they're a CSS toggle if WP wants to enable
 * the richer layout post-parity. */
.fun-stats,
.fun-context { display: none; }

/* ── Tabs ───────────────────────────────────────────────────────────── */
.fun-tabs {
  display: flex;
  gap: 32px;
  overflow-x: auto;
  padding: 24px 48px 1px;
  border-bottom: 1px solid var(--line-soft);
}
.fun-tabs a {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.fun-tabs a.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 600;
}
.fun-tabs a span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* ── Context (per-tab subheading) ───────────────────────────────────── */
.fun-context {
  padding: 28px 48px 8px;
}
.fun-context > div { max-width: 720px; }
.fun-context .eyebrow { color: var(--terracotta); }
.fun-context p {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 620px;
}

/* ── Featured ───────────────────────────────────────────────────────── */
/* Mirror SPA FestivalsTab featured panel (Festivals.jsx:306-321):
 *  - outer section padding: 40px 48px 0
 *  - inner is position:relative with aspect-ratio 21/9 (~576px on desktop)
 *  - image fills via absolute inset:0, content overlaid anchored to bottom
 *    via flex-end */
.fun-featured {
  position: relative;
  margin: 40px 48px 0;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  color: #fff;
}
.fun-featured img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fun-featured > div {
  position: absolute;
  inset: 0;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(180deg, rgba(8,35,56,0.2) 0%, rgba(8,35,56,0.85) 100%);
  color: #fff;
}
.fun-featured .eyebrow-light { color: rgba(255,255,255,0.7); }
.fun-featured h2.display {
  margin: 12px 0 0;
  font-size: 56px;
  line-height: 1.0;
  letter-spacing: -0.02em;
  font-weight: 400;
  color: #fff;
  max-width: 720px;
}
.fun-featured p {
  margin: 14px 0 0;
  max-width: 620px;
  color: rgba(255,255,255,0.9);
  font-size: 16px;
  line-height: 1.55;
}
.fun-featured-meta {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}

/* ── Filter bar ─────────────────────────────────────────────────────── */
.fun-filterbar {
  padding: 28px 48px 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fun-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.fun-chip-row a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}
.fun-chip-row a.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ── Results grid ───────────────────────────────────────────────────── */
.fun-results { padding: 16px 48px 48px; }
.fun-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 14px;
}
.fun-card {
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.fun-card-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.fun-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fun-card-media span {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  background: var(--terracotta);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fun-card-body { padding: 18px 18px 20px; }
.fun-card-body h3.display {
  margin: 8px 0 6px;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  font-weight: 400;
}
.fun-card-body h3.display a { color: var(--ink); text-decoration: none; }
.fun-card-body p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.fun-card-meta {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Empty + submit ─────────────────────────────────────────────────── */
.fun-empty { padding: 60px 48px; text-align: center; }
.fun-empty .eyebrow { color: var(--terracotta); }
.fun-empty p { margin: 10px 0 0; font-size: 15px; color: var(--muted); }

.fun-submit {
  padding: 48px;
  background: var(--ionian-deep);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.fun-submit .eyebrow-light { color: rgba(255,255,255,0.85); }
.fun-submit h2.display {
  margin: 8px 0 0;
  max-width: 720px;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-weight: 400;
  color: #fff;
}

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .fun-intro { padding: 24px 24px 16px; }
  .fun-intro h1.display { font-size: 40px; }
  .fun-intro > p { font-size: 15px; }
  .fun-tabs { padding: 16px 24px 1px; gap: 16px; }
  .fun-tabs a { font-size: 14px; }
  .fun-context { padding: 20px 24px 8px; }
  .fun-featured { padding: 0 24px; }
  .fun-featured img { height: 260px; }
  .fun-featured > div { left: 40px; right: 40px; bottom: 20px; }
  .fun-featured h2.display { font-size: 30px; }
  .fun-filterbar { padding: 20px 24px 8px; }
  .fun-results { padding: 12px 24px 48px; }
  .fun-card-grid { grid-template-columns: 1fr; gap: 16px; }
  .fun-submit { padding: 28px 24px; flex-direction: column; align-items: flex-start; }
  .fun-submit h2.display { font-size: 26px; }
}
