/* Culturissime Éditions — maquette locale, page vitrine
   Palette logo : rouge #CF1C1F, anthracite #3B3C40, canard #016670,
   bordeaux #7C1D35, éditions #716C68. Fond blanc. */

@font-face {
  font-family: Outfit;
  src: url("../fonts/Outfit.var.woff2") format("woff2-variations"),
       url("../fonts/Outfit.var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --rouge: #CF1C1F;
  --anthracite: #3B3C40;
  --canard: #016670;
  --bordeaux: #7C1D35;
  --gris: #716C68;
  --blanc: #ffffff;
  --noir: #000000;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--blanc);
  color: var(--anthracite);
  font-family: Outfit, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--rouge);
}

a:focus-visible {
  outline: 2px solid var(--rouge);
  outline-offset: 3px;
}

.page {
  width: min(72rem, calc(100% - 4rem));
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: clamp(1.5rem, 2.6vw, 2.5rem) 0 clamp(1.75rem, 3vw, 2.75rem);
}

.page--long {
  justify-content: flex-start;
}

.entete {
  display: block;
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.brand {
  display: block;
  width: clamp(12.5rem, 24vw, 25.6rem);
  line-height: 0;
  text-decoration: none;
  color: inherit;
}

/* Sur les pages intérieures, le logo reste en haut mais un peu plus discret. */
.livre .brand,
.page--long .brand {
  width: clamp(12rem, 22vw, 18rem);
}

.brand:hover,
.brand:focus-visible {
  color: inherit;
}

.brand svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Couleurs par défaut = variante 6 */
.logo-cult { fill: var(--rouge); }
.logo-ur { fill: var(--anthracite); }
.logo-iss { fill: var(--canard); }
.logo-ime { fill: var(--bordeaux); }
.logo-editions { fill: var(--gris); }

/* Animation d'accueil : 3 boucles des 6 permutations (0,3 s chacune),
   puis arrêt sur la variante 6, puis ÉDITIONS passe au noir et revient. */
.logo--animated .logo-ur {
  animation: perm-ur 1.8s linear 3 forwards;
}

.logo--animated .logo-iss {
  animation: perm-iss 1.8s linear 3 forwards;
}

.logo--animated .logo-ime {
  animation: perm-ime 1.8s linear 3 forwards;
}

.logo--animated .logo-editions {
  animation: editions-noir 2.9s ease-in-out 5.7s forwards;
}

/* Variante 1–6 : UR / ISS / IME (CULT reste rouge) */
@keyframes perm-ur {
  0%, 16.666% { fill: var(--bordeaux); }       /* 1 */
  16.667%, 33.333% { fill: var(--bordeaux); }  /* 2 */
  33.334%, 50% { fill: var(--canard); }        /* 3 */
  50.001%, 66.666% { fill: var(--canard); }    /* 4 */
  66.667%, 83.333% { fill: var(--anthracite); }/* 5 */
  83.334%, 100% { fill: var(--anthracite); }   /* 6 */
}

@keyframes perm-iss {
  0%, 16.666% { fill: var(--canard); }           /* 1 */
  16.667%, 33.333% { fill: var(--anthracite); }  /* 2 */
  33.334%, 50% { fill: var(--bordeaux); }        /* 3 */
  50.001%, 66.666% { fill: var(--anthracite); }  /* 4 */
  66.667%, 83.333% { fill: var(--bordeaux); }    /* 5 */
  83.334%, 100% { fill: var(--canard); }         /* 6 */
}

@keyframes perm-ime {
  0%, 16.666% { fill: var(--anthracite); }     /* 1 */
  16.667%, 33.333% { fill: var(--canard); }    /* 2 */
  33.334%, 50% { fill: var(--anthracite); }    /* 3 */
  50.001%, 66.666% { fill: var(--bordeaux); }  /* 4 */
  66.667%, 83.333% { fill: var(--canard); }    /* 5 */
  83.334%, 100% { fill: var(--bordeaux); }     /* 6 */
}

@keyframes editions-noir {
  0%   { fill: var(--gris); }
  17%  { fill: var(--noir); }  /* 0,5 s */
  31%  { fill: var(--noir); }  /* court maintien */
  48%  { fill: var(--gris); }  /* 0,5 s retour */
  100% { fill: var(--gris); }
}

@media (prefers-reduced-motion: reduce) {
  .logo--animated .logo-ur,
  .logo--animated .logo-iss,
  .logo--animated .logo-ime,
  .logo--animated .logo-editions {
    animation: none;
  }
}

.phrases,
.devise-wrap {
  margin: clamp(1.65rem, 3vw, 2.55rem) 0 0;
  max-width: min(40rem, 92%);
  padding: 0;
}

.devise {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 2.55rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--anthracite);
}

.couvertures {
  list-style: none;
  margin: clamp(2.15rem, 4.3vw, 3.75rem) 0 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(2rem, 4.5vw, 5rem) clamp(2.5rem, 5.5vw, 6rem);
}

.livre-objet {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  width: clamp(9.85rem, 17.1vw, 17.1rem);
}

.livre-objet:hover,
.livre-objet:focus-visible {
  color: inherit;
}

/* Cadre identique pour les deux livres (ratio de La nuit).
   Dix-sept heures, un peu plus large, est contenue sans déformation. */
.cadre {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 8;
  height: auto;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(59, 60, 64, 0.18), 0 12px 32px rgba(59, 60, 64, 0.13);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.cadre picture,
.cadre img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.cadre img {
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.livre-objet:hover .cadre,
.livre-objet:focus-visible .cadre {
  transform: scale(1.03);
  box-shadow: 0 0 0 1px rgba(59, 60, 64, 0.22), 0 16px 36px rgba(59, 60, 64, 0.18);
}

.legende {
  display: block;
  margin-top: 0.85rem;
  text-align: center;
}

.titre {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--anthracite);
}

.genre {
  display: block;
  margin-top: 0.22rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--gris);
}

/* Clic : on « entre » dans l'objet, puis on rejoint son site */
body.entrer-en-cours .page > :not(.couvertures) {
  opacity: 0.28;
  transition: opacity 0.35s ease;
}

body.entrer-en-cours .livre-objet:not(.is-entering) {
  opacity: 0.22;
  transition: opacity 0.35s ease;
}

body.entrer-en-cours .livre-objet.is-entering {
  position: relative;
  z-index: 2;
}

body.entrer-en-cours .livre-objet.is-entering .cadre {
  transform: scale(1.12);
  box-shadow: 0 0 0 1px rgba(59, 60, 64, 0.22), 0 22px 44px rgba(59, 60, 64, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  .cadre,
  body.entrer-en-cours .page > :not(.couvertures),
  body.entrer-en-cours .livre-objet:not(.is-entering) {
    transition: none;
  }
}

.couverture-page {
  margin: 2rem 0 0;
}

.couverture-page img {
  height: 13.5rem;
  width: auto;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(59, 60, 64, 0.18), 0 10px 28px rgba(59, 60, 64, 0.12);
}

.livre {
  width: 100%;
}

.livre header {
  margin: 2.1rem 0 0;
}

.livre h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.livre .sous-titre {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--gris);
}

.livre .auteur {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  color: var(--anthracite);
}

.meta {
  list-style: none;
  margin: 2.1rem 0 0;
  padding: 0;
  font-size: 0.9rem;
  color: var(--anthracite);
  line-height: 1.7;
}

.commande {
  margin: 1.85rem 0 0;
  font-size: 0.95rem;
}

.commande a {
  color: var(--anthracite);
}

.mentions {
  width: min(36rem, 100%);
  margin-top: 2.1rem;
  text-align: left;
}

.mentions h1 {
  margin: 0 0 1.5rem;
  font-size: 1.35rem;
  font-weight: 500;
  text-align: center;
}

.mentions h2 {
  margin: 1.75rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.mentions p,
.mentions address {
  margin: 0 0 0.75rem;
  font-style: normal;
  font-size: 0.925rem;
  line-height: 1.55;
}

.form-nouvelles {
  margin: clamp(2.15rem, 3.8vw, 3.2rem) 0 0;
  width: min(28rem, 100%);
}

.form-nouvelles label {
  display: block;
  font-size: clamp(1.125rem, 1.5vw, 1.35rem);
  font-weight: 500;
  color: var(--anthracite);
  margin-bottom: 0.65rem;
}

.form-row {
  display: flex;
  gap: 0.55rem;
  width: 100%;
}

.form-nouvelles input[type="email"] {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid #c8c4c0;
  border-radius: 0;
  background: var(--blanc);
  color: var(--anthracite);
  font-family: inherit;
  font-size: 1.05rem;
}

.form-nouvelles input[type="email"]:focus {
  outline: 2px solid var(--anthracite);
  outline-offset: 1px;
  border-color: var(--anthracite);
}

.form-nouvelles button {
  margin: 0;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--anthracite);
  background: var(--blanc);
  color: var(--anthracite);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
}

.form-nouvelles button:hover {
  background: var(--anthracite);
  color: var(--blanc);
}

.sr-only,
.form-nouvelles .honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pied {
  margin-top: clamp(2rem, 3.2vw, 3rem);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--gris);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 0.85rem;
}

.pied a {
  color: inherit;
  text-decoration: none;
}

.pied a:hover,
.pied a:focus-visible {
  color: var(--anthracite);
  text-decoration: underline;
}

@media (max-width: 700px) {
  .page {
    width: min(72rem, calc(100% - 2rem));
    padding: 1.6rem 0 2.25rem;
  }

  .brand {
    width: clamp(11.5rem, 56vw, 16rem);
  }

  .devise {
    font-size: clamp(1.3rem, 5.5vw, 1.75rem);
  }

  .couvertures {
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    margin-top: 2.15rem;
  }

  .livre-objet {
    width: min(12.6rem, 65vw);
  }

  .form-nouvelles {
    margin-top: 2.5rem;
    width: min(22rem, 100%);
  }

  .livre h1 {
    font-size: 1.3rem;
  }
}

/* Écran type 1440×900 : le formulaire reste visible, ou presque. */
@media (min-width: 701px) and (max-height: 940px) {
  .page {
    padding: 1.25rem 0 1.15rem;
  }

  .devise-wrap {
    margin-top: 1.55rem;
  }

  .couvertures {
    margin-top: 1.85rem;
  }

  .livre-objet {
    width: clamp(9.5rem, 14.25vw, 13.8rem);
  }

  .form-nouvelles {
    margin-top: 1.75rem;
  }

  .pied {
    margin-top: 1.45rem;
  }
}
