/* Site public Mindcast — feuille unique, sans dépendance externe. */

:root {
    --fond: #fbfaf8;
    --surface: #fff;
    --texte: #1c1b19;
    --atténué: #6b6862;
    --trait: #e3dfd8;
    --accent: #a8391f;
    --rayon: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --fond: #161513;
        --surface: #201f1c;
        --texte: #f0ede8;
        --atténué: #9c978e;
        --trait: #332f2a;
        --accent: #e8815f;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--fond);
    color: var(--texte);
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
    max-width: 56rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 4rem;
}

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

h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .75rem; }

.lead { color: var(--atténué); font-size: 1.05rem; }
.meta { color: var(--atténué); font-size: .875rem; margin: .25rem 0; }

header.site,
footer.site {
    border-bottom: 1px solid var(--trait);
    padding: 1rem 1.25rem;
}

header.site a {
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
    letter-spacing: -.01em;
}

footer.site {
    border-bottom: 0;
    border-top: 1px solid var(--trait);
    color: var(--atténué);
    font-size: .875rem;
}

/* Pochettes — toujours carrées, pour que la grille reste régulière même
   lorsqu'un podcast n'a pas d'image. */
.artwork {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--rayon);
    background: var(--trait);
    display: block;
}

.placeholder { border: 1px dashed var(--trait); }

.grid {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.card h2 { margin: .75rem 0 .25rem; font-size: 1.05rem; }
.card h2 a { text-decoration: none; }
.card p { margin: .25rem 0; font-size: .9rem; }

.podcast-header {
    display: grid;
    grid-template-columns: 12rem 1fr;
    gap: 1.75rem;
    align-items: start;
    margin-bottom: 1rem;
}

@media (max-width: 38rem) {
    .podcast-header { grid-template-columns: 1fr; }
    .podcast-header .artwork { max-width: 12rem; }
}

.description :first-child { margin-top: 0; }

.button {
    display: inline-block;
    padding: .5rem 1rem;
    background: var(--accent);
    color: var(--fond);
    border-radius: var(--rayon);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
}

audio {
    width: 100%;
    margin: 1.25rem 0;
}

.episodes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.episodes li {
    padding: .9rem 0;
    border-top: 1px solid var(--trait);
}

.episodes a {
    font-weight: 500;
    text-decoration: none;
}

.credits {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
}

.badge {
    background: var(--trait);
    color: var(--texte);
    border-radius: 4px;
    padding: .05rem .4rem;
    font-size: .78rem;
}

.breadcrumb {
    font-size: .875rem;
    margin-bottom: 1rem;
}

/* Les descriptions viennent de Castopod et peuvent contenir de larges
   tableaux ou blocs de code : on les contient plutôt que de laisser la page
   défiler horizontalement. */
.description table,
.description pre {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

.description img {
    max-width: 100%;
    height: auto;
}

/* --- Lecteur d'épisode -------------------------------------------------- */

.player {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
}

.player audio { margin: 0 0 .75rem; }

.player-controls {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.player-controls button,
.player-controls .download {
    font: inherit;
    font-size: .875rem;
    padding: .4rem .7rem;
    background: transparent;
    color: var(--texte);
    border: 1px solid var(--trait);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}

.player-controls button:hover,
.player-controls .download:hover { border-color: var(--accent); color: var(--accent); }

/* La vitesse est l'état le plus consulté du lecteur : largeur fixe pour que
   les boutons voisins ne se déplacent pas à chaque changement. */
.player-controls [data-speed] { min-width: 4rem; font-variant-numeric: tabular-nums; }

.player-status:empty { display: none; }
.player-status { margin: .6rem 0 0; }

/* --- Chapitres ---------------------------------------------------------- */

.chapters { list-style: none; padding: 0; margin: 0; }

.chapters li + li { border-top: 1px solid var(--trait); }

.chapter {
    display: flex;
    gap: .75rem;
    width: 100%;
    padding: .5rem .25rem;
    font: inherit;
    text-align: left;
    background: none;
    border: 0;
    color: var(--texte);
    cursor: pointer;
    border-radius: 6px;
}

.chapter:hover { background: var(--trait); }
.chapter.is-current { color: var(--accent); font-weight: 500; }

.chapter-time {
    color: var(--atténué);
    font-variant-numeric: tabular-nums;
    min-width: 3.5rem;
}

.chapter.is-current .chapter-time { color: var(--accent); }

/* --- Abonnement --------------------------------------------------------- */

.platforms {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.platform {
    display: flex;
    flex-direction: column;
    padding: .5rem .85rem;
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
    text-decoration: none;
    color: var(--texte);
    font-size: .9rem;
    line-height: 1.3;
}

.platform:hover { border-color: var(--accent); color: var(--accent); }
.platform .meta { font-size: .75rem; margin: 0; }

/* Le flux RSS est le lien universel : il est mis en avant. */
.platform-rss { border-color: var(--accent); color: var(--accent); }

/* --- Épisode précédent / suivant ---------------------------------------- */

.neighbours {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
    border-top: 1px solid var(--trait);
    padding-top: 1rem;
}

.neighbour {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    text-decoration: none;
    color: var(--texte);
    font-size: .9rem;
}

.neighbour:hover { color: var(--accent); }

/* Le suivant s'aligne à droite, et occupe la seconde colonne même lorsqu'il
   n'y a pas de précédent — sans quoi il glisserait à gauche. */
.neighbour-next { text-align: right; grid-column: 2; }

@media (max-width: 34rem) {
    .neighbours { grid-template-columns: 1fr; }
    .neighbour-next { text-align: left; grid-column: 1; }
}
