/* ============================================================
   artistcalls — MoMA-inspired
   Stark white, deep black, bold grotesk type, ruthless grid,
   generous whitespace, no ornamentation. The work is the design.
   ============================================================ */

:root {
  /* Palette — high contrast, no warmth */
  --bg:        #ffffff;
  --bg-2:      #f4f4f4;
  --fg:        #000000;
  --muted:     #6b6b6b;
  --rule:      #000000;
  --rule-soft: #e5e5e5;
  --surface:   #ffffff;
  --card:      #ffffff;
  --hover:     #f4f4f4;
  --accent:    #0000ee;   /* classic link blue */
  --shadow:    none;

  /* Badges — monochrome with one functional accent */
  --b-fund:      #000000;
  --b-fund-paid: #000000;
  --b-fund-self: #6b6b6b;
  --b-prize:     #000000;
  --b-fee:       #6b6b6b;
  --b-fee-free:  #000000;
  --b-disc:      #6b6b6b;
  --b-elig:      #6b6b6b;
  --b-accom:     #6b6b6b;

  /* Type — MoMA uses a clean grotesk. We fall through several. */
  --sans:  "Helvetica Neue", "Helvetica", "Inter", "Arial", sans-serif;
  --display: "Helvetica Neue", "Helvetica", "Inter", "Arial", sans-serif;
}

[data-theme='dark'] {
  --bg:        #000000;
  --bg-2:      #0a0a0a;
  --fg:        #ffffff;
  --muted:     #8a8a8a;
  --rule:      #ffffff;
  --rule-soft: #2a2a2a;
  --surface:   #000000;
  --card:      #0a0a0a;
  --hover:     #1a1a1a;
  --accent:    #6c8cff;

  --b-fund:      #ffffff;
  --b-fund-paid: #ffffff;
  --b-fund-self: #8a8a8a;
  --b-prize:     #ffffff;
  --b-fee:       #8a8a8a;
  --b-fee-free:  #ffffff;
  --b-disc:      #8a8a8a;
  --b-elig:      #8a8a8a;
  --b-accom:     #8a8a8a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #000000; --bg-2: #0a0a0a; --fg: #ffffff; --muted: #8a8a8a;
    --rule: #ffffff; --rule-soft: #2a2a2a; --surface: #000000; --card: #0a0a0a;
    --hover: #1a1a1a; --accent: #6c8cff;
    --b-fund: #ffffff; --b-fund-paid: #ffffff; --b-fund-self: #8a8a8a;
    --b-prize: #ffffff; --b-fee: #8a8a8a; --b-fee-free: #ffffff;
    --b-disc: #8a8a8a; --b-elig: #8a8a8a; --b-accom: #8a8a8a;
  }
}

* { box-sizing: border-box; min-width: 0; }
html, body { overflow-x: hidden; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--fg);
  font: 16px/1.45 var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 20px; } }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }

/* ============================================================
   Header — single hairline rule, black wordmark, no ornament
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--fg);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700;
  font-size: 22px; line-height: 1;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.brand:hover { text-decoration: none; }
.brand-mark { display: none; }
.brand-text {
  display: inline-flex; flex-direction: column; gap: 2px;
  line-height: 1;
}
.brand-name { display: inline; }
.brand-tagline {
  font-family: var(--sans);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 480px) {
  .brand-tagline { display: none; }
}
.brand-logo {
  display: block; width: 32px; height: 32px;
  object-fit: contain;
}

.header-actions {
  display: inline-flex; align-items: center; gap: 14px; position: relative;
}
.icon-button {
  background: transparent; border: 0; color: var(--fg);
  padding: 6px; cursor: pointer; line-height: 0;
  border-radius: 0;
}
.icon-button:hover { color: var(--muted); }

/* Settings menu */
.settings-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 35;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--fg);
  padding: 18px 16px;
}
.settings-title {
  margin: 0 0 12px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg);
}
.theme-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-option {
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--fg);
  padding: 10px 0;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  cursor: pointer;
}
.theme-option:hover { background: var(--hover); }
.theme-option.active { background: var(--fg); color: var(--bg); }

/* Filter-bar toggle buttons (Liked, Show past) */
.filter-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--fg);
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}
.filter-toggle:hover { background: var(--hover); }
.filter-toggle.on { background: var(--fg); color: var(--bg); }
.filter-toggle svg { display: block; }
.filter-toggle .filter-toggle-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 5px;
  border: 1px solid currentColor;
  font-size: 11px; font-weight: 700;
}
.filter-toggle .filter-toggle-count:empty,
.filter-toggle:not(.has-count) .filter-toggle-count:empty { display: none; }

/* ============================================================
   Accessibility helpers
   ============================================================ */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   Filters — strict horizontal band, left-aligned, hairline frame
   ============================================================ */
.filters {
  background: var(--bg);
  border-bottom: 1px solid var(--fg);
  padding: 20px 0 16px;
  position: sticky; top: 65px; z-index: 20;
}
.filters .wrap {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch;
  justify-content: flex-start;
}
.filters input, .filters select {
  font: inherit; font-family: var(--sans);
  font-size: 14px; font-weight: 500;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--fg);
  color: var(--fg);
  border-radius: 0;
  appearance: none; -webkit-appearance: none;
  line-height: 1.2;
}
.filters select {
  background-image: linear-gradient(45deg, transparent 50%, var(--fg) 50%),
                    linear-gradient(135deg, var(--fg) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
  cursor: pointer;
}
.filters input {
  flex: 1 1 280px; max-width: 420px; min-width: 220px;
}
.filters input::placeholder { color: var(--muted); }
.filters input:focus, .filters select:focus {
  outline: 2px solid var(--fg); outline-offset: -1px;
}

/* Filters meta row beneath inputs */
.filters .filters-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 20px; margin-top: 14px;
  font-size: 12px; font-weight: 500;
  color: var(--muted);
}

/* Native option visibility */
.filters select option {
  background: var(--bg);
  color: var(--fg);
  padding: 10px 12px;
  font-size: 14px;
}

/* ============================================================
   Custom country dropdown
   ============================================================ */
.country-dropdown { position: relative; display: inline-block; }
.country-button {
  display: inline-flex; align-items: center; gap: 10px;
  font: inherit; font-family: var(--sans);
  font-size: 14px; font-weight: 500;
  padding: 10px 32px 10px 14px;
  background: var(--bg);
  border: 1px solid var(--fg);
  color: var(--fg);
  cursor: pointer; min-width: 200px; text-align: left;
  position: relative;
}
.country-button .caret {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 10px;
}
.country-button #country-label {
  display: inline-flex; align-items: center; gap: 8px; flex: 1;
}
.country-menu {
  position: absolute; top: calc(100% - 1px); left: 0; z-index: 25;
  min-width: 280px; max-height: 360px; overflow: auto;
  background: var(--bg);
  border: 1px solid var(--fg);
  padding: 6px 0;
}
.country-option {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 14px; background: none; border: 0;
  font: inherit; font-family: var(--sans);
  font-size: 14px; text-align: left; cursor: pointer;
  color: var(--fg);
}
.country-option:hover { background: var(--hover); }
.country-option img.flag, .badge.country img.flag,
#country-label img.flag {
  width: 20px; height: 14px; border-radius: 0;
  box-shadow: 0 0 0 1px var(--rule-soft); flex: 0 0 auto;
}
.country-option .flag.globe,
.badge.country .flag.globe,
#country-label .flag.globe {
  display: inline-block; width: 20px; text-align: center;
  font-size: 14px; line-height: 1; box-shadow: none;
}

/* ============================================================
   Cards grid — uniform tiles, MoMA's collection-style layout
   ============================================================ */
main.wrap { padding-top: 40px; padding-bottom: 80px; }

.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 24px;
}
@media (min-width: 760px)  { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 28px; } }
@media (min-width: 1200px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 64px 32px; } }
@media (max-width: 520px)  { .cards { grid-template-columns: minmax(0, 1fr); gap: 40px; } }

.card {
  display: flex; flex-direction: column;
  background: transparent;
  border: 0;
  position: relative;
  min-width: 0;
  height: 100%;
}

/* Card image */
.card .hero {
  display: block; width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--bg-2);
  overflow: hidden; position: relative;
}
.card .hero img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}
/* Subtle bottom gradient on image cards so corner badges stay legible */
.card:not(.no-image) .hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none; z-index: 1;
}
.card:hover .hero img { transform: scale(1.04); }
.card.no-image .hero {
  display: flex; align-items: flex-start; justify-content: flex-start;
  background: var(--fg);
  border: 0;
}
.card.no-image .hero::before { content: none; }

/* Editorial fill for image-less cards: title + badges over a solid panel */
.hero-fill {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: 52px 24px 70px;
  color: var(--bg);
  pointer-events: none;
}
.hero-fill > * { pointer-events: auto; }
.hero-fill .eyebrow {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.7);
  margin: 0;
}
[data-theme='dark'] .hero-fill .eyebrow {
  color: rgba(0,0,0,0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .hero-fill .eyebrow {
    color: rgba(0,0,0,0.6);
  }
}
.hero-fill .hero-title {
  font-family: var(--display);
  font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 8px 0 0;
  color: var(--bg);
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hero badges sit a touch higher on no-image cards (no gradient there) */
.card.no-image .hero .hero-badges {
  left: 24px; right: 24px; bottom: 22px;
}
/* Hero badges — overlay at the bottom of the image/panel.
   For image cards they sit over a dark gradient for legibility.
   For no-image cards they sit in the solid colored panel. */
.hero .hero-badges {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  z-index: 2;
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0;
}
.card:not(.no-image) .hero .hero-badges .badge {
  border-color: rgba(255,255,255,0.7);
  color: #fff;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.card.no-image .hero .hero-badges .badge {
  border-color: rgba(255,255,255,0.55);
  color: rgba(255,255,255,0.95);
  background: transparent;
}
[data-theme='dark'] .card.no-image .hero .hero-badges .badge {
  border-color: rgba(0,0,0,0.5);
  color: rgba(0,0,0,0.9);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .card.no-image .hero .hero-badges .badge {
    border-color: rgba(0,0,0,0.5);
    color: rgba(0,0,0,0.9);
  }
}

/* Make sure the hero-fill panel doesn't conflict with absolutely-positioned badges */
.hero-fill {
  padding-bottom: 60px;
}

/* Location row inside the no-image card hero */
.hero-fill .hero-location {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 14px 0 0;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.85);
}
.hero-fill .hero-location img.flag {
  width: 16px; height: 11px; box-shadow: 0 0 0 1px rgba(255,255,255,0.3);
  flex: 0 0 auto;
}
.hero-fill .hero-location .flag.globe { font-size: 14px; box-shadow: none; }
[data-theme='dark'] .hero-fill .hero-location {
  color: rgba(0,0,0,0.75);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .hero-fill .hero-location {
    color: rgba(0,0,0,0.75);
  }
}

/* Hide the duplicate title in the body for no-image cards (it lives in the hero) */
.card.no-image .body .title { display: none; }
.card.no-image .body { padding-top: 14px; }

/* Top-left country badge over the image */
.hero-country {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0, 0, 0, 0.78);
  color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 0;
  height: 24px; padding: 0 10px;
  font-size: 10px; font-weight: 700; line-height: 1;
  text-transform: uppercase; letter-spacing: 0.06em;
  z-index: 2;
  max-width: calc(100% - 20px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
[data-theme='dark'] .hero-country {
  background: rgba(255, 255, 255, 0.85);
  color: rgba(0, 0, 0, 0.95);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .hero-country {
    background: rgba(255, 255, 255, 0.85);
    color: rgba(0, 0, 0, 0.95);
  }
}
.hero-country img.flag {
  width: 14px; height: 10px; box-shadow: 0 0 0 1px rgba(255,255,255,0.25);
  flex: 0 0 auto;
}

/* Top-right deadline urgency pill */
.hero-deadline {
  position: absolute; top: 10px; right: 10px;
  display: inline-flex; align-items: center;
  background: rgba(210, 34, 45, 0.92);
  color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  height: 24px; padding: 0 10px;
  font-size: 10px; font-weight: 700; line-height: 1;
  text-transform: uppercase; letter-spacing: 0.06em;
  z-index: 2;
}

/* Top-right deadline urgency pill (legacy rule; overridden above) */
.hero-deadline.urgent { background: rgba(210, 34, 45, 0.92); color: #fff; }

/* Card body */
.card .body {
  padding: 16px 0 0;
  display: flex; flex-direction: column; gap: 10px;
  text-align: left;
  flex: 1 1 auto;
}
.card .eyebrow {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0;
}
.card .title {
  font-family: var(--display);
  font-size: 19px; line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.012em;
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card .title a {
  color: var(--fg);
  background-image: linear-gradient(var(--fg), var(--fg));
  background-size: 0 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.25s ease;
}
.card .title a:hover { text-decoration: none; background-size: 100% 1.5px; }
.card .org {
  font-size: 13px; font-weight: 500;
  color: var(--fg);
  margin: 0;
}
.card .desc {
  font-size: 13px; line-height: 1.5;
  color: var(--muted);
  margin: 0;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.card.no-image .body .desc {
  -webkit-line-clamp: 7;
}
.card .org {
  overflow-wrap: anywhere;
}

/* Info badges row */
.badges {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 4px;
}
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 8px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid currentColor;
  background: transparent;
  color: var(--fg);
  line-height: 1;
}
.badge.fund      { color: var(--b-fund); }
.badge.fund-paid { color: var(--b-fund-paid); }
.badge.fund-self { color: var(--b-fund-self); }
.badge.prize     { color: var(--b-prize); }
.badge.fee       { color: var(--b-fee); }
.badge.fee-free  { color: var(--b-fee-free); }
.badge.disc      { color: var(--b-disc); }
.badge.elig      { color: var(--b-elig); }
.badge.accom     { color: var(--b-accom); }

/* Card footer — bottom hairline with deadline + apply */
.card .footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--rule-soft);
  font-size: 12px;
}
.card .deadline {
  font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
}
.card .deadline.urgent { color: #d2222d; }
.card .apply {
  font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg);
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.card .apply:hover { color: var(--accent); }

/* Like button — left of the deadline. Heart icon + count, micro-caps. */
.card .like-btn {
  appearance: none; background: transparent; border: 0; padding: 0;
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); cursor: pointer;
  transition: color 120ms ease, transform 120ms ease;
}
.card .like-btn:hover { color: var(--fg); }
.card .like-btn .like-icon { display: block; }
.card .like-btn:not(.liked) .like-icon { fill: none; }
.card .like-btn.liked { color: #d2222d; }
.card .like-btn.liked .like-icon { fill: currentColor; }
.card .like-btn:active { transform: scale(0.94); }
.card .like-btn .like-count:empty { display: none; }
.card .footer .deadline { margin-left: auto; }

/* Prestige score badge — star + numeric 0-100 next to the like button */
.prestige {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
  cursor: help;
}
.prestige .prestige-star { color: #d4a017; display: block; }
.prestige .prestige-num { color: var(--fg); }

.empty {
  text-align: center; padding: 80px 0;
  color: var(--muted); font-size: 16px;
}

/* ============================================================
   SEO text section — quiet editorial column at the foot
   ============================================================ */
.seo-text {
  margin-top: 60px;
  padding: 64px 0 40px;
  border-top: 1px solid var(--fg);
  background: var(--bg-2);
}
.seo-text .wrap { max-width: 880px; }
.seo-text h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 28px; line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 48px 0 16px;
  color: var(--fg);
}
.seo-text h2:first-child { margin-top: 0; }
.seo-text p {
  font-family: var(--sans); font-size: 16px; line-height: 1.65;
  color: var(--fg); margin: 0 0 18px;
}
.seo-text strong { font-weight: 700; }

/* ============================================================
   Footer
   ============================================================ */
footer {
  margin-top: 0;
  padding: 40px 0;
  border-top: 1px solid var(--fg);
  background: var(--bg);
  color: var(--muted); font-size: 12px;
  font-weight: 500;
}
footer .wrap {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  text-align: left;
}

/* ============================================================
   Detail page
   ============================================================ */
.detail {
  padding-top: 56px;
  padding-bottom: 112px;
}
@media (min-width: 900px) {
  .detail { padding-top: 72px; padding-bottom: 128px; }
}
.crumbs {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 20px;
}
.crumbs a { color: var(--fg); }

/* Two-column layout:
   - Mobile: stacks in source order — header → side (image, chips, like, CTA, facts) → body (about, description, CTA).
   - Desktop: title spans both columns; sticky sidebar on the LEFT keeps
     hero image + CTA + facts always visible while the long description
     scrolls on the right. Designed to fit "everything at once" on a
     ~1080p screen without scrolling below the fold. */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.dl-head h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.dl-head .lede {
  font-size: 15px; line-height: 1.5;
  color: var(--fg);
  margin: 0 0 6px;
  max-width: 70ch;
}
.dl-head .lede:last-child { margin-bottom: 0; }

.dl-side { display: flex; flex-direction: column; gap: 16px; }
.dl-side .chips { margin: 0; }
.dl-hero {
  width: 100%; height: auto; display: block;
  background: var(--muted-bg, #f3f3f3);
}
.dl-cta {
  display: inline-block; align-self: flex-start;
  padding: 12px 22px;
  background: var(--fg); color: var(--bg);
  font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 13px;
}
.dl-cta:hover { text-decoration: none; opacity: 0.85; }
.dl-cta.secondary {
  background: transparent; color: var(--fg);
  border: 1px solid var(--fg);
}

.dl-facts { border-top: 1px solid var(--fg); padding-top: 16px; margin-top: 4px; }
.dl-facts h2 {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 0 0 12px;
}
.dl-facts dl {
  margin: 0; display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px; row-gap: 6px;
}
.dl-facts dt {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0; align-self: baseline;
}
.dl-facts dd {
  margin: 0;
  font-size: 13px; font-weight: 500;
  color: var(--fg);
}
.dl-lastseen { font-size: 11px; margin: 0; }

.dl-body { font-size: 15px; line-height: 1.65; }
.dl-body > .chips { margin: 0 0 16px; }
.dl-body > .like-btn { margin: 0 0 16px; }
.dl-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 24px; }
.dl-h2 {
  font-family: var(--display);
  font-size: 20px; font-weight: 700;
  margin: 32px 0 12px;
}
.dl-body p { margin: 0 0 14px; }
.dl-body-cta { margin-top: 24px; }

/* Desktop: sticky sidebar on the left, scrollable body on the right.
   Title spans both columns at the top. */
@media (min-width: 900px) {
  .detail-layout {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "side body";
    column-gap: 56px;
    row-gap: 24px;
  }
  .dl-head { grid-area: head; margin-bottom: 4px; }
  .dl-side { grid-area: side; position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; padding-right: 8px; }
  .dl-body { grid-area: body; }
  /* Hide native scrollbar chrome on the sticky sidebar */
  .dl-side { scrollbar-width: thin; }
  .dl-side::-webkit-scrollbar { width: 6px; }
  .dl-side::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 3px; }

  /* No-image variant keeps the original single-column flow. */
  .detail-layout.no-image {
    display: block;
    max-width: 820px;
    margin: 0 auto;
  }
}
.detail-layout.no-image { display: block; }
.detail-layout.no-image > .chips { margin: 4px 0 16px; }
.detail-layout.no-image > .like-btn { margin: 0 0 24px; }
.detail-layout.no-image > .dl-like-row { margin: 0 0 24px; }

/* Like + Prestige row on the detail page */
.detail .dl-like-row {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.detail .prestige-lg {
  font-size: 13px; gap: 6px;
}
.detail .prestige-lg .prestige-num {
  font-size: 14px;
}
.detail .prestige-lg .prestige-label {
  color: var(--muted);
}

/* Like button on the detail page — reuses the .card .like-btn look. */
.detail .like-btn {
  appearance: none; background: transparent; border: 0; padding: 0;
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  font: inherit; font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); cursor: pointer;
  transition: color 120ms ease, transform 120ms ease;
}
.detail .like-btn:hover { color: var(--fg); }
.detail .like-btn .like-icon { display: block; }
.detail .like-btn:not(.liked) .like-icon { fill: none; }
.detail .like-btn.liked { color: #d2222d; }
.detail .like-btn.liked .like-icon { fill: currentColor; }
.detail .like-btn:active { transform: scale(0.94); }

/* Chips row above the description, mirroring card badges. */
.detail .chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.detail .chips .badge { font-size: 11px; }
.detail .chips .badge.country { display: inline-flex; align-items: center; gap: 6px; }
.detail .chips .badge.country img.flag { width: 16px; height: 12px; box-shadow: 0 0 0 1px rgba(0,0,0,0.08); }
.detail-eyebrow {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 10px;
}

/* Sources panel (kept hidden, retained for app.js compat) */
.sources-body { display: none; }

/* ============================================================
   Scroll-to-top button — fixed bottom-right, fades in past 600px
   ============================================================ */
.scroll-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  width: 48px; height: 48px;
  background: var(--fg); color: var(--bg);
  border: 0; border-radius: 0;
  font-family: var(--sans); font-size: 22px; font-weight: 600;
  line-height: 1;
  cursor: pointer;
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.scroll-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.scroll-top:hover { background: var(--accent); color: #fff; }
@media (max-width: 640px) {
  .scroll-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}

#list-sentinel { width: 100%; height: 1px; }

/* ============================================================
   Overrides — .badge.country.hero-country wins over .badge
   (two classes > one) so the hero pill keeps its dark backdrop
   instead of inheriting --fg / currentColor borders.
   ============================================================ */
.badge.country.hero-country {
  background: rgba(0, 0, 0, 0.78);
  color: rgba(255, 255, 255, 0.95);
  border: 0;
}
[data-theme='dark'] .badge.country.hero-country {
  background: rgba(255, 255, 255, 0.85);
  color: rgba(0, 0, 0, 0.95);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .badge.country.hero-country {
    background: rgba(255, 255, 255, 0.85);
    color: rgba(0, 0, 0, 0.95);
  }
}
.badge.urgent.hero-deadline {
  background: rgba(210, 34, 45, 0.92);
  color: #fff;
  border: 0;
}
