/* ============================================
   BASE.CSS — Reset, Variables, Typographie
   Serruriers du Léman
============================================ */

/* === FONTS AUTO-HÉBERGÉES (variable fonts, subset latin) ===
   Remplace Google Fonts CDN : 0 connexion tierce, servi via Cloudflare.
   Les *-Fallback (Arial métriquement ajustée) neutralisent le layout
   shift au swap — ne pas modifier les overrides sans re-calibrer. */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/montserrat-400-600-700-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../assets/fonts/open-sans-400-600-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat Fallback';
  src: local('Arial');
  size-adjust: 112.6521%;
  ascent-override: 85.9245%;
  descent-override: 22.2809%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Open Sans Fallback';
  src: local('Arial');
  size-adjust: 101.5017%;
  ascent-override: 105.2233%;
  descent-override: 28.8375%;
  line-gap-override: 0%;
}

/* === VARIABLES === */
:root {
  /* Couleurs — Thème Sombre Luxe */
  --color-bg: #0d0d0d;
  --color-bg-card: #1a1a1a;
  --color-bg-section: #111111;
  --color-gold: #c9a84c;
  --color-gold-light: #e8c97a;
  --color-gold-dark: #a8883a;
  --color-white: #ffffff;
  --color-text: #e8e8e8;
  --color-text-muted: #b0b0b0;
  --color-border: #2a2a2a;
  --color-overlay: rgba(0, 0, 0, 0.75);

  /* Typographies */
  --font-heading: 'Montserrat', 'Montserrat Fallback', Arial, Helvetica, sans-serif;
  --font-body: 'Open Sans', 'Open Sans Fallback', Arial, Helvetica, sans-serif;

  /* Espacement */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;

  /* Bordures */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition: 0.3s ease;
  --transition-slow: 0.6s ease;

  /* Ombres */
  --shadow-gold: 0 0 24px rgba(201, 168, 76, 0.35);
  --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.45);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* WCAG 2.2 SC 2.4.11 Focus Not Obscured — empêche le header sticky (≈120px) de masquer le focus */
  scroll-padding-top: 130px;
  -webkit-text-size-adjust: 100%;
}

/* WCAG SC 2.4.1 — Skip link "Aller au contenu principal" (visible uniquement au focus clavier) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-gold);
  color: #0d0d0d;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  z-index: 10000;
  border-radius: 0 0 6px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid #0d0d0d;
  outline-offset: 2px;
}

/* WCAG SC 2.3.3 — Animation from Interactions (respect des préférences utilisateur) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-animate] { opacity: 1 !important; transform: none !important; }
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

ul, ol { list-style: none; }

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

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* === TYPOGRAPHIE === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-white);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }

p {
  margin-bottom: var(--spacing-md);
  color: var(--color-text);
}

p:last-child { margin-bottom: 0; }

a {
  color: var(--color-gold);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--color-gold-light); }

strong { font-weight: 700; color: var(--color-white); }

/* === UTILITAIRES === */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.section {
  padding: var(--spacing-xl) 0;
}

.section--dark {
  background: var(--color-bg);
}

.section--card {
  background: var(--color-bg-section);
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

/* Badge au-dessus du titre, jamais inline avec lui */
.section-header .badge-pill {
  display: block;
  width: fit-content;
  margin: 0 auto var(--spacing-md);
}

.section-header h2 {
  margin-bottom: var(--spacing-md);
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gold-dark), var(--color-gold-light));
  border-radius: 2px;
}

.section-header p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  max-width: 580px;
  margin: var(--spacing-lg) auto 0;
}

.text-gold { color: var(--color-gold) !important; }
.text-white { color: var(--color-white) !important; }
.text-muted { color: var(--color-text-muted) !important; }
.text-center { text-align: center; }
.text-upper {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85em;
  font-weight: 600;
}

/* === ANIMATIONS === */
[data-animate] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

[data-animate].animated {
  opacity: 1;
  transform: translateY(0);
}

[data-animate-delay="1"] { transition-delay: 0.1s; }
[data-animate-delay="2"] { transition-delay: 0.2s; }
[data-animate-delay="3"] { transition-delay: 0.3s; }
[data-animate-delay="4"] { transition-delay: 0.4s; }

/* === ACCESSIBILITÉ === */
*:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background: var(--color-gold-dark);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-gold); }

/* === SÉLECTION TEXTE === */
::selection {
  background: rgba(201, 168, 76, 0.3);
  color: var(--color-white);
}

/* === RESPONSIVE BASE === */
@media (max-width: 768px) {
  :root {
    --spacing-xl: 3rem;
    --spacing-lg: 1.5rem;
  }

  .container {
    padding: 0 var(--spacing-md);
  }
}

@media (max-width: 480px) {
  :root {
    --spacing-xl: 2.5rem;
  }
}
