/* Base : remise à zéro légère, typographie, mise en page générale. */

/* Polices auto-hébergées (licence OFL, public/fonts) : Fredoka pour les titres, Nunito pour le texte. Deux sous-ensembles
   (latin, latin étendu pour « œ » et les capitales accentuées), chargés seulement si la page en a besoin. */
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(../fonts/fredoka-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(../fonts/fredoka-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url(../fonts/nunito-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url(../fonts/nunito-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  /* Papier crème avec un grain très léger : une page de livre, pas un écran. */
  background: var(--color-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0 0.15 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  color: var(--color-ink);
  font-family: var(--font-body); font-size: var(--text-md); line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img, svg { max-width: 100%; height: auto; display: block; }
/* Lu par les lecteurs d'écran seulement. */
.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; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 var(--space-4); letter-spacing: 0; text-wrap: balance; }
/* Une longue adresse e-mail ou un long mot ne déborde jamais de sa carte. */
.panel, .notice { overflow-wrap: break-word; }
h3 { font-size: var(--text-lg); }
p { margin: 0 0 var(--space-4); }
a { color: var(--color-primary-strong); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--color-primary); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; border-radius: 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-size: 0.9em; background: var(--color-primary-soft); padding: 0.1em 0.4em; border-radius: 6px; }
mark.todo { background: var(--color-warning-soft); color: var(--color-warning); padding: 0 0.3em; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--space-4); }
@media (min-width: 640px) { .container { padding: 0 var(--space-6); } }
.container--narrow { max-width: var(--container-narrow); }
.container--form { max-width: 480px; }
.center { text-align: center; }
.muted { color: var(--color-ink-muted); }
.small { font-size: var(--text-sm); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.skip-link { position: absolute; left: -999px; top: var(--space-2); background: var(--color-surface); padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); z-index: 10; }
.skip-link:focus { left: var(--space-4); }

/* Sections. */
.section { padding: var(--space-8) 0; }
/* Bandeaux sable aux bords ondulés, comme une page découpée. */
.section--tinted { background: var(--color-surface-tint); position: relative; margin: 26px 0; }
.section--tinted::before, .section--tinted::after { content: ""; position: absolute; left: 0; right: 0; height: 26px; background: var(--color-surface-tint); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 26' preserveAspectRatio='none'%3E%3Cpath d='M0 18 Q 30 0 60 13 T 120 18 L 120 26 L 0 26 Z'/%3E%3C/svg%3E") repeat-x bottom / 120px 26px; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 26' preserveAspectRatio='none'%3E%3Cpath d='M0 18 Q 30 0 60 13 T 120 18 L 120 26 L 0 26 Z'/%3E%3C/svg%3E") repeat-x bottom / 120px 26px; pointer-events: none; }
.section--tinted::before { top: -25px; }
.section--tinted::after { bottom: -25px; transform: scaleY(-1); }
.section--tinted + .section--tinted { margin-top: 0; }
.section--tinted + .section--tinted::before { display: none; }
.section__title { font-size: var(--text-2xl); }
.section__subtitle { font-size: var(--text-xl); margin-top: var(--space-6); }
.section__lead { font-size: var(--text-lg); color: var(--color-ink-muted); max-width: 46rem; margin-bottom: var(--space-6); }
.center .section__lead { margin-left: auto; margin-right: auto; }
.split { display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1.1fr 1fr; gap: var(--space-8); } }
.eyebrow { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-weight: 500; font-size: var(--text-md); color: var(--color-secondary-strong); margin-bottom: var(--space-3); }
.eyebrow::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--color-secondary); flex: none; }
.display { font-size: var(--text-display); font-weight: 600; line-height: 1.08; }
.lead { font-size: var(--text-lg); color: var(--color-ink-muted); }
.book-text { font-family: var(--font-book); font-size: var(--text-book); line-height: 1.5; }
.prose h2 { font-size: var(--text-xl); margin-top: var(--space-6); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: var(--space-2); }

/* En-tête et pied de page. */
.site-header { position: sticky; top: 0; z-index: 5; background: rgb(255 247 236 / 0.9); backdrop-filter: saturate(1.2) blur(12px); border-bottom: 1px solid rgb(234 223 206 / 0.7); }
.site-header__inner { display: flex; align-items: center; gap: var(--space-4); min-height: 72px; }
/* Le logo ne rétrécit jamais : sur un écran étroit, ce sont les boutons qui raccourcissent. */
.brand { display: flex; flex: none; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--color-ink); }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); margin: 0; white-space: nowrap; }
.show-xs { display: none; }
@media (max-width: 640px) { .hide-xs { display: none; } .show-xs { display: inline; } .site-header__actions { gap: var(--space-1); } .site-header__actions .btn--sm { padding-inline: var(--space-2); } }
@media (max-width: 420px) { .brand img { width: 34px; height: 34px; } .brand__name { font-size: var(--text-md); } }
.brand__kids { color: var(--color-secondary-strong); }
.site-nav { display: none; gap: var(--space-5); margin-left: var(--space-5); }
.site-nav a { color: var(--color-ink); text-decoration: none; font-weight: 600; }
.site-nav a:hover { color: var(--color-primary); }
.site-header__actions { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; }
/* Rien ne passe à la ligne dans l'en-tête : les liens se masquent plutôt que de s'empiler. */
.site-nav a, .site-header__actions .btn, .lang-switch { white-space: nowrap; }
.site-header__admin { color: var(--color-primary-strong); }
@media (min-width: 1040px) { .site-nav { display: flex; } .site-header__actions .site-header__library { display: none; } }
/* Petit écran : seuls « Mes livres » (connecté) et « Créer » restent ; la langue se change aussi en pied de page. */
/* Petit écran : « Mes livres » (connecté), le compte ou la connexion en lien compact, et « Créer ». */
@media (max-width: 540px) {
  .site-header__actions .btn--ghost:not(.site-header__library):not(.site-header__account) { display: none; }
  .site-header__actions .site-header__account { padding-inline: var(--space-2); border-color: transparent; background: none; }
}
/* Connecté, très petit écran : « Mes livres » cède la place au compte (la bibliothèque reste dans le pied de page et le menu). */
@media (max-width: 400px) { .site-header__actions .site-header__library + .site-header__account { display: none; } }
@media (max-width: 420px) { .site-header__actions .lang-menu { display: none; } }
.site-footer { background: var(--color-night); color: #F1ECFF; padding: var(--space-8) 0 var(--space-7); margin-top: auto; border-radius: 40px 40px 0 0; }
.site-footer__inner { display: grid; gap: var(--space-5); }
/* Grand écran : présentation, puis les deux listes de liens en colonnes. */
@media (min-width: 760px) { .site-footer__inner { grid-template-columns: minmax(14rem, 1.3fr) 1fr 1fr; gap: var(--space-6); align-items: start; } .site-footer nav { flex-direction: column; align-items: flex-start; gap: var(--space-3); } }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); }
.site-footer a { color: #EDE9FF; }
/* Pied de page sombre : le bouton de langue reste lisible ; liens plus espacés pour le doigt. */
.site-footer .lang-switch { background: transparent; color: #FFFFFF; border-color: rgb(255 255 255 / 0.45); }
.site-footer .lang-switch:hover { background: rgb(255 255 255 / 0.12); color: #FFFFFF; }
.site-footer nav a:not(.lang-switch) { display: inline-block; padding: var(--space-2) 0; }
@media (max-width: 640px) { .site-footer nav { gap: var(--space-1) var(--space-5); } }
@media (min-width: 760px) { .site-footer nav { gap: 0; } }
.site-footer .muted { color: #C9C2E6; }

/* Héros de l'accueil. */
.hero { padding: var(--space-7) 0 var(--space-8); background: radial-gradient(900px 520px at 88% 20%, var(--color-blush-soft), transparent 62%), radial-gradient(700px 420px at 6% 96%, var(--color-accent-soft), transparent 60%); }
.hero__inner { display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 900px) { .hero__inner { grid-template-columns: 1.05fr 1fr; } }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-5) 0; }
.hero__facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); color: var(--color-ink-muted); font-weight: 600; font-size: var(--text-sm); }
.hero__facts li { display: flex; align-items: center; gap: var(--space-2); }
.hero__lead--short { display: none; }
/* Tablette : deux colonnes dès 760 px, la couverture à côté du texte. */
@media (min-width: 760px) and (max-width: 899px) { .hero__inner { grid-template-columns: 1.1fr 1fr; gap: var(--space-5); } .hero .display { font-size: 2.5rem; } .hero__lead { font-size: var(--text-md); } }
/* Téléphone : titre, phrase courte, couverture, boutons pleine largeur, puis les points forts. Le texte long reste
   pour les écrans plus grands. `display: contents` laisse ranger les enfants du bloc texte autour de la couverture. */
@media (max-width: 759px) {
  .hero { padding: var(--space-5) 0 var(--space-6); }
  .hero__inner { gap: 0; }
  .hero__text { display: contents; }
  .hero .eyebrow { order: 1; font-size: var(--text-sm); margin-bottom: var(--space-2); }
  .hero .display { order: 2; font-size: clamp(1.9rem, 1.2rem + 3.6vw, 2.5rem); margin-bottom: var(--space-3); }
  .hero__lead { display: none; }
  .hero__lead--short { display: block; order: 3; font-size: var(--text-md); line-height: 1.55; margin-bottom: var(--space-5); }
  .hero__book, .hero__art { order: 4; width: min(82%, 340px); margin-inline: auto; }
  .hero__cta { order: 5; flex-direction: column; margin: var(--space-6) 0 var(--space-4); }
  .hero__cta .btn { width: 100%; }
  .hero__facts { order: 6; flex-direction: column; gap: var(--space-2); }
  .hero__facts li { align-items: flex-start; line-height: 1.4; }
  .hero__facts .icon-dot { margin-top: 0.3em; flex: none; }
  .hero__book-note { display: none; }
  .hero__book-cta { padding: 0.55rem 1.1rem; font-size: var(--text-sm); }
}
.hero__art { margin: 0; }
.hero__art img { width: 100%; filter: drop-shadow(0 24px 40px rgb(43 35 67 / 0.18)); }
.icon-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.icon-dot--sun { background: var(--color-accent); }
.icon-dot--mint { background: var(--color-mint); }
.icon-dot--lilac { background: var(--color-primary-soft); border: 2px solid var(--color-primary); }
.soon__art { margin: 0 auto var(--space-5); }
/* Très petits téléphones (320 px) : le logo seul suffit, les deux boutons d'action restent entiers. */
@media (max-width: 359px) { .brand__name { display: none; } .site-header__inner { gap: var(--space-2); } }
/* Connecté, sur petit téléphone : trois boutons (« Meine Bücher » en allemand) ; le logo seul garde l'en-tête sur une ligne. */
@media (max-width: 399px) { .site-header__inner:has(.site-header__library) .brand__name { display: none; } }

/* Page introuvable : le petit renard perdu, puis des chemins qui mènent quelque part. */
.section__lead--center { margin-inline: auto; }
.lost { text-align: center; }
.lost__art { width: min(360px, 100%); height: auto; margin: 0 auto var(--space-5); display: block; border-radius: var(--radius-xl); box-shadow: 0 18px 40px rgb(53 43 79 / 0.22); }
.lost__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin: var(--space-5) 0 var(--space-4); }
.lost__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-4); margin: 0; padding: 0; list-style: none; }

/* Blog : index en cartes, article en colonne de lecture, appels à l'action entre les sections. */
.blog-grid { list-style: none; padding: 0; margin: var(--space-6) 0 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.blog-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease); }
.blog-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.blog-card h2 { font-size: var(--text-lg); margin: 0; }
.blog-card h2 a { color: var(--color-ink); text-decoration: none; }
.blog-card h2 a::after { content: ""; position: absolute; inset: 0; }
.blog-card { position: relative; }
.blog-card p { color: var(--color-ink-muted); margin: 0; font-size: var(--text-sm); }
.blog-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); font-size: var(--text-xs); color: var(--color-ink-muted); text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.blog-article p { line-height: 1.65; }
.blog-cta { text-align: center; margin: var(--space-6) 0; padding: var(--space-5); background: var(--color-cta-soft); border-radius: var(--radius-xl); }
.blog-cta .btn { white-space: normal; text-align: center; line-height: 1.2; }
.blog-end { text-align: center; }
.breadcrumb { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-1); font-size: var(--text-sm); color: var(--color-ink-muted); }
.breadcrumb li + li::before { content: "›"; margin-right: var(--space-1); }
.breadcrumb a { color: inherit; }
@media (max-width: 640px) { .breadcrumb li[aria-current] { display: none; } }
