/* ============================================================
   Software Madhouse — site styles
   Clean, minimal podcast theme. Dark chrome, light reading.
   ============================================================ */

:root {
  --accent: #ff6b35;
  --accent-hi: #ff8a3d;
  --accent-dark: #e25420;

  --ink: #14161c;        /* primary text */
  --ink-soft: #4a4f5a;   /* secondary text */
  --ink-faint: #8a90a0;  /* tertiary text */

  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-card: #ffffff;
  --line: #e7e9ee;

  --dark: #0f1115;       /* header/footer/hero */
  --dark-soft: #181b22;
  --dark-line: #262a33;
  --on-dark: #f4f5f7;
  --on-dark-soft: #b6bcc9;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15,17,21,.04), 0 8px 24px rgba(15,17,21,.06);
  --shadow-lg: 0 12px 40px rgba(15,17,21,.12);
  --container: 1120px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-display: 'Space Grotesk', var(--font);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}
.container--narrow { max-width: 760px; }

.brand-accent { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: .95rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn-accent { background: var(--accent); color: #1a0d05; }
.btn-accent:hover { background: var(--accent-hi); }
.btn-outline { border-color: rgba(255,255,255,.25); color: var(--on-dark); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-play { background: var(--ink); color: #fff; }
.btn-play:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-faint); color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15,17,21,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--dark-line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--on-dark);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  color: var(--on-dark-soft);
  font-weight: 500;
  font-size: .96rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.site-nav a:hover { color: var(--on-dark); background: var(--dark-soft); text-decoration: none; }
.site-nav a.active { color: var(--accent); }
.nav-rss { display: inline-flex; align-items: center; color: var(--on-dark-soft); padding: 8px 10px !important; }
.nav-rss:hover { color: var(--accent) !important; }

/* mobile nav toggle */
.nav-toggle, .nav-toggle-label { display: none; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(255,107,53,.18), transparent 60%),
    var(--dark);
  color: var(--on-dark);
  border-bottom: 1px solid var(--dark-line);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
  padding-block: 72px;
}
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 12px;
}
.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  margin: 0 0 .15em;
  line-height: 1;
}
.hero-tagline { font-size: 1.3rem; font-weight: 600; color: var(--on-dark); margin: 0 0 .6em; font-family: var(--font-display); }
.hero-desc { color: var(--on-dark-soft); font-size: 1.05rem; max-width: 52ch; margin: 0 0 1.8em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { display: flex; justify-content: center; }
.hero-art img {
  width: 320px; height: 320px;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
}

/* ---------- Generic sections ---------- */
.section { padding-block: 64px; }
.section-subscribe { background: var(--bg-soft); border-top: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.section-head h2 { font-size: 1.8rem; margin: 0; }
.section-head--center { flex-direction: column; align-items: center; text-align: center; }
.section-sub { color: var(--ink-soft); margin: .2em 0 0; }
.section-link { font-weight: 600; white-space: nowrap; }
.empty { color: var(--ink-faint); }

/* ---------- Page hero (sub pages) ---------- */
.page-hero {
  background:
    radial-gradient(700px 320px at 85% -40%, rgba(255,107,53,.15), transparent 60%),
    var(--dark);
  color: var(--on-dark);
  padding-block: 56px;
}
.page-hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 .2em; }
.page-hero-intro { color: var(--on-dark-soft); font-size: 1.1rem; max-width: 60ch; margin: 0; }

/* ---------- Episode list / cards ---------- */
.episode-list { display: flex; flex-direction: column; gap: 16px; }
.episode-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.episode-card:hover { border-color: #d7dae1; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.episode-card-art { position: relative; display: block; }
.episode-card-art img {
  width: 120px; height: 120px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-soft);
}
.episode-badge {
  position: absolute;
  left: 8px; bottom: 8px;
  background: var(--accent);
  color: #1a0d05;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 3px 8px;
  border-radius: 999px;
}
.episode-badge--inline { position: static; display: inline-block; }
.episode-card-body { min-width: 0; display: flex; flex-direction: column; }
.episode-card-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: var(--ink-faint);
  font-size: .85rem;
  margin-bottom: 6px;
}
.episode-card-meta .dot { opacity: .5; }
.episode-card-title { font-size: 1.25rem; margin: 0 0 6px; }
.episode-card-title a { color: var(--ink); }
.episode-card-title a:hover { color: var(--accent-dark); text-decoration: none; }
.episode-card-desc { color: var(--ink-soft); margin: 0 0 14px; font-size: .96rem; }
.episode-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }

/* ---------- Episode single ---------- */
.episode-single { padding-block: 40px 72px; }
.back-link { display: inline-block; color: var(--ink-faint); font-weight: 500; margin-bottom: 24px; }
.back-link:hover { color: var(--accent-dark); text-decoration: none; }
.episode-header { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 28px; }
.episode-header-art { width: 160px; height: 160px; border-radius: var(--radius); object-fit: cover; box-shadow: var(--shadow); flex-shrink: 0; }
.episode-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .15em 0 .25em; }
.episode-guests { color: var(--ink-soft); font-weight: 500; margin: 0; }

.episode-layout { display: grid; grid-template-columns: 1fr 280px; gap: 48px; margin-top: 36px; }
.episode-aside { display: flex; flex-direction: column; gap: 20px; }
.aside-box { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.aside-box h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); margin: 0 0 12px; }
.aside-list { margin: 0; padding-left: 18px; color: var(--ink-soft); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .82rem; color: var(--ink-soft); }

.episode-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; border-top: 1px solid var(--line); padding-top: 24px; }
.episode-pager a { display: flex; flex-direction: column; gap: 2px; max-width: 48%; }
.episode-pager a:hover { text-decoration: none; }
.episode-pager span { color: var(--ink-faint); font-size: .82rem; }
.episode-pager strong { color: var(--ink); font-weight: 600; }
.episode-pager a:hover strong { color: var(--accent-dark); }
.pager-next { text-align: right; margin-left: auto; }

/* ---------- Video (YouTube) ---------- */
.video-player { margin-bottom: 18px; }
.video-frame-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--dark);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.video-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-player-meta { display: flex; align-items: center; gap: 18px; margin-top: 10px; font-size: .85rem; }
.video-link { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-weight: 500; }
.video-link:hover { color: var(--accent-dark); text-decoration: none; }
.video-link svg { width: 18px; height: 18px; }
.btn-yt svg { width: 16px; height: 16px; }

/* ---------- Audio player ---------- */
.audio-player {
  background: var(--dark);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.audio-player-el { width: 100%; height: 44px; }
.audio-player-meta {
  display: flex; align-items: center; gap: 18px;
  margin-top: 12px;
  color: var(--on-dark-soft);
  font-size: .85rem;
}
.ap-duration, .ap-download { display: inline-flex; align-items: center; gap: 6px; }
.ap-download { color: var(--on-dark-soft); margin-left: auto; }
.ap-download:hover { color: var(--accent); text-decoration: none; }
.audio-missing { color: var(--ink-faint); font-style: italic; }

/* ---------- Subscribe buttons ---------- */
.subscribe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  max-width: 760px;
  margin-inline: auto;
}
.subscribe-grid--compact { grid-template-columns: 1fr; gap: 8px; max-width: none; }
.sub-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--ink);
  font-weight: 600;
  font-size: .95rem;
  transition: border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.sub-btn:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--accent); box-shadow: var(--shadow); }
.sub-btn-icon { display: inline-flex; color: var(--accent-dark); }
.subscribe-grid--compact .sub-btn { background: transparent; }

/* ---------- RSS callout ---------- */
.rss-callout { margin-top: 40px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.rss-callout h3 { margin-top: 0; font-size: 1.2rem; }
.rss-url { display: block; margin-top: 8px; background: var(--dark); color: var(--accent-hi); padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem; word-break: break-all; }

/* ---------- About / hosts ---------- */
.section-hosts { background: var(--bg-soft); border-top: 1px solid var(--line); }
.about-intro { font-size: 1.08rem; }
.host-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; max-width: 900px; margin-inline: auto; }
.host-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.host-photo { width: 128px; height: 128px; margin: 0 auto 16px; }
.host-photo img { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; }
.host-photo-placeholder {
  width: 128px; height: 128px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent-dark));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3rem;
}
.host-info h3 { font-size: 1.4rem; margin: 0 0 .15em; }
.host-role { color: var(--accent-dark); font-weight: 600; font-size: .9rem; margin: 0 0 1em; }
.host-bio { color: var(--ink-soft); text-align: left; font-size: .97rem; }
.host-links { display: flex; justify-content: center; gap: 16px; margin-top: 16px; }
.host-links a { font-weight: 600; font-size: .9rem; }

/* ---------- Prose ---------- */
.prose { font-size: 1.05rem; color: var(--ink); }
.prose h2 { font-size: 1.5rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.6em; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose li { margin-bottom: .4em; }
.prose blockquote {
  margin: 1.4em 0;
  padding: 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  font-style: italic;
}
.prose code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px; padding: .1em .4em; font-size: .9em; }
.prose pre { background: var(--dark); color: var(--on-dark); padding: 18px; border-radius: var(--radius-sm); overflow-x: auto; }
.prose pre code { background: none; border: none; padding: 0; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

/* generic page-single */
.page-single { padding-block: 56px 72px; }
.page-single-head h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.page-single-sub { color: var(--ink-soft); font-size: 1.1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: var(--on-dark-soft); padding-top: 56px; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-brand .brand-text { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--on-dark); display: block; margin-bottom: 8px; }
.footer-brand p { max-width: 34ch; margin: 0; }
.site-footer h4 { color: var(--on-dark); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 16px; }
.footer-nav { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.footer-nav a { color: var(--on-dark-soft); }
.footer-nav a:hover { color: var(--accent); text-decoration: none; }
.footer-subscribe .subscribe-grid--compact .sub-btn { background: var(--dark-soft); border-color: var(--dark-line); color: var(--on-dark); }
.footer-subscribe .sub-btn-icon { color: var(--accent); }
.footer-subscribe .sub-btn:hover { border-color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid var(--dark-line);
  padding-block: 22px;
  font-size: .85rem;
}
.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--on-dark-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; padding-block: 56px; }
  .hero-art { order: -1; }
  .hero-art img { width: 220px; height: 220px; }
  .hero-actions { justify-content: center; }
  .hero-desc { margin-inline: auto; }
  .episode-layout { grid-template-columns: 1fr; gap: 32px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  /* mobile nav */
  .nav-toggle-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px; height: 40px;
    cursor: pointer;
  }
  .nav-toggle-label span { display: block; height: 2px; width: 22px; background: var(--on-dark); border-radius: 2px; transition: .2s; }
  .site-nav {
    display: none;
    position: absolute;
    top: 66px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--dark);
    border-bottom: 1px solid var(--dark-line);
    padding: 8px 16px 16px;
  }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .site-nav a { padding: 12px 8px; border-radius: 8px; }
  .header-inner { position: relative; }

  .episode-card { grid-template-columns: 84px 1fr; gap: 14px; padding: 14px; }
  .episode-card-art img { width: 84px; height: 84px; }
  .episode-header { flex-direction: column; gap: 16px; }
  .host-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .episode-pager a { max-width: 100%; }
}
