/* ---------------------------------------------------------
   Landing page du livre "Derrière chaque porte"
   (derriere-chaque-porte/index.html).

   Chargée APRÈS main.css : le header, le footer, les boutons
   (.btn) et TOUS les tokens (:root) viennent de main.css, comme
   sur les pages légales. Ce fichier ne porte que la mise en page
   propre à la landing (maquette Claude Design validée), habillée
   aux couleurs de la charte.

   La page évolue par phases (attente / précommande / vente),
   basculées par js/livre.js : voir les blocs [data-phase-block].
   --------------------------------------------------------- */

:root {
  /* Token propre à la landing (tout le reste vient de main.css). */
  --livre-error: #9c3a2a; /* messages d'erreur, AA sur sable (6,01:1) */
}

/* --- Base --- */
/* L'attribut hidden doit TOUJOURS gagner : sans ce garde, une règle de
   display posée par une classe (ex. .lp-order en flex) bat la feuille de
   style du navigateur et ré-affiche un bloc pourtant masqué par le JS. */
body.livre [hidden] {
  display: none !important;
}
body.livre {
  background: var(--sand);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* main.css réserve un padding-bottom (mobile) pour la barre de contact
     fixe du site : cette landing ne l'embarque pas, la réserve laisserait
     une bande vide sous le footer. */
  padding-bottom: 0;
}
body.livre ::selection {
  background: var(--sand-dark);
}
.lp-container {
  max-width: 1140px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
/* PAS de règle générique sur les liens : le header et le footer du site
   (main.css) gardent leurs couleurs. Les liens du contenu de la landing
   (.lp-author-link, boutons) portent chacun leur style explicite. */
body.livre a:focus-visible,
body.livre button:focus-visible,
body.livre input:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

@keyframes lpFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes lpGlow {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.85;
  }
}

/* --- Hero ---
   Mobile-first : UNE colonne avec la COUVERTURE au-dessus du texte
   (demande client), puis deux colonnes texte | couverture dès 900px. */
.lp-hero {
  padding-top: clamp(32px, 7vw, 96px);
  padding-bottom: clamp(56px, 7vw, 104px);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
  /* Contient le halo décoratif de la couverture (inset négatif) : sans ce
     clip, il crée un défilement horizontal sur mobile. Les paddings du hero
     absorbent la coupe (le dégradé est déjà transparent à ses bords). */
  overflow: clip;
}
.lp-hero .lp-cover {
  order: -1; /* couverture d'abord sur une colonne */
}
@media (min-width: 900px) {
  .lp-hero {
    grid-template-columns: 1fr 1fr;
  }
  .lp-hero .lp-cover {
    order: 0; /* texte à gauche, couverture à droite */
  }
}
.lp-hero-text {
  animation: lpFadeUp 0.7s ease both;
}
.lp-eyebrow {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper-text);
  display: flex;
  align-items: center;
  gap: 14px;
}
.lp-eyebrow::before {
  content: "";
  display: inline-block;
  width: 36px;
  height: 1px;
  background: var(--copper);
}
.lp-hero h1 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(52px, 6.5vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--navy);
}
.lp-hero h1 em {
  font-style: italic;
  font-weight: 400; /* l'italique Fraunces self-hosté est une instance 400 */
  color: var(--copper-text); /* grand corps : largement AA */
}
.lp-subtitle {
  margin: 0 0 26px;
  font-size: 18px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.lp-intro {
  margin: 0 0 36px;
  font-size: var(--text-base);
  line-height: 1.75;
  font-weight: 400;
  max-width: 54ch;
  text-wrap: pretty;
}
.lp-intro strong {
  font-weight: 600;
}

/* --- Compte à rebours (phase attente) --- */
.lp-countdown-block {
  margin: 0 0 34px;
}
.lp-countdown-title {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.lp-countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 480px;
  border-top: 1px solid var(--copper);
  border-bottom: 1px solid var(--sand-dark);
  background: var(--white);
}
/* Sans JavaScript, le compteur ne peut pas vivre : on ne montre que la
   phrase de date (déjà présente au-dessus), jamais des cases figées. */
.no-js .lp-countdown {
  display: none;
}
.lp-count-cell {
  padding: 16px 6px;
  text-align: center;
}
.lp-count-cell + .lp-count-cell {
  border-left: 1px solid var(--sand-dark);
}
.lp-count-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 4.5vw, 46px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}
.lp-count-cell--secs .lp-count-num {
  color: var(--copper-text);
}
.lp-count-label {
  margin-top: 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- Formulaire d'alerte (phase attente) --- */
.lp-notify {
  scroll-margin-top: 24px;
}
.lp-form {
  max-width: 520px;
}
.lp-form-label {
  display: block;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--navy);
}
.lp-form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.lp-email {
  flex: 1 1 240px;
  min-width: 0;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--sand-dark);
  border-radius: var(--radius-full);
}
.lp-email:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.16);
}
/* Piège à robots : champ hors écran, jamais rempli par un humain
   (tabindex -1 + aria-hidden côté HTML). */
.lp-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.lp-submit {
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--copper-deep);
  border: 1.5px solid var(--copper-deep);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-base), border-color var(--transition-base);
}
.lp-submit:hover:not(:disabled) {
  background: color-mix(in srgb, var(--copper-deep) 88%, black);
  border-color: color-mix(in srgb, var(--copper-deep) 88%, black);
}
.lp-submit:disabled {
  opacity: 0.6;
  cursor: default;
}
.lp-form-alert {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--livre-error);
}
.lp-rgpd {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 56ch;
  text-wrap: pretty;
}
.lp-success {
  max-width: 480px;
  padding: 18px 22px;
  background: var(--white);
  border: 1px solid var(--copper);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.6;
}
.lp-success strong {
  font-weight: 600;
  color: var(--navy);
}

/* --- Bouton de (pré)commande (phases précommande / vente) --- */
.lp-order {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
body.livre .lp-order-btn,
body.livre .lp-reminder-btn {
  display: inline-block;
  padding: 17px 36px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--copper-deep);
  border-radius: var(--radius-full);
  transition: background var(--transition-base);
}
body.livre .lp-order-btn:hover,
body.livre .lp-reminder-btn:hover {
  background: color-mix(in srgb, var(--copper-deep) 88%, black);
  color: var(--white);
}
.lp-order-note {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* --- Couverture du livre (hero) --- */
.lp-cover {
  display: flex;
  justify-content: center;
  position: relative;
  animation: lpFadeUp 0.7s 0.15s ease both;
}
.lp-cover-glow {
  position: absolute;
  inset: -8% -12%;
  background: radial-gradient(
    closest-side,
    rgba(184, 115, 51, 0.18),
    rgba(184, 115, 51, 0) 70%
  );
  animation: lpGlow 6s ease-in-out infinite;
}
.lp-cover img {
  position: relative;
  width: min(380px, 78vw);
  height: auto;
  border-radius: 3px;
  box-shadow: 0 30px 60px -18px rgba(15, 42, 63, 0.45),
    0 8px 20px -8px rgba(15, 42, 63, 0.3);
}

/* --- Teaser (section sombre) --- */
.lp-teaser {
  background: var(--navy);
  color: var(--sand);
}
.lp-teaser .lp-container {
  max-width: 860px;
  padding-top: clamp(64px, 8vw, 110px);
  padding-bottom: clamp(64px, 8vw, 110px);
  text-align: center;
}
.lp-teaser-kicker {
  margin: 0 0 26px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--copper-light);
}
.lp-teaser blockquote {
  margin: 0 auto 40px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.35;
  max-width: 24em;
  text-wrap: balance;
}
.lp-teaser-tags {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: clamp(14px, 1.4vw, 20px);
  flex-wrap: wrap;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 239, 231, 0.75);
}
.lp-teaser-tags span {
  white-space: nowrap;
}
.lp-teaser-tags .lp-dot {
  color: var(--copper-light);
}
/* Quand la ligne casse (tablette/mobile), les points médians deviennent des
   orphelins de fin de ligne : tags empilés sans séparateur. */
@media (max-width: 980px) {
  .lp-teaser-tags {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }
  .lp-teaser-tags .lp-dot {
    display: none;
  }
}

/* --- Auteur --- */
.lp-author {
  padding-top: clamp(64px, 8vw, 110px);
  padding-bottom: clamp(64px, 8vw, 110px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
  scroll-margin-top: 24px;
}
.lp-author-photo {
  display: flex;
  justify-content: center;
}
.lp-author-photo img {
  width: min(400px, 84vw);
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}
.lp-author h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 4.5vw, 54px);
  line-height: 1.05;
  color: var(--navy);
}
.lp-author-role {
  margin: 0 0 24px;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--copper-text);
}
.lp-author-bio {
  margin: 0 0 28px;
  font-size: var(--text-base);
  line-height: 1.75;
  max-width: 56ch;
  text-wrap: pretty;
}
body.livre .lp-author-link {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper-text);
  border-bottom: 1px solid var(--copper);
  padding-bottom: 3px;
}
body.livre .lp-author-link:hover {
  color: var(--navy);
}

/* --- Rappel (bas de page) --- */
.lp-reminder {
  border-top: 1px solid var(--sand-dark);
}
.lp-reminder .lp-container {
  padding-top: clamp(48px, 6vw, 72px);
  padding-bottom: clamp(48px, 6vw, 72px);
  text-align: center;
}
.lp-reminder h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.5vw, 40px);
  color: var(--navy);
}
.lp-reminder-text {
  margin: 0 0 28px;
  font-size: 16px;
  color: var(--muted);
}

/* --- Animations coupées si l'utilisateur préfère --- */
@media (prefers-reduced-motion: reduce) {
  .lp-hero-text,
  .lp-cover {
    animation: none;
  }
  .lp-cover-glow {
    animation: none;
    opacity: 0.55;
  }
}

/* --- Impression : contenu seul, sans chrome --- */
@media print {
  .lp-header,
  .lp-footer,
  .lp-countdown,
  .lp-form,
  .cookie-banner {
    display: none !important;
  }
}
