/* =====================================================================
   Responsive - marine & or
   ===================================================================== */

/* ===== Écrans intermédiaires ===== */
@media (max-width: 1240px) {
    .nav-menu > li > a, .nav-sub-toggle { padding: 0.55rem 0.6rem; font-size: 0.9rem; }
    .logo-name { font-size: 1.15rem; }
    .logo-court { font-size: 0.68rem; }
}

/* ===== Navigation repliable ===== */
@media (max-width: 1080px) {
    :root { --header-h: 68px; }

    .mobile-menu-toggle { display: flex; }
    .header-content { position: relative; }
    .navigation { margin-left: 0; position: static; }

    .nav-menu {
        display: none;
        position: absolute;
        top: calc(100% + 0.5rem);
        right: 0;
        left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: 14px;
        box-shadow: var(--shadow-lg);
        padding: 0.6rem;
        z-index: 120;
        max-height: calc(100vh - var(--header-h) - 3rem);
        max-height: calc(100dvh - var(--header-h) - 3rem);
        overscroll-behavior: contain;
        overflow-y: auto;
    }
    .nav-menu.active { display: flex; animation: fadeIn 0.25s ease-out; }
    .nav-menu > li > a, .nav-sub-toggle {
        width: 100%;
        padding: 0.85rem 1rem;
        border-radius: 9px;
        border-bottom: none;
        font-size: 1rem;
        justify-content: space-between;
    }
    .nav-menu > li > a:hover, .nav-menu > li > a.active,
    .nav-sub-toggle:hover, .nav-sub-toggle.active { background: var(--gold-soft); color: var(--navy); }

    .nav-submenu {
        position: static;
        min-width: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 2px solid var(--gold);
        border-radius: 0;
        margin: 0.25rem 0 0.5rem 1rem;
        padding: 0 0 0 0.5rem;
        display: none;
    }
    .has-sub.open > .nav-submenu { display: block; }

    .nav-search-mobile { display: block; padding: 0.25rem 0 0.5rem; }
    .nav-search-mobile form { display: flex; border: 1px solid var(--gray-200); border-radius: 10px; overflow: hidden; }
    .nav-search-mobile input { flex: 1; min-width: 0; border: none; padding: 0.75rem 0.9rem; font: inherit; color: var(--navy); }
    .nav-search-mobile input:focus { outline: none; }
    .nav-search-mobile button { border: none; background: var(--navy); color: var(--gold-light); padding: 0 1rem; cursor: pointer; }
    .nav-search-toggle { display: none; }
    .header-search { display: none !important; }

    .nav-cta, .nav-cta--first, .nav-cta + .nav-cta { margin: 0.5rem 0 0; }
    .nav-cta--mobile { display: block; }
    .nav-menu > li.nav-cta > a.btn { width: 100%; padding: 0.85rem 1rem; font-size: 1rem; justify-content: center; }

    .topbar__depts { display: none; }
}

/* ===== Tablettes ===== */
@media (max-width: 900px) {
    .split { grid-template-columns: 1fr; gap: 3rem; }
    .split-media { max-width: 560px; margin: 0 auto; width: calc(100% - 1.25rem); }

    .cards--3, .cards--4 { grid-template-columns: repeat(2, 1fr); }
    .expert-search__form { grid-template-columns: 1fr 1fr; }
    .es-field--q { grid-column: 1 / -1; }
    .module-grid { grid-template-columns: repeat(2, 1fr); }
    .ressort-grid { grid-template-columns: repeat(2, 1fr); }
    .ressort-admin { grid-template-columns: auto 1fr; }
    .ressort-admin .btn { grid-column: 1 / -1; justify-self: start; }
    .link-cards { grid-template-columns: repeat(2, 1fr); }
    .facts-row { grid-template-columns: repeat(2, 1fr); }

    .stat-grid { grid-template-columns: repeat(2, 1fr); row-gap: 2rem; }
    .stat:nth-child(3) { border-left: none; }

    .contact-layout { grid-template-columns: 1fr; gap: 2rem; }
    .contact-aside { position: static; grid-template-columns: repeat(2, 1fr); order: 2; }

    .footer-top { grid-template-columns: 1fr; }
    .footer-pitch { justify-self: start; }
    .footer-content { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .container { padding: 0 1.25rem; }

    .logo-img { width: 44px; height: 44px; }

    .hero--xl { padding: 5rem 0 4.5rem; }
    .hero--lg { padding: 4.25rem 0; }
    .hero--md { padding: 3.75rem 0; }
    .hero--sm { padding: 3rem 0 2.75rem; }

    .section { padding: 3.75rem 0; }
    .section-title { margin-bottom: 2.25rem; }

    .cards--2 { grid-template-columns: 1fr; }
    .form { padding: 1.75rem; }
    .form-row { grid-template-columns: 1fr; }

    /* iOS agrandit la page au focus d'un champ de moins de 16px */
    .es-field input, .es-field select { font-size: 1rem; }

    .content { overflow-wrap: break-word; }

    .topbar__court { font-size: 0.76rem; }
    .topbar__links li:first-child { display: none; }
}

/* ===== Mobiles ===== */
@media (max-width: 600px) {
    .container { padding: 0 1rem; }

    .header-content { gap: 0.75rem; }
    .logo { gap: 0.6rem; flex-shrink: 1; min-width: 0; }
    .logo-text { min-width: 0; }
    .mobile-menu-toggle { flex-shrink: 0; }
    .logo-name { font-size: 1.02rem; }
    .logo-court { font-size: 0.62rem; letter-spacing: 0.08em; }

    .topbar__inner { justify-content: center; }
    .topbar__links { display: none; }

    .hero--xl { padding: 3.75rem 0 3.5rem; }
    .hero--lg { padding: 3.5rem 0; }
    .hero--md { padding: 3rem 0; }
    .hero--sm { padding: 2.5rem 0 2.25rem; }
    .hero h1 { overflow-wrap: break-word; hyphens: auto; }
    .hero-edition { letter-spacing: 0.18em; }
    .breadcrumb { margin-bottom: 1rem; }

    .section { padding: 3rem 0; }
    .section-title { margin-bottom: 1.75rem; }
    .stats-band { padding: 2rem 0; }

    .hero .btn-row { flex-direction: column; }
    .hero .btn-row .btn { width: 100%; }
    .hero-lead { font-size: 1.02rem; }
    .hero-court { font-size: 0.5em; letter-spacing: 0.1em; }

    .cards, .cards--3, .cards--4, .module-grid, .ressort-grid, .link-cards { grid-template-columns: 1fr; gap: 1.1rem; }
    .expert-search__panel { padding: 1.4rem 1.1rem; }
    .expert-search__form { grid-template-columns: 1fr; }
    .expert-search__form .btn { width: 100%; }
    .hero-search { flex-wrap: wrap; padding: 0.5rem; }
    .hero-search > .icon { display: none; }
    .hero-search input { padding: 0.6rem 0.5rem; }
    .hero-search .btn { width: 100%; }
    .site-search__form { flex-direction: column; }
    .card { padding: 1.4rem; }
    .check-grid { grid-template-columns: 1fr; }
    .price-grid { grid-template-columns: 1fr; }
    .info-list > div { grid-template-columns: 1fr; gap: 0.2rem; }

    .feature { grid-template-columns: 1fr; padding: 1.4rem; }

    .ressort-admin { grid-template-columns: 1fr; padding: 1.3rem; }
    .ressort-admin .btn { width: 100%; }
    .oath { padding: 1.5rem 1.25rem 1.25rem; }
    .empty-state { padding: 2rem 1.25rem; }
    .callout { padding: 1rem; }
    .compare__col .btn, .assurance-band .btn { align-self: stretch; width: 100%; }
    .guided-fields .btn { width: 100%; }
    .expert-search__head h2 { font-size: 1.35rem; align-items: flex-start; }
    .expert-search__head h2 .icon { margin-top: 0.2rem; }
    .event-actions .btn { min-width: 0; }
    .toast { left: 12px; right: 12px; max-width: none; }

    .doc-item { flex-wrap: wrap; }
    .doc-item .btn { width: 100%; }

    .date-list li { flex-direction: column; gap: 0.1rem; }
    .contact-aside { grid-template-columns: 1fr; }
    .form { padding: 1.35rem; border-radius: 12px; }

    .footer { padding-top: 3rem; }
    .footer-brand img { width: 52px; height: 52px; }
    .footer-content { grid-template-columns: 1fr; gap: 1.75rem; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .events-grid, .news-grid { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
    .stat-grid { grid-template-columns: 1fr; }
    .stat + .stat { border-left: none; }
    .facts-row { grid-template-columns: 1fr; }
    .logo-img { width: 38px; height: 38px; }
    .logo-name { font-size: 0.95rem; }
    .logo-court { font-size: 0.58rem; letter-spacing: 0.05em; }
    .form { padding: 1.1rem; }
}

/* ===== Tactile : pas d'effet de survol persistant ===== */
@media (hover: none) and (pointer: coarse) {
    .card:hover, .feature:hover, .btn:hover, .news-card:hover, .event-card:hover, .link-card:hover { transform: none; }
    .card:active, .btn:active { transform: scale(0.98); }
}

/* ===== Mouvement réduit ===== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .js .reveal { opacity: 1; transform: none; }
}

/* ===== Impression ===== */
@media print {
    .header, .footer, .topbar, .admin-bar, .announcement, .mobile-menu-toggle, .progress-track, .page-toc, .skip-link { display: none !important; }
    body { background: #fff; color: #000; }
    .hero { background: #fff !important; color: #000; border-bottom: 2px solid #000; padding: 1.5rem 0 !important; }
    .hero::before, .hero-bg { display: none; }
    .hero h1, .hero-edition, .hero-lead, .hero-court, .breadcrumb { color: #000 !important; }
    .section { padding: 1.5rem 0; }
    .section-navy, .stats-band { background: #fff; color: #000; }
    .card, .feature, .module, .ressort-card { page-break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
    .js .reveal { opacity: 1; transform: none; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
