/* ============================================================================
   BimBeau Starter — feuille principale
   1. Base   2. Socle bb-   3. En-tête, navigation, pied de page   4. Contenu
   5. Composants génériques   6. Défilement et mouvement
   Neutre par construction : structure et accessibilité, pas de direction artistique.
   Convention de nommage du projet : starter-bloc, starter-bloc__elem, starter-bloc--variante, is-etat.
   Placement par classes sémantiques du gabarit, jamais par utilitaires (contrat §4).
   ============================================================================ */

/* --------------------------------------------------------------------------
   1. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body { margin: 0; background: var(--bb-color-bg); color: var(--bb-color-ink); font-family: var(--bb-font-body); font-size: var(--bb-text-md); line-height: 1.5; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--bb-font-display); line-height: 1.15; text-wrap: balance; }
p, figure, ul, ol, dl, dd, blockquote { margin: 0; }
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.15em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--bb-color-accent); outline-offset: 3px; }

/* --------------------------------------------------------------------------
   2. Socle bb- (contrat BimBeau v0.1 §4) — les trois classes du socle, priorité la plus basse
   -------------------------------------------------------------------------- */
.bb-container { width: min(100% - 2 * var(--bb-space-md), var(--bb-width-container)); margin-inline: auto; }
.bb-measure { max-width: var(--bb-width-content); }
.bb-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; }

/* Lien d'évitement : visible au focus clavier */
.starter-skip { position: absolute; top: -100px; left: var(--bb-space-md); z-index: 100; padding: var(--bb-space-xs) var(--bb-space-sm); background: var(--bb-color-ink); color: var(--bb-color-bg); }
.starter-skip:focus { top: var(--bb-space-xs); }

/* --------------------------------------------------------------------------
   3. En-tête, navigation, pied de page — structure à recomposer par projet
   -------------------------------------------------------------------------- */
.starter-header { padding-block: var(--bb-space-sm); border-bottom: 1px solid var(--bb-color-line); }
.starter-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--bb-space-sm) var(--bb-space-md); }
.starter-brand { font-family: var(--bb-font-display); font-size: var(--bb-text-lg); }
.starter-brand a { color: var(--bb-color-brand); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.custom-logo { max-height: 3rem; width: auto; }
.starter-nav__list { display: flex; flex-wrap: wrap; gap: var(--bb-space-xs) var(--bb-space-md); margin: 0; padding: 0; list-style: none; }
.starter-nav__list a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.starter-nav__list a:hover, .starter-nav__list a:focus-visible,
.starter-nav__list .current-menu-item > a, .starter-nav__list .current_page_item > a { text-decoration: underline; }
.starter-header__toggle { display: none; min-height: 44px; min-width: 44px; padding-inline: var(--bb-space-xs); }

/* Sous 768 px : le menu se replie derrière le bouton (JS) ; sans JS, il reste visible. Même seuil dans main.js. */
@media (max-width: 767px) {
  .starter-header__toggle { display: inline-flex; align-items: center; }
  .starter-nav { flex-basis: 100%; }
  html.has-js .starter-nav:not(.is-open) { display: none; }
  .starter-nav__list { flex-direction: column; gap: 0; padding-block: var(--bb-space-xs); border-top: 1px solid var(--bb-color-line); }
}

.starter-footer { margin-top: var(--bb-space-xl); padding-block: var(--bb-space-lg); border-top: 1px solid var(--bb-color-line); font-size: var(--bb-text-sm); }
.starter-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--bb-space-sm) var(--bb-space-md); }
.starter-footer__list { display: flex; flex-wrap: wrap; gap: var(--bb-space-xs) var(--bb-space-md); margin: 0; padding: 0; list-style: none; }
.starter-footer__list a { display: inline-flex; align-items: center; min-height: 44px; }

/* --------------------------------------------------------------------------
   4. Contenu
   -------------------------------------------------------------------------- */
.starter-main { padding-block: var(--bb-space-lg); }
.starter-kicker { font-size: var(--bb-text-sm); margin-bottom: var(--bb-space-xs); }
.starter-title { font-size: var(--bb-text-2xl); margin-bottom: var(--bb-space-md); }
.starter-article__media { margin-bottom: var(--bb-space-md); }
.starter-article__media img { border-radius: var(--bb-radius-md); }

.starter-prose > * + * { margin-top: var(--bb-space-sm); }
.starter-prose h2 { font-size: var(--bb-text-xl); margin-top: var(--bb-space-lg); }
.starter-prose h3 { font-size: var(--bb-text-lg); margin-top: var(--bb-space-md); }
.starter-prose ul, .starter-prose ol { padding-left: 1.25em; }
.starter-prose blockquote { padding-left: var(--bb-space-sm); border-left: 2px solid var(--bb-color-line); }
.starter-prose img { border-radius: var(--bb-radius-md); }

.starter-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--bb-color-line); }
.starter-list__item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--bb-space-xs) var(--bb-space-md); padding-block: var(--bb-space-sm); border-bottom: 1px solid var(--bb-color-line); }
.starter-list__date { font-size: var(--bb-text-sm); white-space: nowrap; }
.starter-main .pagination .nav-links { display: flex; flex-wrap: wrap; gap: var(--bb-space-xs); margin-top: var(--bb-space-md); }

.starter-section { padding-block: var(--bb-space-lg); }
.starter-section__title { font-size: var(--bb-text-xl); margin-bottom: var(--bb-space-md); }

/* --------------------------------------------------------------------------
   5. Composants génériques
   -------------------------------------------------------------------------- */
/* starter_image() : cadre au ratio donné, image couvrante */
.starter-image { position: relative; overflow: hidden; aspect-ratio: var(--ratio, 4 / 3); background: var(--bb-color-line); border-radius: var(--bb-radius-md); }
.starter-image__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* --------------------------------------------------------------------------
   6. Défilement et mouvement
   -------------------------------------------------------------------------- */
/* Ancres : lissage natif du navigateur ; quand Lenis est actif (html.lenis), c'est lui qui lisse. */
html { scroll-behavior: smooth; }
html.lenis { scroll-behavior: auto; }

/* prefers-reduced-motion est respecté systématiquement (contrat §6) : aucune animation ni transition,
   défilement natif. Le motion d'un projet pose ses états finaux dans ce bloc. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
