/* ABOUTME: Design-system CSS for The Daily FM. Tokens match the 2026-04 homepage redesign. */
/* ABOUTME: Dark theme + lime accent default; light/accent overrides live under [data-theme] / [data-accent]. */

:root {
    --bg: #15181d;
    --bg-2: #1c2027;
    --bg-3: #232833;
    --ink: #ffffff;
    --ink-2: #f4f7fb;
    --ink-3: #9aa3b2;
    --rule: #2d333f;
    --rule-2: #262b34;
    --accent: #a3e635;
    --danger: #f87171;
    --success: #86efac;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-accent="amber"]   { --accent: #f59e0b; }
[data-accent="cyan"]    { --accent: #22d3ee; }
[data-accent="magenta"] { --accent: #e879f9; }
[data-accent="white"]   { --accent: #f5f5f5; }

[data-theme="light"] {
    --bg: #fafafa;
    --bg-2: #fff;
    --bg-3: #f4f4f4;
    --ink: #111;
    --ink-2: #1f2933;
    --ink-3: #6b6b6b;
    --rule: #e2e2e2;
    --rule-2: #ececec;
    --accent: #166534;
    --danger: #b91c1c;
    --success: #166534;
}

* { box-sizing: border-box; }

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }
a.link { color: var(--ink); border-bottom: 1px solid var(--rule); padding-bottom: 1px; transition: color 100ms, border-color 100ms; }
a.link:hover { color: var(--accent); border-color: var(--accent); }
.link-button {
    appearance: none;
    border: 0;
    border-bottom: 1px solid var(--rule);
    background: transparent;
    color: var(--ink);
    padding: 0 0 1px;
    font: inherit;
    cursor: pointer;
    transition: color 100ms, border-color 100ms;
}
.link-button:hover {
    color: var(--accent);
    border-color: var(--accent);
}

button { font-family: inherit; cursor: pointer; }

input, textarea, select {
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--ink);
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 10px 12px;
    outline: none;
    transition: border-color 100ms;
    width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; font-family: var(--font-mono); font-size: 14px; line-height: 1.5; }

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
label > span,
label {
    font-size: 12px;
    color: var(--ink-3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
/* Inline-type labels (checkbox/radio) shouldn't stack vertically */
label.inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--ink-2);
}
label.inline input[type="checkbox"] { width: auto; }

/* Helpers */
.mono { font-family: var(--font-mono); }
.small { font-size: 14.5px; }
.dim { color: var(--ink-3); }
.accent { color: var(--accent); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Layout */
.app { max-width: 1100px; margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 480px; margin: 0 auto; }

/* ——— Buttons ——— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--rule);
    background: var(--bg-2);
    color: var(--ink);
    font-size: 14px;
    border-radius: 4px;
    transition: border-color 100ms, background 100ms, color 100ms, filter 100ms;
    text-decoration: none;
}
.btn:hover { border-color: var(--ink-3); }
.btn-primary {
    background: #84cc16;
    border-color: #84cc16;
    color: #000;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0;
}
.btn-primary:hover { filter: brightness(1.08); border-color: #84cc16; }
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--ink-2);
}
.btn-ghost:hover {
    color: var(--ink);
    border-color: var(--rule);
    background: var(--bg-2);
}
.btn-lg { padding: 14px 20px; font-size: 17px; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* ——— Action cards (big button-style links with title + subtitle) ——— */
.action-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid var(--rule);
    background: var(--bg-2);
    color: var(--ink);
    border-radius: 6px;
    text-decoration: none;
    transition: border-color 120ms, background 120ms, filter 120ms;
}
.action-card strong {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
}
.action-card span {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--ink-3);
    line-height: 1.45;
}
.action-card:hover {
    border-color: var(--accent);
}
.action-card-primary {
    background: #3d5a80;
    border-color: #3d5a80;
    color: #f5f5f5;
}
.action-card-primary span { color: #c5d2e3; }
.action-card-primary:hover { background: #486a94; border-color: #486a94; }

/* ——— Nav ——— */
.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    gap: 16px;
    font-size: 16px;
}
.verify-banner {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 8px 16px;
    margin: 0 calc(50% - 50vw);
    background: var(--accent);
    color: #0b0b0b;
    font-size: 13px;
    font-family: var(--font-sans);
}
.verify-banner-link {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
/* Light theme's accent is dark green; dark banner text is low-contrast on it. */
[data-theme="light"] .verify-banner {
    color: #fff;
}
.site-nav .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
}
.site-nav .brand .dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.site-nav .right { display: inline-flex; gap: 18px; align-items: center; color: var(--ink); }
.site-nav .right a { color: var(--ink); }
.site-nav .right a:hover { color: var(--accent); }
.site-nav .right a.is-active { color: var(--accent); }
.site-nav .right a.btn-primary { color: #000; }
.site-nav .right a.btn-primary:hover { color: #000; }
.site-nav .right a.btn-primary.is-active { color: #000; box-shadow: 0 0 0 2px rgba(163, 230, 53, 0.24); }
.site-nav .right form { margin: 0; }
.site-nav .right form button { margin: 0; }
.site-nav .btn-sm { font-size: 15px; padding: 7px 11px; }
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 2px;
    border: 1px solid var(--rule);
    border-radius: 5px;
    background: var(--bg-2);
    width: fit-content;
}
.theme-switcher button {
    appearance: none;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--ink-2);
    font: inherit;
    font-size: 13px;
    line-height: 1;
    padding: 6px 8px;
}
.theme-switcher button:hover { color: var(--accent); }
.theme-switcher button.is-active {
    background: var(--accent);
    color: var(--bg);
}

/* ——— Hero ——— */
.hero { padding: 72px 0 40px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero-title {
    font-size: clamp(40px, 6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 500;
    margin: 0 0 24px;
    max-width: 30ch;
}
.hero-title .muted { color: var(--ink-3); }
.hero-sub {
    font-size: 20px;
    color: var(--ink-2);
    max-width: 58ch;
    line-height: 1.55;
    margin: 0 0 32px;
}
/* ——— Section ——— */
.section { padding: 56px 0; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 28px;
    gap: 24px;
    flex-wrap: wrap;
}
.section-title {
    font-size: 24px;
    letter-spacing: -0.01em;
    font-weight: 500;
    margin: 0;
}
.section-tag {
    font-size: 14.5px;
    color: var(--ink-3);
}

/* ——— Pod list (homepage) ——— */
.pods { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.pod {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: start;
    padding: 18px 8px;
    border-bottom: 1px solid var(--rule);
}
.pod-play {
    width: 44px; height: 44px; border-radius: 6px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 100ms, border-color 100ms, color 100ms, opacity 100ms;
}
.pod-play:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.pod-play:disabled { opacity: 0.4; cursor: not-allowed; }
.pod-play.is-playing { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.pod-main { min-width: 0; }
.pod-top { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.pod-name { font-size: 18px; font-weight: 600; color: var(--accent); transition: color 100ms; }
.pod-name a { color: inherit; }
a.pod-name:hover { color: var(--accent); }
.library-pod .pod-name {
    color: var(--accent);
    font-size: 19px;
    font-weight: 700;
}
.library-coming-soon {
    opacity: 0.52;
}
.library-coming-soon .section-title,
.library-pod-coming-soon .pod-name,
.library-pod-coming-soon .pod-latest,
.library-pod-coming-soon .pod-sources,
.library-pod-coming-soon .dim {
    color: var(--ink-3) !important;
}
.library-pod-coming-soon {
    background: transparent;
    filter: grayscale(0.25);
}
.pod-badge {
    font-size: 13.5px;
    color: var(--ink-3);
    padding: 2px 6px;
    border: 1px solid var(--rule);
    border-radius: 3px;
}
.pod-subscribe-url {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--ink-3);
    overflow-wrap: anywhere;
}
.pod-subscribe-label {
    color: var(--ink-3);
}
.pod-subscribe-url a {
    color: var(--success);
    border-bottom: 1px dashed var(--success);
    padding-bottom: 1px;
}
.pod-episode-row {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
    min-width: 0;
}
.pod.show-script .pod-episode-row { display: flex; }
.pod-listen {
    width: auto;
    height: auto;
    padding: 7px 12px;
    gap: 8px;
    font-size: 13.5px;
    white-space: nowrap;
}
.pod-latest {
    position: relative;
    font-size: 16px;
    color: var(--ink-2);
    line-height: 1.45;
    max-width: 82ch;
    min-width: 0;
    flex: 1;
}
.pod-latest-label {
    display: block;
    margin-bottom: 3px;
    color: var(--ink);
}
.pod-latest-text {
    display: block;
}
.pod-hide {
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 28px;
    margin-top: 2px;
    background: none;
    border: none;
    color: #f59e0b;
    cursor: pointer;
    transition: color 100ms;
}
.pod-hide:hover { color: var(--ink); }
.pod-sources {
    display: flex;
    gap: 10px;
    font-size: 14px;
    color: var(--ink-3);
    margin-top: 6px;
    flex-wrap: wrap;
}
.pod-sources span::before { content: '/ '; color: var(--rule); }
.pod-sources span:first-child::before { content: ''; }
.pod-actions { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pod-add-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.pod-add-form select { width: auto; flex: 1 1 180px; max-width: 300px; padding: 7px 10px; font-size: 14px; }
.subscribe-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; max-width: 560px; margin: 0; }
.subscribe-form > label { margin: 0; flex: 1 1 240px; }
.pod-add-form select:disabled, .pod-add-form button:disabled,
.subscribe-form select:disabled, .subscribe-form button:disabled { opacity: 0.55; cursor: default; }

.pod-right { display: flex; align-items: center; gap: 8px; }
.pod-duration {
    font-size: 14.5px;
    color: var(--ink-3);
    min-width: 56px;
    text-align: right;
}

.pod-progress {
    display: grid;
    grid-template-columns: auto minmax(160px, 240px) auto;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    width: min(480px, 48vw);
    min-height: 18px;
    margin-top: 26px;
    opacity: 0;
    transition: opacity 120ms;
}
.pod.has-progress .pod-progress { opacity: 1; }
.pod-pause {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 100ms, border-color 100ms, color 100ms;
}
.pod-pause:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.pod-progress-track {
    height: 4px;
    background: var(--rule);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: height 100ms, background 100ms;
}
.pod-progress-track:hover {
    height: 6px;
    background: var(--rule-2);
}
.pod-progress-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: var(--accent);
    width: 0;
    transition: width 180ms linear;
}
.pod-progress-status {
    min-width: 88px;
    text-align: right;
    color: var(--ink-3);
    font-size: 14px;
    white-space: nowrap;
}

/* ——— Footer ——— */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 0;
    margin-top: 40px;
    border-top: 1px solid var(--rule);
    font-size: 13px;
    color: var(--ink-3);
}
.footer a:hover { color: var(--ink); }
.footer-right { display: flex; gap: 20px; }

/* ——— Modal ——— */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fade 160ms ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--bg);
    border: 1px solid var(--rule);
    max-width: 480px;
    width: 100%;
    padding: 28px;
    position: relative;
    border-radius: 6px;
    animation: rise 200ms cubic-bezier(.2, .7, .2, 1);
}
@keyframes rise {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--ink-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.modal-close:hover { background: var(--bg-2); color: var(--ink); }
.modal-title { font-size: 20px; font-weight: 500; margin: 0 0 6px; color: var(--ink); }
.modal-sub { color: var(--ink-2); font-size: 14.5px; margin: 0 0 20px; }
.rss-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 16px;
}
.rss-url {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 4px;
    color: var(--ink);
}
.platform-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}
.platform-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--rule);
    background: var(--bg-2);
    color: var(--ink);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 100ms;
}
.platform-btn:hover { border-color: var(--accent); }
.platform-btn .mono { color: var(--ink-3); font-size: 12px; }

/* ——— Auth pages (full-page, not slide-in) ——— */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}
.auth-page-with-nav { min-height: calc(100vh - 80px); padding-top: 24px; }
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 36px;
}
.auth-card label > span {
    color: var(--ink-2);
    font-size: 13px;
}
.auth-card input {
    color: var(--ink);
    font-size: 16px;
}
.auth-kicker {
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.auth-title {
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.015em;
    margin: 0 0 8px;
    color: var(--ink);
}
.auth-sub {
    color: var(--ink-2);
    font-size: 14.5px;
    margin: 0 0 24px;
}
.auth-switch {
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--rule);
    text-align: center;
}
.auth-switch a.link { font-size: 12px; }

/* ——— Generic flash messages ——— */
.flash { margin: 0 0 16px; font-size: 14px; }
.flash-error { color: var(--danger); }
.flash-success { color: var(--success); }

/* ——— Dashboard + podcast detail ——— */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.card {
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 20px;
}
.card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 500; }
.podcast-list-title {
    color: var(--accent);
    font-size: 19px;
    font-weight: 700;
}
.card p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

.feed-line {
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--ink-2);
    background: var(--bg-2);
    border: 1px solid var(--rule);
    padding: 10px 12px;
    border-radius: 4px;
    overflow-x: auto;
    white-space: nowrap;
}

/* Episode article cards */
article.episode {
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 14px;
}
article.episode header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
article.episode audio { width: 100%; margin-top: 12px; }
article.episode details { margin-top: 10px; }
article.episode summary { cursor: pointer; font-size: 13px; color: var(--ink-3); }
article.episode summary:hover { color: var(--ink); }
/* Read-along highlight: the sentence currently being narrated. */
.script-sentence.is-reading {
    background: rgba(163, 230, 53, 0.22);
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
/* Dim just the script's disclosure triangle so it reads as "expand", not a play button. */

/* Status badges */
.badge {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-ready { background: var(--accent); color: var(--bg); }
.badge-failed { background: var(--danger); color: var(--bg); }
.badge-progress {
    background: var(--bg-3);
    color: var(--ink-2);
    border: 1px solid var(--rule);
    animation: pulse 1.4s ease-in-out infinite;
}
.badge-progress::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 6px;
    vertical-align: middle;
    animation: pulse 1.4s ease-in-out infinite;
}

/* Indeterminate progress bar at the top of in-progress episode cards */
article.episode[hx-get] {
    position: relative;
    overflow: hidden;
}
article.episode[hx-get]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: indeterminate 1.6s ease-in-out infinite;
}
@keyframes indeterminate {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* Series list */
.series-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.series-list li {
    font-size: 13.5px;
    color: var(--ink-2);
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.series-list-name {
    color: var(--accent);
    font-size: 16px;
    font-weight: 700;
}

/* Source list */
.source-list {
    padding-left: 20px;
    margin: 0;
}
.source-list li {
    margin: 8px 0;
    min-width: 0;
}
.source-list a {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ——— Icons (inline) ——— */
.icon { display: inline-block; vertical-align: middle; }

/* ——— Responsive ——— */
@media (max-width: 760px) {
    .pod { grid-template-columns: 44px 1fr; }
    .pod-right { grid-column: 2; grid-row: 2; padding-left: 0; margin-top: 8px; }
    .footer { flex-direction: column; gap: 12px; align-items: flex-start; }
    .site-nav { flex-wrap: wrap; gap: 12px; }
}
