/* ==========================================================================
   Biscandine — feuille de style commune
   Réutilisable par les futures pages (blog, forum…) : en-tête, pied de page,
   sections et cartes ne dépendent que des classes ci-dessous.
   Aucune ressource externe : pas de police web, pas de CDN, pas de cookie.
   ========================================================================== */

:root {
  /* Palette */
  --brique: #c15b45;          /* rouge brique clair (193,91,69) */
  --brique-fonce: #9e4431;    /* même teinte, assez sombre pour du texte blanc */
  --brique-nuit: #6f2d20;
  --jaune: #fff68f;           /* jaune pastel (255,246,143) */
  --jaune-doux: #fffbd6;
  --creme: #fdfaf3;
  --papier: #ffffff;
  --encre: #2b211d;
  --encre-douce: #5d4f49;
  --trait: #eadfcf;

  --fond: var(--creme);
  --fond-alt: var(--jaune-doux);
  --carte: var(--papier);
  --texte: var(--encre);
  --texte-doux: var(--encre-douce);
  --lien: var(--brique-fonce);

  /* Typographie (polices système) */
  --police-titre: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --police-texte: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, sans-serif;

  --rayon: 14px;
  --ombre: 0 1px 2px rgba(60, 30, 20, .06), 0 6px 18px rgba(60, 30, 20, .07);
  --ombre-forte: 0 2px 4px rgba(60, 30, 20, .08), 0 14px 32px rgba(60, 30, 20, .14);
  --largeur: 1140px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #1d1715;
    --fond-alt: #241c19;
    --carte: #2a211e;
    --texte: #f3ebe3;
    --texte-doux: #c9bab0;
    --trait: #3d302b;
    --lien: #ffb39f;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    --ombre-forte: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 32px rgba(0, 0, 0, .4);
  }
}

/* --- Base ---------------------------------------------------------------- */

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

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--police-texte);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--police-titre); line-height: 1.2; margin: 0; }
p { margin: 0 0 1em; }
a { color: var(--lien); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
img, svg { display: block; max-width: 100%; }

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

.conteneur { width: min(100% - 2.5rem, var(--largeur)); margin-inline: auto; }

.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;
}

.lien-evitement {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--jaune); color: var(--encre); padding: .6rem 1rem;
  border-radius: 8px; font-weight: 600; text-decoration: none;
}
.lien-evitement:focus { top: 1rem; }

/* --- En-tête ------------------------------------------------------------- */

.entete {
  position: sticky; top: 0; z-index: 50;
  background: var(--brique-nuit);
  background: color-mix(in srgb, var(--brique-nuit) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  border-bottom: 1px solid rgba(255, 246, 143, .18);
}
.entete .conteneur {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 4rem;
}

.marque {
  display: flex; align-items: center; gap: .6rem;
  color: #fff; text-decoration: none;
  font-family: var(--police-titre); font-size: 1.35rem; font-weight: 700;
  letter-spacing: .01em;
}
.marque img { width: 2.5rem; height: 2.5rem; flex: none; border-radius: 9px; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }

.nav { margin-left: auto; }
.nav ul {
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem;
  list-style: none; margin: 0; padding: 0;
}
.nav a, .nav .bientot {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .7rem; border-radius: 999px;
  color: #fff; text-decoration: none; font-size: .95rem;
}
.nav a:hover { background: rgba(255, 255, 255, .12); }
.nav .bientot { opacity: .6; cursor: default; }
.nav .bientot small {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
  border: 1px solid currentColor; border-radius: 999px; padding: 0 .4rem;
}
.nav .langue a {
  border: 1px solid rgba(255, 246, 143, .7); color: var(--jaune); font-weight: 600;
}
.nav .langue a:hover { background: var(--jaune); color: var(--encre); }

/* Menu repliable sans JavaScript (petits écrans) */
.menu-bouton { display: none; }

@media (max-width: 880px) {
  .entete .conteneur { flex-wrap: wrap; }
  .menu-bouton {
    display: inline-flex; margin-left: auto; cursor: pointer;
    padding: .45rem .8rem; border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .35); color: #fff; font-size: .95rem;
  }
  .nav { display: none; width: 100%; margin: 0; padding-bottom: .8rem; }
  #menu-ouvert:checked ~ .nav { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; }
  .nav a, .nav .bientot { padding: .6rem .8rem; border-radius: 8px; }
  .nav .langue a { justify-content: center; }
}
#menu-ouvert { position: absolute; opacity: 0; pointer-events: none; }
#menu-ouvert:focus-visible + .menu-bouton { outline: 3px solid var(--jaune); outline-offset: 2px; }

/* --- Bandeau d'accueil ---------------------------------------------------- */

.accueil {
  position: relative; overflow: hidden; isolation: isolate;
  color: #fff;
  background:
    radial-gradient(120% 90% at 85% 10%, rgba(255, 246, 143, .22), transparent 55%),
    linear-gradient(135deg, var(--brique) 0%, var(--brique-fonce) 55%, var(--brique-nuit) 100%);
  padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem);
}
/* damier discret, qui s'efface vers la gauche */
.accueil::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: repeating-conic-gradient(rgba(255, 255, 255, .07) 0 25%, transparent 0 50%) 0 0 / 56px 56px;
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 95%);
  mask-image: linear-gradient(100deg, transparent 30%, #000 95%);
}
.accueil .conteneur { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center; }
.accueil h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 700; letter-spacing: -.01em;
}
.accueil h1 span { color: var(--jaune); }
.accroche {
  font-family: var(--police-titre); font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  margin: 1rem 0 1.2rem; color: #fff7ea; max-width: 34ch;
}
.accueil p.intro { color: rgba(255, 255, 255, .88); max-width: 56ch; }

.atouts {
  display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 1.6rem 0 0;
}
.atouts li {
  background: rgba(255, 246, 143, .16); border: 1px solid rgba(255, 246, 143, .45);
  color: var(--jaune); border-radius: 999px; padding: .3rem .85rem; font-size: .9rem; font-weight: 600;
}

/* sommaire visuel à droite du bandeau */
.sommaire {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem;
  list-style: none; margin: 0; padding: 0;
}
.sommaire a {
  display: flex; flex-direction: column; gap: .5rem; height: 100%;
  padding: 1rem 1.1rem; border-radius: var(--rayon);
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
  color: #fff; text-decoration: none; font-weight: 600;
  transition: background .2s, transform .2s, border-color .2s;
}
.sommaire a:hover { background: rgba(255, 246, 143, .18); border-color: var(--jaune); transform: translateY(-2px); }
.sommaire svg { width: 1.7rem; height: 1.7rem; color: var(--jaune); }
.sommaire small { font-weight: 400; opacity: .8; font-size: .82rem; }

@media (max-width: 880px) {
  .accueil .conteneur { grid-template-columns: 1fr; }
}

/* --- Sections ------------------------------------------------------------- */

.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section:nth-of-type(even) { background: var(--fond-alt); }

.section-tete { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 2rem; max-width: 70ch; }
.section-tete .pastille {
  flex: none; display: grid; place-items: center;
  width: 3.1rem; height: 3.1rem; border-radius: 12px;
  background: var(--brique); color: var(--jaune);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15);
}
.section-tete .pastille svg { width: 1.7rem; height: 1.7rem; }
.section-tete .pastille--image {
  width: 3.5rem; height: 3.5rem; border-radius: 14px; background: none;
  box-shadow: 0 3px 10px rgba(111, 45, 32, .25);
}
.section-tete h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); color: var(--texte); }
.section-tete p { margin: .4rem 0 0; color: var(--texte-doux); }

.grille {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

/* --- Cartes --------------------------------------------------------------- */

.carte {
  position: relative; display: flex; flex-direction: column;
  background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: 1.4rem 1.4rem 1.2rem; box-shadow: var(--ombre);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.carte::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 4px;
  border-radius: var(--rayon) var(--rayon) 0 0;
  background: linear-gradient(90deg, var(--brique), var(--jaune));
  opacity: 0; transition: opacity .2s;
}
.carte:hover { box-shadow: var(--ombre-forte); transform: translateY(-3px); }
.carte:hover::before { opacity: 1; }

.carte-tete { display: flex; gap: .9rem; align-items: center; margin-bottom: .8rem; }
.carte-tete h3 { margin-bottom: 0; }
.appli {
  flex: none; width: 64px; height: 64px; border-radius: 15px;
  background: var(--jaune-doux);
  box-shadow: 0 0 0 1px rgba(158, 68, 49, .25), 0 3px 8px rgba(60, 30, 20, .15);
  transition: transform .2s;
}
.carte:hover .appli { transform: rotate(-3deg) scale(1.04); }
@media (prefers-color-scheme: dark) { .appli { box-shadow: 0 0 0 1px rgba(255, 246, 143, .25), 0 3px 8px rgba(0, 0, 0, .4); } }

.carte .surtitre {
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--brique); margin-bottom: .35rem;
}
@media (prefers-color-scheme: dark) { .carte-tete { display: flex; gap: .9rem; align-items: center; margin-bottom: .8rem; }
.carte-tete h3 { margin-bottom: 0; }
.appli {
  flex: none; width: 64px; height: 64px; border-radius: 15px;
  background: var(--jaune-doux);
  box-shadow: 0 0 0 1px rgba(158, 68, 49, .25), 0 3px 8px rgba(60, 30, 20, .15);
  transition: transform .2s;
}
.carte:hover .appli { transform: rotate(-3deg) scale(1.04); }
@media (prefers-color-scheme: dark) { .appli { box-shadow: 0 0 0 1px rgba(255, 246, 143, .25), 0 3px 8px rgba(0, 0, 0, .4); } }

.carte .surtitre { color: #f29a84; } }
.carte h3 { font-size: 1.4rem; margin-bottom: .55rem; }
.carte p { color: var(--texte-doux); font-size: .98rem; }
.carte .etiquettes {
  display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0 0 1rem;
}
.carte .etiquettes li {
  font-size: .78rem; padding: .1rem .55rem; border-radius: 999px;
  background: var(--jaune-doux); color: var(--encre-douce); border: 1px solid #f1e6a8;
}
@media (prefers-color-scheme: dark) {
  .carte .etiquettes li { background: #3a2f22; color: #f0e2a0; border-color: #54452c; }
}

.carte--large { grid-column: 1 / -1; }

/* --- Boutons -------------------------------------------------------------- */

.liens { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .4rem; }
.bouton {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .95rem; border-radius: 999px;
  font-size: .9rem; font-weight: 600; text-decoration: none; line-height: 1.3;
  border: 1.5px solid var(--brique-fonce); color: var(--brique-fonce); background: transparent;
  transition: background .15s, color .15s;
}
.bouton svg { width: 1rem; height: 1rem; flex: none; }
.bouton:hover { background: var(--brique-fonce); color: #fff; }
.bouton--plein { background: var(--brique-fonce); color: #fff; }
.bouton--plein:hover { background: var(--brique-nuit); border-color: var(--brique-nuit); }
.bouton--jaune { background: var(--jaune); border-color: #d9cf5a; color: var(--encre); }
.bouton--jaune:hover { background: #fff0a0; color: var(--encre); border-color: var(--brique-fonce); }
@media (prefers-color-scheme: dark) {
  .bouton { border-color: #f29a84; color: #ffcfc2; }
  .bouton:hover { background: #f29a84; color: #1d1715; }
  .bouton--plein { background: var(--brique); border-color: var(--brique); color: #fff; }
  .bouton--plein:hover { background: var(--brique-fonce); border-color: var(--brique-fonce); color: #fff; }
  .bouton--jaune { background: var(--jaune); border-color: var(--jaune); color: var(--encre); }
  .bouton--jaune:hover { background: #fff0a0; border-color: #fff0a0; color: var(--encre); }
}

/* --- Bibliothèque (livres numérisés) ------------------------------------- */

.livres-titre {
  font-family: var(--police-titre); font-size: 1.1rem; margin: .6rem 0 .7rem;
  display: flex; align-items: center; gap: .6rem;
}
.livres-titre::after { content: ""; flex: 1; height: 1px; background: var(--trait); }
.livres {
  list-style: none; margin: 0 0 1rem; padding: 0;
  display: grid; gap: .8rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}
.livre {
  display: flex; gap: .85rem; align-items: stretch;
  padding: .8rem; border-radius: 10px;
  border: 1px solid var(--trait); background: var(--fond);
  transition: border-color .2s;
}
.livre:hover { border-color: var(--brique); }
.livres--en-cours .livre { border-style: dashed; }
.livre .dos {
  flex: none; width: 2.6rem; min-height: 5.2rem; border-radius: 3px 6px 6px 3px;
  background: linear-gradient(90deg, rgba(0,0,0,.25) 0 4px, transparent 4px), var(--couleur, var(--brique));
  box-shadow: inset -2px 0 0 rgba(255, 255, 255, .15);
  display: grid; place-items: center;
  color: var(--jaune); font-family: var(--police-titre); font-weight: 700; font-size: .85rem;
}
.livre-corps { display: flex; flex-direction: column; min-width: 0; }
.livre-corps .badge { margin-bottom: .35rem; }
.livre strong { display: block; font-family: var(--police-titre); font-size: 1.05rem; line-height: 1.25; }
.livre .auteur { display: block; font-size: .85rem; color: var(--texte-doux); margin-top: .2rem; }
.livre .note { display: block; font-size: .85rem; font-style: italic; color: var(--texte); margin-top: .35rem; }
.livre-liens { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: auto; padding-top: .5rem; }
.livre-liens a {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .85rem; font-weight: 600; text-decoration: none;
}
.livre-liens a:hover { text-decoration: underline; }
.livre-liens svg { width: .95rem; height: .95rem; }

/* --- Bientôt -------------------------------------------------------------- */

.carte--bientot { border-style: dashed; background: transparent; box-shadow: none; }
.carte--bientot:hover { transform: none; box-shadow: none; }
.carte--bientot::before { display: none; }
.badge {
  align-self: flex-start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: var(--jaune); color: var(--encre); border-radius: 999px; padding: .15rem .6rem; margin-bottom: .7rem;
}

/* --- Pied de page ---------------------------------------------------------- */

.pied {
  background: var(--brique-nuit); color: rgba(255, 255, 255, .82);
  padding: 2.5rem 0; font-size: .92rem;
}
.pied .conteneur { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.pied a { color: var(--jaune); }
.pied p { margin: 0; }

/* --- Impression ------------------------------------------------------------ */

@media print {
  .entete, .menu-bouton, .lien-evitement, .sommaire { display: none !important; }
  .accueil { background: none; color: #000; padding: 1rem 0; }
  .accueil::before { display: none; }
  .accueil h1 span, .accroche, .accueil p.intro { color: #000; }
  .carte { box-shadow: none; break-inside: avoid; }
  .bouton::after { content: " (" attr(href) ")"; font-weight: 400; font-size: .8em; }
}

/* Section à une seule carte : titre à gauche, carte à droite */
@media (min-width: 881px) {
  .section--compacte .conteneur {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 3rem; align-items: start;
  }
  .section--compacte .section-tete { margin-bottom: 0; position: sticky; top: 6rem; }
  .section--compacte .grille { grid-template-columns: 1fr; }
}
