/* ==========================================================================
   BASE.CSS — Variables, Reset, Typographie
   GRD Rénovation
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CUSTOM PROPERTIES
   -------------------------------------------------------------------------- */
:root {
  /* Palette — Artisan Premium */
  --color-primary:      #1B2A4A;   /* Marine profond */
  --color-primary-dark: #111e33;
  --color-primary-rgb:  27, 42, 74;
  --color-secondary:    #C4784A;   /* Terre cuite */
  --color-secondary-light: #d4916a;
  --color-accent:       #D4A96A;   /* Or chaud */
  --color-surface:      #F5F0EB;   /* Blanc cassé chaud */
  --color-surface-alt:  #EDE8E2;
  --color-text:         #2C2C2C;
  --color-text-muted:   #6B6460;
  --color-text-light:   #9B9490;
  --color-white:        #FFFFFF;
  --color-border:       #DDD8D2;
  --color-success:      #3A7D44;
  --color-error:        #C0392B;

  /* Typographie */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  /* Échelle typographique (Major Third × 1.25) */
  --text-xs:   0.64rem;
  --text-sm:   0.8rem;
  --text-base: 1rem;
  --text-md:   1.25rem;
  --text-lg:   1.563rem;
  --text-xl:   1.953rem;
  --text-2xl:  2.441rem;
  --text-3xl:  3.052rem;
  --text-4xl:  3.815rem;

  /* Espacement (base 8px) */
  --space-1:  0.5rem;
  --space-2:  1rem;
  --space-3:  1.5rem;
  --space-4:  2rem;
  --space-6:  3rem;
  --space-8:  4rem;
  --space-12: 6rem;
  --space-16: 8rem;

  /* Layout */
  --container-max:     1200px;
  --container-padding: 1.5rem;
  --section-padding:   5rem 0;

  /* Bordures & Ombres */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(27, 42, 74, 0.07);
  --shadow-md: 0 8px 32px rgba(27, 42, 74, 0.11);
  --shadow-lg: 0 20px 60px rgba(27, 42, 74, 0.16);
  --shadow-xl: 0 32px 80px rgba(27, 42, 74, 0.22);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   300ms ease;
  --transition-slow:   600ms ease;
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-floating: 900;
  --z-header:   1000;
  --z-overlay:  1100;
  --z-modal:    1200;
}

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

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

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

img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

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

ul, ol {
  list-style: none;
}

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

/* --------------------------------------------------------------------------
   3. TYPOGRAPHIE
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: var(--space-2);
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 2rem;
  height: 2px;
  background-color: var(--color-secondary);
  vertical-align: middle;
  margin-right: 0.75rem;
}

h1 { font-size: clamp(2.2rem, 5vw, var(--text-4xl)); }
h2 { font-size: clamp(1.8rem, 3.5vw, var(--text-3xl)); }
h3 { font-size: clamp(1.3rem, 2.5vw, var(--text-xl)); }
h4 { font-size: var(--text-md); }

.section-title {
  font-size: clamp(1.8rem, 3.5vw, var(--text-3xl));
  margin-bottom: var(--space-2);
}

.section-subtitle {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  font-weight: 400;
  max-width: 600px;
  line-height: 1.6;
}

.section-header {
  margin-bottom: var(--space-8);
}

.section-header--center {
  text-align: center;
}

.section-header--center .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
   4. LAYOUT HELPERS
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

section {
  padding: var(--section-padding);
}

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

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-white);
}

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

.section--surface-alt {
  background-color: var(--color-surface-alt);
}

/* Grille responsive */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --------------------------------------------------------------------------
   5. ACCESSIBILITÉ
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--color-secondary);
  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: 0;
}

/* Désactiver animations si préférence système */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
