/* === The Red Light Review — site styles === */

:root {
  --red:        #A12C2C;
  --red-deep:   #6B1818;
  --red-glow:   #E6354A;
  --ink:        #1A1A1A;
  --ink-soft:   #2A2826;
  --muted:      #6B6862;
  --faint:      #BAB9B4;
  --page:       #FAF8F5;
  --surface:    #FFFFFF;
  --border:     #E2DED5;
  --shadow:     0 1px 2px rgba(20,15,15,.06), 0 8px 24px rgba(20,15,15,.06);
  --serif:      "Playfair Display", "Times New Roman", serif;
  --sans:       "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius:     10px;
  --maxw:       1200px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page:    #0E0C0B;
    --surface: #161311;
    --ink:     #F1ECE3;
    --ink-soft:#D5CFC4;
    --muted:   #9C988F;
    --faint:   #5C5851;
    --border:  #2A2521;
    --shadow:  0 1px 2px rgba(0,0,0,.5), 0 12px 32px rgba(0,0,0,.5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-deep); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .4em; }
h1 { font-size: clamp(2.4rem, 4vw + 1rem, 4.4rem); }
h2 { font-size: clamp(1.8rem, 2vw + 1rem, 2.6rem); }
h3 { font-size: 1.2rem; }

/* === Header === */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: color-mix(in oklab, var(--page) 80%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--red); }
.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--red); color: white;
  border-radius: 6px;
  font-family: var(--serif); font-size: 14px; font-weight: 700;
  letter-spacing: 1px;
}
.brand-text { font-family: var(--serif); font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.site-header nav { display: flex; gap: 22px; align-items: center; }
.site-header nav a { color: var(--ink-soft); font-size: 15px; font-weight: 500; }
.site-header nav a:hover { color: var(--red); text-decoration: none; }
@media (max-width: 640px) {
  .site-header nav a:not(#nav-auth) { display: none; }
  .brand-text { display: none; }
}

/* === Hero === */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: 56px 24px 24px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 1.3fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 360px; margin: 0 auto; }
}
.hero-art img {
  width: 100%; aspect-ratio: 1/1;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.hero-copy h1 { color: var(--ink); }
.tagline {
  font-family: var(--serif); font-style: italic;
  font-size: 1.4rem; color: var(--red);
  margin: 0 0 18px;
}
.lede { color: var(--ink-soft); font-size: 1.05rem; max-width: 56ch; }
.hero-cta { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600; font-size: 15px;
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--red); color: white; }
.btn-primary:hover { background: var(--red-deep); color: white; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }

.hero-player {
  margin-top: 42px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-player iframe { display: block; border-radius: 6px; }

/* === Episodes === */
.episodes {
  max-width: var(--maxw); margin: 0 auto;
  padding: 64px 24px;
}
.section-head { margin-bottom: 28px; }
.section-head p { color: var(--muted); margin: 0 0 18px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  font-family: var(--sans);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip-active { background: var(--ink); color: var(--page); border-color: var(--ink); }

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.ep-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ep-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--red);
  text-decoration: none;
}
.ep-card-art {
  position: relative;
  aspect-ratio: 1/1;
  background: var(--ink);
}
.ep-card-art img { width: 100%; height: 100%; object-fit: cover; }
.ep-card-num {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,.7); color: white;
  font-family: var(--sans); font-weight: 700; font-size: 12px;
  letter-spacing: 1px;
  padding: 4px 8px; border-radius: 4px;
}
.ep-card-body { padding: 14px 16px 18px; flex: 1; display: flex; flex-direction: column; }
.ep-card-title {
  font-family: var(--serif); font-weight: 700;
  font-size: 1.05rem; color: var(--ink);
  line-height: 1.25;
  margin: 0 0 6px;
}
.ep-card-sub {
  font-size: 13px; color: var(--muted);
  margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ep-card-meta {
  display: flex; gap: 8px; align-items: center;
  margin-top: auto;
  font-size: 12px; color: var(--muted);
}
.ep-card-status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(161,44,44,.1); color: var(--red);
  font-weight: 600; font-size: 11px; letter-spacing: .3px;
  text-transform: uppercase;
}
.ep-card-status.published { background: rgba(67,122,34,.12); color: #437A22; }
.ep-card-date { font-variant-numeric: tabular-nums; }

/* === Listen === */
.listen { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.listen, .about { max-width: var(--maxw); margin: 0 auto; padding: 56px 24px; }
.listen { max-width: none; }
.listen > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.platforms { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.platform {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 500; font-size: 14px;
}
.platform:hover { border-color: var(--red); color: var(--red); text-decoration: none; }
.platform[data-pending] { opacity: .5; cursor: not-allowed; }
.platform[data-pending]::after { content: " — coming soon"; font-size: 11px; color: var(--faint); }

.footer-player {
  background: var(--page);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* === About === */
.about p { color: var(--ink-soft); max-width: 70ch; }
.about .contact { margin-top: 18px; color: var(--muted); }

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px 24px;
  background: var(--surface);
  font-size: 14px;
}
.footer-grid {
  display: grid; grid-template-columns: 1fr auto;
  gap: 24px;
  max-width: var(--maxw); margin: 0 auto 12px;
  align-items: center;
}
.footer-grid > div:last-child { display: flex; gap: 18px; }
.footer-grid p { margin: 4px 0 0; color: var(--muted); }
.copyright { text-align: center; color: var(--faint); margin: 12px 0 0; font-size: 12px; }

/* === Episode page === */
.ep-page { max-width: 880px; margin: 0 auto; padding: 32px 24px 64px; }
.ep-back { color: var(--muted); font-size: 14px; }
.ep-hero {
  display: grid; grid-template-columns: 240px 1fr; gap: 28px;
  margin: 24px 0 32px;
}
@media (max-width: 640px) { .ep-hero { grid-template-columns: 1fr; } }
.ep-hero img { border-radius: var(--radius); box-shadow: var(--shadow); }
.ep-meta { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.ep-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ep-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(161,44,44,.1); color: var(--red); font-weight: 500;
  text-transform: lowercase;
}
.ep-player { margin: 24px 0 32px; }
.ep-summary { font-size: 1.05rem; color: var(--ink-soft); margin-bottom: 18px; }
.ep-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }

/* === Comments === */
.comments-section h2 { font-family: var(--serif); margin-top: 24px; }
.comment-form {
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.comment-form textarea {
  width: 100%; resize: vertical;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
  background: var(--page);
  color: var(--ink);
  min-height: 90px;
}
.comment-form textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.comment-form .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.comment-form small { color: var(--muted); font-size: 12px; }
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.comment-children { margin-left: 28px; padding-left: 16px; border-left: 2px solid var(--border); margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--border); }
.comment-author { font-weight: 600; font-size: 14px; }
.comment-time { color: var(--muted); font-size: 12px; }
.comment-body { white-space: pre-wrap; word-wrap: break-word; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.comment-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.vote-btn, .reply-btn, .delete-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 4px 6px; border-radius: 4px;
  font: inherit; font-size: 13px;
}
.vote-btn:hover, .reply-btn:hover, .delete-btn:hover { color: var(--red); background: rgba(161,44,44,.06); }
.vote-btn.active { color: var(--red); font-weight: 600; }
.vote-count { font-variant-numeric: tabular-nums; min-width: 16px; }
.deleted { color: var(--faint); font-style: italic; }
.admin-bar { background: rgba(255,200,0,.12); padding: 6px 10px; border-radius: 4px; font-size: 12px; color: #6B5300; margin-top: 8px; }
.admin-bar input { width: 60px; margin: 0 4px; padding: 2px 6px; border: 1px solid #d0c490; background: #fffef0; border-radius: 3px; }

/* === Login === */
.login-wrap { max-width: 440px; margin: 80px auto; padding: 36px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-align: center; box-shadow: var(--shadow); }
.login-wrap h1 { font-size: 1.8rem; margin-bottom: 18px; }
.login-wrap p { color: var(--muted); margin-bottom: 24px; }
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--page); color: var(--ink);
  font-weight: 600; margin-bottom: 10px;
  cursor: pointer; font-size: 15px;
}
.oauth-btn:hover { border-color: var(--red); }

/* === Utility === */
.hidden { display: none !important; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--page);
  padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 100;
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
