/**
 * Responsive Design - Mobile & Tablet Optimization
 */

/* ============================================
   TABLET (768px - 991px)
   ============================================ */
@media (max-width: 991px) {
    :root {
        --spacing-lg: 2.4rem;
        --spacing-xl: 3.2rem;
    }
    
    /* Header dla starych stron - już w style.css */
    
    /* Navigation */
    .nav-container {
        padding: 1rem 1.5rem;
    }
    
    /* Hero */
    .hero-content {
        padding: 1.5rem;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    /* Events */
    .events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Gallery / Portfolio / Contact */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        grid-auto-rows: 200px;
    }
    
    .puzzle-large,
    .puzzle-wide {
        grid-column: span 2;
    }
    
    .puzzle-medium {
        grid-column: span 2;
    }
    
    /* Artists Grid */
    .artists-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    /* Homepage artists rail — węższy ekran: niższy pasek */
    .artists-showcase-rail {
        --as-rail-h: min(58vh, 480px);
    }
    
    .artist-profile-stage-inner {
        grid-template-columns: minmax(200px, 38%) 1fr;
        gap: 1.5rem;
        min-height: min(62vh, 520px);
    }

    .artist-profile-portrait {
        max-height: min(62vh, 520px);
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .about-image {
        /* On mobile we want the collage above the text */
        order: 1;
    }
    
    .about-content {
        order: 2;
        text-align: center;
    }
    
    .about-content .section-title {
        text-align: center;
    }
    
    .about-content .section-title::after {
        margin: var(--spacing-sm) auto 0;
    }

    /* Homepage collage - make the center image more circular and higher */
    .about-collage-item-center {
        --y: 40% !important;
        --w: 68% !important;
        --h: 68% !important;
    }
    
    /* Featured */
    .featured-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .featured-item {
        max-height: 250px;
    }

}

/* ============================================
   MOBILE (max 767px)
   ============================================ */
@media (max-width: 767px) {
    :root {
        --spacing-md: 1.2rem;
        --spacing-lg: 2rem;
        --spacing-xl: 2.4rem;
    }
    
    /* Header mobile */
    .main-header {
        padding: 0.75rem 0;
    }
    
    .header-content {
        gap: 1rem;
        grid-template-columns: 1fr auto;
    }
    
    .main-header .logo h1 {
        font-size: 1.25rem;
    }
    
    .main-header .nav-menu {
        width: 100%;
        top: 60px;
        height: calc(100vh - 60px);
    }
    
    .lang-dropdown-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .lang-dropdown-menu {
        right: 0;
        left: auto;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Container */
    .container {
        padding: 0 1.5rem;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0.875rem 1rem;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
        padding: 1.5rem;
        width: 100%;
        top: 60px;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu li a {
        display: block;
        padding: 0.75rem 0;
        font-size: 1rem;
    }
    
    .lang-menu {
        /* On mobile the languages should behave like a dropdown.
           Don't force it to be always-open inside the navigation drawer. */
        position: absolute;
        top: calc(100% + 8px);
        right: auto;
        left: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        margin-top: 0;
        border: 1px solid var(--color-primary);
        background: var(--color-bg-section);
        z-index: 1100;
    }
    
    /* Hero */
    .hero-section {
        min-height: 100vh;
        height: auto;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .btn-hero {
        padding: 0.875rem 2rem;
        font-size: 0.9rem;
    }
    
    .scroll-down {
        bottom: 2rem;
        font-size: 2rem;
    }
    
    /* Sections */
    section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    /* Kreska pod tytułem: jak na PC (width: 100% nagłówka) — NIE skracać do 60px */
    
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    /* Homepage: jeden artysta — zdjęcie nad blokiem tekstu (czytelniej niż wąski baner) */
    .artists-showcase-rail--solo .artists-showcase-strip {
        display: flex;
        flex-direction: column;
        aspect-ratio: unset;
        min-height: 0;
        max-height: none;
        height: auto;
    }

    .artists-showcase-rail--solo .artists-showcase-strip-media {
        position: relative;
        flex: 0 0 auto;
        height: min(42vh, 360px);
        min-height: 260px;
        width: 100%;
    }

    .artists-showcase-rail--solo .artists-showcase-strip-media img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 50% 8%;
        transform: none;
    }

    .artists-showcase-rail--solo .artists-showcase-strip-scrim {
        position: absolute;
        inset: 0;
        background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.12) 0%,
            rgba(0, 0, 0, 0.65) 100%
        );
    }

    .artists-showcase-rail--solo .artists-showcase-strip-expanded {
        position: relative;
        width: 100%;
        max-width: none;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        flex: 0 0 auto;
        border-radius: 0 0 16px 16px;
        padding: 1.35rem 1.2rem 1.65rem;
        background: rgba(6, 8, 10, 0.98);
    }

    .artists-showcase-rail--solo .artists-showcase-strip-title {
        font-size: clamp(1.65rem, 6vw, 2.25rem);
    }
    
    /* Events */
    .events-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Gallery / Portfolio */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
    }
    
    .puzzle-small,
    .puzzle-medium,
    .puzzle-tall,
    .puzzle-large,
    .puzzle-wide {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    /* Artists Grid Mobile */
    .artists-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .artist-avatar {
        width: 120px;
        height: 120px;
    }
    
    .artist-profile-stage-inner {
        grid-template-columns: 1fr;
        min-height: 0;
        gap: 1.75rem;
    }

    .artist-profile-portrait {
        max-width: min(100%, 380px);
        max-height: min(52vh, 440px);
        margin: 0 auto;
    }

    .artist-profile-intro {
        align-items: center;
        text-align: center;
    }

    .artist-name--stage {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    .artist-social-links--profile.artist-social-links--minimal {
        justify-content: center;
    }

    .artist-bio.artist-bio-card {
        padding: 1.5rem 1.25rem;
        border-radius: 16px;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .portfolio-image {
        height: 250px;
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    /* Page Title */
    .page-title {
        font-size: 1.75rem;
    }
    
    /* Filters */
    .gallery-filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .event-image {
        height: 200px;
    }
    
    .event-content {
        padding: 1.25rem;
    }
    
    .event-content h3 {
        font-size: 1.3rem;
    }
    
    /* About */
    .about-grid {
        gap: 2rem;
    }

    /* Homepage collage: image #5 (center) - disable heavy shadow on mobile */
    .about-collage-item-center {
        box-shadow: none !important;
    }
    
    .about-description {
        font-size: 1rem;
    }
    
    .btn-secondary {
        padding: 0.75rem 1.5rem;
        font-size: 0.85rem;
    }
    
    /* Featured */
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .featured-item {
        aspect-ratio: 1/1;
        max-height: 200px;
    }
    
    /* CTA */
    .cta-content h2 {
        font-size: 2rem;
    }
    
    .cta-content p {
        font-size: 1.1rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-col {
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    /* Cookie Banner */
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .cookie-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-actions button,
    .cookie-actions a {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   SMALL MOBILE (max 480px)
   ============================================ */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .btn-hero,
    .btn-primary {
        padding: 0.75rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .event-card {
        margin-bottom: 1rem;
    }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        height: 100vh;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .scroll-down {
        display: none;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .main-nav,
    .scroll-down,
    .cookie-banner,
    .btn-hero,
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .hero-section,
    section {
        page-break-inside: avoid;
    }
}

/* ============================================
   HIGH DPI DISPLAYS
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-background,
    .about-background {
        background-size: cover;
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ============================================
   TOUCH DEVICES
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .featured-item:hover img,
    .event-card:hover .event-image img,
    .about-image:hover img {
        transform: none;
    }
    
    /* Make hover overlays always visible on mobile */
    .featured-overlay {
        transform: translateY(0);
    }
}

/* ============================================
   DARK MODE SUPPORT (if user prefers)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Already dark by default, but could add variations */
}

/* ============================================
   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;
    }
    
    [data-parallax] .hero-background,
    [data-parallax] .about-background {
        background-attachment: scroll !important;
        transform: none !important;
    }
}
