/**
 * critical.css — Styles essentiels pour le rendu initial (Above-the-fold)
 * Ce fichier est préchargé pour optimiser le LCP (Largest Contentful Paint)
 * 
 * @package adimed-theme
 * @version 2.0.0
 */

/* ==========================================================================
   VARIABLES ESSENTIELLES
   ========================================================================== */
:root {
    /* Couleurs primaires */
    --color-navy: #002B5C;
    --color-navy-dark: #001a38;
    --color-navy-90: rgba(0, 43, 92, 0.9);
    --color-navy-60: rgba(0, 43, 92, 0.6);
    --color-navy-20: rgba(0, 43, 92, 0.2);
    --color-navy-10: rgba(0, 43, 92, 0.1);
    --color-navy-5: rgba(0, 43, 92, 0.05);
    
    /* Rouge CTA */
    --color-red: #D62828;
    --color-red-dark: #b51c1c;
    --color-red-20: rgba(214, 40, 40, 0.2);
    --color-red-15: rgba(214, 40, 40, 0.15);
    
    /* Surfaces */
    --color-white: #FFFFFF;
    --surface-page: #F9FAFB;
    --surface-card: #FFFFFF;
    
    /* Typographie */
    --font-display: "DM Serif Display", Georgia, serif;
    --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Tailles */
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    
    /* Espacements */
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Layout */
    --container-max: 1280px;
    --header-height: 72px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 43, 92, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 43, 92, 0.08), 0 2px 4px -1px rgba(0, 43, 92, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

/* ==========================================================================
   RESET MINIMAL
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background-color: var(--surface-page);
    color: var(--color-navy);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ==========================================================================
   HEADER CRITIQUE
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 43, 92, 0.06);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 43, 92, 0.08);
}

.header__container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.logo__symbol {
    width: 40px;
    height: 40px;
    background: var(--color-navy);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo__symbol svg {
    width: 24px;
    height: 24px;
    color: white;
}

.logo__text {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 400;
    color: var(--color-navy);
    letter-spacing: -0.02em;
}

.logo__tagline {
    font-size: var(--text-sm);
    color: var(--color-navy-60);
    font-weight: 500;
}

/* Navigation primaire */
.nav-primary {
    display: none;
}

@media (min-width: 1024px) {
    .nav-primary {
        display: flex;
        align-items: center;
        gap: var(--space-8);
    }
}

.nav-primary__list {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    list-style: none;
}

.nav-primary__link {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-navy-90);
    padding: var(--space-2) 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-primary__link:hover {
    color: var(--color-navy);
}

.nav-primary__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-red);
    transition: width var(--transition-base);
}

.nav-primary__link:hover::after {
    width: 100%;
}

/* ==========================================================================
   BOUTON CTA CRITIQUE
   ========================================================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: var(--color-red);
    color: var(--color-white);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px var(--color-red-15);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.25s ease, 
                box-shadow 0.25s ease, 
                transform 0.25s ease;
}

.btn-primary:hover {
    background: var(--color-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(214, 40, 40, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.header-cta {
    display: none;
}

@media (min-width: 1024px) {
    .header-cta {
        display: inline-flex;
    }
}

/* ==========================================================================
   HERO CRITIQUE
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-navy) 0%, #003d85 50%, #0047a8 100%);
}

.hero__content {
    position: relative;
    z-index: 10;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-16) var(--space-4);
    color: var(--color-white);
}

.hero__overline {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--space-4);
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 8vw, var(--text-4xl));
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: var(--space-6);
    max-width: 800px;
    width: 100%;
}

@media (max-width: 768px) {
    .hero__title br {
        display: none;
    }
}

.hero__title em {
    font-style: italic;
    color: #ff6b6b;
}

.hero__desc {
    font-size: var(--text-lg);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    max-width: 640px;
    margin-bottom: var(--space-8);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

@media (max-width: 480px) {
    .hero__actions > a {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

/* Hero carousel */
.hero-carousel {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-carousel-slides {
    position: absolute;
    inset: 0;
}

.hero-carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-carousel-slide.active {
    opacity: 1;
}

.hero-carousel-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.hero-carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 43, 92, 0.92) 0%,
        rgba(0, 43, 92, 0.75) 50%,
        rgba(0, 61, 133, 0.6) 100%
    );
    z-index: 2;
}

/* ==========================================================================
   UTILITAIRES CRITIQUES
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 1024px) {
    .container {
        padding: 0 48px;
    }
}

.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;
}

/* Mobile menu button */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--color-navy);
    background: none;
    border: none;
    cursor: pointer;
}

@media (min-width: 1024px) {
    .menu-toggle {
        display: none;
    }
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Skip link pour accessibilité */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-navy);
    color: var(--color-white);
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Loading state */
.is-loading {
    opacity: 0.7;
    pointer-events: none;
}
