/* Avant on croyait que... | feuille de style unique */
:root {
  --ciel: #f5f1d9;      /* fond */
  --nuit: #14215C;      /* texte et titres */
  --soleil: #FFB81C;    /* accent chaud, focus */
  --corail: #E8434B;    /* la croyance barree */
  --papier: #FFFFFF;    /* blocs de contenu */
  --brume: #4A5690;     /* texte secondaire */

  --titre: "Bricolage Grotesque", "Arial Rounded MT Bold", system-ui, sans-serif;
  --texte: "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;

  --mesure: 38rem;
  --large: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ciel);
  color: var(--nuit);
  font-family: var(--texte);
  font-size: 1.125rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--nuit); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--corail); }

:focus-visible { outline: 3px solid var(--soleil); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--titre); font-weight: 800; line-height: 1.1; margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: 1.35rem; }

.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 1rem; top: 1rem; background: var(--papier); padding: .5rem 1rem; z-index: 10; }

/* En-tete */
.entete {
  max-width: var(--large);
  margin: 0 auto;
  padding: 1.25rem 1.25rem .5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 2rem;
  align-items: baseline;
  justify-content: space-between;
}
.marque { font-family: var(--titre); font-weight: 800; font-size: 1.25rem; text-decoration: none; }
.entete ul { list-style: none; display: flex; gap: 1.25rem; margin: 0; padding: 0; }
.entete nav a { text-decoration: none; font-weight: 700; }
.entete nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--soleil); text-decoration-thickness: 4px; }

main { max-width: var(--large); margin: 0 auto; padding: 0 1.25rem 3rem; }

/* Titre de la page d'accueil : l'element marquant du site */
.accueil-titre { padding: 1.5rem 0 2.5rem; }
/* Pleine largeur sur petit ecran, puis environ la moitie sur grand ecran */
.image-titre { display: block; width: clamp(50%, 28rem, 100%); border-radius: 1.5rem; margin: 0 auto 2rem; }
.image-episode { width: min(100%, 26rem); border-radius: 1.5rem; margin: 1.25rem auto; }
/* Bords fondus dans le fond de page */
.image-fondue {
  width: min(100%, 30rem); margin: 2rem auto;
  /* Deux degrades croises : seuls les bords s'estompent, le reste reste net */
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 10%, #000 90%, transparent),
    linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(to right, transparent, #000 10%, #000 90%, transparent),
    linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
          mask-composite: intersect;
}
.grand-titre {
  font-size: clamp(2.75rem, 1.5rem + 6vw, 6rem);
  letter-spacing: -.02em;
  margin: 0;
}
.croyance-petite s {
  text-decoration-color: color-mix(in srgb, var(--corail) 35%, transparent);
  text-decoration-thickness: .12em;
}
.correction {
  font-size: 1.25rem;
  margin: 1rem 0 0;
  padding-left: 1rem;
  border-left: 5px solid var(--soleil);
}

/* Blocs de contenu */
.intro, .abonnement, .page-texte, .episode {
  max-width: var(--mesure);
}
.intro { margin-bottom: 3rem; }
.chapeau { font-size: 1.3rem; font-weight: 700; }

/* Grand lien vers les episodes */
.vers-episodes { margin: 0 0 3rem; }
.grand-lien {
  display: inline-block;
  background: var(--soleil);
  color: var(--nuit);
  font-family: var(--titre);
  font-weight: 800;
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem);
  text-decoration: none;
  padding: .6em 1.2em;
  border-radius: 1rem;
}
.grand-lien::after { content: " →"; content: " →" / ""; } /* fleche ignoree par les lecteurs d'ecran */
/* Sur petit ecran, la fleche ferait passer le texte sur deux lignes */
@media (max-width: 30rem) { .grand-lien::after { content: none; } }
.grand-lien:hover { background: var(--nuit); color: var(--papier); }
/* Le focus jaune ne se verrait pas sur le fond jaune */
.grand-lien:focus-visible { outline-color: var(--nuit); }

/* Badges des plateformes d'ecoute : cote a cote, meme hauteur */
.ecouter { margin-bottom: 3rem; }
.ecouter .vers-episodes { margin-bottom: 1.5rem; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.badges a { display: block; border-radius: 8px; }
.badges img { display: block; width: auto; height: 52px; }
/* Plateforme pas encore disponible : badge grise, sans lien */
.badge-bientot { display: flex; align-items: center; gap: .5rem; }
.badge-bientot img { filter: grayscale(1); opacity: .45; }
.badge-bientot span { color: var(--brume); font-weight: 700; font-size: 1rem; }

.lecteur { margin: 1.25rem 0; }
.lecteur audio { width: 100%; }
.lecteur figcaption { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--brume); font-size: 1rem; margin-top: .4rem; }

.abonnement { margin-top: 3rem; overflow-wrap: anywhere; }

/* Soutien : boutons TWINT et Patreon cote a cote */
.support-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.support-actions a { display: block; border-radius: 6px; }
.support-actions img { width: auto; height: 58px; border-radius: 6px; }

/* Pages de texte et episodes */
.page-texte h1, .episode h1 { font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem); margin-top: 1.5rem; }
.fil { margin: 1.5rem 0 0; font-weight: 700; }
.meta, .duree { color: var(--brume); font-size: 1rem; }
.croyance-petite { font-size: 1.15rem; }
.texte, .page-texte { overflow-wrap: break-word; }

.episodes-detail { padding: 0; list-style: none; }
.episodes-detail li {
  position: relative;
  background: var(--papier);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}
.episodes-detail h2 { font-size: 1.5rem; }
/* Carte entierement cliquable : le lien du titre couvre toute la carte,
   mais les lecteurs d'ecran n'annoncent que le titre */
.carte-lien { text-decoration: none; }
.carte-lien::after { content: ""; position: absolute; inset: 0; border-radius: 1rem; }
.episodes-detail li:hover .carte-lien { text-decoration: underline; text-decoration-color: var(--corail); }
.episodes-detail li:hover { box-shadow: 0 0 0 3px var(--nuit); }
/* Le focus entoure toute la carte, pas seulement le titre */
.carte-lien:focus-visible { outline: none; }
.carte-lien:focus-visible::after { outline: 3px solid var(--soleil); outline-offset: 3px; }
/* Numero au-dessus du titre, dans le lien (lu avec le titre) */
.episode-num { display: block; color: var(--brume); font-size: 1rem; font-weight: 700; margin-bottom: .2rem; }
.image-liste { width: min(100%, 20rem); border-radius: 1rem; margin: .75rem auto; }

.suite { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; }
.suite .suivant { margin-left: auto; }

/* Pied de page */
.pied {
  max-width: var(--large);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 2px solid var(--nuit);
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 2rem;
}
.pied p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
