/* ===========================================
   Responsive CSS for Northern Data Corridor
   =========================================== */

/* Tablet (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .container {
        grid-template-columns: 220px 1fr;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }

    .sidebar {
        width: 220px;
    }

    .sidebar-header h3 {
        font-size: 1rem;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    .hero-title {
        font-size: clamp(1.8rem, 4vw, 2.5rem);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline {
        flex-direction: column;
    }

    .timeline-item::after {
        display: none;
    }

    .table-responsive {
        overflow-x: scroll;
    }
}

/* Mobile (max-width: 768px) */
@media screen and (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: var(--spacing-sm);
    }

    /* Hide sidebar on mobile, show as drawer */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 9999;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.active {
        left: 0;
    }

    /* Mobile menu toggle */
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 10000;
        background: var(--bg-glass);
        backdrop-filter: blur(10px);
        border: 1px solid var(--border-color);
        padding: 12px;
        border-radius: 10px;
        cursor: pointer;
        box-shadow: var(--shadow);
    }

    /* Layout adjustments */
    .hero-section {
        padding: var(--spacing-lg) var(--spacing-md);
        border-radius: 20px;
    }

    .hero-title {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    /* Stats grid - single column */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .stat-number {
        font-size: 2rem;
    }

    /* Content sections */
    .content-section {
        padding: var(--spacing-lg) var(--spacing-sm);
        border-radius: 20px;
    }

    .section-header h2 {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* Timeline mobile */
    .timeline {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .timeline-item {
        min-width: 100%;
    }

    .timeline-item::after {
        display: none;
    }

    /* Three pillars */
    .three-pillars {
        grid-template-columns: 1fr;
    }

    /* Charts */
    .chart-container canvas {
        max-height: 300px;
    }

    /* Tables */
    .table-filters {
        flex-direction: column;
    }

    .table-filters label {
        min-width: 100%;
    }

    table {
        font-size: 0.85rem;
    }

    th,
    td {
        padding: var(--spacing-xs);
    }

    /* Map */
    #sitesMap {
        height: 400px !important;
    }

    .map-legend {
        flex-direction: column;
    }

    /* Criteria grid */
    .criteria-grid {
        grid-template-columns: 1fr;
    }

    /* CTA section */
    .cta-section {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .cta-content h3 {
        font-size: 1.5rem;
    }

    .cta-content p {
        font-size: 1rem;
    }

    .cta-features {
        text-align: left;
        padding-left: 0;
    }

    .premium-btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 1rem;
        display: block;
        text-align: center;
    }

    /* Theme toggle - move to avoid conflict with mobile menu */
    .theme-toggle {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    /* Reading progress */
    #reading-progress {
        height: 3px;
    }
}

/* Small mobile (max-width: 480px) */
@media screen and (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .lead-text {
        font-size: 1rem;
    }

    table {
        font-size: 0.75rem;
    }

    .premium-btn {
        font-size: 0.9rem;
    }
}

/* Landscape mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        width: 200px;
    }

    .nav-link {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}

/* Print styles */
@media print {

    .sidebar,
    .theme-toggle,
    #reading-progress,
    .cta-section,
    .mobile-menu-toggle {
        display: none !important;
    }

    .container {
        grid-template-columns: 1fr;
    }

    .content-section {
        page-break-inside: avoid;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}