/*
 * Base Styles
 * Fondations du système de design : Variables, Reset, Typography, Layout
 */

/* ========== CSS RESET ========== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
h1, h2, h3, h4, h5, h6,
p,
ul, ol, li {
  margin: 0;
  padding: 0;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

ul, ol {
  list-style: none;
}

/* ========== CSS CUSTOM PROPERTIES ========== */

:root {
  /* Brand Colors */
  --color-primary: #2F4F5A;
  --color-secondary: #E0D5CA;
  --color-accent: #A24936;
  --color-text: #142226;
  --color-bg: #FBFAF6;
  --color-white: #FBFAF6;

  /* Semantic Colors */
  --color-success: #4CAF50;
  --color-error: #E53935;
  --color-warning: #FFA726;

  /* Spacing System (8px base unit) */
  --spacing-unit: 8px;
  --spacing-xs: calc(var(--spacing-unit) * 1);   /* 8px */
  --spacing-sm: calc(var(--spacing-unit) * 2);   /* 16px */
  --spacing-md: calc(var(--spacing-unit) * 3);   /* 24px */
  --spacing-lg: calc(var(--spacing-unit) * 4);   /* 32px */
  --spacing-xl: calc(var(--spacing-unit) * 6);   /* 48px */

  /* Typography */
  --font-headings: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --line-height-base: 1.5;

  /* Font Sizes */
  --font-size-h1: 48px;
  --font-size-h2: 32px;
  --font-size-h3: 24px;
  --font-size-body: 18px;
  --font-size-cta: 18px;

  /* Font Weights */
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --font-weight-black: 900;

  /* Letter Spacing */
  --letter-spacing-cta: 0.04em;

  /* Transitions */
  --transition-base: 0.2s ease;
}

/* ========== SMOOTH SCROLL ========== */

html {
  scroll-behavior: smooth;
}

/* ========== TYPOGRAPHY ========== */

body {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1 {
  font-family: var(--font-headings);
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
}

h2 {
  font-family: var(--font-headings);
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
  line-height: 1.3;
}

h3 {
  font-family: var(--font-headings);
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
}

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

a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-accent);
}

a:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========== LAYOUT ========== */

.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

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

/* ========== ACCESSIBILITY ========== */

.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  z-index: 1000;
}

.skip-to-content:focus {
  top: 0;
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== RESPONSIVE OVERRIDES ========== */

/* Tablet breakpoint: 768px+ */
@media (min-width: 768px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Desktop breakpoint: 1024px+ */
@media (min-width: 1024px) {
  h1 {
    font-size: 56px;
  }

  h2 {
    font-size: 40px;
  }
}
