/* ============================================================
   HERBLINE ÉDITIONS — Système de design partagé (Bloc 1)
   Palette bordeaux / crème conservée. Pas de framework.
   ============================================================ */

:root {
  --bg:        #f4ece0;   /* crème */
  --bg-alt:    #5b1a23;   /* bordeaux profond */
  --bg-soft:   #ece1cf;   /* crème soutenu */
  --ink:       #1b1410;   /* encre */
  --ink-soft:  #4a3b32;
  --accent:    #5b1a23;
  --accent-2:  #8a3a44;
  --line:      #c8b8a4;
  --line-soft: #d9c9b3;
  --on-accent: #f4ece0;
  --focus:     #d6a86a;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* Garantit que la viewport entière est toujours peinte,
     évite le blanc navigateur sous le footer sur pages courtes. */
  background: var(--bg);
  min-height: 100vh;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Layout page-level : footer poussé en bas, main absorbe l'espace résiduel. */
  min-height: 100vh;        /* fallback navigateurs sans dvh */
  min-height: 100dvh;       /* viewport dynamique moderne */
  display: flex;
  flex-direction: column;
}

main {
  /* main absorbe l'espace résiduel entre header et footer ; pages courtes :
     footer poussé en bas du viewport ; pages longues : main suit le contenu. */
  flex: 1 0 auto;
}

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

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }

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

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 { font-size: clamp(2.4rem, 5.5vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { margin: 0 0 1rem; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand a { display: inline-block; padding: 0.25rem 0; color: inherit; }
.brand a:hover, .brand a:focus-visible { text-decoration: none; color: var(--accent); }

.nav { display: flex; align-items: center; gap: 1.75rem; }

.nav__list {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.25rem 0;
  position: relative;
}
.nav__link:hover, .nav__link:focus-visible { color: var(--ink); text-decoration: none; }
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav__link:hover::after, .nav__link:focus-visible::after { transform: scaleX(1); }
.nav__link[aria-current="page"] { color: var(--ink); }
.nav__link[aria-current="page"]::after { transform: scaleX(1); }

/* Mobile menu */
.nav__toggle {
  display: none;
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  width: 42px; height: 42px;
  cursor: pointer;
  padding: 0;
  border-radius: 2px;
  align-items: center;
  justify-content: center;
}
.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--ink);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease, bottom 0.2s ease;
}
.nav__toggle span::before, .nav__toggle span::after { content: ""; position: absolute; left: 0; }
.nav__toggle span::before { top: -7px; }
.nav__toggle span::after  { bottom: -7px; }
.nav__toggle[aria-expanded="true"] span { background: transparent; }
.nav__toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span::after  { bottom: 0; transform: rotate(-45deg); }

@media (max-width: 880px) {
  .nav__toggle { display: inline-flex; }
  .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line-soft);
    padding: 1.25rem 1.5rem 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
  }
}

/* ===== Sections ===== */
.section {
  padding: clamp(4rem, 8vw, 7rem) 0;
  position: relative;
}

.section--alt {
  background: var(--bg-alt);
  color: var(--on-accent);
}

.section--alt .eyebrow { color: rgba(244,236,224,0.7); }
.section--alt a { color: var(--on-accent); }

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid currentColor;
  width: max-content;
  max-width: 100%;
}

.section__head { margin-bottom: 3rem; max-width: 60ch; }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; }

/* ===== Hero (homepage simplifiée) ===== */
.hero { padding-top: clamp(5rem, 12vw, 10rem); padding-bottom: clamp(5rem, 12vw, 10rem); }
.hero__home { text-align: center; }
.hero__signature {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 0 auto 1.5rem;
  max-width: 18ch;
}
.hero__signature span { display: block; }
.hero__signature span:nth-child(2) { color: var(--accent); }
.hero__home .hero__lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 auto 2.5rem;
}
.hero__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* CTA hero unique */
.hero__cta {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
  margin-bottom: 2.5rem;
}

/* Placeholder visuel sobre, intégré au design */
.hero__visual {
  margin: 0 auto;
  max-width: 880px;
}
.hero__visual-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background:
    repeating-linear-gradient(
      135deg,
      var(--bg-soft) 0 24px,
      var(--bg) 24px 48px
    );
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__visual-tag {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--bg);
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
}

/* Visually hidden utilitaire accessible */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Bande défilante "Herbline Éditions" — décorative, masquée aux lecteurs d'écran.
   Deux groupes strictement identiques (même nombre d'items, même gap interne).
   Largeur par groupe >= viewport max (1920px) pour couvrir sans trou.
   Animation translateX(-50%) : le 2e groupe prend la place du 1er au reset,
   boucle invisible et fluide. Aucune puce brute, aucun gradient, aucun bouton. */
.marquee {
  overflow: hidden;
  background: var(--accent);
  color: var(--on-accent);
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  /* Pleine largeur : pas de max-width ni padding latéral sur le conteneur. */
  width: 100%;
  /* Hauteur bande : ~100-140px desktop, plus compacte mobile (item ~1.6-2.4rem + padding). */
  padding: clamp(1.6rem, 3.6vw, 3.4rem) 0;
  line-height: 1;
}
.marquee__track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;       /* la track contient 2 groupes côte à côte */
  animation: marquee-scroll 40s linear infinite;
  will-change: transform;
}
.marquee__group {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  /* Largeur minimale pour couvrir jusqu'à 1920px : 2x viewport max + gap. */
  min-width: 1920px;
  justify-content: space-around;
  padding: 0 clamp(1rem, 3vw, 3rem);
  gap: clamp(1.5rem, 4vw, 4rem);
}
.marquee__item {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  /* Taille sensiblement plus grande qu'avant (était clamp(1.1, 2vw, 1.6rem)). */
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-accent);
  white-space: nowrap;
  flex: 0 0 auto;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
/* Reduced-motion : on coupe l'animation et on affiche une occurrence centrée,
   lisible et stable. La track est contrainte à 100% et les groupes empilés. */
@media (prefers-reduced-motion: reduce) {
  .marquee {
    padding: clamp(1.4rem, 3vw, 2.4rem) 0;
  }
  .marquee__track {
    animation: none;
    transform: none;
    width: 100%;
    justify-content: center;
    flex-direction: column;
    gap: clamp(0.6rem, 1.2vw, 0.9rem);
  }
  .marquee__group {
    min-width: 0;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0;
    gap: clamp(1rem, 2.4vw, 2rem);
  }
  .marquee__group[aria-hidden="true"] {
    display: none;          /* évite la lecture répétée et le doublon visuel */
  }
  .marquee__item:not(:first-child) {
    display: none;          /* occurrence unique centrée sous prefers-reduced-motion */
  }
  .marquee__item {
    font-size: clamp(1.05rem, 4vw, 1.6rem);
    letter-spacing: 0.08em;
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  font-family: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  border-radius: 2px;
}
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--bg); text-decoration: none; }

.btn--accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn--accent:hover, .btn--accent:focus-visible { background: var(--on-accent); color: var(--accent); }

.btn--ghost { border-color: var(--on-accent); color: var(--on-accent); }
.btn--ghost:hover, .btn--ghost:focus-visible { background: var(--on-accent); color: var(--accent); }

.section--alt .btn:not(.btn--accent):not(.btn--ghost) { color: var(--on-accent); border-color: var(--on-accent); }
.section--alt .btn:not(.btn--accent):not(.btn--ghost):hover,
.section--alt .btn:not(.btn--accent):not(.btn--ghost):focus-visible {
  background: var(--on-accent); color: var(--accent);
}

/* ===== Page La Maison ===== */
.maison { max-width: 65ch; margin: 0 auto; }
.maison__title { text-align: center; margin-bottom: 2.5rem; }
.maison__lede {
  font-family: Georgia, serif;
  font-size: clamp(1.2rem, 1.8vw, 1.4rem);
  line-height: 1.45;
  margin-bottom: 1.5rem;
  color: var(--ink);
}
.maison__lede--alt { color: var(--ink-soft); }
.maison__quote {
  margin: 3rem auto 0;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--accent);
  font-family: Georgia, serif;
  font-style: italic;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  line-height: 1.35;
  max-width: 50ch;
}

/* ===== Catalogue & fiche livre ===== */
.catalogue {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  justify-items: center;
  max-width: 460px;
  margin: 0 auto;
}

.catalogue__item {
  display: block;
  text-align: center;
  width: 100%;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}
.catalogue__cover {
  aspect-ratio: 3/4;
  margin: 0 auto 1.5rem;
  max-width: 340px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 0;
  overflow: hidden;
}
.catalogue__cover img { display: block; width: 100%; height: auto; }
.catalogue__title {
  font-family: Georgia, serif;
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  line-height: 1.2;
  margin: 0 0 0.4rem;
}
.catalogue__author {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
  letter-spacing: 0.02em;
}
.catalogue__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

/* ===== Page livre (Santal Fantôme) ===== */
.livre {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}
@media (max-width: 880px) { .livre { grid-template-columns: 1fr; } }

.cover {
  position: relative;
  aspect-ratio: 3/4;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  overflow: hidden;
}
.cover::before {
  content: "";
  position: absolute;
  left: 6px; top: 6px; right: 6px; bottom: 6px;
  border: 1px solid var(--line);
  pointer-events: none;
}
.cover--art {
  aspect-ratio: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: 0 24px 60px rgba(20, 6, 12, 0.28);
  max-width: 380px;
  margin: 0 auto;
}
.cover--art::before { display: none; }
.cover__image { display: block; width: 100%; height: auto; }

.livre__sticky { position: sticky; top: 6rem; }
@media (max-width: 880px) { .livre__sticky { position: static; } }

.livre__title { margin-bottom: 0.5rem; }
.livre__subtitle {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  color: var(--ink-soft);
  margin-bottom: 1.75rem;
}

.livre__details dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.5rem;
  margin: 0 0 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.livre__details dt {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  align-self: center;
}
.livre__details dd { margin: 0; font-family: Georgia, serif; }

.livre__resume { font-size: 1.05rem; max-width: 58ch; }
.livre__resume p { margin-bottom: 1rem; }
.livre__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.livre__note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 1rem; }

/* ===== Page Actualités ===== */
.news {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}
.news__item {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}
.news__date {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}
.news__title {
  font-family: Georgia, serif;
  font-size: 1.4rem;
  line-height: 1.2;
  margin-bottom: 0;
}

/* ===== Contact ===== */
.contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  max-width: 640px;
  margin: 0 auto;
}
.contact__intro {
  font-family: Georgia, serif;
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  color: var(--ink-soft);
  max-width: 50ch;
}
.contact__email {
  font-family: Georgia, serif;
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
}
.contact__email a { color: var(--accent); border-bottom: 1px solid currentColor; }
.contact__email a:hover, .contact__email a:focus-visible { text-decoration: none; color: var(--accent-2); }
.contact__note {
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  margin-top: 1rem;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding: 4rem 0 2rem;
}
.site-footer a { color: var(--bg); }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--focus); }

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(244,236,224,0.2);
}
@media (max-width: 880px) { .footer__grid { grid-template-columns: 1fr; } }

.footer__brand { font-family: Georgia, serif; font-size: 1.4rem; letter-spacing: 0.1em; }
.footer__col h4 {
  font-family: -apple-system, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: rgba(244,236,224,0.7);
}
.footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; font-size: 0.95rem; }

.footer__legal {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: rgba(244,236,224,0.6);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}
.footer__legal ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 1.5rem; flex-wrap: wrap; }

/* ===== Fade-in sobre (page courte uniquement) ===== */
.fade {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .fade { opacity: 1; transform: none; transition: none; }
}

/* ===== Skip link ===== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ===== Légal ===== */
.legal {
  max-width: 760px;
  margin: 0 auto;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.legal h2 { margin: 2.5rem 0 1rem; color: var(--ink); font-size: 1.4rem; }
.legal h2:first-child { margin-top: 0; }
.legal p { margin-bottom: 1rem; }
.legal strong { color: var(--ink); }

/* ===== Utilitaire ===== */
.placeholder-token {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: rgba(91,26,35,0.08);
  padding: 0.1em 0.4em;
  border-radius: 2px;
  letter-spacing: 0.05em;
}
