/* ==========================================================================
   CORWIN LAB — design system
   Palette papier / encre / vermillon. Typographie système : aucune requête
   vers un serveur de polices (RGPD, et ça charge plus vite).
   ========================================================================== */

:root {
  --papier: #FCFBF8;
  --papier-2: #F4F1EA;
  --encre: #16130F;
  --encre-2: #2E2A24;
  --gris: #736E66;
  --gris-clair: #A8A29A;
  --ligne: #E6E0D8;
  /* Trois nuances, mesurées pour l'accessibilité :
     --accent       décor pur (surlignage, pastilles, filets) — jamais du texte
     --accent-texte texte courant : 5,11:1 sur crème (AA petit texte)
     --accent-fonce survol et pressé : 6,48:1 */
  --accent: #E4572E;
  --accent-texte: #C13E18;
  --accent-fonce: #A83214;
  --vert: #1F7A5A;

  --serif: Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --max: 1140px;
  --pad: clamp(18px, 4.5vw, 44px);
  --r: 3px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------------------------------------------------------------- typographie */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.022em;
  margin: 0;
  line-height: 1.08;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6.4vw, 4.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.25; }

p { margin: 0 0 1.05em; text-wrap: pretty; }

.lead {
  font-size: clamp(1.05rem, 1.7vw, 1.26rem);
  line-height: 1.55;
  color: var(--encre-2);
}

.muted { color: var(--gris); }

.kicker {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .17em;
  font-weight: 700;
  color: var(--accent-texte);
}

/* ---------------------------------------------------------------- entête */
.entete {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(252, 251, 248, .9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--ligne);
}

.entete-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 62px;
}

.marque {
  font-family: var(--serif);
  font-size: 1.24rem;
  letter-spacing: -.02em;
  text-decoration: none;
  white-space: nowrap;
}

.marque em {
  font-style: normal;
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: .93rem;
}

.nav a {
  text-decoration: none;
  color: var(--gris);
  transition: color .16s var(--ease);
}

.nav a:hover, .nav a[aria-current="page"] { color: var(--encre); }

.panier-btn {
  border: 1px solid var(--encre);
  border-radius: 100px;
  padding: 7px 15px;
  font-size: .88rem;
  font-weight: 600;
  background: transparent;
  color: var(--encre);
  cursor: pointer;
  font-family: var(--sans);
  transition: background .16s var(--ease), color .16s var(--ease);
}

.panier-btn:hover { background: var(--encre); color: var(--papier); }

.panier-btn span {
  display: inline-block;
  min-width: 1.15em;
  text-align: center;
}

/* ---------------------------------------------------------------- boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  border: 0;
  border-radius: var(--r);
  padding: 15px 28px;
  font-family: var(--sans);
  font-size: .97rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform .14s var(--ease), background .16s var(--ease),
              box-shadow .16s var(--ease);
}

.btn--accent { background: var(--accent-texte); color: #fff; }
.btn--accent:hover { background: var(--accent-fonce); transform: translateY(-1px); }

.btn--encre { background: var(--encre); color: var(--papier); }
.btn--encre:hover { transform: translateY(-1px); }

.btn--vide {
  background: transparent;
  color: var(--encre);
  box-shadow: inset 0 0 0 1px var(--encre);
}
.btn--vide:hover { background: var(--encre); color: var(--papier); }

.btn--large { padding: 17px 34px; font-size: 1.03rem; width: 100%; }

.btn:disabled { opacity: .55; cursor: progress; transform: none; }

/* ---------------------------------------------------------------- accueil */
.heros {
  padding: clamp(52px, 9vw, 104px) 0 clamp(38px, 6vw, 66px);
  border-bottom: 1px solid var(--ligne);
}

.heros-grille {
  display: grid;
  grid-template-columns: 1.35fr .95fr;
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
}

.heros h1 { margin-bottom: 22px; }

.heros .souligne {
  background-image: linear-gradient(transparent 68%, rgba(228, 87, 46, .22) 68%,
                                    rgba(228, 87, 46, .22) 94%, transparent 94%);
  padding: 0 .06em;
}

.prix-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 26px;
  padding: 11px 18px;
  background: var(--papier-2);
  border: 1px solid var(--ligne);
  border-radius: 100px;
}

.prix-tag b {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 400;
  line-height: 1;
}

.prix-tag small { color: var(--gris); font-size: .85rem; }

.heros-couverture { justify-self: center; }

/* Catalogue : le(s) livre(s) à gauche, la note éditoriale à droite.
   Cela évite qu'un catalogue d'un seul titre laisse un vide béant. */
.catalogue {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(250px, 330px);
  gap: clamp(34px, 5vw, 68px);
  align-items: start;
}

.catalogue-note {
  border-left: 2px solid var(--ligne);
  padding-left: clamp(20px, 3vw, 34px);
}

.catalogue-note h3 { font-size: 1.22rem; }
.catalogue-note p { color: var(--gris); font-size: .95rem; }
.catalogue-note .points li { font-size: .93rem; margin-bottom: 9px; }

/* ---------------------------------------------------------------- cartes livre */
/* Flex plutôt que grid : avec un seul titre, une grille laisse des colonnes
   vides qui déséquilibrent la section. En flex, la carte garde sa taille
   naturelle et les suivantes s'alignent au fur et à mesure des publications. */
.etagere {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(26px, 3.6vw, 44px);
}

.livre {
  display: flex;
  flex-direction: column;
  flex: 0 0 248px;
  max-width: 248px;
  text-decoration: none;
  color: inherit;
}

.livre-couv {
  position: relative;
  aspect-ratio: 900 / 1277;
  background: var(--papier-2);
  border: 1px solid var(--ligne);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(22, 19, 15, .05), 0 12px 26px -14px rgba(22, 19, 15, .28);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}

.livre:hover .livre-couv {
  transform: translateY(-4px);
  box-shadow: 0 2px 3px rgba(22, 19, 15, .06), 0 22px 42px -16px rgba(22, 19, 15, .34);
}

.livre-couv img { width: 100%; height: 100%; object-fit: cover; }

.livre-badge {
  position: absolute;
  top: 11px;
  left: 11px;
  background: var(--accent-texte);
  color: #fff;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 100px;
}

.livre-meta { padding-top: 15px; }

.livre-meta h3 { margin-bottom: 5px; }

.livre-sous {
  color: var(--gris);
  font-size: .92rem;
  line-height: 1.45;
  margin: 0 0 12px;
}

.livre-pied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--ligne);
}

.livre-prix {
  font-family: var(--serif);
  font-size: 1.42rem;
}

.livre-prix small { font-family: var(--sans); font-size: .76rem; color: var(--gris); }

.livre-cta {
  font-size: .86rem;
  font-weight: 650;
  color: var(--accent-texte);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- sections */
.section { padding: clamp(50px, 8vw, 92px) 0; }
.section--ligne { border-top: 1px solid var(--ligne); }
.section--sable { background: var(--papier-2); border-top: 1px solid var(--ligne); border-bottom: 1px solid var(--ligne); }

.entete-section { max-width: 640px; margin-bottom: clamp(30px, 4.5vw, 52px); }
.entete-section h2 { margin: 12px 0 14px; }

/* Deux colonnes texte : titre à gauche, argumentaire à droite.
   Passe sur une seule colonne en dessous de 780 px, sinon la mesure de ligne
   devient trop courte pour être confortable. */
.deux-colonnes {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(30px, 5vw, 70px);
  align-items: start;
}

/* ---------------------------------------------------------------- étapes */
.etapes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: clamp(24px, 3.4vw, 42px);
}

.etape-n {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--accent-texte);
  border-top: 2px solid var(--accent);
  padding-top: 12px;
  margin-bottom: 14px;
  display: block;
}

.etape h3 { margin-bottom: 9px; font-size: 1.24rem; }
.etape p { color: var(--gris); font-size: .95rem; margin: 0; }

/* ---------------------------------------------------------------- liste points */
.points { list-style: none; margin: 0; padding: 0; }

.points li {
  position: relative;
  padding-left: 27px;
  margin-bottom: 11px;
  color: var(--encre-2);
}

.points li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: .68em;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* ---------------------------------------------------------------- faq */
.faq { border-top: 1px solid var(--ligne); }

.faq details {
  border-bottom: 1px solid var(--ligne);
  padding: 19px 0;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-family: var(--serif);
  font-size: 1.14rem;
}

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

.faq summary::after {
  content: "+";
  font-family: var(--sans);
  font-size: 1.3rem;
  color: var(--accent-texte);
  line-height: 1;
  transition: transform .2s var(--ease);
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq details p { margin: 13px 0 0; color: var(--gris); max-width: 68ch; }

/* ---------------------------------------------------------------- fiche livre */
.fiche {
  display: grid;
  grid-template-columns: minmax(0, 330px) 1fr;
  gap: clamp(30px, 5vw, 68px);
  align-items: start;
  padding: clamp(38px, 6vw, 72px) 0;
}

.fiche-couv {
  position: sticky;
  top: 86px;
  border: 1px solid var(--ligne);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(22, 19, 15, .06), 0 26px 50px -20px rgba(22, 19, 15, .34);
}

.achat {
  background: var(--papier-2);
  border: 1px solid var(--ligne);
  border-radius: 5px;
  padding: 22px;
  margin: 26px 0 0;
}

.achat-prix {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.achat-prix b { font-family: var(--serif); font-size: 2.3rem; font-weight: 400; line-height: 1; }
.achat-prix small { color: var(--gris); font-size: .85rem; }

.achat-note {
  font-size: .84rem;
  color: var(--gris);
  margin: 12px 0 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.filet { height: 1px; background: var(--ligne); margin: 22px 0; border: 0; }

.detail-tab { width: 100%; border-collapse: collapse; font-size: .92rem; }
.detail-tab th {
  text-align: left;
  font-weight: 600;
  color: var(--gris);
  padding: 9px 0;
  width: 40%;
  vertical-align: top;
  border-bottom: 1px solid var(--ligne);
}
.detail-tab td { padding: 9px 0; border-bottom: 1px solid var(--ligne); vertical-align: top; }

/* ---------------------------------------------------------------- fil d'ariane */
.fil {
  font-size: .84rem;
  color: var(--gris);
  padding: 20px 0 0;
}
.fil a { text-decoration: none; color: var(--gris); }
.fil a:hover { color: var(--encre); }
.fil span { margin: 0 7px; color: var(--gris); }

/* ---------------------------------------------------------------- tiroir panier */
.voile {
  position: fixed;
  inset: 0;
  background: rgba(22, 19, 15, .42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s var(--ease);
  z-index: 90;
}
.voile[data-ouvert="true"] { opacity: 1; pointer-events: auto; }

.tiroir {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(406px, 100%);
  background: var(--papier);
  border-left: 1px solid var(--ligne);
  transform: translateX(102%);
  transition: transform .3s var(--ease);
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.tiroir[data-ouvert="true"] { transform: none; }

.tiroir-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 22px;
  border-bottom: 1px solid var(--ligne);
}
.tiroir-tete h2 { font-size: 1.22rem; }

.fermer {
  background: none;
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--gris);
  padding: 4px;
}
.fermer:hover { color: var(--encre); }

.tiroir-corps { flex: 1; overflow-y: auto; padding: 20px 22px; }

.tiroir-pied { border-top: 1px solid var(--ligne); padding: 18px 22px; }

.ligne-item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 13px;
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--ligne);
}
.ligne-item:last-child { border-bottom: 0; margin-bottom: 0; }

.ligne-couv {
  width: 54px;
  aspect-ratio: 900 / 1277;
  object-fit: cover;
  border: 1px solid var(--ligne);
  border-radius: 2px;
}

.ligne-t { font-size: .95rem; font-family: var(--serif); line-height: 1.25; }
.ligne-s { font-size: .8rem; color: var(--gris); margin-top: 3px; }

.ligne-x {
  background: none;
  border: 0;
  color: var(--gris);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 4px;
}
.ligne-x:hover { color: var(--accent-texte); }

.total-l {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 15px;
  font-size: .95rem;
}
.total-l b { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; }

.vide { text-align: center; color: var(--gris); padding: 40px 0; }
.vide p { font-family: var(--serif); font-size: 1.14rem; color: var(--encre); }

/* ---------------------------------------------------------------- remerciement */
.merci {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  padding: clamp(48px, 9vw, 110px) 0;
}

.coche {
  width: 62px;
  height: 62px;
  margin: 0 auto 26px;
  border-radius: 50%;
  background: var(--vert);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
}

.encart {
  background: var(--papier-2);
  border: 1px solid var(--ligne);
  border-radius: 5px;
  padding: 24px;
  margin-top: 30px;
  text-align: left;
}

/* ---------------------------------------------------------------- pied */
.pied {
  border-top: 1px solid var(--ligne);
  padding: 46px 0 36px;
  font-size: .9rem;
  color: var(--gris);
}

.pied-grille {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 34px;
}

.pied h4 {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--encre);
  margin: 0 0 13px;
}

.pied ul { list-style: none; margin: 0; padding: 0; }
.pied li { margin-bottom: 8px; }
.pied a { text-decoration: none; }
.pied a:hover { color: var(--encre); text-decoration: underline; }

.pied-bas {
  border-top: 1px solid var(--ligne);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: .84rem;
}

/* ---------------------------------------------------------------- pages texte */
.texte { max-width: 730px; padding: clamp(36px, 6vw, 66px) 0; }
.texte h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin-bottom: 28px; }
.texte h2 { font-size: 1.32rem; margin: 36px 0 12px; }
.texte p, .texte li { color: var(--encre-2); }
.texte ul { padding-left: 21px; }

/* ---------------------------------------------------------------- avis */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 130%);
  background: var(--encre);
  color: var(--papier);
  padding: 13px 22px;
  border-radius: 100px;
  font-size: .9rem;
  font-weight: 550;
  z-index: 200;
  transition: transform .28s var(--ease);
  max-width: 92vw;
  text-align: center;
}
.toast[data-show="true"] { transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 780px) {
  .deux-colonnes { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 860px) {
  .catalogue { grid-template-columns: 1fr; gap: 40px; }
  .catalogue-note {
    border-left: 0;
    border-top: 2px solid var(--ligne);
    padding-left: 0;
    padding-top: 26px;
  }
  .heros-grille { grid-template-columns: 1fr; gap: 38px; }
  .heros-couverture { max-width: 280px; }
  .fiche { grid-template-columns: 1fr; }
  .fiche-couv { position: static; max-width: 300px; }
  .pied-grille { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .livre { flex: 1 1 100%; max-width: 320px; }
  .nav { gap: 15px; font-size: .87rem; }
  .nav .masquer-mobile { display: none; }
  .pied-grille { grid-template-columns: 1fr; gap: 26px; }
}

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