/* ── Custom Properties ──────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:           hsl(0, 0%, 100%);
  --bg-subtle:    hsl(0, 0%, 96%);
  --bg-muted:     hsl(0, 0%, 98%);
  --bg-tint:      hsl(48, 100%, 97%);   /* warm yellow tint — kirby accent */

  /* Text */
  --text:         hsl(0, 0%, 10%);
  --text-muted:   hsl(0, 0%, 46%);
  --text-faint:   hsl(0, 0%, 64%);
  --text-dim:     hsl(0, 0%, 34%);

  /* Borders */
  --border:       hsl(0, 0%, 12%);
  --border-mid:   hsl(0, 0%, 80%);
  --border-light: hsl(0, 0%, 88%);
  --border-sub:   hsl(0, 0%, 93%);

  /* Accent (near-black, fills buttons) */
  --accent:       hsl(0, 0%, 10%);
  --accent-fg:    hsl(0, 0%, 100%);

  /* Link underline — kirby's yellow */
  --link-underline: hsl(48, 96%, 53%);

  /* Shadows */
  --shadow-sm:    0 1px 3px hsla(0, 0%, 0%, 0.06), 0 1px 2px hsla(0, 0%, 0%, 0.04);
  --shadow-md:    0 4px 12px hsla(0, 0%, 0%, 0.08), 0 2px 4px hsla(0, 0%, 0%, 0.04);

  /* Radius */
  --radius-sm:    0.25rem;
  --radius-md:    0.375rem;

  /* Typography */
  --font-sans:       'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif:      'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono:       "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  --font-typewriter: 'Special Elite', 'Courier New', Courier, monospace;
}

/* ── Dark theme ─────────────────────────────────────────────────────────── */
html[data-theme="dark"] {
  --bg:           hsl(0, 0%, 7%);
  --bg-subtle:    hsl(0, 0%, 12%);
  --bg-muted:     hsl(0, 0%, 9%);
  --bg-tint:      hsl(48, 20%, 10%);
  --text:         hsl(0, 0%, 88%);
  --text-muted:   hsl(0, 0%, 50%);
  --text-faint:   hsl(0, 0%, 35%);
  --text-dim:     hsl(0, 0%, 60%);
  --border:       hsl(0, 0%, 28%);
  --border-mid:   hsl(0, 0%, 22%);
  --border-light: hsl(0, 0%, 18%);
  --border-sub:   hsl(0, 0%, 14%);
  --accent:       hsl(0, 0%, 88%);
  --accent-fg:    hsl(0, 0%, 7%);
  --link-underline: hsl(48, 80%, 42%);
  --shadow-sm:    0 1px 3px hsla(0, 0%, 0%, 0.3), 0 1px 2px hsla(0, 0%, 0%, 0.2);
  --shadow-md:    0 4px 12px hsla(0, 0%, 0%, 0.4), 0 2px 4px hsla(0, 0%, 0%, 0.3);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg:           hsl(0, 0%, 7%);
    --bg-subtle:    hsl(0, 0%, 12%);
    --bg-muted:     hsl(0, 0%, 9%);
    --bg-tint:      hsl(48, 20%, 10%);
    --text:         hsl(0, 0%, 88%);
    --text-muted:   hsl(0, 0%, 50%);
    --text-faint:   hsl(0, 0%, 35%);
    --text-dim:     hsl(0, 0%, 60%);
    --border:       hsl(0, 0%, 28%);
    --border-mid:   hsl(0, 0%, 22%);
    --border-light: hsl(0, 0%, 18%);
    --border-sub:   hsl(0, 0%, 14%);
    --accent:       hsl(0, 0%, 88%);
    --accent-fg:    hsl(0, 0%, 7%);
    --link-underline: hsl(48, 80%, 42%);
    --shadow-sm:    0 1px 3px hsla(0, 0%, 0%, 0.3), 0 1px 2px hsla(0, 0%, 0%, 0.2);
    --shadow-md:    0 4px 12px hsla(0, 0%, 0%, 0.4), 0 2px 4px hsla(0, 0%, 0%, 0.3);
  }
}

/* ── UI chrome: always sans-serif ───────────────────────────────────────── */
.site-nav, .site-logo, .nav-links, .nav-links a,
.site-footer, .footer-links, .footer-links a, .footer-copy,
.date, .post-tag, .post-tag-inline, .post-tag-count, .listing-type,
.listing-code, .listing-item--station,
.article-tags, .review-tags,
.sidebar-heading, .tag-list,
.block-gallery figcaption,
.station-status, .rating-row,
.section-head, .listing-head,
.btn, .shop-btn, .filter-btn, .filter-tag,
input, select, textarea, button,
pre, code { font-family: var(--font-sans); }

/* ── Typewriter style — for historical passages ─────────────────────────── */
.typewriter {
  font-family: var(--font-typewriter);
  font-size: 0.97em;
  line-height: 1.9;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

/* ── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 400;
  color: var(--text);
  margin: 0;
  padding: 0;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Links — kirby yellow-underline style */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s;
}
a:hover {
  text-decoration-color: var(--text);
}

/* Suppress underline on purely structural/nav links */
.site-logo,
.nav-links a,
.footer-links a,
.listing-item--station,
.listing-item--album a,
.listing-item--product a,
.gallery-item a,
.btn,
.filter-btn,
.filter-tag,
.shop-btn {
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  line-height: 1.2;
  margin-top: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

img { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 1rem; }

/* ── Nav ────────────────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border-sub);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.site-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 3rem;
  height: 52px;
}

.site-logo {
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.site-logo:hover { opacity: 0.7; }

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

/* ── Theme toggle ───────────────────────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.3rem;
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  line-height: 0;
  transition: color 0.15s;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg { display: block; }

.theme-toggle .icon-light,
.theme-toggle .icon-dark  { display: none; }
.theme-toggle .icon-auto  { display: block; }

html[data-theme="light"] .theme-toggle .icon-auto,
html[data-theme="light"] .theme-toggle .icon-dark  { display: none; }
html[data-theme="light"] .theme-toggle .icon-light { display: block; }

html[data-theme="dark"] .theme-toggle .icon-auto,
html[data-theme="dark"] .theme-toggle .icon-light  { display: none; }
html[data-theme="dark"] .theme-toggle .icon-dark   { display: block; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
}
.btn:hover { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

.btn--primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn--primary:hover { opacity: 0.82; }

/* ── Shared utilities ───────────────────────────────────────────────────── */
.tag {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 500;
}

.date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  background: var(--bg-subtle);
}

/* ── Newspaper home ─────────────────────────────────────────────────────── */
.newspaper-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Masthead strip */
.newspaper-masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 3px solid var(--text);
  border-bottom: 1px solid var(--border-mid);
  padding: 0.5rem 0;
  margin-bottom: 2.5rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* Two-column newspaper grid */
.newspaper-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  align-items: start;
}

.newspaper-grid--full { grid-template-columns: 1fr; }

.newspaper-main {
  padding-right: 2.5rem;
  border-right: 1px solid var(--border-mid);
}
.newspaper-grid--full .newspaper-main { padding-right: 0; border-right: none; }

.newspaper-sidebar { padding-left: 2rem; }

/* Section labels */
.section-label {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-mid);
  padding-bottom: 0.35rem;
  margin: 0 0 1.25rem;
}

/* Lead story */
.lead-story {
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-mid);
}

.lead-image { margin: 0 0 1.25rem; overflow: hidden; }
.lead-image img { width: 100%; height: auto; display: block; transition: opacity 0.2s; }
.lead-image a { display: block; }
.lead-image a:hover img { opacity: 0.9; }

.lead-headline { font-size: 2rem; line-height: 1.12; margin: 0 0 0.75rem; font-weight: 700; }
.lead-headline a { text-decoration: none; color: var(--text); }
.lead-headline a:hover { text-decoration: underline; text-decoration-color: var(--link-underline); }

.lead-deck { font-size: 1rem; line-height: 1.65; color: var(--text-dim); margin: 0 0 1.1rem; }

.lead-more {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.lead-more:hover { color: var(--text); }

/* News list */
.news-section { margin-top: 0; }
.news-list { list-style: none; padding: 0; margin: 0; }

.news-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-sub);
  align-items: start;
}

.news-meta { font-family: var(--font-sans); font-size: 0.72rem; color: var(--text-faint); line-height: 1.4; padding-top: 0.1rem; }
.news-type { display: block; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-size: 0.62rem; margin-top: 0.3rem; }

.news-body a { text-decoration: none; display: block; }
.news-body a:hover strong { text-decoration: underline; text-decoration-color: var(--link-underline); }
.news-body strong { display: block; font-size: 1rem; font-weight: 600; line-height: 1.35; margin-bottom: 0.3rem; }
.news-body span { font-size: 0.82rem; color: var(--text-dim); line-height: 1.5; display: block; }

/* Sidebar card */
.sidebar-card { border: 1px solid var(--border-mid); padding: 1.5rem; }

.sidebar-card-img { display: block; overflow: hidden; margin-bottom: 1rem; }
.sidebar-card-img img { width: 100%; display: block; transition: opacity 0.2s; }
.sidebar-card-img:hover img { opacity: 0.9; }

.sidebar-product-title { font-size: 1.1rem; margin: 0 0 0.5rem; line-height: 1.3; font-weight: 700; }
.sidebar-product-title a { text-decoration: none; color: var(--text); }
.sidebar-product-title a:hover { text-decoration: underline; text-decoration-color: var(--link-underline); }

.sidebar-product-desc { font-family: var(--font-sans); font-size: 0.85rem; color: var(--text-dim); margin: 0 0 1.25rem; line-height: 1.55; }

/* Recent albums strip */
.recent-albums {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-mid);
}

.recent-albums-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.album-card {
  display: block;
  text-decoration: none;
  color: var(--text);
}

.album-card-img {
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.album-card-img img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, opacity 0.2s;
}
.album-card:hover .album-card-img img { transform: scale(1.03); opacity: 0.92; }

.album-card-meta strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}
.album-card-meta span {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Listing ────────────────────────────────────────────────────────────── */
.listing-layout { max-width: 1100px; margin: 0 auto; padding: 2rem; }
.photography-layout { max-width: 1100px; margin: 0 auto; padding: 2rem; }

/* Sidebar layout — used on all section listing pages */
.listing-body {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 3rem;
  align-items: start;
}

.listing-sidebar {
  position: sticky;
  top: 4.5rem;
}

.sidebar-heading {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  margin: 0 0 0.65rem;
}

.listing-sidebar .tag-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.listing-sidebar .post-tag {
  justify-content: space-between;
}

.section-head {
  border-bottom: 1px solid var(--border-sub);
  padding-bottom: 1rem;
  margin-bottom: 2.5rem;
}
.section-head h1 { margin: 0; font-size: 1.75rem; }

.empty-note { color: var(--text-faint); font-style: italic; }

/* Station rows */
.listing-grid--stations { display: flex; flex-direction: column; }

.listing-item--station {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1.25rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-sub);
  color: inherit;
}
.listing-item--station:hover h2 { text-decoration: underline; text-decoration-color: var(--link-underline); }

.station-thumb { width: 72px; height: 72px; overflow: hidden; background: var(--bg-subtle); border-radius: var(--radius-sm); }
.station-thumb img { width: 100%; height: 100%; object-fit: cover; }

.listing-item--station h2 { font-size: 1rem; margin: 0 0 0.2rem; font-weight: 500; }
.listing-code { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); display: block; margin-top: 0.15rem; }

/* Album grid */
.listing-grid--albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.listing-item--album a { display: block; color: inherit; }
.listing-item--album a:hover h2 { text-decoration: underline; text-decoration-color: var(--link-underline); }

.album-thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--bg-subtle); margin-bottom: 0.75rem; border-radius: var(--radius-sm); }
.album-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.listing-item--album:hover .album-thumb img { transform: scale(1.03); }

.listing-item--album h2 { font-size: 1.05rem; margin: 0 0 0.2rem; font-weight: 500; }

/* News rows */
.listing-grid--news { display: flex; flex-direction: column; }

.listing-item--article,
.listing-item--review {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-sub);
}

.listing-item--article .date,
.listing-item--review .date { flex-shrink: 0; width: 5rem; }

.listing-item--article a,
.listing-item--review a { flex: 1; color: inherit; text-decoration: none; }
.listing-item--article a:hover h2,
.listing-item--review a:hover h2 { text-decoration: underline; text-decoration-color: var(--link-underline); }

.listing-item--article h2,
.listing-item--review h2 { font-size: 1rem; font-weight: 500; margin: 0; }

.listing-item--article small,
.listing-item--review small { font-size: 0.78rem; color: var(--text-faint); display: block; margin-top: 0.15rem; }

.listing-type { font-size: 0.75rem; color: var(--text-faint); margin-left: 0.5rem; }

/* Tag filter bar (listing page) */
.listing-tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2rem;
}

/* Tags at the bottom of article / review pages */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-sub);
}

/* Shared tag pill — used in filter bar, article header, and listing rows */
.post-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--border-light);
  border-radius: 100px;
  color: var(--text-dim);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.post-tag:hover { border-color: var(--border); color: var(--text); }
.post-tag.is-active { border-color: var(--accent); background: var(--accent); color: var(--accent-fg); }
.post-tag.is-active:hover { opacity: 0.85; }

.post-tag-count {
  font-size: 0.68rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.post-tag.is-active .post-tag-count { color: inherit; opacity: 0.65; }

/* Inline tags shown per-item in the listing (no link, decorative) */
.listing-item-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.post-tag-inline {
  font-size: 0.68rem;
  padding: 1px 7px;
  border: 1px solid var(--border-sub);
  border-radius: 100px;
  color: var(--text-faint);
}

/* Product grid */
.listing-grid--products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}

.listing-item--product a { display: block; color: inherit; }
.listing-item--product a:hover h2 { text-decoration: underline; text-decoration-color: var(--link-underline); }

.product-thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-subtle);
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.listing-item--product h2 { font-size: 1rem; margin: 0.3rem 0; font-weight: 500; }
.listing-item--product .price { font-weight: 600; font-size: 0.9rem; margin: 0; }

/* ── Station ────────────────────────────────────────────────────────────── */
.station-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

@media (min-width: 768px) {
  .station-grid { grid-template-columns: 260px 1fr; }
  .station-meta { border-right: 1px solid var(--border-sub); padding-right: 2rem; }
  .sticky-content { position: sticky; top: 4rem; }
}

.station-meta h1 { font-size: 1.3rem; margin-bottom: 0.25rem; }
.code { font-family: var(--font-mono); font-size: 0.82em; color: var(--text-faint); }
.meta-row { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.station-ratings { display: flex; flex-direction: column; gap: 0.4rem; margin: 1rem 0; font-size: 0.82rem; }
.rating-row { display: flex; justify-content: space-between; align-items: center; }
.rating-label { color: var(--text-muted); }
.rating-dots { letter-spacing: 2px; }

.station-status {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  margin-top: 0.5rem;
  color: var(--text-dim);
  background: var(--bg-subtle);
}

.verdict { font-size: 0.9rem; margin-top: 1rem; }
.verdict blockquote { margin: 0; padding: 0; font-style: italic; color: var(--text-dim); }

.station-story section { margin-bottom: 2rem; }

.station-story h3 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border-sub);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

.gallery-strip { display: flex; gap: 8px; margin: 2rem 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gallery-strip a { display: block; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden; }
.gallery-strip img { height: 200px; width: auto; object-fit: cover; }

.human-echo {
  background: var(--bg-subtle);
  padding: 1.5rem 1.75rem;
  margin-top: 2rem;
  border-left: 3px solid var(--border-mid);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.human-echo h4 {
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.product-plug {
  background: var(--bg-tint);
  padding: 1.5rem;
  margin-top: 3rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-sub);
}
.plug-icon { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.product-plug strong { display: block; margin-bottom: 0.25rem; font-weight: 600; }
.product-plug p { font-size: 0.9rem; color: var(--text-dim); margin: 0 0 0.5rem; }
.product-plug a { font-size: 0.875rem; font-weight: 600; }

/* ── Photography page ───────────────────────────────────────────────────── */
.photography-layout { max-width: 1100px; margin: 0 auto; padding: 2rem; }

.gallery-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-sub);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.filter-btn {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.filter-btn:hover { border-color: var(--border); color: var(--text); }
.filter-btn.is-active { border-color: var(--accent); background: var(--accent); color: var(--accent-fg); }

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border-sub);
  color: var(--text-dim);
  border-radius: 100px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.filter-tag:hover { border-color: var(--border); color: var(--text); }
.filter-tag.is-active { border-color: var(--accent); background: var(--accent); color: var(--accent-fg); }
.filter-tag.is-active .filter-tag-count { color: var(--accent-fg); opacity: 0.65; }

.filter-tag-count {
  font-size: 0.7rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.gallery-year-group { margin-bottom: 3rem; }

.gallery-year-heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border-sub);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.album-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.album-tag {
  font-size: 0.66rem;
  font-weight: 500;
  padding: 1px 7px;
  border: 1px solid var(--border-sub);
  color: var(--text-faint);
  border-radius: 100px;
}

/* ── Album ──────────────────────────────────────────────────────────────── */
.album-head {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--border-sub);
}

.album-head h1 { font-size: 2rem; margin-bottom: 0.25rem; }
.album-head > p { color: var(--text-muted); margin: 0 0 0.75rem; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.gallery-item { position: relative; overflow: hidden; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.gallery-item a { display: block; }

.gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.02); }

.gallery-item figcaption { font-size: 0.78rem; color: var(--text-muted); padding: 0.4rem 0.5rem; }

.shop-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--bg);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.82rem;
  box-shadow: var(--shadow-md);
  transform: translateY(150%);
  transition: transform 0.3s ease;
}
.gallery-item:hover .shop-btn { transform: translateY(0); }

/* ── Product page ───────────────────────────────────────────────────────── */
.product-layout { max-width: 1100px; margin: 0 auto; padding: 2rem; }

.product-header { margin-bottom: 2.5rem; border-bottom: 1px solid var(--border-sub); padding-bottom: 2rem; }
.product-header .badge { margin-bottom: 0.75rem; }
.product-header h1 { font-size: 2.2rem; margin-bottom: 0.75rem; }
.product-description { max-width: 680px; line-height: 1.8; font-size: 1.05rem; }

.product-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: 3rem;
}

.product-summary { font-size: 1rem; line-height: 1.75; color: var(--text-dim); margin-bottom: 1.5rem; }
.product-hero-img img { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.price { font-size: 1.4rem; font-weight: 700; margin: 0 0 1.5rem; }

/* ── Article & Review ───────────────────────────────────────────────────── */
.article-layout,
.review-layout { max-width: 720px; margin: 0 auto; padding: 2rem; }

.article-head,
.review-head { border-bottom: 1px solid var(--border-sub); padding-bottom: 1.5rem; margin-bottom: 2rem; }

.article-head .date,
.review-head .date { display: block; margin-bottom: 0.6rem; }

.article-head h1,
.review-head h1 { font-size: 2rem; margin-bottom: 0; letter-spacing: -0.02em; }

.review-subject { color: var(--text-dim); font-size: 1.05rem; margin: 0.4rem 0 0; }
.review-rating { font-size: 1.1rem; letter-spacing: 3px; margin: 0.4rem 0 0; }

.review-columns { display: grid; grid-template-columns: 160px 1fr; gap: 2rem; align-items: start; }
.review-cover img { width: 100%; border: 1px solid var(--border-sub); border-radius: var(--radius-sm); }

.article-body,
.review-body { line-height: 1.85; font-size: 1.05rem; }

/* ── Lightbox (basicLightbox) ───────────────────────────────────────────── */
.basicLightbox {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: hsla(0, 0%, 0%, 0.85);
  z-index: 9999;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease;
  will-change: opacity;
}

.basicLightbox--visible { opacity: 1; }

.basicLightbox__placeholder {
  max-width: 95vw;
  max-height: 95vh;
  overflow: auto;
  pointer-events: none;
}

.basicLightbox__placeholder > * { pointer-events: all; }

.basicLightbox__placeholder img {
  display: block;
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border-sub); margin-top: 5rem; }

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { font-size: 0.85rem; color: var(--text-muted); transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }

.footer-copy { font-size: 0.75rem; color: var(--text-faint); margin: 0; width: 100%; }

/* ── Page builder ───────────────────────────────────────────────────────── */
.pb-section { margin-bottom: 0; }

.pb-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.pb-col {
  grid-column: span var(--span, 12);
  min-width: 0;
}

.pb-col > * { margin-bottom: 1.25rem; }
.pb-col > *:last-child { margin-bottom: 0; }

/* ── Built-in block styles ──────────────────────────────────────────────── */

/* heading */
.pb-col h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border-sub);
  padding-bottom: 0.35rem;
}
.pb-col h3 { font-size: 1.2rem; }
.pb-col h4 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* text (kirbytext prose) */
.pb-col ul, .pb-col ol { padding-left: 1.5rem; margin: 0 0 1rem; }
.pb-col li { margin-bottom: 0.3rem; }

/* inline code */
.pb-col code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-subtle);
  border: 1px solid var(--border-sub);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.35em;
}

/* image */
.pb-col figure { margin: 0; }
.pb-col figure img { width: 100%; border-radius: var(--radius-sm); }
.pb-col figure figcaption {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.35rem 0 0;
}

/* quote */
.pb-col blockquote {
  margin: 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--link-underline);
  font-style: italic;
  color: var(--text-dim);
  background: var(--bg-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.pb-col blockquote footer {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: normal;
}

/* code block */
.pb-col pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border-sub);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}
.pb-col pre code { background: none; border: none; padding: 0; font-size: 1em; }

/* horizontal rule */
.pb-col hr { border: none; border-top: 1px solid var(--border-sub); }

/* ── Gallery block ──────────────────────────────────────────────────────── */
.block-gallery { margin: 3rem 0; }

/*
 * Breakout: galleries inside the narrow article/review column (720px)
 * escape to a wider width, re-centered against the viewport.
 * Max width caps at 1100px; on small viewports it shrinks with 2rem side gutter.
 */
.article-body .block-gallery,
.review-body .block-gallery {
  --gallery-max: 1100px;
  --gallery-half: calc(var(--gallery-max) / 2);
  width: min(calc(100vw - 4rem), var(--gallery-max));
  margin-top: 3rem;
  margin-bottom: 3rem;
  margin-left: calc(50% - min(calc(50vw - 2rem), var(--gallery-half)));
}

.block-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 240px;
  grid-auto-flow: row dense;
  gap: 4px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* Single image: full width, natural proportions */
.block-gallery[data-count="1"] .block-gallery-grid {
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
}
.block-gallery[data-count="1"] .gallery-cell img {
  height: auto;
  max-height: 560px;
  width: 100%;
  object-fit: contain;
  margin: 0 auto;
}

/* Two images: equal columns */
.block-gallery[data-count="2"] .block-gallery-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* Landscape images span 2 of 3 columns */
.gallery-cell.span-2 { grid-column: span 2; }

.gallery-cell {
  display: block;
  overflow: hidden;
  background: var(--bg-subtle);
}

.gallery-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-cell:hover img { transform: scale(1.03); }

.block-gallery figcaption {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.5rem 0 0;
  font-style: italic;
  text-align: center;
}

/* Square (Instagram-style) variant */
.block-gallery--square .block-gallery-grid {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 4px;
}

.block-gallery--square .gallery-cell {
  aspect-ratio: 1 / 1;
}

.block-gallery--square[data-count="1"] .block-gallery-grid,
.block-gallery--square[data-count="2"] .block-gallery-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* ── Review cover (above body) ──────────────────────────────────────────── */
.review-cover-row {
  max-width: 720px;
  margin: 0 auto 2rem;
  padding: 0 2rem;
}
.review-cover-row img {
  max-width: 160px;
  border: 1px solid var(--border-sub);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .newspaper-grid { grid-template-columns: 1fr; }
  .newspaper-main { padding-right: 0; border-right: none; }
  .newspaper-sidebar { padding-left: 0; margin-top: 2rem; }
  .recent-albums-grid { grid-template-columns: 1fr; }
  .album-card-img img { height: 180px; }
  .product-head { grid-template-columns: 1fr; }
  .review-columns { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .site-nav { gap: 1rem; padding: 0 1rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.8rem; }
  .newspaper-container,
  .station-grid,
  .listing-layout,
  .photography-layout,
  .album-head { padding: 1rem; }
  /* Breakout galleries: full bleed edge-to-edge on mobile */
  .article-body .block-gallery,
  .review-body .block-gallery { width: 100vw; margin-left: calc(50% - 50vw); }
  .listing-body { grid-template-columns: 1fr; }
  .listing-sidebar { position: static; }
  .listing-sidebar .tag-list { flex-direction: row; flex-wrap: wrap; }
  .gallery-grid { padding: 1rem; gap: 1rem; }
  .block-gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
  .gallery-cell.span-2 { grid-column: span 1; }
  .block-gallery[data-count="2"] .block-gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .pb-col { grid-column: 1 / -1 !important; }
  .article-head h1,
  .review-head h1 { font-size: 1.6rem; }
}
