/* ===== POLICES AUTO-HÉBERGÉES ===== */
@font-face {
    font-family: 'Luciole';
    src: url('../fonts/Luciole-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ===== VARIABLES ===== */
:root {
    /* Couleurs mode clair (par défaut) */
    --bleu-principal: #003152;
    --bleu-fonce: #00243d;
    --vert-accent: #c0f549;
    --blanc: #ffffff;
    --gris-clair: #f5f5f5;
    --gris-texte: #333333;
    --orange-focus: #cc4400;
    --ombre: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: 0.3s ease;

    /* Variables sémantiques de fond et texte */
    --couleur-fond: #ffffff;
    --couleur-texte: #333333;
    --couleur-fond-alt: #f5f5f5;
    --couleur-carte: #ffffff;
}

/* ===== DARK MODE (prefers-color-scheme) ===== */
/* Palette personnalisée - Fond noir, vert olive, orange terre cuite */
/* Contrastes validés WCAG AA (minimum 4,5:1) */
@media (prefers-color-scheme: dark) {
    :root {
        /* Palette dark mode personnalisée */
        --bleu-principal: #80ae13;       /* Vert olive (primary) - 7,6:1 sur #000 ✅ */
        --bleu-fonce: #0b0909;           /* Surface sombre (footer, header) */
        --vert-accent: #80ae13;          /* Vert olive (accents, badges) - 7,6:1 ✅ */
        --blanc: #d1c7c7;               /* Texte gris rosé clair */
        --gris-clair: #0b0909;           /* Surface sombre (sections alt) */
        --gris-texte: #d1c7c7;           /* Texte gris rosé clair - 12,5:1 ✅ */
        --orange-focus: #f57a3d;         /* Orange terre cuite - 6,8:1 ✅ */
        --ombre: 0 2px 10px rgba(0, 0, 0, 0.9);

        /* Variables sémantiques */
        --couleur-fond: #000000;         /* Fond principal noir */
        --couleur-texte: #d1c7c7;        /* Texte gris rosé clair */
        --couleur-fond-alt: #0b0909;     /* Sections alternées */
        --couleur-carte: #0b0909;        /* Cartes */

        /* Fonds colorés assombris pour texte #d1c7c7 (ratio >= 4,5:1) */
        --vert-bouton: #2D5A00;          /* Vert sombre - 4,75:1 avec #d1c7c7 ✅ */
        --orange-bouton: #8B3A00;        /* Orange sombre - 4,65:1 avec #d1c7c7 ✅ */
    }

    /* === Typographie === */

    h1, h2, h3, h4, h5, h6 {
        color: var(--bleu-principal);
    }

    body, p, li, span, strong, em, time, cite {
        color: var(--couleur-texte);
    }

    /* === Liens === */

    a {
        color: var(--bleu-principal);
    }

    a:hover, a:focus {
        color: #9ccc33;
    }

    /* === Sections et Cartes === */

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

    .card {
        background-color: var(--couleur-carte);
        border: 1px solid #1a1a1a;
        color: var(--couleur-texte);
    }

    .service-detail {
        background: var(--couleur-carte);
        border-left-color: var(--bleu-principal);
        color: var(--couleur-texte);
    }

    .service-detail h3 {
        color: var(--bleu-principal);
    }

    .service-detail p,
    .service-detail li,
    .service-detail strong {
        color: var(--couleur-texte);
    }

    /* === Images === */

    img:not([src*=".svg"]) {
        filter: grayscale(20%);
    }

    /* === Boutons === */

    a.btn-primary {
        background: var(--vert-bouton);
        color: var(--couleur-texte);
        font-weight: 600;
    }

    a.btn-primary:hover {
        background: var(--bleu-principal);
        color: #000000;
    }

    .btn-secondary {
        background: transparent;
        color: var(--bleu-principal);
        border-color: var(--bleu-principal);
    }

    .btn-secondary:hover {
        background: var(--vert-bouton);
        color: var(--couleur-texte);
    }

    a.back-to-top {
        background: var(--vert-bouton);
        color: var(--couleur-texte);
    }

    a.back-to-top:hover {
        background: var(--bleu-principal);
        color: #000000;
    }

    /* === Focus === */

    *:focus-visible {
        outline: 2px solid var(--orange-focus);
        outline-offset: 3px;
    }

    /* === Badges et accents === */

    .badge, .stat-number {
        color: var(--vert-accent);
    }

    /* === Header === */

    .header {
        background: var(--bleu-fonce);
    }

    .header a, .header .logo {
        color: var(--couleur-texte);
    }

    /* === Navigation === */

    .nav-list a {
        color: var(--couleur-texte);
    }

    .nav-list a:hover {
        color: var(--bleu-principal);
    }

    .nav-list a[aria-current="page"],
    .nav-list a[aria-current="page"]:hover {
        background: var(--orange-bouton);
        color: var(--couleur-texte) !important;
    }

    /* === Footer === */

    .footer {
        background: var(--bleu-fonce);
        color: var(--couleur-texte);
    }

    .footer h4 {
        color: var(--bleu-principal);
    }

    .footer a {
        color: var(--couleur-texte);
    }

    .footer a:hover {
        color: var(--bleu-principal);
    }

    .footer p,
    .footer li,
    .footer span,
    .footer strong,
    .footer time {
        color: var(--couleur-texte);
    }

    /* === Hero === */

    .hero {
        background: var(--bleu-fonce);
    }

    .hero p,
    .hero span,
    .hero strong,
    .hero em {
        color: var(--couleur-texte);
    }

    .hero h1 {
        color: var(--bleu-principal);
    }

    .hero .baseline {
        color: var(--orange-focus);
    }


    /* === Skip link === */

    .skip-link {
        background: var(--orange-bouton);
        color: var(--couleur-texte);
    }
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Luciole', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--couleur-texte);
    background-color: var(--couleur-fond);
}

/* ===== ACCESSIBILITÉ ===== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--bleu-principal);
    color: var(--blanc);
    padding: 1rem;
    z-index: 1000;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

*:focus-visible {
    outline: 3px solid var(--orange-focus);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== TYPOGRAPHIE ===== */
h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    color: var(--bleu-principal);
    line-height: 1.3;
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 1.75rem; font-weight: 600; margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--bleu-principal);
    text-decoration: underline;
}

a:hover {
    color: var(--bleu-fonce);
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== HEADER ===== */
.header {
    background: var(--bleu-principal);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    color: var(--blanc);
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.logo:hover {
    color: var(--vert-accent);
}

/* ===== NAVIGATION ===== */
.nav-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-list a {
    color: var(--blanc);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background var(--transition);
    font-size: 0.95rem;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
    background: var(--orange-focus);
    color: var(--blanc);
}

/* Menu mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--blanc);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--bleu-principal), var(--bleu-fonce));
    color: var(--blanc);
    padding: 4rem 0;
}

.hero *:not(.baseline) {
    color: var(--blanc);
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.hero-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--vert-accent);
    flex-shrink: 0;
}

.hero-text {
    text-align: left;
}

.hero h1 {
    color: var(--blanc);
    margin-bottom: 0.5rem;
    font-size: 2.25rem;
}

.hero .baseline {
    font-size: 1.25rem;
    color: var(--vert-accent);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.hero p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--blanc);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===== BOUTONS ===== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--vert-accent);
    color: var(--bleu-principal);
}

.btn-primary:hover {
    background: var(--blanc);
    color: var(--bleu-principal);
}

.btn-secondary {
    background: transparent;
    color: var(--blanc);
    border: 2px solid var(--blanc);
}

.btn-secondary:hover {
    background: var(--blanc);
    color: var(--bleu-principal);
}

/* ===== SECTIONS ===== */
.section {
    padding: 4rem 0;
}

.section-alt {
    background: var(--couleur-fond-alt);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

/* ===== GRILLES ===== */
.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;
}

/* ===== CARTES ===== */
.card {
    background: var(--couleur-carte);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--ombre);
}

.card h3 {
    color: var(--bleu-principal);
    margin-bottom: 1rem;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.card-accent {
    border-top: 4px solid var(--vert-accent);
}

.card-accent h3 {
    font-size: 1.35rem;
}

/* Cartes savoir-être uniformes */
.card-savoir-etre {
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

.card-savoir-etre .card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.card-savoir-etre h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.card-savoir-etre p {
    font-size: 0.95rem;
    margin-bottom: 0;
    flex-grow: 1;
}

/* ===== LISTE À PUCES ===== */
.list-check {
    list-style: none;
}

.list-check li {
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.list-check li::before {
    content: "✔";
    position: absolute;
    left: 0;
    color: var(--vert-accent);
    font-weight: bold;
}

/* Sous-listes dans .list-check */
.list-check ul {
    list-style: none;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* ===== STATS ===== */
.stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--vert-accent);
    font-family: 'Montserrat', sans-serif;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--blanc);
}

/* ===== SERVICES DÉTAILLÉS ===== */
.service-detail {
    background: var(--blanc);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: var(--ombre);
    border-left: 4px solid var(--vert-accent);
}

.service-detail h3 {
    margin-bottom: 1rem;
}

/* ===== RÉFÉRENCES ===== */
.references {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.reference-tag {
    background: var(--bleu-principal);
    color: var(--blanc);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* ===== FORMULAIRE ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--bleu-principal);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--bleu-principal);
    outline: none;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.required {
    color: var(--orange-focus);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bleu-fonce);
    color: var(--blanc);
    padding: 3rem 0 1.5rem;
}

.footer p,
.footer li,
.footer span,
.footer strong,
.footer time {
    color: var(--blanc);
}

.footer-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: start;
}

.footer-content > div {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.footer h4 {
    color: var(--vert-accent);
    margin-bottom: 1rem;
    font-family: 'Montserrat', sans-serif;
}

.footer a {
    color: var(--blanc);
}

.footer a:hover {
    color: var(--vert-accent);
}

.footer ul {
    list-style: none;
}

.footer li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

/* ===== ACCESSIBILITÉ PAGE ===== */
.legal-content h3 {
    margin-top: 2rem;
}

.legal-content h3:first-child {
    margin-top: 0;
}

/* ===== FIL D'ARIANE (BREADCRUMB) ===== */
.breadcrumb {
    padding: 1rem 0;
    background: var(--gris-clair);
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    align-items: center;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li + li::before {
    content: "›";
    margin: 0 0.5rem;
    color: var(--gris-texte);
    font-weight: normal;
}

.breadcrumb a {
    color: var(--bleu-principal);
    text-decoration: underline;
}

.breadcrumb a:hover {
    color: var(--bleu-fonce);
}

.breadcrumb li[aria-current="page"] {
    color: var(--gris-texte);
}

/* ===== BOUTON RETOUR HAUT ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--vert-accent);
    color: var(--bleu-principal);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 3px solid var(--blanc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all var(--transition);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--blanc);
    color: var(--bleu-principal);
    border-color: var(--vert-accent);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.back-to-top:focus-visible {
    outline: 3px solid var(--orange-focus);
    outline-offset: 4px;
}

@media (max-width: 768px) {
    .back-to-top {
        width: 48px;
        height: 48px;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.5rem;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-list {
        display: none;
        width: 100%;
        flex-direction: column;
        background: var(--bleu-fonce);
        position: absolute;
        top: 100%;
        left: 0;
        padding: 1rem;
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .nav-list a {
        padding: 0.75rem 1rem;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .hero-photo {
        width: 150px;
        height: 150px;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .stats {
        gap: 2rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .card-savoir-etre {
        min-height: auto;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }

    .container {
        padding: 0 1rem;
    }

    .btn {
        display: block;
        text-align: center;
        margin-bottom: 1rem;
    }
}

/* ===== IMPRESSION (PRINT) ===== */
@media print {
    /* Masquer les éléments non essentiels */
    .header,
    .skip-link,
    .menu-toggle,
    .breadcrumb,
    .hero-buttons,
    .btn,
    .back-to-top,
    .footer {
        display: none !important;
    }

    /* Fond blanc, texte noir */
    body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
        line-height: 1.5;
    }

    /* Réinitialiser les couleurs pour l'impression */
    h1, h2, h3, h4 {
        color: black !important;
        page-break-after: avoid;
    }

    .hero {
        background: none !important;
        color: black !important;
        padding: 1rem 0 !important;
    }

    .hero h1 {
        color: black !important;
        font-size: 18pt;
    }

    .hero .baseline {
        color: black !important;
        font-size: 12pt;
    }

    .hero-photo {
        border: 2px solid #333 !important;
    }

    /* Sections et cartes */
    .section {
        padding: 1rem 0 !important;
    }

    .section-alt {
        background: none !important;
    }

    .card,
    .service-detail {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
        margin-bottom: 1rem;
        background: white !important;
    }

    /* Liens : afficher l'URL entre parenthèses */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }

    a[href^="mailto:"]::after,
    a[href^="tel:"]::after,
    a[href^="#"]::after {
        content: "";
    }

    /* Listes */
    .list-check li::before {
        color: black !important;
    }

    /* Grilles : simplifier en colonne unique pour impression */
    .grid-2,
    .grid-3,
    .grid-4 {
        display: block !important;
    }

    .grid-2 > *,
    .grid-3 > *,
    .grid-4 > * {
        margin-bottom: 1rem;
    }

    /* Éviter les sauts de page */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    .card,
    .service-detail,
    ul, ol {
        page-break-inside: avoid;
    }

    /* Afficher les URLs complets pour les liens importants */
    .hero a[href^="mailto"],
    .hero a[href^="tel"] {
        text-decoration: none;
    }

    /* Optimiser les marges pour l'impression */
    @page {
        margin: 2cm;
    }

    /* Éviter les orphelines et veuves */
    p, li {
        orphans: 3;
        widows: 3;
    }
}

/* ===== DARK MODE - OVERRIDES FINAUX ===== */
/* Placé après les règles de base pour garantir la priorité */
@media (prefers-color-scheme: dark) {
    .header {
        background: var(--bleu-fonce);
    }

    a.logo {
        color: var(--couleur-texte);
    }

    a.logo:hover {
        color: var(--bleu-principal);
    }

    .nav-list a {
        color: var(--couleur-texte);
    }

    .nav-list a[aria-current="page"],
    .nav-list a[aria-current="page"]:hover {
        background: var(--orange-bouton);
        color: var(--couleur-texte);
    }

    .service-detail {
        background: var(--couleur-carte);
        border-left-color: var(--bleu-principal);
        color: var(--couleur-texte);
    }

    .service-detail h3 {
        color: var(--bleu-principal);
    }

    .service-detail p,
    .service-detail li,
    .service-detail strong {
        color: var(--couleur-texte);
    }

    /* Breadcrumb */
    .breadcrumb a:hover {
        color: #9ccc33;
    }

    /* Footer */
    .footer a:hover {
        color: #9ccc33;
    }

    .footer h4 {
        color: var(--bleu-principal);
    }
}
