﻿/* ====================================================================
   RESPONSIVE STYLES FOR ALL PAGES
   Mud & Meaning — Mobile-First Responsive Corrections
   ==================================================================== */

/* ========== GLOBAL ADJUSTMENTS ========== */
@media (max-width: 1200px) {
    .container {
        padding: 0 clamp(16px, 4vw, 24px);
    }
}

/* ========== TABLET (900px and below) ========== */
@media (max-width: 900px) {

    /* Header & Navigation */
    .nav {
        flex-wrap: wrap;
        position: relative;
    }

    .menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(244,227,195,.98);
        flex-direction: column;
        padding: 1rem;
        border-top: 1px solid rgba(122,63,23,.18);
        box-shadow: 0 10px 20px rgba(67,37,13,.15);
        z-index: 999;
    }

        .menu.active {
            display: flex;
        }

        .menu a {
            padding: 0.75rem 0;
            border-bottom: 1px solid rgba(122,63,23,.1);
            width: 100%;
            text-align: center;
        }

            .menu a:last-child {
                border-bottom: none;
            }

    .hamburger {
        display: flex;
    }

    /* Hero Slider */
    .hero-slider {
        height: clamp(500px, 65vh, 700px);
    }

    .content .inner {
        gap: clamp(20px, 4vw, 28px);
    }

    .visual {
        max-height: 350px;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
    }

    /* About Page - Grid Layouts */
    .two-col,
    .four-col,
    .three-col {
        grid-template-columns: 1fr;
    }

    .craft .steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .partners .logos {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Gallery Page - Lightbox */
    .gallery-page .lb-wrap {
        grid-template-columns: 1fr;
        height: min(92vh, 820px);
    }

    .gallery-page .lb-media {
        height: 60vh;
    }
}

/* ========== SMALL TABLET (768px and below) ========== */
@media (max-width: 768px) {

    /* Hero Adjustments */
    .content .inner {
        grid-template-columns: 1fr !important;
    }

    .caption h1 {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }

    .visual {
        max-height: 320px;
    }

    /* Sections */
    .features,
    .workshops,
    .shop,
    .testimonials {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    }

    .gallery {
        columns: 2;
    }

    /* Newsletter */
    .newsletter {
        flex-direction: column;
        align-items: stretch;
    }

        .newsletter form {
            width: 100%;
            margin-inline-start: 0;
        }

        .newsletter input {
            min-width: 100%;
        }

    /* About Page */
    .about-hero {
        min-height: 50vh;
    }

    .hero-content {
        padding: 2rem 1rem;
    }

    .craft .steps {
        grid-template-columns: 1fr;
    }

    .partners .logos {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Gallery Page */
    .gallery-page .title-row {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .gallery-page .title-icon {
        width: 56px;
        height: 56px;
    }

    .gallery-page .filters .row {
        flex-direction: column;
        gap: 16px;
    }

    .gallery-page .chip-group {
        width: 100%;
        justify-content: center;
    }

    .gallery-page .controls {
        width: 100%;
        justify-content: space-between;
    }

    .gallery-page .search {
        width: 100%;
        min-width: 100%;
    }
}

/* ========== MOBILE (640px and below) ========== */
@media (max-width: 640px) {

    /* Typography */
    body {
        font-size: 15px;
    }

    /* Hero Slider */
    .hero-slider {
        height: clamp(480px, 60vh, 620px);
        min-height: 480px;
    }

    .caption {
        padding: clamp(16px, 4vw, 20px);
    }

        .caption h1 {
            font-size: clamp(1.5rem, 7vw, 2.2rem);
            line-height: 1.2;
        }

        .caption p {
            font-size: clamp(0.9rem, 3vw, 1rem);
        }

        .caption .actions {
            flex-direction: column;
            gap: 10px;
        }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .visual {
        max-height: 280px;
    }

    .ornament {
        width: clamp(80px, 18vw, 120px);
        height: clamp(80px, 18vw, 120px);
    }

    .nav-btn {
        width: 36px;
        height: 36px;
    }

    .dots {
        padding: 6px 10px;
        gap: 6px;
    }

    .dot {
        width: 8px;
        height: 8px;
    }

    /* Sections */
    section {
        padding: clamp(28px, 6vw, 48px) 0;
    }

    .section-title {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Features */
    .features,
    .workshops,
    .shop,
    .testimonials {
        grid-template-columns: 1fr;
        gap: clamp(14px, 3vw, 18px);
    }

    .feature .icon {
        width: 44px;
        height: 44px;
    }

    /* Cards */
    .card img,
    .product img {
        height: clamp(180px, 30vw, 220px);
    }

    .card .actions {
        flex-direction: column;
    }

        .card .actions .btn {
            width: 100%;
        }

    .price {
        margin-inline-start: 0;
        margin-top: 8px;
    }

    /* Gallery */
    .gallery {
        columns: 1;
    }

    /* Newsletter */
    .newsletter input {
        padding: clamp(12px, 3vw, 14px);
        width: 100%;
    }

    .newsletter button {
        width: 100%;
    }

    /* About Page */
    .about-hero .brand-mark {
        width: 80px;
        left: 1rem;
        bottom: 1rem;
    }

    .hero-title {
        font-size: clamp(1.8rem, 6vw, 2.8rem);
    }

    .hero-subtitle {
        font-size: clamp(0.95rem, 3vw, 1.15rem);
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }

    .stats .stat {
        padding: 16px;
    }

    .stats .num {
        font-size: clamp(1.6rem, 5vw, 2.2rem);
    }

    .team .member img {
        height: 200px;
    }

    .testimonials .slide {
        padding: 14px;
    }

    .partners .logos {
        grid-template-columns: 1fr;
        gap: 20px;
    }

        .partners .logos img {
            max-width: 140px;
        }

    /* Gallery Page */
    .gallery-page .page-header {
        padding: 40px 16px 24px;
    }

    .gallery-page .page-title h1 {
        font-size: clamp(24px, 6vw, 36px);
    }

    .gallery-page .filters {
        padding: 14px;
    }

    .gallery-page .chip {
        padding: 7px 11px;
        font-size: 14px;
    }

    .gallery-page .search input {
        padding: 10px 32px 10px 10px;
        font-size: 14px;
    }

    .gallery-page .grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .gallery-page .card,
    .gallery-page .card.wide,
    .gallery-page .card.tall {
        grid-column: span 1;
        grid-row: span 1;
    }

    .gallery-page .info {
        padding: 12px;
    }

        .gallery-page .info .title {
            font-size: 15px;
        }

        .gallery-page .info .meta {
            font-size: 12px;
        }

    .gallery-page .btn {
        padding: 7px 10px;
        font-size: 13px;
    }

    .gallery-page .lb-wrap {
        width: 96vw;
        height: min(94vh, 740px);
    }

    .gallery-page .lb-media {
        height: 55vh;
    }

    .gallery-page .lb-info {
        padding: 12px;
    }

    .gallery-page .lb-btn {
        width: 38px;
        height: 38px;
    }
}

/* ============================================
   🔧 FIX: اسلایدر موبایل + منوی موبایل
   ============================================ */
@media (max-width: 680px) {

    /* 1️⃣ هدر Sticky */
    header {
        position: sticky;
        top: 0;
        z-index: 9999;
    }

    /* 2️⃣ منوی دسکتاپ مخفی */
    .menu {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    /* 3️⃣ منوی موبایل با Overlay */
    .mobile-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: flex;
        flex-direction: column;
        gap: 8px;
        background: var(--bg-accent);
        padding: 12px;
        border-bottom: 1px solid rgba(122,63,23,.18);
        box-shadow: 0 8px 16px rgba(67,37,13,.2);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        pointer-events: none;
    }

        .mobile-menu.open {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
            pointer-events: auto;
        }

        .mobile-menu a {
            padding: 10px;
            border-radius: 10px;
            transition: background 0.2s;
        }

            .mobile-menu a:hover {
                background: rgba(163,94,47,.1);
            }

    /* 4️⃣ اسلایدر: ارتفاع + padding-top برای هدر */
    .hero-slider {
        height: calc(55vh + 70px);
        min-height: calc(380px + 70px);
        max-height: calc(500px + 70px);
        margin-top: 0;
        padding-top: 70px; /* فضای هدر */
    }

        /* 5️⃣ اسلایدها باید کل فضا رو بگیرن */
        .hero-slider .slides,
        .hero-slider .slide {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }

    /* 6️⃣ Background تصویر */
    .slide .bg {
        object-fit: cover;
        object-position: center;
        height: 100%;
        width: 100%;
        animation: none !important; /* غیرفعال کردن Ken Burns */
        transform: scale(1) !important;
    }

    /* 7️⃣ محتوای اسلاید باید از زیر هدر شروع بشه */
    .slide .content {
        padding-top: 70px;
    }

    /* 8️⃣ Visual */
    .visual {
        max-height: 280px;
        width: 100%;
        overflow: hidden;
    }

        .visual img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
        }

    /* 9️⃣ Caption */
    .caption {
        padding: 18px;
    }

        .caption h1 {
            font-size: clamp(1.5rem, 4vw, 2.2rem);
        }

        .caption p {
            font-size: 0.95rem;
        }

    /* 🔟 Navigation buttons */
    .nav-btn {
        width: 38px;
        height: 38px;
    }

    .prev {
        left: 10px;
    }

    .next {
        right: 10px;
    }

    /* Body overflow */
    body {
        overflow-x: hidden;
    }

    .content .inner {
        max-height: none;
        overflow: visible;
    }
}

/* ========== EXTRA SMALL MOBILE (480px and below) ========== */
@media (max-width: 480px) {

    /* Brand */
    .brand img {
        width: 32px;
        height: 32px;
    }

    .brand .title-fa {
        font-size: 0.9rem;
    }

    .brand .title-en {
        display: none;
    }

    /* Hero - ارتفاع کمتر */
    .hero-slider {
        height: calc(50vh + 70px);
        min-height: calc(340px + 70px);
        padding-top: 70px;
    }

    .slide .content {
        padding-top: 70px;
    }

    .caption {
        padding: 14px;
    }

        .caption h1 {
            font-size: 1.4rem;
        }

    .visual {
        max-height: 240px;
    }

    .prev {
        left: 6px;
    }

    .next {
        right: 6px;
    }

    /* Sections */
    .section-title h2 {
        font-size: 1.4rem;
    }

    /* Cards */
    .card img,
    .product img {
        height: 200px;
    }

    .badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Gallery Page */
    .gallery-page .page-header {
        padding: 32px 12px 20px;
    }

    .gallery-page .title-icon {
        width: 48px;
        height: 48px;
    }

    .gallery-page .page-title h1 {
        font-size: 24px;
    }

    .gallery-page .filters {
        padding: 12px;
        border-radius: 16px;
    }

    .gallery-page .chip-group {
        gap: 6px;
    }

    .gallery-page .chip {
        padding: 6px 10px;
        font-size: 13px;
    }

    .gallery-page .card {
        border-radius: 16px;
    }

    .gallery-page .badge {
        top: 10px;
        left: 10px;
        font-size: 12px;
        padding: 5px 9px;
    }

    .gallery-page .fav {
        width: 32px;
        height: 32px;
        top: 10px;
        right: 10px;
    }
}

/* ========== LANDSCAPE MOBILE (max-height: 500px) ========== */
@media (max-height: 500px) and (orientation: landscape) {

    .hero-slider {
        height: 100vh;
        min-height: auto;
    }

    .content .inner {
        padding: 16px;
    }

    .caption {
        padding: 16px;
    }

        .caption h1 {
            font-size: 1.6rem;
            margin-bottom: 8px;
        }

        .caption p {
            margin-top: 6px;
            font-size: 0.9rem;
        }

        .caption .actions {
            margin-top: 12px;
            gap: 8px;
        }

    .visual {
        max-height: none;
        height: 100%;
    }

    .about-hero {
        min-height: 100vh;
    }

    .gallery-page .lb-wrap {
        height: 98vh;
    }
}

/* ========== PRINT STYLES ========== */
@media print {

    header,
    .hamburger,
    .nav-btn,
    .dots,
    .progress,
    .leafs,
    .hero-scroll,
    .newsletter,
    .cta {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .hero-slider {
        height: auto;
        min-height: auto;
    }

    .slide {
        position: relative;
        opacity: 1;
    }

    section {
        page-break-inside: avoid;
    }
}

/* ========== ACCESSIBILITY IMPROVEMENTS ========== */

/* Focus states for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
    *:focus-visible {
        outline: 3px solid var(--green, #2F6E3E);
        outline-offset: 2px;
        transition: outline-offset 0.2s ease;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {

    .btn,
    .card,
    .feature,
    .product {
        border-width: 2px;
    }

    .nav {
        border-bottom-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .slide .bg {
        animation: none !important;
    }

    .leafs span {
        animation: none !important;
    }

    .gallery-page .leaf {
        animation: none !important;
    }

    .gallery-page .card:hover .media {
        transform: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) {
        color-scheme: dark;
    }
}
/* ============================================
   موبایل: پنهان کردن عکس Visual
   ============================================ */

/* موبایل کوچک */
@media (max-width: 680px) {
    .visual {
        display: none !important;
    }

    .content .inner {
        grid-template-columns: 1fr !important;
    }
}

/* تبلت و بالاتر: عکس دیده شه */
@media (min-width: 681px) {
    .visual {
        display: block;
    }
}
