/* ==========================================================================
   Base — Le Comptoir JunaSol
   Typographie fluid, container, utilities
   ========================================================================== */

html {
    scroll-behavior: smooth;
    transition:
        background-color var(--dur) var(--ease),
        color var(--dur) var(--ease);
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
    transition:
        background-color var(--dur) var(--ease),
        color var(--dur) var(--ease);
}

/* --- Titres --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.12;
    color: var(--text);
}

h1 { font-size: clamp(2.25rem, 1.5rem + 3vw, 4.25rem); font-weight: 600; }
h2 { font-size: clamp(1.85rem, 1.3rem + 2vw, 3rem);   font-weight: 600; }
h3 { font-size: clamp(1.35rem, 1.05rem + 1vw, 1.75rem); font-weight: 500; letter-spacing: -0.01em; }
h4 { font-size: clamp(1.1rem, 0.95rem + 0.5vw, 1.35rem); font-weight: 500; font-family: var(--font-body); letter-spacing: 0; }
h5 { font-size: 1.05rem; font-weight: 600; font-family: var(--font-body); letter-spacing: 0; }

p { margin-bottom: var(--s-4); }
p:last-child { margin-bottom: 0; }

a {
    color: var(--olive);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--terre); }

em { font-style: italic; }
strong { font-weight: 600; }

/* --- Container & layout --- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--s-6);
}
.container-narrow {
    width: 100%;
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 var(--s-6);
}
.container-wide {
    width: 100%;
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 var(--s-6);
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-olive  { color: var(--olive); }
.text-terre  { color: var(--terre); }
.bg-alt      { background-color: var(--surface-alt); }
.bg-surface  { background-color: var(--surface); }
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: absolute;
    left: var(--s-4);
    top: -100px;
    background: var(--olive);
    color: #fff;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    z-index: 9999;
    transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: var(--s-4); }

/* --- Focus visible --- */
:focus-visible {
    outline: 2px solid var(--olive);
    outline-offset: 3px;
    border-radius: var(--r-sm);
}

/* --- Sélection --- */
::selection {
    background: var(--olive-light);
    color: var(--text);
}

/* --- Section commune --- */
section {
    padding: var(--s-20) 0;
    position: relative;
    transition:
        background-color var(--dur) var(--ease),
        color var(--dur) var(--ease);
}
section.compact { padding: var(--s-12) 0; }

.section-title {
    font-size: clamp(2rem, 1.5rem + 1.5vw, 2.75rem);
    margin-bottom: var(--s-3);
}
.section-subtitle {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 60ch;
    margin-bottom: var(--s-10);
}
.section-header {
    margin-bottom: var(--s-12);
}
.section-header.center { text-align: center; }
.section-header.center .section-subtitle { margin-left: auto; margin-right: auto; }

/* --- Scroll reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.8s var(--ease),
        transform 0.8s var(--ease);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --- Transitions globales --- */
header, footer, .card, .btn, input, textarea, select, .badge, .chip, .tag {
    transition:
        background-color var(--dur) var(--ease),
        color var(--dur) var(--ease),
        border-color var(--dur) var(--ease),
        box-shadow var(--dur-fast) var(--ease),
        transform var(--dur-fast) var(--ease);
}

/* --- Typographie éditoriale --- */
.eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--olive);
    margin-bottom: var(--s-3);
}
.lead {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--muted);
    max-width: 62ch;
}
.display-italic {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
}
