/*
Theme Name: 23h12
Theme URI: https://example.com
Author: Billy L.
Description: Thème léger pour vendre l'ebook « 23h12 » : une page de vente, compatible WooCommerce et Stripe.
Version: 1.4.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: t23
*/

/* ---------------------------------------------------------- polices (hébergées localement : RGPD) */
@font-face { font-family: "DM Serif Display"; src: url("assets/fonts/dm-serif-display.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url("assets/fonts/dm-serif-display-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("assets/fonts/work-sans-var.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("assets/fonts/work-sans-var-italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }

/* ---------------------------------------------------------- jetons */
:root {
  --papier: #E5DCCB;
  --feuille: #EFE8DA;
  --encre: #211C18;
  --nuit: #173F45;
  --rouge: #C23A22;
  --creme: #F3E7D3;
  --gris: #5E574F;
  --titre: "DM Serif Display", Georgia, serif;
  --texte: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --mesure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--papier); color: var(--encre);
  font: 300 1.0625rem/1.65 var(--texte);
  /* grain de papier très léger */
  background-image: radial-gradient(rgba(33, 28, 24, .05) 1px, transparent 1px);
  background-size: 3px 3px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--rouge); outline-offset: 3px; border-radius: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }

h1, h2, h3 { font-family: var(--titre); font-weight: 400; line-height: 1.05; margin: 0; letter-spacing: -.005em; }
h2 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3rem); margin-bottom: 1.25rem; }
p { margin: 0 0 1rem; max-width: var(--mesure); }
strong { font-weight: 600; }

/* ---------------------------------------------------------- en-tête : bandeau de nuit au bord déchiré */
.bandeau { position: relative; background: var(--encre); color: var(--creme); }
.bandeau__in { display: flex; align-items: center; justify-content: space-between; padding-block: 1.1rem 1.4rem; }
.marque { font-family: var(--titre); font-weight: 400; font-size: 1.6rem; text-decoration: none; }
.bandeau__lien { font-size: .95rem; font-weight: 500; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.bandeau__dechirure { position: absolute; left: 0; right: 0; bottom: -17px; width: 100%; height: 18px; color: var(--encre); display: block; }

/* ---------------------------------------------------------- héros */
.heros { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem) clamp(2.5rem, 2rem + 3vw, 4.5rem); position: relative; overflow: hidden; }
.heros__grille { display: grid; gap: 2.5rem; align-items: end; }
.heros__grille > * { min-width: 0; }
.heros__titre { font-size: clamp(5rem, 2.8rem + 12vw, 11.5rem); line-height: .85; letter-spacing: -.03em; display: flex; flex-direction: column; gap: .12em; }
.heros__ligne { display: flex; align-items: center; gap: .18em; flex-wrap: nowrap; }
.pastille { display: inline-block; width: 1.55em; height: .72em; border-radius: 999px; overflow: hidden; border: 2px solid var(--encre);
  background: var(--nuit); flex: none; }
.pastille img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.heros__sous { font-family: var(--titre); font-style: italic; font-weight: 400; font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.1rem); line-height: 1.2; margin: 1.5rem 0 1rem; max-width: 22ch; }
.heros__texte { color: var(--gris); font-size: 1.08rem; }
.achat { display: flex; align-items: center; gap: 1.25rem; margin-top: 1.75rem; flex-wrap: wrap; }

.bouton { display: inline-block; font: 600 1.05rem/1 var(--texte); text-decoration: none; color: var(--encre);
  background: transparent; border: 1.5px solid var(--encre); padding: 1.15rem 1.6rem; position: relative;
  box-shadow: 4px 4px 0 var(--encre); transition: transform .12s, box-shadow .12s; cursor: pointer; }
.bouton:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--encre); }
.bouton:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--encre); }
.bouton--plein { background: var(--encre); color: var(--creme); }
.bouton--clair { color: var(--creme); border-color: var(--creme); box-shadow: 4px 4px 0 var(--creme); }
.bouton--clair:hover { box-shadow: 6px 6px 0 var(--creme); }

/* l'étoile rouge du prix */
.etoile { width: 6.2rem; height: 6.2rem; flex: none; display: grid; place-items: center; text-align: center; color: var(--creme);
  background: var(--rouge); transform: rotate(-9deg);
  clip-path: polygon(50% 0%,59% 10%,71% 4%,75% 17%,88% 15%,87% 29%,99% 34%,92% 46%,100% 56%,89% 63%,93% 76%,80% 79%,77% 92%,64% 89%,56% 100%,46% 91%,34% 97%,29% 85%,16% 87%,16% 74%,3% 70%,9% 58%,0% 48%,9% 38%,3% 26%,15% 22%,17% 9%,30% 12%,37% 1%,46% 9%); }
.etoile span { font: 700 1.2rem/1 var(--texte); }
.etoile small { display: block; font: 400 .7rem/1.2 var(--texte); margin-top: .2rem; }

.couverture { justify-self: center; width: min(78vw, 19rem); transform: rotate(3deg); position: relative; }
.couverture img, .couverture__vide { box-shadow: 0 1px 0 rgba(0,0,0,.25), 14px 18px 0 -2px rgba(33,28,24,.18); border: 1px solid rgba(33,28,24,.35); }
.couverture__vide { aspect-ratio: 2/3; background: var(--nuit); color: var(--creme); display: grid; place-content: center; text-align: center; padding: 1.5rem; }
.couverture__vide strong { font-family: var(--titre); font-weight: 400; font-size: 3.6rem; }
.encre { color: var(--encre); width: 9rem; position: absolute; left: -9.5rem; bottom: -.5rem; opacity: .85; transform: rotate(-3deg); }

/* ---------------------------------------------------------- sections */
.bloc { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }
.bloc--trait { border-top: 1px dashed rgba(33, 28, 24, .35); }
.recit p { font-size: 1.15rem; }
.recit p:first-of-type { font-weight: 500; }

.contenu { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 2rem 3rem; }
.contenu li { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; align-items: start; max-width: 30rem; }
.contenu svg { width: 3rem; height: 3rem; color: var(--nuit); }
.contenu h3 { font-size: 1.3rem; margin-bottom: .35rem; }
.contenu p { color: var(--gris); margin: 0; }

.extrait { background: var(--feuille); padding: clamp(1.75rem, 1rem + 3vw, 3rem); margin-top: 2rem; max-width: 40rem; transform: rotate(-.6deg);
  box-shadow: 8px 10px 0 -1px rgba(33,28,24,.12);
  clip-path: polygon(0 1.2%,6% 0,13% 1%,21% .2%,30% 1.1%,38% .1%,47% .9%,55% 0,63% 1%,72% .2%,80% 1.2%,88% .1%,95% .9%,100% .3%,100% 100%,0 100%); }
.extrait h3 { font-size: 1.15rem; margin-bottom: 1rem; color: var(--nuit); }
.extrait p { font-size: 1.05rem; }
.extrait .phrase { border-left: 3px solid var(--rouge); padding-left: 1rem; font-weight: 500; }

.sommaire { margin: 2rem 0 0; padding: 0; list-style: none; counter-reset: ch; display: grid; gap: .1rem 3rem; }
.sommaire li { counter-increment: ch; display: grid; grid-template-columns: 2.5rem 1fr; padding: .85rem 0; border-bottom: 1px dashed rgba(33,28,24,.3); }
.sommaire li::before { content: counter(ch); font-family: var(--titre); font-weight: 400; font-size: 1.25rem; color: var(--rouge); line-height: 1.3; }

.nuit { background: var(--nuit); color: var(--creme); text-align: left; }
.nuit h2 { max-width: 16ch; }
.nuit p { color: rgba(243, 231, 211, .85); }
.garanties { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .6rem; font-size: .98rem; }
.garanties li { display: flex; gap: .7rem; align-items: center; }
.garanties svg { width: 1.2rem; height: 1.2rem; flex: none; }

.faq details { border-bottom: 1px dashed rgba(33,28,24,.35); padding: 1.1rem 0; max-width: 44rem; }
.faq summary { cursor: pointer; font-weight: 500; font-size: 1.08rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--titre); font-size: 1.4rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: .75rem 0 0; color: var(--gris); }

.pied { background: var(--encre); color: rgba(243,231,211,.75); padding-block: 2.5rem 6rem; font-size: .92rem; }
.pied__in { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.pied nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.pied a { text-decoration: none; }
.pied a:hover { text-decoration: underline; }

/* barre d'achat mobile : apparaît quand le bouton du haut n'est plus visible */
.barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--encre); color: var(--creme);
  padding: .8rem 1.25rem calc(.8rem + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  transform: translateY(110%); transition: transform .25s ease; }
.barre.est-visible { transform: none; }
.barre strong { font-family: var(--titre); font-weight: 400; font-size: 1.3rem; }
.barre .bouton { padding: .85rem 1.1rem; font-size: .98rem; box-shadow: 3px 3px 0 var(--creme); background: var(--creme); color: var(--encre); border-color: var(--creme); }

/* ---------------------------------------------------------- pages WooCommerce (commande, merci, mentions) */
.page-contenu { padding-block: 3.5rem 5rem; }
.page-contenu h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); margin-bottom: 2rem; }
.page-contenu .entry-content { max-width: 46rem; }
.page-contenu .entry-content h2 { font-size: 1.45rem; margin: 2.2rem 0 .6rem; }
.page-contenu .entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1rem 0 1.5rem; }
.page-contenu .entry-content th, .page-contenu .entry-content td { text-align: left; vertical-align: top; padding: .6rem .7rem; border-bottom: 1px dashed rgba(33,28,24,.3); }
.page-contenu .entry-content th { font-weight: 600; border-bottom: 1.5px solid var(--encre); }
.page-contenu .wp-block-table { overflow-x: auto; margin: 0; }
@media (max-width: 40rem) {
  .page-contenu .entry-content thead { display: none; }
  .page-contenu .entry-content tr { display: block; padding: .8rem 0; border-bottom: 1px dashed rgba(33,28,24,.3); }
  .page-contenu .entry-content td { display: block; border: 0; padding: .15rem 0; }
  .page-contenu .entry-content td[data-label]::before { content: attr(data-label) " : "; font-weight: 600; }
}
.woocommerce form .form-row input.input-text, .woocommerce form .form-row select, .woocommerce-page select {
  background: var(--feuille); border: 1.5px solid var(--encre); border-radius: 0; padding: .8rem .9rem; font: inherit; }
.woocommerce #payment, .woocommerce-checkout #payment { background: var(--feuille); border-radius: 0; }
.woocommerce button.button, .woocommerce a.button, .woocommerce #place_order {
  background: var(--encre) !important; color: var(--creme) !important; border-radius: 0 !important; font: 600 1.05rem/1 var(--texte) !important;
  padding: 1.1rem 1.5rem !important; box-shadow: 4px 4px 0 var(--nuit); }
.woocommerce-info, .woocommerce-message { border-top-color: var(--nuit); background: var(--feuille); }
.woocommerce-error { border-top-color: var(--rouge); }
/* récapitulatif du livre en haut de la page de commande */
.t23-recap { display: flex; gap: 1.25rem; align-items: center; background: var(--feuille); padding: 1.1rem 1.25rem; margin: 0 0 2rem;
  border: 1px solid rgba(33,28,24,.18); }
.t23-recap img { width: 74px; height: auto; flex: none; transform: rotate(-3deg); box-shadow: 5px 6px 0 -1px rgba(33,28,24,.18); }
.t23-recap h2 { font-size: 1.6rem; margin: 0 0 .2rem; }
.t23-recap p { margin: 0; color: var(--gris); font-size: .95rem; line-height: 1.45; }
.t23-recap strong { color: var(--encre); font-weight: 600; }
/* une seule colonne : le formulaire est court */
.woocommerce-checkout .col2-set .col-1, .woocommerce-checkout .col2-set .col-2 { float: none; width: 100%; }
.t23-merci { background: var(--feuille); border-left: 4px solid var(--nuit); padding: 1.5rem 1.5rem 1rem; margin: 0 0 2.5rem; }
.t23-merci h2 { font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.3rem); margin-bottom: .6rem; }
.t23-merci .bouton { margin: .5rem 0 .25rem; }
.t23-merci__aide { color: var(--gris); font-size: .92rem; }
.t23-renonciation { background: var(--feuille); border-left: 3px solid var(--rouge); padding: .9rem 1rem; margin: 0 0 1.25rem; font-size: .95rem; }

/* ---------------------------------------------------------- écrans moyens et larges */
@media (min-width: 48rem) {
  .heros__grille { grid-template-columns: 1.35fr 1fr; }
  .contenu { grid-template-columns: 1fr 1fr; }
  .sommaire { grid-template-columns: 1fr 1fr; }
  .nuit .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
  .barre { display: none; }
  .pied { padding-bottom: 2.5rem; }
}
@media (max-width: 30rem) {
  .encre { display: none; }
  .pastille { width: 1.05em; height: .6em; }
  .etoile { width: 5.4rem; height: 5.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bouton, .barre, .faq summary::after { transition: none; }
}
