/* ============================================
   NextStep Educare - Responsive Styles
   ============================================ */

/* ============================================
   Mobile Styles (Default - Mobile First)
   ============================================ */

/* Mobile Navigation and Tablet (Responsive Menu) */
@media (max-width: 1023px) {
    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--color-white);
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-6);
        box-shadow: var(--shadow-lg);
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav.active {
        transform: translateX(0);
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
    }

    .nav-link {
        padding: var(--space-3) 0;
        border-bottom: 1px solid var(--color-gray-100);
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: var(--space-4);
        margin-top: var(--space-2);
        display: none;
    }

    .nav-item.has-dropdown.active .dropdown-menu {
        display: block;
    }

    .header-cta {
        width: 100%;
        margin-top: var(--space-4);
        padding: var(--space-4);
    }

    .btn {
        width: 100%;
    }
}

/* ============================================
   Tablet Styles (768px - 1023px)
   ============================================ */
/* ============================================
   Tablet / Small Desktop Styles (768px - 1023px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1023px) {

    /* Typography Adjustments */
    h1 {
        font-size: var(--text-4xl);
    }

    h2 {
        font-size: var(--text-3xl);
    }

    .section-title {
        font-size: var(--text-3xl);
    }

    /* Grid Adjustments */
    .grid-cols-4,
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .grid-cols-3,
    .events-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   Desktop Styles (1024px and up)
   ============================================ */
@media (min-width: 1024px) {

    /* Container */
    .container {
        padding: 0 var(--space-8);
    }

    /* Typography */
    h1 {
        font-size: var(--text-6xl);
    }

    /* Grid stays as defined */
    .grid-cols-2-lg {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-3-lg {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-cols-4-lg {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   Large Desktop (1280px and up)
   ============================================ */
@media (min-width: 1280px) {
    :root {
        --container-max: 1320px;
    }
}

/* ============================================
   Mobile-Specific Component Adjustments (< 768px)
   ============================================ */
@media (max-width: 767px) {

    /* Sections */
    .section {
        padding: var(--space-12) 0;
    }

    .section-sm {
        padding: var(--space-8) 0;
    }

    /* Grids - Force single column on mobile */
    .grid-cols-4,
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: var(--space-6);
    }

    /* Cards */
    .card {
        padding: var(--space-6);
    }

    .card-image-wrapper {
        height: 180px;
    }

    /* Buttons */
    .btn {
        width: 100%;
        padding: var(--space-4) var(--space-6);
    }

    .btn-lg {
        padding: var(--space-4) var(--space-8);
    }

    /* Form Layout on Mobile */
    .contact-form-grid {
        grid-template-columns: 1fr !important;
    }

    /* Typography Overflows */
    h1 {
        font-size: var(--text-3xl);
        word-break: break-word;
    }

    h2 {
        font-size: var(--text-2xl);
    }

    .section-title {
        font-size: var(--text-2xl);
    }

    /* Hero Padding */
    .hero {
        padding: 120px 0 60px !important;
    }
}

/* ============================================
   Tablet Specific Fixes
   ============================================ */
@media (min-width: 768px) and (max-width: 1023px) {

    .grid-cols-4,
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .hero {
        padding: 150px 0 80px !important;
    }

    /* Form Layout on Tablet */
    .contact-form-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .form-group-full {
        grid-column: span 2;
    }
}

/* ============================================
   Contact Form Grid (Forced Single Column)
   ============================================ */
.contact-form-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: var(--space-6);
    max-width: 600px;
    margin: 0 auto;
}

.form-group-full {
    grid-column: span 1 !important;
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {

    .header,
    .footer,
    .mobile-menu-toggle,
    .btn,
    .nav {
        display: none;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    a {
        text-decoration: underline;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-animate {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   High Contrast Mode
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --color-navy: #000000;
        --color-red: #CC0000;
    }

    .btn-primary {
        border: 2px solid var(--color-white);
    }

    .card {
        border: 2px solid var(--color-gray-800);
    }
}