/* ==========================================================================
   Responsive Styles - Mobile First Approach
   ========================================================================== */

/* --------------------------------------------------------------------------
   Large Tablets and Small Desktops (max-width: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    :root {
        --space-4xl: 4rem;
        --space-5xl: 6rem;
    }

    .about-grid {
        gap: var(--space-2xl);
    }

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

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

    .gallery-item-large {
        grid-column: span 2;
    }

    .contact-grid {
        gap: var(--space-2xl);
    }
}

/* --------------------------------------------------------------------------
   Tablets (max-width: 900px)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .videos-grid {
        grid-template-columns: 1fr;
    }

    .video-sidebar {
        flex-direction: row;
        overflow-x: auto;
        gap: var(--space-md);
        padding-bottom: var(--space-md);
    }

    .video-thumbnail {
        min-width: 200px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-links {
        justify-items: center;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        gap: var(--space-sm);
    }
}

/* --------------------------------------------------------------------------
   Mobile Landscape and Small Tablets (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    :root {
        --space-4xl: 3rem;
        --space-5xl: 4rem;
    }

    /* Navigation */
    .nav-toggle {
        display: flex;
        z-index: 1001;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--color-bg-dark);
        flex-direction: column;
        padding: var(--space-5xl) var(--space-xl);
        gap: var(--space-lg);
        transition: right var(--transition-base);
        box-shadow: var(--shadow-xl);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-link {
        color: rgba(255, 255, 255, 0.9);
        font-size: 1.125rem;
    }

    .nav-cta {
        margin-top: var(--space-lg);
    }

    .nav-toggle.active .hamburger {
        background: transparent;
    }

    .nav-toggle.active .hamburger::before {
        top: 0;
        transform: rotate(45deg);
        background: #fff;
    }

    .nav-toggle.active .hamburger::after {
        top: 0;
        transform: rotate(-45deg);
        background: #fff;
    }

    /* Hero */
    .hero-stats {
        flex-direction: column;
        gap: var(--space-xl);
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 280px;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .about-image {
        max-width: 400px;
        margin: 0 auto;
    }

    /* Topics */
    .topics-grid {
        grid-template-columns: 1fr;
    }

    .topic-card {
        height: 280px;
    }

    /* Gallery */
    .gallery-collage {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 150px;
    }

    .gallery-item-large,
    .gallery-item-tall {
        grid-column: span 1;
        grid-row: span 1;
    }

    /* Testimonials */
    .testimonial-card {
        padding: 0 var(--space-md);
    }

    .testimonial-content {
        padding: var(--space-xl);
    }

    blockquote {
        font-size: 1rem;
    }

    .testimonial-author {
        padding-left: 0;
    }

    /* Contact */
    .contact-bg {
        display: none;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-info {
        padding-right: 0;
        text-align: center;
    }

    .contact-details {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .contact-item {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }

    .contact-form {
        grid-template-columns: 1fr;
    }

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

    .contact-form .btn {
        grid-column: span 1;
    }

    /* Footer */
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Mobile Portrait (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    :root {
        --space-3xl: 2rem;
        --space-4xl: 2.5rem;
        --space-5xl: 3rem;
    }

    .container {
        padding: 0 var(--space-md);
    }

    /* Hero */
    .hero {
        background-attachment: scroll;
    }

    .hero-content {
        padding: var(--space-3xl) var(--space-md);
    }

    .hero-subtitle {
        font-size: 0.75rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    /* About */
    .about-credentials {
        flex-direction: column;
        gap: var(--space-md);
    }

    /* Gallery */
    .gallery-collage {
        grid-template-columns: 1fr;
        grid-auto-rows: 200px;
    }

    /* Clients */
    .clients-logos {
        flex-direction: column;
        gap: var(--space-lg);
    }

    /* Footer */
    .footer-links {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .hero {
        background-attachment: scroll;
    }
}

/* --------------------------------------------------------------------------
   High Contrast Mode
   -------------------------------------------------------------------------- */
@media (prefers-contrast: high) {
    :root {
        --color-accent: #ffc107;
        --color-border: #333;
    }

    .btn-primary {
        border: 2px solid #000;
    }

    .nav-link::after {
        height: 3px;
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
    .navbar,
    .hero-scroll,
    .videos,
    .testimonials-slider .testimonial-controls,
    .contact-form-wrapper,
    .social-links {
        display: none;
    }

    .hero {
        min-height: auto;
        background: #fff !important;
        color: #000;
    }

    .hero-overlay {
        display: none;
    }

    .hero-content {
        color: #000;
    }

    .hero-title,
    .hero-subtitle,
    .hero-tagline {
        color: #000 !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}
