/* --- RESPONSIVE FIXES (Mobile & Tablet) --- */
@media (max-width: 768px) {

    /* 1. Container & Layout Headers Forced Fix */
    /* LOGO & NAVBAR FIXES */
    .nav-content {
        padding: 0 10px !important;
        justify-content: space-between !important;
        gap: 5px !important;
    }

    .logo {
        max-width: 80% !important;
        flex-shrink: 1 !important;
        gap: 8px !important;
    }

    .logo img {
        width: 45px !important;
        /* Smaller logo */
    }

    .logo div {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        /* Allow flex item to shrink */
    }

    .logo span:first-of-type {
        font-size: 0.85rem !important;
        /* Fit text */
        white-space: normal !important;
        /* Allow wrap if really needed */
        line-height: 1.1 !important;
        display: block !important;
        word-break: break-all;
        /* Safety */
    }

    .logo span:last-of-type {
        font-size: 0.75rem !important;
        margin-top: 2px !important;
    }

    .hero-print-header {
        display: block !important;
        /* Kill flexbox completely */
        height: auto !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    .hp-header-left {
        width: 100% !important;
        display: block !important;
        padding: 20px 10px !important;
        box-sizing: border-box !important;
    }

    .hp-header-right {
        width: 100% !important;
        display: block !important;
        padding: 20px 15px 40px 15px !important;
        /* Extra bottom padding for date */
        box-sizing: border-box !important;
        background: #f3f4f6;
        /* Keep contrast */
        position: relative;
        z-index: 1;
    }

    /* Date fix */
    .hp-header-right .date {
        font-size: 1.5rem !important;
        margin-top: 10px !important;
        display: block !important;
    }

    /* Yellow band fix */
    .hero-print-band {
        position: relative !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        transform: none !important;
        text-align: center !important;
        clip-path: none !important;
        padding: 15px !important;
        font-size: 1.4rem !important;
        z-index: 5 !important;
        box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1) !important;
    }

    .hp-header-left h1 {
        word-break: break-word !important;
        /* Allow break at hyphens mostly */
        overflow-wrap: anywhere !important;
        /* Force break if still too long */
        font-size: 1.0rem !important;
        /* Safe small size */
        line-height: 1.2 !important;
        white-space: normal !important;
        width: 100% !important;
    }

    .container {
        padding: 0 15px;
        /* Reduce global padding slightly */
    }

    .split-layout {
        gap: 30px;
        margin-bottom: 40px;
    }

    /* 2. Navigation (Hamburger Menu) */
    .hamburger {
        display: flex;
        /* Force show hamburger on mobile */
        position: absolute;
        right: 20px;
        top: 25px;
    }

    .nav-links {
        display: none;
        /* Hide menu by default */
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 80%;
        /* Slightly wider for better touch targets */
        flex-direction: column;
        padding-top: 90px;
        justify-content: flex-start;
        gap: 0;
        background: rgba(63, 98, 18, 0.98);
        backdrop-filter: blur(10px);
        z-index: 1000;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    }

    .nav-links.active {
        display: flex;
        /* Show when active */
    }

    .nav-links a {
        font-size: 1.1rem;
        padding: 15px 30px;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        justify-content: flex-start;
    }

    .nav-links a:hover {
        background: rgba(255, 255, 255, 0.1);
        padding-left: 40px;
        /* Slide effect */
    }

    .nav-links .btn-soutenir {
        margin: 20px 30px;
        width: calc(100% - 60px);
        justify-content: center;
        text-align: center;
    }

    /* 3. Typography & Readability */
    /* 3. Typography & Readability */
    .hp-header-left {
        padding: 20px 0 !important;
        /* Remove horizontal padding completely */
        width: 100vw !important;
        /* Force full width */
        max-width: 100%;
        overflow: hidden;
        /* Cut off anything that still protrudes */
        box-sizing: border-box;
    }

    .finance-item h3 {
        font-size: 2.5rem;
        /* Reduced from 3.5rem */
    }

    .hero h1,
    .hp-header-left h1 {
        font-size: 1.1rem !important;
        /* Force small size */
        letter-spacing: 0px !important;
        word-wrap: break-word !important;
        white-space: normal !important;
        /* Force wrap */
        line-height: 1.2 !important;
        width: 100% !important;
        display: block !important;
        text-align: center !important;
        hyphens: auto;
    }

    .section-title h2 {
        font-size: 1.8rem;
    }

    /* 4. Tables & Data */
    .finance-list li {
        font-size: 0.9rem;
    }

    /* 5. Team Photos */
    .team-photo-placeholder {
        height: 380px;
        /* Increased height for better framing on mobile */
    }

    /* 6. Scrutin Alert Box */
    .alert-box h4 {
        font-size: 1.2rem;
    }

    /* 7. Grid & Layout Fixes (Nature Section) */
    .prog-grid {
        grid-template-columns: 1fr !important;
        /* Force single column */
        gap: 25px;
    }

    .prog-card {
        grid-column: auto !important;
        /* Reset any 'span 2' on mobile */
        width: 100%;
        margin-bottom: 0;
    }

    .split-layout {
        display: flex;
        /* Better control than grid for simple stacking */
        flex-direction: column;
        gap: 20px;
    }

    .split-layout.reverse {
        flex-direction: column;
        /* Ensure image is on top or bottom as preferred, usually column is fine */
    }

    .split-img-container img {
        width: 100%;
        height: auto;
    }

    /* 8. Association Section Overflow Fix */
    section#social .container>div[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column;
        gap: 40px !important;
        margin-bottom: 40px !important;
    }

    /* Fix email overflow */
    section#social a[href^="mailto"] {
        word-break: break-all;
        font-size: 0.9rem;
        display: inline-block;
    }
}

/* Fix for very small screens (iPhone SE, etc.) */
@media (max-width: 380px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .finance-item h3 {
        font-size: 2rem;
    }

    .nav-links a {
        font-size: 1rem;
        padding: 12px 20px;
    }
}