﻿/* =========================================
   1. ریست پایه و متغیرها
   ========================================= */
:root {  
    
    --badge-built: #20744d;
    --card-shadow: 0 10px 30px rgba(17, 17, 63, 0.08);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

 

/* =========================================
   2. هدر و ناوبری بالای صفحه
   ========================================= */
/*.site-header {
    border-bottom: 1px solid #e2e4eb;
    padding: 30px 0 0;
}*/

.category-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 35px;
    margin-top: 25px;
}

    .category-nav a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 6px 18px;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 500;
        color:  #6f7383;
        text-decoration: none;
        transition: all 0.2s ease;
    }

        .category-nav a:hover {
            color: #11113f;
            background-color: #f1f2f7;
        }

        .category-nav a.active {
            background-color: #11113f;
            color: #ffffff;
        }

.header-content {
    text-align: center;
    max-width: 750px;
    margin-inline: auto;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color:  #6f7383;
    margin-bottom: 10px;
}

    .header-badge::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background-color: #11113f;
    }

.header-content h1 {
    font-size: clamp(26px, 3.5vw, 40px);
    font-weight: 800;
    color: #11113f;
    margin-bottom: 10px;
}

.header-content p {
    color:  #6f7383;
    font-size: 14.5px;
    line-height: 1.8;
}

/* =========================================
   3. نوار ابزار و فیلترها
   ========================================= */
.gallery-section {
    padding: 45px 0 0px;
}

.gallery-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e4eb;
    flex-wrap: wrap;
    gap: 16px;
}

.title-counter {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .title-counter h2 {
        font-size: 20px;
        font-weight: 700;
        color: #171a2b;
    }

.badge-count {
    background-color: #11113f;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 5px;
}

.filter-group {
    display: inline-flex;
    background-color: #ffffff;
    border: 1px solid #e2e4eb;
    border-radius: 7px;
    overflow: hidden;
}

.filter-btn {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color:  #6f7383;
    padding: 8px 16px;
    cursor: pointer;
    border-left: 1px solid #e2e4eb;
    transition: all 0.2s ease;
}

    .filter-btn:last-child {
        border-left: none;
    }

    .filter-btn:hover {
        color: #11113f;
        background-color: #f5f6fa;
    }

    .filter-btn.active {
        background-color: #11113f;
        color: #ffffff;
    }

/* =========================================
   4. چیدمان گرید و کارت‌های پروژه
   ========================================= */
 
.projects-grid {
    display: grid;
    /* نمایش دقیقاً ۲ ستون در دسکتاپ */
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.project-card {
    position: relative;
    background-color: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e4eb;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .project-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 16px 36px rgba(17, 17, 63, 0.12);
    }

/* =========================================
   باکس تصویر و اسلایدر (پایه و مشترک)
   ========================================= */
.media-box {
    position: relative;
    width: 100%;
    background-color: #e5e7eb;
    overflow: hidden;
}

    /* استایل مخصوص ویلا (افقی‌تر و ارتفاع استاندارد) */
    .media-box.media-box-villa {
        aspect-ratio: 16 / 10;
        max-height: 420px;
    }

    /* استایل مخصوص آپارتمان (حدود یک‌سوم بلندتر و کشیده‌تر) */
    /* استایل مخصوص آپارتمان (۲۵٪ کشیده‌تر و بلندتر) */
    /* دسکتاپ: ۵٪ افزایش ارتفاع نسبت به قبل */
    .media-box.media-box-apparteman {
        aspect-ratio: 16 / 17.43;
        max-height: 735px; /* ۵٪ افزایش نسبت به ۷۰۰ پیکسل */
    }




/*.image-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #e5e7eb;  
}

    .image-layer img,
    .media-box > img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center center;
        display: block;
    }*/
 
/* =========================================
   تنظیم زوم متعادل‌تر (پوشش بیشتر فضای خالی)
   ========================================= */

.image-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #e5e7eb;
}

    /* آپارتمان: افزایش زوم به ۱۶ درصد */
    .image-layer img,
    .media-box > img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center center;
        display: block;
        transform: scale(1.16); /* از ۱.۱۰ به ۱.۱۶ افزایش یافت */
        transform-origin: center center;
    }

/* ویلا: افزایش زوم به ۲۸ درصد */
.media-box.media-box-villa .image-layer img,
.media-box.media-box-villa > img {
    transform: scale(1.28); /* از ۱.۲۰ به ۱.۲۸ افزایش یافت */
}




.design-layer {
    clip-path: inset(0 calc(100% - var(--position, 50%)) 0 0);
}

.slider-line,
.slider-btn,
.range-slider {
    /* همان تنظیمات فعلی شما */
}


/* برچسب‌های وضعیت */
.badge-tag {
    position: absolute;
    top: 14px;
    z-index: 4;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    color: #ffffff;
    pointer-events: none;
}

.badge-render {
    right: 14px;
    background: rgba(17, 17, 63, 0.88);
}

.badge-built {
    left: 14px;
    background: rgba(32, 116, 77, 0.9);
}

/* المان‌های اسلایدر مقایسه */
.slider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--position, 50%);
    width: 2px;
    background-color: #ffffff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
    transform: translateX(-50%);
    z-index: 5;
    pointer-events: none;
}

.slider-btn {
    position: absolute;
    top: 50%;
    left: var(--position, 50%);
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #ffffff;
    color: #11113f;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 15px;
    font-weight: 800;
    z-index: 6;
    pointer-events: none;
}

.range-slider {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
    z-index: 7;
    direction: ltr;
    -webkit-appearance: none;
    appearance: none;
    touch-action: pan-y;
}

/* =========================================
   5. لایه شفاف جزئیات روی تصویر (Overlay)
   ========================================= */
.card-details {
    position: absolute;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 8;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 8px 16px 16px;
    background: linear-gradient( to top, rgba(10, 12, 28, 0.88) 0%, rgba(10, 12, 28, 0.62) 38%, rgba(10, 12, 28, 0.25) 72%, rgba(10, 12, 28, 0) 100% );
    color: #ffffff;
    text-decoration: none;
}


.card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

    .card-info h3 {
        margin: 0;
        color: rgba(255, 255, 255, 0.96);
        font-size: 14.5px;
        font-weight: 600;
        line-height: 1.4;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

.card-city {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 400;
}

    .card-city svg {
        width: 13px;
        height: 13px;
        color: rgba(255, 255, 255, 0.7);
        flex-shrink: 0;
    }

.card-arrow {
    color: rgba(255, 255, 255, 0.85);
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.card-details:hover .card-arrow {
    color: #ffffff;
    transform: translate(-3px, -3px);
}


/* =========================================
   6. ریسپانسیو (موبایل و تبلت)
   ========================================= */
@media (max-width: 768px) {
    .gallery-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-group {
        width: 100%;
    }

    .filter-btn {
        flex: 1;
        text-align: center;
        padding: 8px 10px;
        font-size: 12px;
    }

    .category-nav {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 6px;
        scrollbar-width: none;
    }

        .category-nav::-webkit-scrollbar {
            display: none;
        }

        .category-nav a {
            white-space: nowrap;
        }

    /* نمایش ۱ ستون در موبایل */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

   
        .media-box.media-box-villa {
            aspect-ratio: 4 / 3;
            max-height: none;
        }

    .media-box.media-box-apparteman {
        aspect-ratio: 4 / 5.4;
        max-height: none;
    }
}

/* کانتینر دکمه لود مور */
.load-more-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px auto 20px;
    width: 100%;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 34px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    user-select: none;
}

    .btn-load-more:hover {
        background: #0f172a;
        color: #ffffff;
        border-color: #0f172a;
        transform: translateY(-2px);
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.15);
    }

        .btn-load-more:hover .btn-icon {
            transform: translateY(3px);
        }

    .btn-load-more.btn-view-all {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        color: #ffffff;
        border-color: transparent;
        box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
    }

        .btn-load-more.btn-view-all:hover {
            background: linear-gradient(135deg, #1d4ed8, #1e40af);
            transform: translateY(-2px);
            box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
        }

    .btn-load-more .btn-icon {
        transition: transform 0.25s ease;
        display: inline-flex;
    }

    .btn-load-more.is-loading {
        opacity: 0.75;
        pointer-events: none;
    }

        .btn-load-more.is-loading .btn-icon {
            animation: spin 0.8s linear infinite;
        }

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}