/* ============================================
   OPENSEZAM — MAQUETTE SITE REFONTE
   Design System — Assembler
   ============================================ */

/* ── Design tokens & keyframes ── */
@import "tokens.css";

/* ── Éléments atomiques ── */
@import "atoms.css";

/* ── Composants réutilisables ── */
@import "molecules.css";

/* ── Sections et layouts de page ── */
@import "organisms.css";

/* ══════════════════════════════════════════
   BASE — Reset, body, grainient background
   ══════════════════════════════════════════ */

/* Transition douce lors du changement de thème */
*, *::before, *::after {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
/* Exclure les animations du shader et des éléments critiques */
canvas, .nav::before, [class*="animation"] {
    transition: none !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; background: var(--bg-page); }
body { font-family: var(--font-body); color: var(--text); background: var(--bg-page); line-height: 1.7; overflow-x: hidden; }

/* Grainient — fond animé pleine page (homepage dark mode) */
#grainient-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.35;
}
#grainient-bg canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
[data-theme="dark"] body.grainient-page {
    background: transparent;
}

/* ══════════════════════════════════════════
   TYPOGRAPHY
   ══════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 600; line-height: 1.25; color: var(--heading-color); max-width: 700px; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 580px; }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 1rem; max-width: 620px; }
h3 { font-size: clamp(1.2rem, 3vw, 1.6rem); margin-bottom: 1rem; }
h4 { font-size: 1.15rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; max-width: 700px; }

/* Auto-centrage dans les blocs text-center */
.text-center h1, .text-center h2, .text-center h3,
.text-center h4, .text-center h5, .text-center h6,
.text-center p { margin-left: auto; margin-right: auto; }

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-label {
    font-family: var(--font-heading); font-size: 0.8rem; font-weight: 700;
    letter-spacing: 3px; text-transform: uppercase; color: var(--primary);
    margin-bottom: 1rem; display: block;
}
.section-title { margin-bottom: 1.5rem; }
.section-subtitle { font-size: 1.15rem; color: var(--text-light); max-width: 700px; margin: 0 auto 3rem; }

/* ══════════════════════════════════════════
   LAYOUT UTILITIES
   ══════════════════════════════════════════ */

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section-py) 0; }
.section-dark { background: var(--dark); color: var(--white); --text-light: rgba(255,255,255,0.7); --text-muted: rgba(255,255,255,0.65); }
.section-dark h2, .section-dark h3, .section-dark h4 { color: var(--white); }
.section-dark .section-subtitle { color: var(--text-muted); }
.section-alt { background: transparent; }
.text-center { text-align: center; }

/* ---- LEGAL / ARTICLE CONTENT ---- */
.legal-content { max-width: 760px; margin: 0 auto; color: var(--text-light); }
.legal-content h2 { font-size: 1.3rem; color: var(--heading-color); margin-top: 2.5rem; max-width: none; }
.legal-content h2:first-child, .legal-content section:first-child h2 { margin-top: 0; }
.legal-content h3 { font-size: 1.05rem; color: var(--heading-color); margin-top: 1.5rem; max-width: none; }
.legal-content p { line-height: 1.8; max-width: none; }
.legal-content a { color: var(--primary); text-decoration: none; }
.legal-content a:hover { text-decoration: underline; }

/* ---- LEGAL LAYOUT (with TOC sidebar) ---- */
.legal-layout { display: grid; grid-template-columns: 260px 1fr; gap: 3rem; align-items: start; }
.legal-layout .legal-content { max-width: none; margin: 0; }
.legal-layout .legal-content section { scroll-margin-top: calc(var(--nav-height) + 2rem); }
.legal-toc {
    position: sticky;
    top: calc(var(--nav-height) + 2rem);
    background: var(--card-bg-glass);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--card-border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: inset 0 1px 0 0 rgba(255,255,255,0.14), 0 4px 20px rgba(0,0,0,0.08);
    max-height: calc(100vh - var(--nav-height) - 4rem);
    overflow-y: auto;
}
.legal-toc-label {
    font-family: var(--font-heading); font-size: 0.75rem; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase; color: var(--primary);
    display: block; margin-bottom: 1rem;
}
.legal-toc nav { display: flex; flex-direction: column; gap: 0.15rem; }
.legal-toc nav a {
    color: var(--text-light); text-decoration: none; font-size: 0.85rem;
    line-height: 1.4; padding: 0.45rem 0.6rem; border-radius: 8px;
    transition: all 0.2s ease;
}
.legal-toc nav a:hover { color: var(--heading-color); background: rgba(255,255,255,0.08); }
@media (max-width: 900px) {
    .legal-layout { grid-template-columns: 1fr; }
    .legal-toc { position: static; max-height: none; margin-bottom: 1rem; }
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }

@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .grid-6 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
    .grid-6 { grid-template-columns: 1fr; }
}
