/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ======================================== */

/* ===== EXTRA SMALL DEVICES (phones, 576px and down) ===== */
@media (max-width: 575.98px) {
    /* Typography */
    .hero__title {
        font-size: 2rem;
    }
    
    .hero__subtitle {
        font-size: 1rem;
    }
    
    .about__title,
    .events__title,
    .contact__title {
        font-size: 2rem;
    }
    
    .about__paragraph {
        font-size: var(--font-size-base);
    }
    
    /* Layout */
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero__content {
        padding: 0 var(--spacing-md);
    }
    
    .about,
    .events,
    .contact {
        padding: var(--spacing-2xl) 0;
    }
    
    /* Navigation */
    .nav__container {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .nav__menu {
        flex-direction: column;
        gap: var(--spacing-sm);
        width: 100%;
    }
    
    .nav__link {
        text-align: center;
        padding: var(--spacing-md);
        border-radius: var(--border-radius-md);
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }
    
    .contact__actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Gallery */
    .gallery__grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .gallery__image-container {
        height: 200px;
    }
    
    .gallery__overlay {
        padding: var(--spacing-md);
    }
    
    .gallery__title {
        font-size: var(--font-size-base);
    }
    
    .gallery__description {
        font-size: var(--font-size-xs);
    }
    
    /* Footer */
    .footer__content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-xl);
    }
    
    .footer__social-links {
        align-items: center;
    }
    
    /* Modal */
    .modal__content {
        max-width: 95vw;
        margin: var(--spacing-sm);
    }
    
    .modal__close {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        width: 32px;
        height: 32px;
        font-size: var(--font-size-lg);
    }
}

/* ===== SMALL DEVICES (landscape phones, 576px and up) ===== */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Typography */
    .hero__title {
        font-size: 2.5rem;
    }
    
    .hero__subtitle {
        font-size: 1.1rem;
    }
    
    /* Gallery */
    .gallery__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .gallery__image-container {
        height: 220px;
    }
    
    /* Navigation */
    .nav__container {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .nav__menu {
        flex-direction: row;
        gap: var(--spacing-lg);
    }
    
    /* Buttons */
    .btn {
        width: auto;
    }
    
    .contact__actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* ===== MEDIUM DEVICES (tablets, 768px and up) ===== */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Typography */
    .hero__title {
        font-size: 3rem;
    }
    
    .hero__subtitle {
        font-size: 1.25rem;
    }
    
    .about__title,
    .events__title,
    .contact__title {
        font-size: 2.5rem;
    }
    
    /* Layout */
    .about,
    .events,
    .contact {
        padding: var(--spacing-3xl) 0;
    }
    
    /* Gallery */
    .gallery__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xl);
    }
    
    .gallery__image-container {
        height: 240px;
    }
    
    /* Footer */
    .footer__content {
        grid-template-columns: repeat(2, 1fr);
        text-align: left;
    }
    
    .footer__social {
        text-align: center;
    }
}

/* ===== LARGE DEVICES (desktops, 992px and up) ===== */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Typography */
    .hero__title {
        font-size: 3.5rem;
    }
    
    .hero__subtitle {
        font-size: 1.375rem;
    }
    
    .about__title,
    .events__title,
    .contact__title {
        font-size: 3rem;
    }
    
    /* Layout */
    .about,
    .events,
    .contact {
        padding: var(--spacing-4xl) 0;
    }
    
    /* Gallery */
    .gallery__grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .gallery__image-container {
        height: 250px;
    }
    
    /* Footer */
    .footer__content {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== EXTRA LARGE DEVICES (large desktops, 1200px and up) ===== */
@media (min-width: 1200px) {
    /* Typography */
    .hero__title {
        font-size: 4rem;
    }
    
    .hero__subtitle {
        font-size: 1.5rem;
    }
    
    .about__title,
    .events__title,
    .contact__title {
        font-size: 3.5rem;
    }
    
    /* Layout */
    .container {
        max-width: 1200px;
    }
    
    /* Gallery */
    .gallery__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-2xl);
    }
    
    .gallery__image-container {
        height: 280px;
    }
}

/* ===== ULTRA WIDE SCREENS (1400px and up) ===== */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .gallery__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-3xl);
    }
    
    .gallery__image-container {
        height: 300px;
    }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        height: 100vh;
        min-height: 500px;
    }
    
    .hero__title {
        font-size: 2.5rem;
    }
    
    .hero__subtitle {
        font-size: 1.1rem;
    }
    
    .about,
    .events,
    .contact {
        padding: var(--spacing-2xl) 0;
    }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .gallery__image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== 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-behavior: auto !important;
    }
    
    .gallery__item {
        animation: none;
    }
    
    .gallery__item:hover {
        transform: none;
    }
    
    .gallery__image {
        transition: none;
    }
    
    .btn:hover {
        transform: none;
    }
}


/* ===== PRINT STYLES ===== */
@media print {
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .header,
    .nav,
    .footer,
    .modal,
    .btn {
        display: none !important;
    }
    
    .hero {
        height: auto;
        min-height: auto;
        padding: var(--spacing-xl) 0;
    }
    
    .hero__video {
        display: none;
    }
    
    .hero__overlay {
        display: none;
    }
    
    .hero__content {
        color: #000;
        position: static;
    }
    
    .gallery__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .gallery__item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .gallery__overlay {
        position: static;
        background: transparent;
        color: #000;
        opacity: 1;
        padding: var(--spacing-sm);
    }
    
    .gallery__title {
        color: #000;
        text-shadow: none;
    }
    
    .gallery__description {
        color: #000;
        text-shadow: none;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #000000;
        --color-text-primary: #000000;
        --color-bg-primary: #ffffff;
    }
    
    .btn {
        border-width: 3px;
    }
    
    .gallery__item {
        border: 2px solid var(--color-primary);
    }
}

/* ===== FOCUS IMPROVEMENTS FOR KEYBOARD USERS ===== */
@media (any-hover: none) {
    .gallery__item:hover .gallery__overlay {
        opacity: 0;
    }
    
    .gallery__item:focus .gallery__overlay {
        opacity: 1;
    }
    
    .gallery__item:focus .gallery__image {
        filter: grayscale(0%);
    }
}

/* ===== CONTAINER QUERIES (Future-proofing) ===== */
@supports (container-type: inline-size) {
    .gallery__grid {
        container-type: inline-size;
    }
    
    @container (max-width: 300px) {
        .gallery__image-container {
            height: 200px;
        }
    }
    
    @container (min-width: 600px) {
        .gallery__grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
    
    @container (min-width: 900px) {
        .gallery__grid {
            grid-template-columns: repeat(3, 1fr);
        }
    }
    
    @container (min-width: 1200px) {
        .gallery__grid {
            grid-template-columns: repeat(4, 1fr);
        }
    }
}
