/*
 * ════════════════════════════════════════════════════════════
 *  Base — ART au féminin
 *  Reset, valeurs par défaut des éléments, accessibilité, utilitaires
 *  d'animation. Chargé sur toutes les pages par layouts/application.
 *
 *  Contient :
 *  - Import Google Fonts (Noto Serif + Inter)
 *  - Reset universel
 *  - Styles body globaux
 *  - Skip link et focus visible (accessibilité)
 *  - Utilitaires d'animation
 * ════════════════════════════════════════════════════════════
 */

/* ── Google Fonts — chargé via <link> dans les layouts ─────── */
/* @import supprimé : render-blocking. Voir layouts artiste/exposition/application. */

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* ── Body ──────────────────────────────────────────────────── */
body {
  font-family: var(--font-serif);
  background: var(--color-surface);
  color: var(--color-on-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ── Typographie — text-wrap (interfaces.dev) ──────────────── */
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* ── Nombres tabulaires ─────────────────────────────────────── */
/* Empêche le décalage visuel lors de mises à jour de chiffres  */
time, [data-price], [data-count], .tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ── Médias ────────────────────────────────────────────────── */
img, svg, video {
  display: block;
  max-width: 100%;
}

/* Contour 1px semi-transparent sur les images (interfaces.dev) */
/* Noir pur uniquement — une teinte se mélange à la surface et lit comme de la saleté */
img {
  outline: 1px solid var(--color-hairline);
  outline-offset: -1px;
}

/* ── Liens ─────────────────────────────────────────────────── */
a { color: inherit; }

/* ── Skip link (accessibilité) ─────────────────────────────── */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  background: var(--color-primary-dark);
  color: var(--color-on-primary);
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  text-decoration: none;
  z-index: 9999;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--transition-base);
}
.skip-link:focus { top: 0; }

/* ── Focus visible ─────────────────────────────────────────── */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-sm);
}

/* ── Réduction de mouvement ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Utilitaires d'animation (interfaces.dev) ──────────────── */

/* Fade-in de base */
@keyframes ds-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: ds-fadein 0.5s ease forwards; }

/* Fade-out subtil (opacity + blur, moins brusque qu'un déplacement) */
@keyframes ds-fadeout {
  from { opacity: 1; filter: blur(0); }
  to   { opacity: 0; filter: blur(2px); }
}

.fade-out { animation: ds-fadeout 0.2s ease forwards; }

/* Animations échelonnées — appliquer sur les enfants d'une liste */
.stagger-enter > * {
  opacity: 0;
  animation: ds-fadein 0.4s ease forwards;
}
.stagger-enter > *:nth-child(1) { animation-delay: var(--stagger-1); }
.stagger-enter > *:nth-child(2) { animation-delay: var(--stagger-2); }
.stagger-enter > *:nth-child(3) { animation-delay: var(--stagger-3); }
.stagger-enter > *:nth-child(4) { animation-delay: var(--stagger-4); }
.stagger-enter > *:nth-child(5) { animation-delay: var(--stagger-5); }
