/* ============================================================
   HymSchool — Styles principaux
   main.css : variables, reset, layout, typographie, utilitaires
   ============================================================ */

/* ─── Google Fonts ──────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Variables CSS ─────────────────────────────────────────────────────────── */
:root {
  /* Couleurs */
  --color-primary:      #2d9c8a;   /* teal logo center */
  --color-primary-dark: #1e7a6a;
  --color-primary-light:#ccf5ef;
  --color-accent:       #e8781e;   /* orange logo right */
  --color-accent-light: #fde8d0;
  --color-navy:         #1a2878;   /* navy logo text HYM */
  --color-navy-dark:    #0f1a50;
  --color-bg-dark:      #0f1a50;   /* deep navy (was slate) */
  --color-bg-dark-2:    #1a2878;
  --color-bg-light:     #f8fafc;
  --color-bg-white:     #ffffff;
  --color-text:         #1e293b;
  --color-muted:        #64748b;
  --color-border:       #e2e8f0;
  --color-border-dark:  #2a3a7a;
  --color-success:      #10b981;
  --color-danger:       #ef4444;
  --color-warning:      #f59e0b;

  /* Typographie */
  --font-title: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:  'Inter', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'Courier New', monospace;

  /* Échelle typographique */
  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */
  --text-2xl:  1.5rem;    /* 24px */
  --text-3xl:  1.875rem;  /* 30px */
  --text-4xl:  2.25rem;   /* 36px */
  --text-5xl:  3rem;      /* 48px */
  --text-6xl:  3.75rem;   /* 60px */

  /* Espacements (base 8px) */
  --space-1:  0.5rem;   /* 8px */
  --space-2:  1rem;     /* 16px */
  --space-3:  1.5rem;   /* 24px */
  --space-4:  2rem;     /* 32px */
  --space-6:  3rem;     /* 48px */
  --space-8:  4rem;     /* 64px */
  --space-12: 6rem;     /* 96px */
  --space-16: 8rem;     /* 128px */

  /* Layout */
  --container-max:   1200px;
  --container-pad:   1.5rem;
  --section-py:      6rem;
  --section-py-mob:  4rem;

  /* Bordures & Ombres */
  --radius-sm:  0.375rem;  /* 6px */
  --radius-md:  0.75rem;   /* 12px */
  --radius-lg:  1.25rem;   /* 20px */
  --radius-xl:  1.5rem;    /* 24px */
  --radius-full: 9999px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.07);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.14), 0 4px 16px rgba(0,0,0,.08);
  --shadow-xl:  0 20px 60px rgba(0,0,0,.20);

  /* Transitions */
  --transition:      200ms ease;
  --transition-slow: 350ms ease;
}

/* ─── Thème clair / sombre ──────────────────────────────────────────────────── */
/*
 * Strategy (identical to Hymagos_Website):
 *   Light = default. Override base design tokens in [data-theme="dark"]
 *   so every component using var(--color-bg-white), var(--color-text), etc. auto-adapts.
 *   Nav/tab/drawer use --theme-* vars for the few hardcoded dark glass values.
 *   Nav links default to white (hero is always a dark gradient);
 *   only .navbar.is-scrolled switches to theme-aware colors.
 */

/* ── LIGHT MODE (default) ── */
:root,
html[data-theme="light"] {
  /* Nav scrolled state */
  --theme-nav-bg:              rgba(255,255,255,.97);
  --theme-nav-border:          rgba(45,156,138,.20);
  --theme-nav-shadow:          0 2px 16px rgba(0,0,0,.08);
  --theme-nav-link:            #334155;
  --theme-nav-link-hover-c:    var(--color-primary-dark);
  --theme-nav-link-hover-bg:   rgba(45,156,138,.08);
  --theme-nav-active-c:        var(--color-primary-dark);
  --theme-nav-active-bg:       rgba(45,156,138,.12);
  --theme-hamburger:           #1e293b;
  /* Sticky tabs */
  --theme-tab-bg:              rgba(255,255,255,.98);
  --theme-tab-border:          rgba(45,156,138,.15);
  --theme-tab-link:            #64748b;
  --theme-tab-link-hover-c:    var(--color-primary-dark);
  --theme-tab-link-hover-bg:   rgba(45,156,138,.06);
  --theme-tab-active-c:        var(--color-primary-dark);
  --theme-tab-active-border:   var(--color-primary-dark);
  /* Mobile drawer */
  --theme-drawer-bg:           #ffffff;
  --theme-drawer-text:         #1e293b;
  --theme-drawer-hover:        #f0fdfb;
  /* Theme toggle button */
  --theme-toggle-bg:           rgba(45,156,138,.10);
  --theme-toggle-c:            var(--color-primary-dark);
  --theme-toggle-hover:        rgba(45,156,138,.18);
  /* Body & icon state */
  --theme-body-bg:             #f4faf9;
  --theme-sun-display:         block;
  --theme-moon-display:        none;
  
  /* Text colors with good contrast */
  --theme-text-primary:        #1e7a6a; /* primary-dark */
  --theme-text-primary-hover:  #165c50;
  --theme-text-accent:         #c25e12; /* accent-dark */
}

/* ── DARK MODE ── */
html[data-theme="dark"] {
  /* ── Override base design tokens — components auto-switch ── */
  --color-bg-white:            rgba(255,255,255,.06);  /* glass panels over gradient */
  --color-bg-light:            rgba(0,0,0,.12);         /* subtle section alternates */
  --color-text:                rgba(255,255,255,.90);
  --color-muted:               rgba(255,255,255,.55);
  --color-border:              rgba(255,255,255,.10);
  --color-border-dark:         rgba(255,255,255,.14);
  --color-primary-light:       rgba(45,156,138,.22);
  --color-accent-light:        rgba(232,120,30,.18);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.30);
  --shadow-md:  0 4px 16px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.38);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.65), 0 4px 16px rgba(0,0,0,.45);

  /* Nav scrolled */
  --theme-nav-bg:              rgba(10,18,60,.85);
  --theme-nav-border:          rgba(45,156,138,.30);
  --theme-nav-shadow:          0 2px 24px rgba(0,0,0,.35);
  --theme-nav-link:            rgba(255,255,255,.80);
  --theme-nav-link-hover-c:    #ffffff;
  --theme-nav-link-hover-bg:   rgba(255,255,255,.10);
  --theme-nav-active-c:        var(--color-accent);
  --theme-nav-active-bg:       rgba(232,120,30,.14);
  --theme-hamburger:           #ffffff;
  /* Sticky tabs */
  --theme-tab-bg:              rgba(10,18,60,.90);
  --theme-tab-border:          rgba(45,156,138,.30);
  --theme-tab-link:            rgba(255,255,255,.60);
  --theme-tab-link-hover-c:    rgba(255,255,255,.90);
  --theme-tab-link-hover-bg:   rgba(255,255,255,.06);
  --theme-tab-active-c:        var(--color-accent);
  --theme-tab-active-border:   var(--color-accent);
  /* Mobile drawer */
  --theme-drawer-bg:           rgba(10,18,60,.97);
  --theme-drawer-text:         rgba(255,255,255,.85);
  --theme-drawer-hover:        rgba(255,255,255,.06);
  /* Theme toggle */
  --theme-toggle-bg:           rgba(255,255,255,.10);
  --theme-toggle-c:            #ffffff;
  --theme-toggle-hover:        rgba(255,255,255,.18);
  /* Icon state */
  --theme-body-bg:             transparent;
  --theme-sun-display:         none;
  --theme-moon-display:        block;

  /* Text colors with good contrast */
  --theme-text-primary:        #4fd1c5;
  --theme-text-primary-hover:  #81e6d9;
  --theme-text-accent:         #fbd38d;
}

/* Dark mode: hero gradient applied to the entire page (fixed so it doesn't scroll) */
html[data-theme="dark"] {
  background: linear-gradient(135deg, var(--color-navy-dark) 0%, var(--color-primary-dark) 55%, var(--color-primary) 100%);
  background-attachment: fixed;
  min-height: 100%;
}
html[data-theme="dark"] body {
  background-color: transparent;
}

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

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

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

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

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

ul, ol { list-style: none; }

button { cursor: pointer; font-family: inherit; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

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

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-top: var(--section-py);
  padding-bottom: var(--section-py);
}
.section--sm {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}
.section--dark {
  background-color: var(--color-bg-dark);
  color: #ffffff;
}
.section--dark h1,
.section--dark h2,
.section--dark h3 {
  color: #ffffff;
}
.section--gray {
  background-color: var(--color-bg-light);
}
.section--teal {
  background: linear-gradient(135deg, var(--color-navy-dark) 0%, var(--color-primary-dark) 40%, var(--color-primary) 70%, rgba(232,120,30,.45) 100%);
  color: #ffffff;
}
.section--teal h1,
.section--teal h2,
.section--teal h3 {
  color: #ffffff;
}

/* Grilles */
.grid {
  display: grid;
  gap: var(--space-4);
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2-3 { grid-template-columns: 2fr 1fr; }

/* Flex */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* ─── Typographie ───────────────────────────────────────────────────────────── */
.heading-1 {
  font-size: clamp(2rem, 5vw, var(--text-6xl));
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.heading-2 {
  font-size: clamp(1.5rem, 3.5vw, var(--text-4xl));
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.heading-3 {
  font-size: clamp(1.25rem, 2.5vw, var(--text-3xl));
  font-weight: 700;
}
.heading-4 {
  font-size: var(--text-xl);
  font-weight: 600;
}

.section-label {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--theme-text-primary);
  display: block;
  margin-bottom: var(--space-2);
}
.section-label--light {
  color: var(--theme-text-accent);
}

.section-title {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 3vw, var(--text-4xl));
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-muted);
  max-width: 640px;
  margin-inline: auto;
  line-height: 1.7;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}
.section-header--left {
  text-align: left;
  margin-bottom: var(--space-6);
}
.section-header--left .section-subtitle {
  margin-inline: 0;
}

/* ─── Utilitaires ───────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.text-primary { color: var(--theme-text-primary); }
.text-accent  { color: var(--theme-text-accent); }
.text-muted   { color: var(--color-muted); }
.text-white   { color: #ffffff; }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }

.font-mono { font-family: var(--font-mono); }
.font-bold  { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

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

.hidden  { display: none !important; }
.visible { visibility: visible; }

/* Séparateur */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-6) 0;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root {
    --section-py: var(--section-py-mob);
  }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .container { padding-inline: 1rem; }

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