/* =========================================================================
   Luis Miguel Ariza — v2
   Socle commun : polices, couleurs, typographie, en-tête, pied de page,
   composants partagés (boutons, repères, couverture de livre).
   Les styles propres à une page sont dans home.css, books.css, pages.css.
   ========================================================================= */

/* Polices (SIL OFL, hébergées sur le site) : Spectral pour les titres, IBM Plex Sans pour le texte,
   IBM Plex Mono pour les repères. Choisies pour un ton d'édition littéraire, loin des polices « par défaut ». */
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 200; font-display: swap;
  src: url(/assets/fonts/spectral-latin-200-normal.woff2) format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 300; font-display: swap;
  src: url(/assets/fonts/spectral-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/assets/fonts/spectral-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/assets/fonts/spectral-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 200; font-display: swap;
  src: url(/assets/fonts/spectral-latin-200-italic.woff2) format("woff2"); }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 300; font-display: swap;
  src: url(/assets/fonts/spectral-latin-300-italic.woff2) format("woff2"); }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(/assets/fonts/spectral-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
  src: url(/assets/fonts/ibm-plex-sans-latin-wght-normal.woff2) format("woff2-variations"); }
@font-face { font-family: "Plex Sans"; font-style: italic; font-weight: 100 700; font-display: swap;
  src: url(/assets/fonts/ibm-plex-sans-latin-wght-italic.woff2) format("woff2-variations"); }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  /* Abysse (fonds sombres) et papier (fonds de lecture) */
  --abyss: #0b1214;
  --abyss-2: #121c1f;
  --abyss-3: #1b282c;
  --paper: #f6f1e7;
  --paper-2: #ece4d4;
  --paper-3: #e2d7c2;

  /* Texte */
  --ink: #161b1d;            /* sur papier : 15.9:1 */
  --ink-soft: #4a5154;       /* sur papier : 7.6:1 */
  --on-dark: #eef0ec;        /* sur abysse : 16.6:1 */
  --on-dark-soft: #a9b4b3;   /* sur abysse : 8.9:1 */

  /* Accents : laiton (couvertures, steampunk) et bioluminescence (abysses, science) */
  --brass: #d6a54a;          /* sur abysse : 8.7:1 — décor et texte sur fond sombre */
  --brass-deep: #8a5a12;     /* sur papier : 5.6:1 — liens et texte accentué sur fond clair */
  --glow: #74d6c8;           /* sur abysse : 10.9:1 — uniquement sur fond sombre */
  --line-dark: rgba(238, 240, 236, .14);
  --line-light: rgba(22, 27, 29, .14);

  --serif: "Spectral", "Iowan Old Style", Georgia, serif;
  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 76rem;
  --narrow: 46rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section: clamp(4rem, 10vw, 8rem);
  --radius: 4px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 4.25rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans); font-optical-sizing: auto;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
main { display: block; }
main:focus { outline: none; }

h1, h2, h3, h4 {
  font-family: var(--serif); font-weight: 400; line-height: 1.08; letter-spacing: -.015em;
  margin: 0 0 .5em; text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 1.6rem + 4.2vw, 5.25rem); }
h2 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); }
h3 { font-size: clamp(1.35rem, 1.15rem + .8vw, 1.75rem); }
p { margin: 0 0 1em; text-wrap: pretty; }

a { color: var(--brass-deep); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 2px; }
.on-dark a, .on-dark { color: var(--on-dark); }
.on-dark a { text-decoration-color: var(--brass); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Sections sombres réutilisables */
.on-dark { background: var(--abyss); color: var(--on-dark); }
.on-dark ::selection { background: var(--brass); color: var(--abyss); }
::selection { background: var(--brass); color: var(--abyss); }

/* Repère de section façon carnet scientifique : « 01 — Novelist » */
.kicker {
  display: inline-flex; align-items: center; gap: .75em; margin: 0 0 1.25rem;
  font: 500 .75rem/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--brass-deep);
}
.kicker::before { content: ""; width: 2.25rem; height: 1px; background: currentColor; }
.on-dark .kicker { color: var(--brass); }

.lead { font-family: var(--serif); font-size: clamp(1.2rem, 1.05rem + .6vw, 1.5rem); line-height: 1.45; font-weight: 350; }
.meta { font: 400 .8125rem/1.5 var(--mono); letter-spacing: .04em; color: var(--ink-soft); }
.on-dark .meta { color: var(--on-dark-soft); }

/* Boutons : un seul appel principal par bloc, les autres actions sont des liens */
.btn {
  display: inline-flex; align-items: center; gap: .6em; min-height: 2.75rem; padding: .85em 1.4em;
  font: 600 .9375rem/1 var(--sans); letter-spacing: .01em; text-decoration: none;
  border-radius: 999px; border: 1px solid transparent;
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.btn-primary { background: var(--brass); color: var(--abyss); }
.btn-primary:hover { background: #e4b862; transform: translateY(-1px); }
.btn-ghost { border-color: currentColor; color: inherit; }
.btn-ghost:hover { background: rgba(214, 165, 74, .12); }
.link-arrow { font-weight: 600; text-decoration: none; color: inherit; border-bottom: 1px solid var(--brass); padding-bottom: .1em; }
.link-arrow::after { content: " →"; transition: margin .25s var(--ease); }
.link-arrow:hover::after { margin-left: .25em; }

/* Couverture de livre en volume (shortcode bookCover) */
.book-cover {
  position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 2px 6px 6px 2px; overflow: hidden;
  background: var(--abyss-3);
  box-shadow: 0 1px 1px rgba(0,0,0,.25), 0 10px 20px -6px rgba(0,0,0,.45), 0 30px 60px -20px rgba(0,0,0,.5);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.book-cover picture, .book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover.pos-right img { object-position: right center; }  /* pas de style en ligne : CSP style-src self */
.book-cover::after { /* reflet et pli de la reliure */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.35) 0, rgba(255,255,255,.18) 1.5%, rgba(0,0,0,.08) 3.5%, transparent 7%),
              linear-gradient(120deg, rgba(255,255,255,.08), transparent 40%);
}
a:hover > .book-cover, a:focus-visible > .book-cover { transform: translateY(-6px) rotate(-.6deg); }
@media (prefers-reduced-motion: reduce) { .book-cover, .btn { transition: none; } a:hover > .book-cover { transform: none; } }

.status { display: inline-block; font: 500 .6875rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  padding: .45em .7em; border-radius: 999px; border: 1px solid currentColor; }

/* Lien d'évitement */
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .75rem 1rem; background: var(--brass); color: var(--abyss); font-weight: 600; }
.skip-link:focus { top: 1rem; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(11, 18, 20, .92); color: var(--on-dark);
  border-bottom: 1px solid var(--line-dark);
}
@supports (backdrop-filter: blur(1px)) { .site-header { background: rgba(11, 18, 20, .78); backdrop-filter: blur(14px) saturate(1.4); } }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; min-height: var(--header-h); flex-wrap: wrap; }
.wordmark { display: flex; align-items: baseline; gap: .7rem; color: var(--on-dark); text-decoration: none; }
.wordmark-name { font: 400 1.35rem/1 var(--serif); letter-spacing: -.01em; }
.wordmark-name em { font-style: italic; color: var(--brass); }
.wordmark-role { font: 400 .6875rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-soft); }
.main-nav ul { display: flex; gap: .25rem 1.6rem; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; }
.main-nav a { position: relative; display: block; padding: .5rem 0; color: var(--on-dark-soft); text-decoration: none; font-size: .9375rem; font-weight: 500; transition: color .2s; }
.main-nav a:hover, .main-nav a[aria-current] { color: var(--on-dark); }
.main-nav a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: .2rem; height: 1px; background: var(--brass); }
/* Sélecteur de langue : ES · EN · FR, à droite de la navigation (sur mobile, à côté du nom) */
.main-nav { order: 1; margin-left: auto; }
.lang-switch { order: 2; }
.lang-switch ul { display: flex; margin: 0; padding: 0 0 0 1.1rem; list-style: none; border-left: 1px solid var(--line-dark); }
.lang-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; min-height: 2.75rem; color: var(--on-dark-soft); text-decoration: none; font: 500 .75rem/1 var(--mono); letter-spacing: .1em; transition: color .2s; }
.lang-switch a:hover { color: var(--on-dark); }
.lang-switch a[aria-current] { color: var(--brass); }
/* Avec le sélecteur de langue, le rôle ne tient plus à côté du nom (la largeur du contenu est plafonnée) :
   il reste lu par les lecteurs d'écran, et il est affiché en grand dans le héros de l'accueil */
.wordmark-role { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 60rem) and (max-width: 66rem) {
  .header-inner { gap: 1rem 1.25rem; }
  .main-nav ul { gap: .25rem 1.1rem; }
  .main-nav a { font-size: .875rem; }
  .lang-switch ul { padding-left: .6rem; }
  .lang-switch a { min-width: 1.9rem; }
}
/* Menu mobile (details/summary, sans JavaScript) : bouton « Menu » à droite, panneau sous l'en-tête */
.mobile-menu { display: none; }
@media (max-width: 59.99rem) {
  .main-nav { display: none; }
  .header-inner { flex-wrap: nowrap; gap: .5rem; }
  .wordmark { margin-right: auto; }
  .lang-switch { order: 0; }
  .lang-switch ul { padding-left: 0; border-left: 0; }
  .lang-switch a { min-width: 2rem; }
  .mobile-menu { display: block; }
  .mobile-menu summary {
    display: flex; align-items: center; gap: .55rem; min-height: 2.75rem; padding: 0 .1rem 0 .75rem;
    border-left: 1px solid var(--line-dark); list-style: none; cursor: pointer;
    color: var(--on-dark); font: 500 .75rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mm-close, .mobile-menu[open] .mm-open { display: none; }
  .mobile-menu[open] .mm-close { display: inline; }
  /* Deux traits qui deviennent une croix */
  .mm-icon { position: relative; width: 1.1rem; height: .7rem; }
  .mm-icon::before, .mm-icon::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: var(--brass); transition: transform .25s ease, top .25s ease; }
  .mm-icon::before { top: 0; }
  .mm-icon::after { top: calc(100% - 1.5px); }
  .mobile-menu[open] .mm-icon::before { top: calc(50% - .75px); transform: rotate(45deg); }
  .mobile-menu[open] .mm-icon::after { top: calc(50% - .75px); transform: rotate(-45deg); }
  .mobile-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); overflow-y: auto;
    padding: .5rem var(--gutter) 2rem; background: var(--abyss); border-bottom: 1px solid var(--line-dark);
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .45);
  }
  .mobile-nav ol { margin: 0; padding: 0; list-style: none; counter-reset: nav; }
  .mobile-nav li { counter-increment: nav; border-bottom: 1px solid var(--line-dark); }
  .mobile-nav a {
    display: flex; align-items: baseline; gap: 1rem; padding: 1rem 0; min-height: 3rem;
    color: var(--on-dark); text-decoration: none; font: 300 1.75rem/1.15 var(--serif);
  }
  .mobile-nav a::before { content: counter(nav, decimal-leading-zero); font: 400 .6875rem/1 var(--mono); letter-spacing: .1em; color: var(--on-dark-soft); }
  .mobile-nav a[aria-current] { color: var(--brass); }
  .mobile-nav a[aria-current]::before { color: var(--brass); }
  /* La page ne défile pas sous le menu ouvert */
  html:has(.mobile-menu[open]) { overflow: hidden; }
}
@media (max-width: 59.99rem) { .wordmark-name { white-space: nowrap; } }
/* Téléphone : le mot « Menu » reste lu par les lecteurs d'écran, seule l'icône est affichée */
@media (max-width: 30rem) {
  .wordmark-name { font-size: 1.2rem; }
  .lang-switch a { min-width: 1.85rem; }
  .mobile-menu summary { padding-left: .6rem; min-width: 2.75rem; justify-content: flex-end; }
  .mm-open, .mm-close { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mm-icon { width: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) { .mm-icon::before, .mm-icon::after { transition: none; } }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--abyss); color: var(--on-dark-soft); padding: var(--section) 0 2rem; font-size: .9375rem; }
/* Pied de page : présentation · liens rapides (rubriques, livres) · contact.
   Téléphone : les deux listes de liens côte à côte ; tablette : 2 colonnes ; ordinateur : 4. */
.footer-top { display: grid; gap: 2.5rem 1.5rem; grid-template-columns: 1fr 1fr; padding-bottom: 3rem; border-bottom: 1px solid var(--line-dark); }
.footer-about, .footer-contact { grid-column: 1 / -1; }
@media (min-width: 40rem) { .footer-about, .footer-contact { grid-column: auto; } .footer-top { gap: 3rem 2.5rem; } }
@media (min-width: 64rem) { .footer-top { grid-template-columns: 1.5fr .8fr 1fr 1.2fr; } }
.footer-links ul { margin: 0; padding: 0; list-style: none; }
.footer-links li + li { margin-top: .15rem; }
.footer-links a { display: inline-block; padding: .3rem 0; text-decoration: none; color: var(--on-dark-soft); transition: color .2s; }
.footer-links a:hover, .footer-links a:focus-visible { color: var(--on-dark); text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: .25em; }
.footer-links cite { font-style: italic; }
/* Écran tactile : liens du pied de page à 44 px de haut (34 px auparavant), sans changer la typographie */
@media (max-width: 59.99rem) {
  .footer-links li + li { margin-top: 0; }
  .footer-links a { padding-block: .6rem; }
}
.footer-sign { font: 400 clamp(1.8rem, 1.3rem + 2vw, 2.6rem)/1.1 var(--serif); color: var(--on-dark); margin: 0 0 1rem; }
.footer-sign em { color: var(--brass); }
.site-footer h2 { font: 500 .75rem/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--brass); margin: 0 0 1rem; }
.site-footer a { color: var(--on-dark); text-decoration-color: var(--line-dark); }
.site-footer a:hover { text-decoration-color: var(--brass); }
.site-footer address { font-style: normal; }
.social { display: flex; gap: .75rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.social a { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid var(--line-dark); border-radius: 50%; color: var(--on-dark); transition: border-color .2s, color .2s; }
.social a:hover { border-color: var(--brass); color: var(--brass); }
.social svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; padding-top: 1.5rem; font-size: .8125rem; }
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0; padding: 0; list-style: none; }

/* Champs à compléter avant publication (pages légales) */
mark.todo { background: #ffe58a; color: #000; padding: 0 .2em; }
