/* stoon.live — dark gradient shell, #fff119 as the accent/primary voice.
   Body copy sits on a soft off-white: full #fff119 paragraphs vibrate badly
   against near-black at long line lengths. Headings, links, labels and marks
   carry the yellow, so the brand reads without costing legibility. */

:root {
  --bg-top: #0d0d0d;
  --bg-bottom: #252525;
  --surface: #161616;
  --surface-raised: #1d1d1d;
  --border: #2f2f2f;
  --border-soft: #262626;

  --primary: #fff119;
  --primary-dim: #c9bf14;
  --primary-glow: rgba(255, 241, 25, 0.14);

  --text: #ece9dd;
  --text-muted: #9c988a;
  --text-faint: #6d6a60;

  /* Square site. Set these two to bring rounding back anywhere it's used. */
  --radius: 0;
  --radius-lg: 0;
  --maxw: 1180px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* Safari iOS tints the status bar and toolbar from <html>, not <body>. */
  background-color: var(--bg-top);
  /* Tells the browser to render form controls and scrollbars dark. */
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: linear-gradient(170deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  color: var(--primary);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
/* Must stay on one line at every width. nowrap guarantees that; the vw-based
   size keeps the line inside the viewport. Measured at ~12.7em wide in the
   fonts this stack actually resolves to (SF Pro, Roboto, Segoe UI, Arial), so
   6.2vw leaves ~15% slack. base.html shrinks it further if a wider fallback
   font ever overflows. */
.hero-title {
  white-space: nowrap;
  font-size: clamp(1.25rem, 6.2vw, 3.1rem);
  max-width: 100%;
}
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Skip link ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #0d0d0d;
  padding: 10px 16px;
  font-weight: 700;
  z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
.site-header {
  padding-top: env(safe-area-inset-top, 0px);
  position: sticky;
  /* Containing block for the nav dropdown. */
  top: 0;
  z-index: 50;
  background: rgba(13, 13, 13, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
/* Wordmarks are typically very wide (the current one is 6:1), so cap height
   modestly and let width follow. Bump this one value to resize the logo. */
.brand img { max-height: 32px; width: auto; }
.brand-word {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.04em;
}
.brand-word span { color: var(--text); }
.brand:hover { text-decoration: none; }

[hidden] { display: none !important; }

.nav-toggle {
  margin-left: auto;
  /* Bars only — no frame. Keeps a 44px target for touch without drawing a box. */
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

/* Three bars from one element: the middle is the box, the outer two are
   pseudo-elements that rotate into an X when open. */
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 0;
  transition: transform 0.2s ease, opacity 0.15s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.nav-toggle:hover .nav-toggle-bars,
.nav-toggle:hover .nav-toggle-bars::before,
.nav-toggle:hover .nav-toggle-bars::after { background: #fff566; }
.nav-toggle.is-open .nav-toggle-bars { background: transparent; }
.nav-toggle.is-open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }

/* Once the script confirms JS, the nav becomes a panel under the header and is
   shown only while .is-open. Without JS it stays the plain inline row above. */
.has-js .nav {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  margin: 0;
  padding: 10px 20px 16px;
  background: rgba(13, 13, 13, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.has-js .nav.is-open { display: flex; }
.has-js .nav a { padding: 12px 14px; font-size: 1rem; }

@media (min-width: 720px) {
  /* Panel stays a dropdown but hugs the right edge instead of spanning. */
  .has-js .nav {
    left: auto;
    min-width: 220px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin: 8px 20px 0 0;
    padding: 8px;
  }
}
.nav a {
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover,
.nav a.active { color: var(--primary); background: var(--primary-glow); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 36px;
  border-bottom: 1px solid var(--border-soft);
}
.hero p.tagline {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 60ch;
  margin: 0;
}

/* ---------- Layout ---------- */
.section { padding: 44px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
/* Home-page section headings sit back from the yellow so the content under
   them leads — same muted tone as the hero tagline. Only .section-head uses
   this; article and card headings keep the primary colour. */
.section-head h2 { margin: 0; color: var(--text-muted); }
.section-head a { font-size: 0.92rem; font-weight: 600; }

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 900px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s, transform 0.18s;
}
.card:hover { border-color: var(--primary-dim); transform: translateY(-2px); }
.card-media { aspect-ratio: 16 / 9; background: var(--surface-raised); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; }
.card-body h3 a { color: var(--primary); }
.card-body p { margin: 0; color: var(--text-muted); font-size: 0.94rem; }

.meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
.meta a { color: var(--text-faint); }
.meta a:hover { color: var(--primary); }

/* Labels are set as text, not badges — no background, no capsule. They sit in
   .meta rows and read as part of that line. */
.tag {
  display: inline-block;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.tag.cancelled { color: #ff8080; }

/* ---------- Featured ---------- */
.featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.featured .featured-media { aspect-ratio: 4 / 3; height: 100%; }
.featured .featured-media img { width: 100%; height: 100%; object-fit: cover; }
/* With an image alongside, the 24px grid gap supplies the left inset, so the
   body only pads the other three sides. */
.featured .featured-body { padding: 22px 24px 22px 0; }

/* No hero image: one column, and the body needs padding on all four sides. */
.featured--no-media { grid-template-columns: minmax(0, 1fr); }
.featured--no-media .featured-body { padding: 22px 24px; }

/* The featured card is a lead-in, not the article itself, so its type runs a
   step below the section headings around it. */
.featured .featured-body h2 {
  font-size: clamp(1.15rem, 2.1vw, 1.45rem);
  margin: 6px 0 8px;
}
.featured .featured-body p { font-size: 0.92rem; margin: 0 0 4px; }
.featured .featured-body .btn { padding: 8px 16px; font-size: 0.85rem; }
.featured .featured-body p:last-child { margin: 14px 0 0; }

@media (max-width: 760px) {
  .featured { grid-template-columns: minmax(0, 1fr); }
  .featured .featured-body { padding: 24px; }
}

/* ---------- Event rows ---------- */
.event-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
}
.event-row:last-child { border-bottom: none; }
.event-date {
  text-align: center;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 4px;
}
.event-date .m {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  font-weight: 700;
}
.event-date .d { display: block; font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.event-info h3 { margin: 0 0 2px; font-size: 1.05rem; }
.event-info p { margin: 0; color: var(--text-muted); font-size: 0.88rem; }
@media (max-width: 620px) {
  .event-row { grid-template-columns: 60px minmax(0, 1fr); }
  .event-row .event-cta { grid-column: 2; }
}

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filters a {
  border: 1px solid var(--border);
  padding: 7px 15px;
  border-radius: var(--radius);
  font-size: 0.87rem;
  color: var(--text-muted);
  font-weight: 500;
}
.filters a:hover { border-color: var(--primary-dim); color: var(--primary); text-decoration: none; }
.filters a.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #0d0d0d;
  font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--primary);
  color: #0d0d0d;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.94rem;
  border: 1px solid var(--primary);
}
.btn:hover { background: #fff566; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.ghost:hover { background: var(--primary-glow); }

/* ---------- Article ---------- */
.article { max-width: 72ch; }
.article-body { font-size: 1.06rem; color: var(--text); }
.article-body p { margin: 0 0 1.3em; }
.article-body h2, .article-body h3 { margin-top: 1.8em; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body img { border-radius: var(--radius); margin: 1.6em 0; }
.article-body blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--primary);
  color: var(--text-muted);
  font-style: italic;
}
.article-body ul, .article-body ol { padding-left: 1.3em; margin: 0 0 1.3em; }
.article-body li { margin-bottom: 0.4em; }
.article-body code {
  background: var(--surface-raised);
  padding: 2px 6px;
  border-radius: 0;
  font-size: 0.9em;
}
.hero-figure figcaption {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 8px;
}

/* ---------- Sidebar / ads ---------- */
.sidebar { display: flex; flex-direction: column; gap: 28px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.panel h3 { margin: 0 0 14px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; }

.ad-slot { text-align: center; }
.ad-slot img { margin: 0 auto; border-radius: var(--radius); }
.ad-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.ad-slot--header, .ad-slot--footer { margin: 28px 0; }
.ad-slot--in_feed { grid-column: 1 / -1; }

/* Reserved-but-empty placement: only visible to staff, so a missing ad never
   leaves a hole in the live layout. */
.ad-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 16px;
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 40px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.pagination .current { background: var(--primary); border-color: var(--primary); color: #0d0d0d; font-weight: 700; }

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 60px;
  border-top: 1px solid var(--border-soft);
  padding: 36px 0 calc(36px + env(safe-area-inset-bottom, 0px));
  color: var(--text-faint);
  font-size: 0.88rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Mobile compaction ----------
   Desktop spacing is roughly 1.6x what a phone needs; this tightens the whole
   vertical rhythm rather than scaling any single element. */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }

  .header-inner { padding: 9px 16px; gap: 12px; }
  .brand img { max-height: 24px; }
  .brand-word { font-size: 1.25rem; }
  .nav-toggle { width: 38px; height: 38px; }

  .hero { padding: 26px 0 20px; }
  .hero p.tagline { font-size: 1rem; }

  .section { padding: 26px 0; }
  .section-head { margin-bottom: 16px; }
  .columns { gap: 28px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }

  .card-body { padding: 14px 16px 18px; gap: 6px; }
  .card-body h3 { font-size: 1.05rem; }

  .featured .featured-body,
  .featured--no-media .featured-body { padding: 18px 16px; }
  .featured .featured-body .btn { padding: 8px 14px; font-size: 0.82rem; }

  .panel { padding: 16px; }

  .event-row { padding: 12px 0; gap: 14px; }
  .event-date { padding: 6px 4px; }
  .event-date .d { font-size: 1.3rem; }
  .event-info h3 { font-size: 1rem; }

  .filters { gap: 6px; margin-bottom: 18px; }
  .filters a { padding: 6px 12px; font-size: 0.82rem; }

  .article-body { font-size: 1rem; }

  .site-footer {
    margin-top: 36px;
    padding: 24px 0 calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .footer-inner { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .card:hover { transform: none; }
}
