/* ============================================================
   SIMPLE PODCAST HOST — METE NA MESA THEME

   Palette rule:
   - Brand/UI: yellow + neutral greys only
   - Positive states: green
   - Negative alerts/errors: orange
   - Dark mode: automatic via prefers-color-scheme

   Config Rounded / Config Round is expected to already be hosted
   on the same server. If your font files use different paths, edit
   only the three @font-face src URLs immediately below.
   ============================================================ */

@font-face {
  font-family: "Config Round";
  src:
    local("Config Rounded Regular"),
    local("Config Rounded"),
    url("/fonts/config-round/configrounded-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Config Round";
  src:
    local("Config Rounded Medium"),
    url("/fonts/config-round/configrounded-medium.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Config Round";
  src:
    local("Config Rounded Bold"),
    url("/fonts/config-round/configrounded-bold.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Brand */
  --brand-yellow: #f4c400;
  --brand-yellow-hover: #dbaf00;
  --brand-yellow-soft: #fff5bf;
  --brand-yellow-text: #171717;

  /* Positive / negative states */
  --success: #00a35d;
  --success-strong: #00864b;
  --success-soft: rgba(0, 163, 93, .10);
  --danger: #e46e02;
  --danger-strong: #bd5900;
  --danger-soft: rgba(228, 110, 2, .10);

  /* Light theme — neutral only */
  --bg: #f4f4f4;
  --surface: #ffffff;
  --surface-2: #ededed;
  --surface-3: #e4e4e4;
  --text: #181818;
  --muted: #6b6b6b;
  --border: #d6d6d6;
  --border-strong: #bcbcbc;
  --shadow: 0 14px 38px rgba(0, 0, 0, .08);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, .06);

  /* Shared layout */
  --radius: 18px;
  --radius-small: 11px;
  --max-width: 1120px;
  --font: "Config Round", "Config Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Brand remains yellow; everything else stays neutral. */
    --brand-yellow: #ffd11a;
    --brand-yellow-hover: #e8bb00;
    --brand-yellow-soft: #342d0d;
    --brand-yellow-text: #111111;

    --success: #00a35d;
    --success-strong: #00a35d;
    --success-soft: rgba(0, 163, 93, .14);
    --danger: #e46e02;
    --danger-strong: #e46e02;
    --danger-soft: rgba(228, 110, 2, .14);

    --bg: #101010;
    --surface: #191919;
    --surface-2: #242424;
    --surface-3: #2d2d2d;
    --text: #f3f3f3;
    --muted: #adadad;
    --border: #363636;
    --border-strong: #505050;
    --shadow: 0 14px 38px rgba(0, 0, 0, .34);
    --shadow-soft: 0 8px 22px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--text);
  text-decoration-color: var(--brand-yellow);
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
}

a:hover { text-decoration-color: currentColor; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--brand-yellow); color: var(--brand-yellow-text); }

:focus-visible {
  outline: 3px solid var(--brand-yellow);
  outline-offset: 3px;
}

.shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
}

/* ===== SHOW HEADER ===== */
.site-header {
  position: relative;
  padding: 1rem 0 3.5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at top left, var(--brand-yellow-soft) 0, transparent 38%),
    linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: var(--brand-yellow);
}

.streaming-header-bar {
  position: relative;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255,255,255,.58);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: var(--shadow-soft);
}

@media (prefers-color-scheme: dark) {
  .streaming-header-bar {
    background: rgba(25,25,25,.72);
  }
}

.streaming-brand,
.brand-link-rich {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  min-width: 0;
  text-decoration: none;
}

.streaming-brand-thumb,
.brand-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.streaming-brand-copy,
.brand-copy {
  display: grid;
  min-width: 0;
}

.streaming-brand-label,
.brand-label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.streaming-brand-title,
.brand-title {
  font-size: .98rem;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-action,
.rss-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: .55rem .92rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: .88rem;
  font-weight: 800;
  text-decoration: none;
  text-decoration-color: transparent;
  white-space: nowrap;
}

.topbar-action.secondary {
  background: var(--surface-2);
}

.topbar-action:hover,
.rss-link:hover {
  border-color: var(--brand-yellow);
  background: var(--brand-yellow-soft);
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(180px, 300px) 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.hero-showcase {
  padding: clamp(1.25rem, 2vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background: rgba(255,255,255,.66);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  box-shadow: var(--shadow);
}

@media (prefers-color-scheme: dark) {
  .hero-showcase {
    background: rgba(25,25,25,.76);
  }
}

.show-cover {
  display: block;
}

.show-cover img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero h1,
.episode-page h1 {
  margin: .15rem 0 .8rem;
  font-size: clamp(2.3rem, 6vw, 5rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.02;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 .45rem;
  padding: .22rem .58rem;
  border-radius: 999px;
  background: var(--brand-yellow);
  color: var(--brand-yellow-text);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  font-size: .75rem;
}

.subtitle {
  margin: 0 0 1.2rem;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  color: var(--muted);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 0 0 1.15rem;
}

.show-description {
  max-width: 760px;
  color: var(--muted);
}

.show-description p { margin: 0 0 1rem; }

/* ===== EPISODE ARCHIVE ===== */
.content-shell { padding-block: 3.2rem 5rem; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.2;
}

.section-heading h2::after {
  content: "";
  display: block;
  width: 3.2rem;
  height: 5px;
  margin-top: .45rem;
  border-radius: 999px;
  background: var(--brand-yellow);
}

.section-heading span,
.episode-meta,
.recorded {
  color: var(--muted);
  font-size: .92rem;
}

.episode-list { display: grid; gap: 1rem; }

.episode-card {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 1.6rem;
  padding: 1.2rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.episode-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.episode-art img,
.cover-placeholder {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: calc(var(--radius) - 7px);
}

.cover-placeholder {
  display: grid;
  place-items: center;
  background: var(--brand-yellow);
  color: var(--brand-yellow-text);
  font-size: 2rem;
}

.episode-card h3 {
  margin: .25rem 0 .55rem;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  font-weight: 750;
  line-height: 1.2;
}

.episode-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.episode-card h3 a:hover { text-decoration: underline; text-decoration-color: var(--brand-yellow); }
.episode-card p { margin: 0 0 .75rem; color: var(--muted); }
.text-link { font-weight: 750; text-decoration-color: var(--brand-yellow); }

.pagination {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
}
.pagination a { font-weight: 700; }
.pagination a:last-child { text-align: right; }

.empty-state {
  padding: 3rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

/* ===== EPISODE PAGE ===== */
.compact-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-top: 5px solid var(--brand-yellow);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

@media (prefers-color-scheme: dark) {
  .compact-header {
    background: rgba(25,25,25,.78);
  }
}

.compact-header-shell {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  color: var(--text);
  font-weight: 850;
  text-decoration: none;
  font-size: 1.05rem;
}

.compact-actions {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.brand-link:hover { text-decoration: none; }
.back-link { display: inline-block; margin-bottom: 2rem; font-weight: 700; }
.episode-page { max-width: 900px; }

.episode-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
}

.episode-cover-large {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.episode-hero h1 { font-size: clamp(2rem, 5vw, 3.6rem); }

.player-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 2.4rem;
  box-shadow: var(--shadow-soft);
}

.player-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--brand-yellow);
}

.player-card audio {
  width: 100%;
  display: block;
  accent-color: var(--brand-yellow);
}

.player-links {
  margin-top: .7rem;
  display: flex;
  flex-wrap: wrap;
  gap: .7rem 1.3rem;
  font-size: .9rem;
}

.markdown-body { font-size: 1.03rem; }
.markdown-body p { margin: 0 0 1.1rem; }
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 { margin: 2rem 0 .75rem; line-height: 1.2; }
.markdown-body a { font-weight: 600; }

.markdown-body blockquote {
  margin: 1.4rem 0;
  padding: .65rem 1rem;
  border-left: 5px solid var(--brand-yellow);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  background: var(--surface);
  color: var(--muted);
}

.markdown-body code {
  padding: .12em .35em;
  border-radius: 5px;
  background: var(--surface-2);
}

.markdown-body hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.markdown-body li + li { margin-top: .35rem; }

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.site-footer .shell {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ===== SHARED PANELS / FORMS / ADMIN ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-soft);
}

.notice {
  margin: 1rem 0;
  padding: .85rem 1rem;
  border-radius: var(--radius-small);
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 650;
}

.notice.success {
  color: var(--success-strong);
  border-color: var(--success);
  background: var(--success-soft);
}

.notice.error,
.notice.warning {
  color: var(--danger-strong);
  border-color: var(--danger);
  background: var(--danger-soft);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .65rem 1rem;
  border: 1px solid var(--brand-yellow);
  border-radius: 10px;
  background: var(--brand-yellow);
  color: var(--brand-yellow-text);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.button:hover {
  background: var(--brand-yellow-hover);
  border-color: var(--brand-yellow-hover);
  transform: translateY(-1px);
}

.button.secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.button.secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

label { display: grid; gap: .35rem; font-weight: 700; }
label + label { margin-top: 1rem; }

input,
textarea,
select {
  width: 100%;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: .72rem .8rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid color-mix(in srgb, var(--brand-yellow) 35%, transparent);
  border-color: var(--brand-yellow-hover);
}

input[type="checkbox"],
input[type="radio"] { accent-color: var(--brand-yellow); }
textarea { resize: vertical; }
small, .hint, .muted, .help { color: var(--muted); font-weight: 400; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid label + label { margin-top: 0; }
.span-2 { grid-column: 1 / -1; }
.install-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.install-panel { width: min(760px, 100%); }
.install-panel h1 { margin-top: .2rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 720px) {
  .site-header {
    padding-top: .7rem;
    padding-bottom: 2.2rem;
  }
  .streaming-header-bar {
    display: flex;
    padding: .7rem .8rem;
    border-radius: 16px;
  }
  .streaming-brand-title,
  .brand-title {
    font-size: .92rem;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .hero-showcase {
    gap: 1rem;
    padding: 1rem;
    border-radius: 22px;
  }
  .show-cover {
    width: min(230px, 62vw);
    margin-inline: auto;
  }
  .hero-copy {
    text-align: left;
  }
  .hero-actions .button {
    flex: 1 1 180px;
  }
  .episode-card { grid-template-columns: 96px 1fr; gap: 1rem; }
  .episode-card p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .compact-header-shell {
    min-height: 72px;
  }
  .topbar-action,
  .rss-link {
    min-height: 38px;
    padding: .5rem .78rem;
  }
  .episode-hero { grid-template-columns: 110px 1fr; gap: 1rem; align-items: start; }
  .episode-cover-large { border-radius: 12px; }
  .pagination { grid-template-columns: 1fr 1fr; }
  .pagination span { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}

@media (max-width: 470px) {
  .streaming-header-bar,
  .compact-header-shell {
    gap: .75rem;
  }
  .streaming-brand-thumb,
  .brand-thumb {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 12px;
  }
  .streaming-brand-label,
  .brand-label {
    font-size: .68rem;
  }
  .hero h1,
  .episode-page h1 {
    font-size: clamp(1.9rem, 10vw, 2.8rem);
  }
  .episode-card { grid-template-columns: 1fr; }
  .episode-art { width: 140px; }
  .episode-hero { grid-template-columns: 1fr; }
  .episode-cover-large { width: min(220px, 70vw); }
  .compact-actions {
    gap: .45rem;
  }
  .compact-actions .topbar-action.secondary {
    display: none;
  }
  .site-footer .shell { flex-direction: column; justify-content: center; padding-block: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ===== EPISODE SEARCH / TAGS ===== */
.episode-search {
  margin-bottom: 2.2rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.episode-search-form { display: grid; gap: .55rem; }
.episode-search-form > label { font-weight: 800; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; }
.search-row input { min-width: 0; }

.tag-browser,
.episode-tags,
.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}

.tag-browser { margin-top: 1rem; }
.tag-browser-label { color: var(--muted); font-size: .88rem; font-weight: 750; }

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 32px;
  padding: .28rem .65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: .84rem;
  font-weight: 750;
  text-decoration: none;
}

.tag-chip:hover,
.tag-chip.active {
  border-color: var(--brand-yellow);
  background: var(--brand-yellow-soft);
  color: var(--text);
}

.tag-chip span { color: var(--muted); font-size: .76rem; }
.tag-chip.small { min-height: 27px; padding: .18rem .52rem; font-size: .78rem; }
.episode-tags { margin: .15rem 0 .8rem; }
.episode-tags-hero { margin-top: .8rem; }

.active-filters {
  margin-top: .9rem;
  padding-top: .8rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .88rem;
}
.active-filters a { margin-left: auto; font-weight: 750; }

@media (max-width: 560px) {
  .search-row { grid-template-columns: 1fr; }
  .search-row .button { width: 100%; }
  .active-filters a { width: 100%; margin-left: 0; }
}
