:root {
    --bg: #f6f1e8;
    --card: #fffaf1;
    --ink: #171411;
    --muted: #776b5d;
    --line: rgba(23, 20, 17, .14);
    --accent: #111111;
    --accent-2: #f0b43c;
    --danger: #b42318;
    --success: #16794f;
    --shadow: 0 20px 60px rgba(0, 0, 0, .08);
    --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(240,180,60,.22), transparent 36rem), var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: rgba(246, 241, 232, .82);
    border-bottom: 1px solid var(--line);
}
.header-grid {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 850;
    white-space: nowrap;
}
.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: var(--accent);
    font-size: .9rem;
    letter-spacing: .02em;
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
    text-decoration: none;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 250, 241, .64);
    font-weight: 700;
    font-size: .94rem;
}
.page-main { padding: 38px 0 70px; }

.post-hero-nav {
    margin-top: 14px;
    display: flex;
    justify-content: center;
}
.post-hero-nav .main-nav {
    max-width: 100%;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 250, 241, .76);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .06);
}
.post-hero-nav .main-nav a {
    background: transparent;
}
.card {
    background: rgba(255, 250, 241, .92);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero-card {
    padding: clamp(24px, 4vw, 44px);
}
h1, h2, h3 { line-height: 1.08; margin: 0 0 14px; }
h1 { font-size: clamp(2.15rem, 7vw, 5rem); letter-spacing: -.06em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); letter-spacing: -.04em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 16px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 760px; }
.eyebrow {
    display: inline-flex;
    margin: 0 0 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .78rem;
    color: var(--muted);
}
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.button, button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 12px 18px;
    text-decoration: none;
    font-weight: 850;
    min-height: 46px;
    cursor: pointer;
    font: inherit;
}
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button.ghost { background: rgba(255,255,255,.42); }
.button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.audio-player { width: 100%; margin: 18px 0 4px; }
.section-block { margin-top: 34px; }
.section-title-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.section-title-row a { font-weight: 800; }
.episode-hero-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 430px;
    margin: 0 0 26px;
    overflow: hidden;
    border-radius: 22px;
    background: #e8dfce;
    text-decoration: none;
}
.episode-hero-image img,
.episode-detail-image img,
.episode-card-image img,
.episode-row-image img,
.admin-image-preview img,
.admin-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.episode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.episode-card {
    overflow: hidden;
    padding: 0;
}
.episode-card-body { padding: 20px 22px 24px; }
.episode-card-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e8dfce;
    text-decoration: none;
}
.episode-image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 120px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(240,180,60,.45), rgba(23,20,17,.10));
    color: var(--ink);
    font-weight: 950;
    font-size: clamp(1.35rem, 4vw, 2.2rem);
    letter-spacing: -.04em;
}
.episode-card h3 a, .episode-row h2 a { text-decoration: none; }
.episode-list { display: grid; gap: 14px; }
.episode-row {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
    padding: 18px;
}
.episode-row-image {
    display: block;
    width: 170px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 18px;
    background: #e8dfce;
    text-decoration: none;
}
.episode-row-image .episode-image-placeholder {
    min-height: 0;
    font-size: 1.25rem;
}
.episode-detail { padding: clamp(26px, 5vw, 54px); }
.episode-detail h1 {
    max-width: 920px;
    font-size: clamp(1.85rem, 4.4vw, 3.25rem);
    line-height: 1.04;
    letter-spacing: -.045em;
    margin-bottom: 10px;
}
.episode-detail .lead {
    max-width: 820px;
    font-size: clamp(1rem, 2vw, 1.12rem);
    line-height: 1.5;
}
.episode-detail-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 520px;
    overflow: hidden;
    border-radius: 24px;
    margin: 24px 0 10px;
    background: #e8dfce;
}
.shownotes {
    margin-top: 26px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    white-space: normal;
}
.date-line, .muted { color: var(--muted); font-size: .93rem; }
.pill {
    display: inline-flex;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(0,0,0,.07);
    color: var(--ink);
    font-weight: 800;
    font-size: .84rem;
    white-space: nowrap;
}
.pill.green { background: rgba(22,121,79,.12); color: var(--success); }
.notice {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(240,180,60,.12);
    margin: 0 0 16px;
}
.notice.success { background: rgba(22,121,79,.10); color: var(--success); }
.notice.danger { background: rgba(180,35,24,.10); color: var(--danger); }
.login-body {
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-wrap { width: min(480px, 100%); }
.login-card { padding: 30px; }
.form-stack { display: grid; gap: 16px; }
.wide-form { padding: 24px; }
label { display: grid; gap: 7px; font-weight: 800; }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 13px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 500;
}
textarea { resize: vertical; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.upload-box {
    border: 1px dashed rgba(23,20,17,.28);
    border-radius: 20px;
    padding: 18px;
    background: rgba(255,255,255,.38);
}
.media-upload-box { display: grid; gap: 14px; }
.admin-image-preview {
    display: grid;
    gap: 8px;
    margin: 0;
    max-width: 360px;
}
.admin-image-preview img {
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    background: #e8dfce;
}
.admin-image-preview figcaption { color: var(--muted); font-size: .9rem; }
.check-row {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
}
.check-row input { width: auto; }
.admin-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 15px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.table-actions { display: flex; gap: 12px; justify-content: flex-end; white-space: nowrap; }
.admin-thumb {
    display: inline-grid;
    place-items: center;
    width: 88px;
    height: 56px;
    border-radius: 14px;
    background: #e8dfce;
    color: var(--ink);
    font-weight: 950;
}
.admin-thumb.placeholder {
    background: linear-gradient(135deg, rgba(240,180,60,.45), rgba(23,20,17,.10));
}
.site-footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); }
.footer-grid { display: flex; justify-content: space-between; gap: 14px; }

@media (max-width: 760px) {
    .wrap { width: min(100% - 22px, 1120px); }
    .header-grid { align-items: center; }
    .brand span:last-child { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }
    .main-nav { flex: 1; justify-content: flex-start; }
    .episode-grid, .form-grid.two { grid-template-columns: 1fr; }
    .episode-row { grid-template-columns: 1fr; }
    .episode-row-image { width: 100%; aspect-ratio: 16 / 9; }
    .episode-row .pill { justify-self: start; }
    .section-title-row { align-items: start; flex-direction: column; }
    .footer-grid { flex-direction: column; }

    .post-hero-nav { justify-content: flex-start; }
    .post-hero-nav .main-nav { border-radius: 22px; width: 100%; }
}

/* Homepage met Korte Podcast-banner in zandkleurige stijl */
.brand-hero {
    overflow: hidden;
    padding: 0;
    background: #eee1cf;
}
.brand-hero-banner {
    width: 100%;
    height: auto;
    display: block;
}
.episode-home-block {
    margin-top: 26px;
}
.home-section-intro {
    max-width: 760px;
    margin-bottom: 20px;
}
.home-section-intro h1 {
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    letter-spacing: -.055em;
    margin-bottom: 10px;
}
.home-section-intro p:not(.eyebrow) {
    color: var(--muted);
    font-size: 1.08rem;
    max-width: 620px;
}
.episode-grid-home {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.empty-card {
    padding: clamp(22px, 4vw, 34px);
}
.empty-card h2 {
    margin-bottom: 8px;
}

@media (max-width: 920px) {
    .episode-grid-home {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .brand-hero {
        border-radius: 20px;
    }
    .episode-grid-home {
        grid-template-columns: 1fr;
    }
}

/* Detailpagina aflevering: rustiger en compacter */
.episode-detail {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
    padding: clamp(22px, 4vw, 38px);
}
.episode-detail-header {
    margin-bottom: 18px;
}
.episode-detail h1 {
    max-width: 780px;
    font-size: clamp(1.35rem, 3.1vw, 2.15rem);
    line-height: 1.12;
    letter-spacing: -.035em;
    margin-bottom: 8px;
}
.episode-detail-image {
    margin: 18px 0 20px;
    border-radius: 20px;
    max-height: 430px;
}
.episode-detail-text {
    max-width: 720px;
    color: var(--ink);
    font-size: clamp(.98rem, 1.5vw, 1.06rem);
    line-height: 1.62;
    margin: 0 0 18px;
}
.episode-detail .audio-player {
    margin-top: 10px;
}
.field-hint {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 500;
}

@media (max-width: 640px) {
    .episode-detail h1 {
        font-size: 1.32rem;
    }
    .episode-detail {
        padding: 20px;
    }
}

/* Admin users */
.admin-user-list {
    display: grid;
    gap: 1rem;
}
.admin-user-card {
    display: grid;
    gap: 1rem;
}
.admin-user-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.admin-user-heading h3 {
    margin: 0 0 .25rem;
}
.mini-admin-form {
    display: grid;
    gap: .85rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

/* Homepage paginering */
.home-pagination {
    justify-content: center;
    margin-top: 28px;
}
.home-pagination .button {
    min-width: 46px;
    padding-left: 16px;
    padding-right: 16px;
}
.pagination-gap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 4px;
    color: var(--muted);
    font-weight: 900;
}

/* Extra audio beheer + mediabibliotheek */
.media-upload-box select,
.extra-audio-admin-box select {
    width: 100%;
}

.extra-audio-new-list {
    display: grid;
    gap: 1rem;
    margin: 1rem 0;
}

.extra-audio-new-row,
.extra-audio-admin-item {
    border: 1px solid rgba(42, 31, 21, .14);
    border-radius: 18px;
    padding: 1rem;
    background: rgba(255, 249, 237, .72);
}

.extra-audio-admin-item textarea,
.extra-audio-new-row textarea {
    min-height: 5.5rem;
}

.episode-audio-description {
    margin: -.35rem 0 1rem;
    max-width: 68ch;
    color: var(--muted, #6f6255);
    line-height: 1.55;
}

/* Uploads-mediakiezer: lijkt op kiezen bij uploaden, maar bladert door serverbestanden */
.media-file-picker {
    position: relative;
    margin-top: .45rem;
}

.media-file-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

.file-button {
    appearance: none;
    border: 1px solid rgba(42, 31, 21, .22);
    background: rgba(255, 255, 255, .78);
    color: var(--ink, #21170f);
    border-radius: 12px;
    padding: .72rem 1rem;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: inset 0 -1px 0 rgba(42, 31, 21, .06);
}

.file-button:hover,
.file-button:focus-visible {
    background: #fff;
    outline: 2px solid rgba(42, 31, 21, .16);
    outline-offset: 2px;
}

.file-name-display {
    color: var(--muted, #6f6255);
    font-size: .95rem;
    min-width: 14rem;
}

.media-browser-panel {
    margin-top: .75rem;
    padding: 1rem;
    border: 1px solid rgba(42, 31, 21, .16);
    border-radius: 18px;
    background: rgba(255, 251, 242, .98);
    box-shadow: 0 18px 45px rgba(42, 31, 21, .14);
    max-height: 520px;
    overflow: auto;
    z-index: 20;
}

.media-browser-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .85rem;
}

.media-browser-head strong,
.media-browser-head small {
    display: block;
}

.media-browser-head small {
    margin-top: .18rem;
    color: var(--muted, #6f6255);
}

.media-search {
    width: 100%;
    margin-bottom: .8rem;
}

.media-folder-list {
    display: grid;
    gap: .65rem;
}

.media-folder {
    border: 1px solid rgba(42, 31, 21, .1);
    border-radius: 14px;
    background: rgba(255,255,255,.45);
    overflow: hidden;
}

.media-folder summary {
    cursor: pointer;
    padding: .75rem .9rem;
    font-weight: 900;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.media-folder summary::-webkit-details-marker {
    display: none;
}

.media-folder summary::before {
    content: '▸';
    display: inline-block;
    transform: rotate(0deg);
    margin-right: .35rem;
}

.media-folder[open] summary::before {
    transform: rotate(90deg);
}

.media-folder summary span {
    color: var(--muted, #6f6255);
    font-weight: 700;
    font-size: .85rem;
}

.media-folder-items {
    display: grid;
    gap: .45rem;
    padding: 0 .75rem .75rem;
}

.media-item {
    width: 100%;
    border: 1px solid rgba(42, 31, 21, .12);
    background: rgba(255, 255, 255, .8);
    color: inherit;
    border-radius: 12px;
    padding: .55rem .65rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    text-align: left;
    cursor: pointer;
}

.media-item:hover,
.media-item.is-selected {
    border-color: rgba(42, 31, 21, .34);
    background: #fff;
}

.media-item-empty {
    margin-bottom: .7rem;
    justify-content: center;
    color: var(--muted, #6f6255);
}

.media-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 44px;
    border-radius: 9px;
    overflow: hidden;
    background: rgba(42, 31, 21, .08);
}

.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-audio-icon {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(42, 31, 21, .1);
    font-weight: 900;
}

.media-item-text {
    min-width: 0;
    display: grid;
    gap: .12rem;
}

.media-item-text span,
.media-item-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-item-text small {
    color: var(--muted, #6f6255);
}

@media (max-width: 640px) {
    .media-browser-panel {
        max-height: 70vh;
        padding: .8rem;
    }

    .file-name-display {
        min-width: 0;
        width: 100%;
    }
}


/* Hoofdaudio en extra-audio titels compacter */
.episode-audio-list {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}

.episode-audio-item {
    border-top: 1px solid rgba(42, 31, 21, .12);
    padding-top: 1rem;
}

.episode-audio-title {
    margin: 0 0 .45rem;
    font-size: clamp(1rem, 1.6vw, 1.18rem);
    line-height: 1.2;
    letter-spacing: -.015em;
}

.episode-audio-item .audio-player {
    margin-top: .45rem;
}
