/* ============================================
   MADE Institut — Base Styles
   Reset + Typographie + Fondation
   ============================================ */

/* ── Google Fonts (Cormorant Garamond + Montserrat) ── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=Montserrat:wght@300;400;500;600;700&display=swap');

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Typographie ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  color: var(--dark);
  letter-spacing: 0.02em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); letter-spacing: 0.05em; }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

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

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

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

a:hover {
  color: var(--primary-dark);
}

/* ── Images ── */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  font-style: italic; /* alt text style */
}

/* ── Formulaires ── */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

input, textarea, select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--white);
  font-size: 16px; /* Prevents iOS zoom */
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* ── Listes ── */
ul, ol {
  list-style: none;
}

/* ── Sélection ── */
::selection {
  background-color: rgba(var(--primary-rgb), 0.2);
  color: var(--dark);
}

/* ── Focus visible (accessibilité) ── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Utilitaires Layout ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

/* ── Section spacing ── */
.section {
  padding: var(--space-section) 0;
}

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

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

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

/* ── Section header ── */
.section__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section__label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.section__title {
  font-size: var(--fs-h2);
  margin-bottom: var(--space-md);
}

.section__subtitle {
  font-size: var(--fs-body);
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Decorative divider ── */
.divider {
  width: 60px;
  height: 2px;
  background-color: var(--primary);
  margin: var(--space-lg) auto;
}

/* ── Visually hidden (accessibility) ── */
.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;
}

/* ── Scroll animation base ── */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

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

[data-animate="fade-right"] {
  transform: translateX(-30px);
}

[data-animate="fade-right"].is-visible {
  transform: translateX(0);
}

[data-animate="fade-left"] {
  transform: translateX(30px);
}

[data-animate="fade-left"].is-visible {
  transform: translateX(0);
}

[data-animate="scale"] {
  transform: scale(0.95);
}

[data-animate="scale"].is-visible {
  transform: scale(1);
}
