/* ============================================================
   Design System — CFPP / IFPP
   ============================================================ */

:root {
    --primary-color:      #003366;
    --primary-gradient:   linear-gradient(135deg, #003366 0%, #001f40 100%);
    --secondary-color:    #00A3E0;
    --secondary-gradient: linear-gradient(135deg, #00A3E0 0%, #0089C4 100%);
    --accent-color:       #FFB81C;
    --text-color:         #2D3748;
    --light-bg:           #F7FAFC;
    --white:              #FFFFFF;
    --border-radius:      16px;
    --border-radius-lg:   24px;
    --border-radius-md:   12px;
    --shadow-sm:  0 4px 6px rgba(0,0,0,0.05);
    --shadow-md:  0 10px 30px rgba(0,0,0,0.08);
    --shadow-lg:  0 20px 50px rgba(0,0,0,0.12);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--white);
    line-height: 1.7;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Accessibility ── */
.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;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    padding: 10px 20px;
    background: var(--secondary-color);
    color: var(--white);
    font-weight: 700;
    z-index: 9999;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ── Top Bar ── */
.top-bar {
    background: #002244;
    color: white;
    padding: 10px 0;
    font-size: 13px;
}
.top-bar-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}
.top-bar-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}
.top-bar-link:hover { color: var(--secondary-color); }

.lang-selector {
    display: flex;
    gap: 12px;
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-left: 20px;
    align-items: center;
}
.lang-flag img {
    border-radius: 2px;
    transition: 0.3s;
    display: block;
}
.lang-flag:not(.lang-active) img { filter: grayscale(100%) opacity(0.5); }

/* ── Header ── */
.site-header {
    background: var(--white);
    padding: 10px 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: padding 0.3s, background 0.3s;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: 36px;
    width: auto;
}
.header-logo-combined {
    height: 38px;
    width: auto;
    display: block;
}
@media (max-width: 576px) {
    .header-logo-combined { height: 30px; }
}
.logo-text-fallback {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-color);
}
.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-sm {
    padding: 7px 16px;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
}

/* ── Navigation ── */
.nav-list {
    display: flex;
    list-style: none;
    gap: 10px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-list a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 12px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    padding: 0 5px;
}
.nav-list a:hover { color: var(--secondary-color); }

.nav-arrow { font-size: 10px; opacity: 0.7; }

/* ── Dropdown Niveau 1 → 2 ── */
.nav-list li { position: relative; }

.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 230px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    list-style: none;
    padding: 8px 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
    border-radius: 10px;
    z-index: 200;
    border-top: 3px solid var(--secondary-color);
}

/* ── Dropdown Niveau 2 → 3 ── */
.sub-menu .sub-menu {
    top: 0;
    left: 100%;
    transform: translateX(10px);
    border-top: none;
    border-left: 3px solid var(--secondary-color);
}

/* ── Ouverture niveau 2 au survol du niveau 1 ── */
.nav-list li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ── Ouverture niveau 3 au survol du niveau 2 ── */
.sub-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ── Indicateur flèche droite sur les items ayant des enfants (niveau 2+) ── */
.sub-menu li.menu-item-has-children > a::after {
    content: '\f054'; /* fa-chevron-right */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 9px;
    margin-left: auto;
    opacity: 0.5;
}

/* ── Liens des sous-menus ── */
.sub-menu a {
    padding: 9px 18px;
    font-size: 13px;
    color: var(--text-color);
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-weight: 500;
}
.sub-menu a:hover {
    background: var(--light-bg);
    color: var(--secondary-color);
    padding-left: 22px;
}

/* ── Séparateur visuel niveau 3 ── */
.sub-menu .sub-menu a {
    font-size: 12px;
    color: #555;
    padding: 8px 16px;
}
.sub-menu .sub-menu a:hover {
    color: var(--secondary-color);
    background: #f0f8ff;
    padding-left: 20px;
}

/* Mega Menu */
.nav-list li.has-mega-menu { position: static; }

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 40px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    justify-content: center;
    border-bottom: 4px solid var(--secondary-color);
}
.nav-list li.has-mega-menu:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.mega-menu-container {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding: 0 24px;
}
.mega-column h4 {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    text-transform: uppercase;
}
.mega-column ul { list-style: none; padding: 0; }
.mega-column ul li { margin-bottom: 10px; }
.mega-column ul li a {
    color: #666;
    font-weight: 500;
    font-size: 14px;
    padding: 0;
    display: block;
    transition: 0.3s;
}
.mega-column ul li a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

/* ── Mobile Hamburger ── */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}
.hamburger-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Hero Section ── */
.hero {
    padding: 150px 0;
    color: var(--white);
    position: relative;
    overflow: hidden;
    background: var(--primary-color);
}
.hero-slideshow {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}
.slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}
.hero-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(0,34,68,0.9), rgba(0,34,68,0.4));
    z-index: 2;
}
.hero .container { position: relative; z-index: 3; }

.hero::after {
    content: "";
    position: absolute;
    bottom: -2px; left: 0;
    width: 100%; height: 100px;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 320" xmlns="http://www.w3.org/2000/svg"><path fill="%23F8FAFC" fill-opacity="1" d="M0,224L48,213.3C96,203,192,181,288,181.3C384,181,480,203,576,224C672,245,768,267,864,250.7C960,235,1056,181,1152,149.3C1248,117,1344,107,1392,101.3L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-repeat: no-repeat;
}

/* Hero content */
.hero-title {
    font-size: clamp(36px, 5vw, 72px);
    font-weight: 800;
    color: white;
    line-height: 1.1;
    margin-bottom: 30px;
}
.hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    color: white;
    opacity: 0.9;
    margin-bottom: 40px;
    line-height: 1.6;
}
.hero-badge {
    color: var(--secondary-color);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 14px;
    display: block;
    margin-bottom: 20px;
}
.hero-actions { display: flex; gap: 15px; flex-wrap: wrap; }
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 14px 36px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    letter-spacing: 0.5px;
    text-align: center;
}
.btn-primary {
    background: var(--secondary-gradient);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0,163,224,0.2);
}
.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,163,224,0.4);
}
.btn-gold {
    background: var(--accent-color);
    color: var(--primary-color);
    font-weight: 800;
}
.btn-gold:hover {
    background: #e5a518;
    transform: scale(1.05);
}
.btn-outline-white {
    background: transparent;
    border: 2px solid white;
    color: white;
}
.btn-outline-white:hover {
    background: white;
    color: var(--primary-color);
}

/* ── Sections ── */
.section {
    padding: 80px 0;
}
.section-light { background: var(--light-bg); }
.section-dark  { background: var(--primary-color); color: white; }
.section-white { background: var(--white); }

.section-title { text-align: center; margin-bottom: 60px; }
.section-title h2 {
    font-size: 36px;
    color: var(--primary-color);
    font-weight: 800;
}
.section-divider {
    width: 80px; height: 4px;
    background: var(--secondary-color);
    margin: 20px auto;
    border-radius: 2px;
}

/* ── Cards ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.program-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
}
.program-card::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: var(--secondary-gradient);
    opacity: 0;
    transition: var(--transition);
}
.program-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-lg);
}
.program-card:hover::after { opacity: 1; }

.program-card i {
    font-size: 40px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}
.program-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* School cards (no-hover accent bar variant) */
.school-card {
    text-align: center;
    padding: 50px 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* News card */
.news-card {
    text-align: left;
    padding: 0;
    overflow: hidden;
    border-radius: var(--border-radius-md);
}
.news-card-image {
    height: 220px;
    background: #eee;
    position: relative;
    overflow: hidden;
}
.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news-badge {
    position: absolute;
    top: 20px; left: 20px;
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
}
.news-card-body {
    padding: 20px;
}

/* News list item (articles.php) */
.news-list-item {
    display: flex;
    gap: 30px;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    margin-bottom: 30px;
    transition: 0.3s;
    align-items: flex-start;
}
.news-list-item:hover { transform: translateX(5px); }
.news-media {
    flex: 0 0 250px;
    height: 180px;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f4f8;
    position: relative;
}
.news-media img { width: 100%; height: 100%; object-fit: cover; }
.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.news-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
}
.read-more-link {
    color: var(--secondary-color);
    font-weight: 700;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}

/* Hospital spotlight section */
.hospital-section {
    background: var(--primary-color);
    color: white;
    padding: 120px 0;
    position: relative;
    overflow: hidden;
}
.hospital-bg {
    position: absolute;
    right: 0; top: 0;
    width: 40%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
}
.hospital-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}
.hospital-feature {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: 0.3s;
    background: #fdfdfd;
}
.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(0,163,224,0.1);
    background: white;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}
.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* ── Footer ── */
.site-footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 80px 0 20px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 60px;
    align-items: start;
}
.footer-col h3, .footer-col h4 {
    margin-bottom: 24px;
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}
.footer-col a:hover { color: var(--secondary-color); }
.footer-bottom {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    opacity: 0.7;
}
.social-links { display: flex; gap: 12px; flex-wrap: wrap; }
.social-btn {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    text-decoration: none;
    transition: 0.3s;
}
.social-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}
.stat-number {
    font-size: 40px;
    font-weight: 800;
}
.stat-label {
    font-weight: 700;
    color: var(--primary-color);
}

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 50px;
    flex-wrap: wrap;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 8px;
    border: 1px solid #ddd;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s;
}
.page-link:hover,
.page-link.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

/* ── Article styles ── */
.article-hero {
    position: relative;
    height: 500px;
    background: var(--primary-color);
    overflow: hidden;
    display: flex;
    align-items: center;
    color: white;
}
.article-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
}
.article-body-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 30px 0;
}
.article-body-content h2,
.article-body-content h3 {
    color: var(--primary-color);
    margin: 40px 0 20px;
}
.article-body-content blockquote {
    background: #f9f9f9;
    padding: 20px;
    border-left: 5px solid var(--secondary-color);
    font-style: italic;
    margin: 30px 0;
}

/* ── Contact page ── */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}
.contact-info-item {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: flex-start;
}
.contact-icon {
    width: 44px; height: 44px;
    background: var(--light-bg);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--secondary-color);
    flex-shrink: 0;
}

/* ── 404 page ── */
.error-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
}
.error-code {
    font-size: 120px;
    font-weight: 900;
    color: var(--secondary-color);
    line-height: 1;
    opacity: 0.3;
}

/* ── Breadcrumb ── */
.breadcrumb-nav {
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}
.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 4px;
    font-size: 13px;
}
.breadcrumb-item a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active span { color: #888; }
.breadcrumb-sep {
    font-size: 8px;
    color: #ccc;
    margin: 0 4px;
}

/* ── Back-to-top button ── */
.back-to-top {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 46px;
    height: 46px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 990;
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}
.back-to-top:hover { background: var(--secondary-color); }

/* ── WhatsApp floating button ── */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(37,211,102,.4);
    z-index: 990;
    transition: transform 0.3s, box-shadow 0.3s;
}
.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(37,211,102,.5);
    color: white;
}

/* ── Search bar in header (desktop) ── */
.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-search input {
    padding: 7px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    width: 180px;
    transition: 0.3s;
}
.header-search input:focus {
    outline: none;
    border-color: var(--secondary-color);
    width: 220px;
}

/* ── Upload.php MIME validation notice ── */
.upload-hint { font-size: 12px; color: #888; margin-top: 4px; }

/* ── Gallery ── */
.gallery-item { position: relative; overflow: hidden; }
.gallery-item:hover img { transform: scale(1.1); }
.gallery-item .overlay { transform: translateY(100%); transition: 0.3s; }
.gallery-item:hover .overlay { transform: translateY(0); }
.filter-btn {
    padding: 10px 25px;
    border: none;
    background: white;
    color: var(--primary-color);
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: 0.3s;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--secondary-color);
    color: white;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .mega-menu-container { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
    /* Show hamburger, hide desktop nav & CTA */
    .mobile-nav-toggle { display: flex; }
    .header-cta { display: none; }

    /* Mobile navigation overlay */
    .nav-list {
        display: none;
        position: fixed;
        inset: 0;
        background: white;
        flex-direction: column;
        padding: 90px 24px 40px;
        gap: 0;
        overflow-y: auto;
        z-index: 998;
        box-shadow: inset 0 0 0 100vw rgba(0,0,0,0.4);
    }
    .nav-list.is-open { display: flex; }

    .nav-list > li > a {
        padding: 15px 0;
        border-bottom: 1px solid #f0f0f0;
        font-size: 17px;
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    /* Mobile dropdowns: show on click (JS adds .is-open) */
    .sub-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: #f0f4f8;
        border-radius: 8px;
        display: none;
        padding: 4px 0 !important;
        margin: 4px 0 8px 0;
    }
    .sub-menu.is-open { display: block; }

    /* Niveau 2 mobile */
    .sub-menu > li > a {
        padding: 12px 16px !important;
        font-size: 15px !important;
        border-bottom: 1px solid #e2e8f0 !important;
    }

    /* Niveau 3 mobile : indenté */
    .sub-menu .sub-menu {
        background: #e8edf3 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border-left: 3px solid var(--secondary-color) !important;
    }
    .sub-menu .sub-menu > li > a {
        padding: 10px 16px 10px 28px !important;
        font-size: 13px !important;
        color: #475569 !important;
    }

    .mega-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        display: none;
        flex-direction: column;
        box-shadow: none;
        border: none;
        padding: 0;
    }
    .mega-menu.is-open { display: block; }
    .mega-menu-container {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 16px 0;
    }

    /* Content grids */
    .hero-grid,
    .card-grid,
    .footer-grid,
    .contact-grid,
    .article-grid,
    .form-row { grid-template-columns: 1fr; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hospital-features { grid-template-columns: 1fr; }

    .hero { text-align: center; padding: 80px 0 100px; }
    .hero-actions { justify-content: center; }

    .news-list-item { flex-direction: column; }
    .news-media { flex: none; width: 100%; height: 200px; }
}

@media (max-width: 576px) {
    /* Grilles */
    .stats-grid          { grid-template-columns: 1fr 1fr; }
    .card-grid           { grid-template-columns: 1fr; }
    .form-row            { grid-template-columns: 1fr; }

    /* Typographie */
    .error-code          { font-size: 80px; }
    .top-bar-inner       { gap: 10px; font-size: 11px; }

    /* Hero */
    .hero                { padding: 60px 0 70px; }
    .hero h1             { font-size: clamp(26px, 7vw, 40px); }
    .hero-actions        { flex-direction: column; gap: 12px; }
    .hero-actions .btn   { width: 100%; text-align: center; }

    /* Bande hospitalière */
    .hospital-section    { padding: 40px 0; }
    .hospital-section h2 { font-size: clamp(24px, 7vw, 40px); }

    /* Cartes news */
    .news-card-image     { height: 160px; }
    .news-card-body      { padding: 16px; }

    /* Header compact */
    .header-logo         { height: 28px; }
    .logo-text-fallback  { font-size: 13px; }

    /* Footer */
    .footer-grid         { grid-template-columns: 1fr; gap: 30px; }

    /* Sections */
    .section             { padding: 50px 0; }

    /* Formulaires */
    .form-control        { font-size: 16px; } /* évite le zoom iOS */

    /* Tableaux : scroll horizontal */
    .adm-table-wrap      { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .adm-table           { min-width: 500px; }
}

/* ── Très petits écrans (320px) ── */
@media (max-width: 380px) {
    .container           { padding: 0 14px; }
    .hero h1             { font-size: 22px; }
    .stats-grid          { grid-template-columns: 1fr; }
    .program-card        { padding: 20px; }
}
