/*
 * Podcasts (/podcasts). Built on tokens.css and site.css: the site's fonts,
 * colours and spacing, its page-head, band, record, panel and form patterns.
 * Only what podcasts add lives here.
 */

/* ── Section bar under the site nav ───────────────────────────────────── */
.pod-nav { border-bottom: var(--rule); background: var(--color-paper); }
.pod-nav__inner { display: flex; align-items: center; gap: var(--space-lg); min-height: 3.5rem; }
.pod-nav__title { display: inline-flex; align-items: center; gap: var(--space-xs); font-family: var(--font-display); font-size: var(--text-md); font-weight: 800; color: var(--color-ink); text-decoration: none; }
.pod-nav__title svg { width: 18px; height: 18px; fill: none; stroke: var(--color-accent); stroke-width: 2; stroke-linecap: round; }
.pod-nav__title:hover { color: var(--color-ink); }
.pod-nav__links { display: flex; gap: var(--space-xs); list-style: none; margin: 0; overflow-x: auto; scrollbar-width: none; }
.pod-nav__links::-webkit-scrollbar { display: none; }
.pod-nav__links a {
    display: inline-flex; align-items: center; min-height: 3.5rem; padding: 0 var(--space-xs);
    border-bottom: 2px solid transparent; font-size: var(--text-sm); font-weight: 500; color: var(--color-muted);
    text-decoration: none; white-space: nowrap;
}
.pod-nav__links a:hover { color: var(--color-ink); }
.pod-nav__links a[aria-current="page"] { color: var(--color-ink); border-bottom-color: var(--color-accent); }
.pod-nav__cta { margin-left: auto; min-height: 36px; padding-inline: var(--space-md); }
@media (max-width: 48rem) {
    .pod-nav__inner { flex-wrap: wrap; gap: 0 var(--space-md); padding-block: var(--space-xs) 0; }
    .pod-nav__links { order: 3; width: 100%; margin-inline: calc(var(--space-xs) * -1); }
    .pod-nav__links a { min-height: 2.75rem; }
    .pod-nav__cta { min-height: 36px; }
}

.pod-head h1 { max-width: 24ch; }

/* ── Featured episode (night band) ───────────────────────────────────── */
.pod-feature__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-2xl); align-items: center; }
.pod-feature__media {
    position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
    border-radius: var(--radius-lg); background: var(--color-night-2);
}
.pod-feature__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-long) var(--ease-out); }
.pod-feature__media:hover img { transform: scale(1.02); }
.pod-feature__play {
    position: absolute; left: var(--space-md); bottom: var(--space-md);
    display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%;
    background: var(--color-night-ink); color: var(--color-night);
}
.pod-feature__play svg { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; }
.pod-feature__kicker { font-size: var(--text-sm); font-weight: 600; color: var(--color-night-muted); }
.pod-feature__kicker a { color: var(--color-night-accent); text-decoration: none; }
.pod-feature__kicker a:hover { text-decoration: underline; }
.pod-feature h2 { margin-top: var(--space-xs); font-size: var(--text-2xl); line-height: var(--lh-snug); letter-spacing: -0.015em; }
.pod-feature__summary { margin-top: var(--space-sm); max-width: 52ch; color: var(--color-night-muted); }
.pod-feature__meta { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-md); list-style: none; font-size: var(--text-sm); color: var(--color-night-ink); }
.pod-feature__meta li { padding: 2px var(--space-xs); border: 1px solid var(--color-night-rule); border-radius: var(--radius-sm); }
.pod-feature__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg); margin-top: var(--space-lg); }
.pod-feature .btn { background: var(--color-night-ink); border-color: var(--color-night-ink); color: var(--color-night); }
.pod-feature .btn:hover { background: var(--color-paper-3); border-color: var(--color-paper-3); color: var(--color-night); }
.pod-feature .more { color: var(--color-night-accent); }
.pod-feature__media.is-empty { display: grid; place-items: center; }
@media (max-width: 56rem) {
    .pod-feature__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); }
}

/* ── Filters ──────────────────────────────────────────────────────────── */
.pod-filters { gap: var(--space-sm); }
.pod-filters__channel { width: auto; min-width: 12rem; flex: 0 1 14rem; }
.pod-segment { display: inline-flex; margin: 0; padding: 3px; border: 1px solid var(--color-rule-strong); border-radius: var(--radius-md); background: var(--color-paper); }
.pod-segment label { position: relative; margin: 0; }
.pod-segment input { position: absolute; opacity: 0; pointer-events: none; }
.pod-segment span {
    display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--space-md);
    border-radius: calc(var(--radius-md) - 2px); font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); cursor: pointer;
    transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.pod-segment span:hover { color: var(--color-ink); }
.pod-segment input:checked + span { background: var(--color-ink); color: var(--color-night-ink); }
.pod-segment input:focus-visible + span { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ── Episode grid ─────────────────────────────────────────────────────── */
.pod-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); gap: var(--space-xl) var(--space-lg); }
.pod-grid--compact { grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr)); }
.pod-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.pod-card__media {
    position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden;
    border-radius: var(--radius-md); background: var(--color-paper-3); color: var(--color-neutral);
}
.pod-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-long) var(--ease-out); }
.pod-card:hover .pod-card__media img { transform: scale(1.02); }
.pod-card__media > svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.pod-card__format, .pod-card__time {
    position: absolute; bottom: var(--space-xs); display: inline-flex; align-items: center; gap: 4px;
    padding: 2px var(--space-xs); border-radius: var(--radius-sm);
    background: oklch(16% 0.012 243 / 0.82); color: var(--color-night-ink);
    font-size: var(--text-xs); font-weight: 600; line-height: 1.6; font-variant-numeric: tabular-nums;
}
.pod-card__format { left: var(--space-xs); }
.pod-card__format svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.pod-card__time { right: var(--space-xs); }
.pod-card__meta { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-sm); margin-top: var(--space-sm); font-size: var(--text-xs); color: var(--color-muted); }
.pod-card__meta a { position: relative; z-index: 1; font-weight: 600; color: var(--color-accent); text-decoration: none; }
.pod-card__meta a:hover { text-decoration: underline; }
.pod-card h3 { margin-top: var(--space-2xs); font-family: var(--font-body); font-size: var(--text-md); font-weight: 600; line-height: var(--lh-snug); }
.pod-card h3 a { color: var(--color-ink); text-decoration: none; }
.pod-card h3 a::after { content: ""; position: absolute; inset: 0; }
.pod-card h3 a:hover { color: var(--color-accent); text-decoration: underline; }
.pod-card__summary { margin-top: var(--space-2xs); font-size: var(--text-sm); color: var(--color-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pod-card__by { margin-top: var(--space-xs); font-size: var(--text-xs); font-weight: 500; color: var(--color-ink); }
.pod-card .skeleton--line, .pod-card .skeleton--title { margin-top: var(--space-sm); }

/* ── Channels ─────────────────────────────────────────────────────────── */
.pod-channels { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr)); gap: var(--space-md); }
.pod-channel { position: relative; display: flex; gap: var(--space-md); padding: var(--space-md); border: var(--rule); border-radius: var(--radius-lg); background: var(--color-paper); transition: border-color var(--dur-micro) var(--ease-out); }
.pod-channel:hover { border-color: var(--color-ink); }
.pod-channel__cover, .pod-show__cover {
    flex: none; display: grid; place-items: center; width: 5.5rem; height: 5.5rem; overflow: hidden;
    border-radius: var(--radius-md); background: var(--color-accent-soft); color: var(--color-accent-strong);
    font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800;
}
.pod-channel__cover img, .pod-show__cover img { width: 100%; height: 100%; object-fit: cover; }
.pod-channel__body { min-width: 0; }
.pod-channel h3 { font-family: var(--font-body); font-size: var(--text-md); font-weight: 600; line-height: var(--lh-snug); }
.pod-channel h3 a { color: var(--color-ink); text-decoration: none; }
.pod-channel h3 a::after { content: ""; position: absolute; inset: 0; }
.pod-channel h3 a:hover { color: var(--color-accent); }
.pod-channel__body > p { margin-top: var(--space-2xs); font-size: var(--text-sm); color: var(--color-muted); }
.pod-channel__meta { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-md); font-size: var(--text-xs) !important; }

/* ── Organizations ────────────────────────────────────────────────────── */
.pod-orgs { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); border-top: var(--rule); }
.pod-org { position: relative; display: flex; align-items: center; gap: var(--space-sm); padding-block: var(--space-md); border-bottom: var(--rule); }
.pod-org__mark {
    flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; overflow: hidden;
    border: var(--rule); border-radius: var(--radius-md); background: var(--color-paper);
    font-family: var(--font-display); font-size: var(--text-sm); font-weight: 800; letter-spacing: 0.02em; color: var(--color-accent-strong);
}
.pod-org__mark img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.pod-org__mark.is-large { width: 5.5rem; height: 5.5rem; font-size: var(--text-xl); }
.pod-org__name { display: block; font-weight: 600; color: var(--color-ink); text-decoration: none; }
.pod-org__name::after { content: ""; position: absolute; inset: 0; }
.pod-org__name:hover { color: var(--color-accent); text-decoration: underline; }
.pod-org__kind { display: block; font-size: var(--text-xs); color: var(--color-muted); }

/* ── Channel & organization heads ─────────────────────────────────────── */
.pod-show { display: flex; gap: var(--space-xl); align-items: flex-start; }
.pod-show .pod-show__cover { width: 9rem; height: 9rem; font-size: var(--text-3xl); }
.pod-show__kicker { margin-bottom: var(--space-xs); font-size: var(--text-sm); font-weight: 600; color: var(--color-accent); }
.pod-show__actions { margin-top: var(--space-lg); }
.share svg { width: 15px; height: 15px; margin-right: 6px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pod-about { color: var(--color-muted); }
@media (max-width: 40rem) {
    .pod-show { flex-direction: column; gap: var(--space-md); }
    .pod-show .pod-show__cover, .pod-org__mark.is-large { width: 5rem; height: 5rem; font-size: var(--text-xl); }
}

/* ── Invitation band ──────────────────────────────────────────────────── */
.pod-invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-lg) var(--space-2xl); }
.pod-invite h2 { font-size: var(--text-xl); }
.pod-invite p { margin-top: var(--space-xs); max-width: 58ch; color: var(--color-muted); }
.pod-invite__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg); }

/* ── Episode page ─────────────────────────────────────────────────────── */
.pod-episode-head { padding-bottom: 0; }
.pod-episode-head .page-head__crumbs { margin-bottom: var(--space-md); }
.pod-record { padding-top: var(--space-lg); }
.pod-player.is-video video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); background: var(--color-night); }
.pod-embed { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); background: var(--color-night); }
.pod-embed[style*="--embed-height"] { aspect-ratio: auto; height: var(--embed-height); background: transparent; }
.pod-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pod-audio { display: flex; align-items: center; gap: var(--space-lg); padding: var(--space-md); border: var(--rule); border-radius: var(--radius-lg); background: var(--color-paper); }
.pod-audio__art { flex: none; display: grid; place-items: center; width: 8rem; height: 8rem; overflow: hidden; border-radius: var(--radius-md); background: var(--color-accent-soft); color: var(--color-accent); }
.pod-audio__art img { width: 100%; height: 100%; object-fit: cover; }
.pod-audio__art svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.pod-audio__body { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: var(--space-2xs); }
.pod-audio__show { font-size: var(--text-xs); font-weight: 600; color: var(--color-accent); }
.pod-audio__body strong { font-family: var(--font-display); font-size: var(--text-lg); line-height: var(--lh-snug); }
.pod-audio__body audio { width: 100%; margin-top: var(--space-xs); }
.pod-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); margin-top: var(--space-sm); }
.pod-select { display: inline-flex; align-items: center; gap: var(--space-xs); margin: 0; padding: 4px 4px 4px var(--space-sm); border: var(--rule); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--color-muted); }
.pod-select[hidden] { display: none; }
.pod-select select { padding: 4px var(--space-xs); border: 0; border-radius: var(--radius-sm); background: var(--color-paper-2); font: inherit; font-weight: 600; color: var(--color-ink); cursor: pointer; }
.pod-download { margin-left: auto; font-size: var(--text-sm); font-weight: 600; }
.pod-share { margin-top: var(--space-md); }
.pod-related { display: block; text-decoration: none; color: var(--color-ink); }
.pod-related:hover { border-color: var(--color-ink); color: var(--color-ink); }
.pod-related__label { display: block; margin-bottom: var(--space-2xs); font-size: var(--text-xs); font-weight: 600; color: var(--color-accent); }
.pod-follow .btn { width: 100%; }
.pod-more-link { margin-top: var(--space-lg); }
@media (max-width: 40rem) {
    .pod-audio { flex-direction: column; align-items: stretch; }
    .pod-audio__art { width: 100%; height: 11rem; }
    .pod-download { margin-left: 0; }
}

/* ── Submission form ──────────────────────────────────────────────────── */
.pod-form { display: grid; gap: var(--space-xl); }
.pod-form__summary { padding: var(--space-sm) var(--space-md); border-left: 3px solid var(--color-danger); background: var(--color-paper-2); }
.pod-step { margin: 0; padding: 0; border: 0; min-width: 0; }
.pod-step legend { display: flex; align-items: center; gap: var(--space-sm); width: 100%; margin-bottom: var(--space-md); padding-bottom: var(--space-xs); border-bottom: 2px solid var(--color-ink); font-family: var(--font-display); font-size: var(--text-lg); font-weight: 800; }
.pod-step legend > span:first-child {
    display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
    background: var(--color-ink); color: var(--color-night-ink); font-family: var(--font-body); font-size: var(--text-xs); font-weight: 600;
}
.pod-step legend .form-optional { font-family: var(--font-body); font-size: var(--text-sm); }
.pod-label { font-size: var(--text-sm); font-weight: 600; }
.pod-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
.pod-choice__item { position: relative; margin: 0; cursor: pointer; }
.pod-choice__item input { position: absolute; top: var(--space-md); left: var(--space-md); accent-color: var(--color-accent); width: 1rem; height: 1rem; margin: 0; }
.pod-choice__item > span {
    display: block; height: 100%; padding: var(--space-md) var(--space-md) var(--space-md) calc(var(--space-md) * 2 + 1rem);
    border: 1px solid var(--color-rule-strong); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--color-muted);
    transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.pod-choice__item b { display: block; margin-bottom: 2px; font-size: var(--text-md); color: var(--color-ink); }
.pod-choice__item:hover > span { border-color: var(--color-ink); }
.pod-choice__item input:checked + span { border-color: var(--color-accent); background: var(--color-accent-soft); }
.pod-choice__item input:focus-visible + span { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.pod-format { margin-top: var(--space-md); }
.pod-format .pod-segment { justify-self: start; }
.pod-textarea { height: auto; min-height: 6rem; padding-block: var(--space-sm); line-height: var(--lh-body); resize: vertical; }
.form-note.is-ok { color: var(--color-success); }
.form-note.is-warn { color: var(--color-danger); }
.form-error:empty { display: none; }
.pod-count { text-align: right; font-variant-numeric: tabular-nums; }
.pod-count:empty { display: none; }
.pod-drop {
    display: flex; align-items: center; gap: var(--space-md); min-height: 5.5rem; padding: var(--space-md);
    border: 1px dashed var(--color-rule-strong); border-radius: var(--radius-md); background: var(--color-paper);
    font-size: var(--text-sm); color: var(--color-muted); cursor: pointer;
    transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.pod-drop, .form-row > label.pod-drop { font-weight: 400; }
.pod-drop b { color: var(--color-accent); font-weight: 600; }
.pod-drop:hover, .pod-drop.is-over { border-color: var(--color-accent); background: var(--color-accent-soft); }
.pod-drop:focus-within { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.pod-drop img { width: 8rem; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); }
.pod-drop[data-file]::after { content: attr(data-file) " · choose another"; overflow-wrap: anywhere; }
.pod-known { display: flex; align-items: flex-start; gap: var(--space-sm); padding: var(--space-md); border: var(--rule); border-radius: var(--radius-md); background: var(--color-paper-2); }
.pod-known[hidden] { display: none; }
.pod-known p { display: flex; flex-wrap: wrap; gap: 2px var(--space-sm); flex: 1; min-width: 0; font-size: var(--text-sm); color: var(--color-muted); }
.pod-known p b { width: 100%; font-size: var(--text-md); color: var(--color-ink); }
.pod-known p span { overflow-wrap: anywhere; }
.pod-known__check { display: grid; place-items: center; flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--color-success); }
.pod-known__check svg { width: 14px; height: 14px; fill: none; stroke: var(--color-paper); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pod-known + .form-grid { margin-top: var(--space-md); }
.pod-link-button { padding: 0; border: 0; background: none; font-size: var(--text-sm); font-weight: 600; color: var(--color-accent); cursor: pointer; }
.pod-link-button:hover { text-decoration: underline; }
.pod-done { display: flex; gap: var(--space-md); padding: var(--space-xl); border: 1px solid var(--color-success); border-radius: var(--radius-lg); background: var(--color-paper); }
.pod-done[hidden] { display: none; }
.pod-done:focus { outline: none; }
.pod-done > svg { flex: none; width: 2.25rem; height: 2.25rem; fill: none; stroke: var(--color-success); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pod-done h2 { font-size: var(--text-xl); }
.pod-done p { margin-top: var(--space-xs); max-width: 56ch; color: var(--color-muted); }
.pod-done__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg); margin-top: var(--space-lg); }
.pod-steps { margin-top: var(--space-sm); padding-left: var(--space-lg); font-size: var(--text-sm); color: var(--color-muted); }
.pod-steps li + li { margin-top: var(--space-xs); }
@media (max-width: 40rem) {
    .pod-choice { grid-template-columns: minmax(0, 1fr); }
    .pod-segment { display: flex; }
    .pod-segment label { flex: 1; }
    .pod-segment span { justify-content: center; width: 100%; padding-inline: var(--space-xs); white-space: nowrap; }
    .pod-format .pod-segment { justify-self: stretch; }
}

/* ── Toast (copy confirmations) ───────────────────────────────────────── */
.pod-toast {
    position: fixed; left: 50%; bottom: var(--space-lg); z-index: var(--z-toast);
    padding: var(--space-xs) var(--space-md); border-radius: var(--radius-md);
    background: var(--color-night); color: var(--color-night-ink); font-size: var(--text-sm); font-weight: 500;
    opacity: 0; transform: translate(-50%, 6px); pointer-events: none;
    transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}
.pod-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
    .pod-card__media img, .pod-feature__media img, .pod-toast { transition: none; }
    .pod-card:hover .pod-card__media img, .pod-feature__media:hover img { transform: none; }
}
