/**
 * Responsive Styles
 *
 * @package Amore
 */

/* ==========================================================================
   Extra Small Devices (phones, 480px and below)
   ========================================================================== */

@media (max-width: 480px) {
    :root {
        --space-base: 0.875rem;
    }

    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    h1, .h1 {
        font-size: var(--text-3xl);
    }

    h2, .h2 {
        font-size: var(--text-2xl);
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-content {
        padding: var(--space-4);
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .hero-actions {
        flex-direction: column;
    }

    .section-header {
        margin-bottom: var(--space-8);
    }

    .pricing-card {
        padding: var(--space-6);
    }

    /* Gallery */
    .gallery-masonry,
    .gallery-grid {
        padding: 0 var(--space-3);
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        padding: var(--space-4);
    }

    /* Footer */
    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        max-width: none;
    }

    .footer-social {
        justify-content: center;
    }
}

/* ==========================================================================
   Small Devices (large phones, 640px and below)
   ========================================================================== */

@media (max-width: 640px) {
    /* Typography */
    .text-lg {
        font-size: var(--text-base);
    }

    /* Sections */
    .section {
        padding: var(--space-12) var(--space-4);
    }

    /* Hero */
    .hero {
        min-height: 90vh;
    }

    .page-hero {
        min-height: 50vh;
    }

    .hero-scroll {
        display: none;
    }

    /* Grid Layouts */
    .services-grid,
    .features-grid,
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    /* Two Column to Single */
    .intro-grid,
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .intro-images {
        display: none;
    }

    /* Wedding Details */
    .wedding-details {
        grid-template-columns: 1fr 1fr;
    }

    /* Testimonials */
    .testimonial-quote {
        font-size: var(--text-lg);
    }

    /* Navigation within gallery */
    .wedding-navigation {
        grid-template-columns: 1fr;
    }

    .wedding-nav-item:first-child {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .wedding-nav-item:last-child {
        text-align: left;
    }

    /* Lightbox */
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        left: var(--space-2);
    }

    .lightbox-next {
        right: var(--space-2);
    }
}

/* ==========================================================================
   Medium Devices (tablets, 768px and below)
   ========================================================================== */

@media (max-width: 768px) {
    /* Header */
    .site-header {
        padding: var(--space-3) var(--space-4);
    }

    /* Grid Adjustments */
    .two-column-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .three-column-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Pricing Grid */
    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Blog Grid */
    .blog-grid {
        grid-template-columns: 1fr;
    }

    /* Portfolio Filters */
    .portfolio-filters {
        flex-wrap: wrap;
    }

    /* Journal Sidebar */
    .journal-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        margin-top: var(--space-12);
    }

    /* Contact Form */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* FAQ */
    .faq-question {
        font-size: var(--text-base);
    }
}

/* ==========================================================================
   Large Devices (small laptops, 1024px and below)
   ========================================================================== */

@media (max-width: 1024px) {
    /* Navigation */
    .primary-navigation {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Grid Adjustments */
    .four-column-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Intro Section */
    .intro-section .intro-grid {
        gap: var(--space-8);
    }

    /* Gallery */
    .gallery-masonry {
        columns: 2;
    }

    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Extra Large Devices (large laptops, 1200px and below)
   ========================================================================== */

@media (max-width: 1200px) {
    /* Container width */
    .container-lg {
        max-width: 100%;
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }

    /* Header spacing */
    .primary-menu {
        gap: var(--space-6);
    }
}

/* ==========================================================================
   Desktop (1024px and above)
   ========================================================================== */

@media (min-width: 1024px) {
    /* Hide mobile elements */
    .mobile-only {
        display: none !important;
    }

    /* Grid enhancements */
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Gallery masonry */
    .gallery-masonry {
        columns: 3;
    }

    /* Intro section special layout */
    .intro-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-12);
        align-items: center;
    }

    .intro-images {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .intro-images .intro-image:first-child {
        margin-top: var(--space-12);
    }

    /* About Page Grid */
    .about-grid {
        display: grid;
        grid-template-columns: 1fr 1.2fr;
        gap: var(--space-12);
        align-items: start;
    }

    /* Pricing Grid */
    .pricing-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .pricing-card.featured {
        transform: scale(1.05);
    }

    .pricing-card.featured:hover {
        transform: scale(1.05) translateY(-10px);
    }

    /* Contact Layout */
    .contact-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-12);
    }
}

/* ==========================================================================
   Wide Screens (1400px and above)
   ========================================================================== */

@media (min-width: 1400px) {
    .container-xl {
        max-width: 1400px;
    }

    .gallery-masonry {
        columns: 4;
    }

    .portfolio-grid {
        max-width: 1800px;
    }
}

/* ==========================================================================
   Ultra Wide Screens (1800px and above)
   ========================================================================== */

@media (min-width: 1800px) {
    :root {
        --space-base: 1.125rem;
    }

    .hero-title {
        font-size: 5.5rem;
    }
}

/* ==========================================================================
   High DPI / Retina Displays
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Use higher resolution images where needed */
    .site-branding img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ==========================================================================
   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;
    }

    .hero-label,
    .hero-title,
    .hero-subtitle,
    .hero-actions,
    .hero-scroll {
        opacity: 1;
        animation: none;
    }

    .mobile-menu li {
        transform: none;
        opacity: 1;
    }
}

/* ==========================================================================
   Dark Mode (if user prefers)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    /* 
     * Dark mode styles could be added here
     * For a wedding photography site, light mode is typically preferred
     * Uncomment and customize if dark mode is desired
     */
    /*
    :root {
        --color-background: #1a1a1a;
        --color-text: #f5f5f5;
        --color-text-light: #a0a0a0;
        --color-cream: #252525;
        --color-white: #1a1a1a;
    }
    */
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    /* Hide non-essential elements */
    .site-header,
    .site-footer,
    .mobile-menu-overlay,
    .lightbox,
    .back-to-top,
    .portfolio-filters,
    .gallery-view-toggle,
    .fullscreen-btn,
    .btn,
    .cta-section,
    .instagram-section,
    nav {
        display: none !important;
    }

    /* Reset backgrounds */
    body {
        background: white;
        color: black;
    }

    /* Ensure images print */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    /* Page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }

    /* Links */
    a {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }

    /* Gallery grid for print */
    .gallery-masonry,
    .gallery-grid {
        display: block;
    }

    .gallery-item {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* ==========================================================================
   Landscape Orientation (Mobile)
   ========================================================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-16) var(--space-6);
    }

    .page-hero {
        min-height: auto;
        padding: var(--space-12) var(--space-6);
        padding-top: 100px;
    }
}

/* ==========================================================================
   Touch Device Optimizations
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects that don't work well on touch */
    .card:hover {
        transform: none;
    }

    .wedding-card:hover .card-overlay {
        opacity: 0;
    }

    .wedding-card:hover .card-content {
        transform: translateY(0);
        opacity: 1;
    }

    /* Always show wedding card content on touch devices */
    .wedding-card .card-overlay {
        opacity: 1;
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.6) 0%,
            rgba(0, 0, 0, 0) 60%
        );
    }

    .wedding-card .card-content {
        transform: translateY(0);
        opacity: 1;
    }

    /* Larger touch targets */
    .btn {
        min-height: 48px;
    }

    .filter-btn {
        padding: var(--space-3) var(--space-5);
    }

    /* Disable hover image zoom */
    .gallery-item:hover img,
    .card:hover .card-image img {
        transform: none;
    }
}
