/* ========================================================================== 
   SK Homepage Section: Luxury True Masonry Gallery
   ========================================================================== */

.homepage-gallery-luxury-section {
    position: relative;
    box-sizing: border-box;
    width: calc(100% - 72px);
    max-width: 1650px;
    margin: 58px auto;
    padding: 44px 62px 48px;
    overflow: hidden;
    direction: rtl;

    background: var(--sk-gallery-section-bg, #fcf8f0);
    border: 1px solid var(
        --sk-gallery-section-border,
        rgba(183, 139, 70, 0.2)
    );
    border-radius: 28px;
    box-shadow: var(
        --sk-gallery-section-shadow,
        0 18px 44px rgba(94, 63, 27, 0.13)
    );

    --sk-gallery-gap: 18px;
}

.homepage-gallery-luxury-section,
.homepage-gallery-luxury-section * {
    box-sizing: border-box;
}

.homepage-gallery-luxury-section::before,
.homepage-gallery-luxury-section::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.homepage-gallery-luxury-section::before {
    background: var(--sk-gallery-pattern-bg, transparent);
}

.homepage-gallery-luxury-section.is-pattern-grid::after {
    background-image:
        linear-gradient(
            to right,
            var(--sk-gallery-pattern-color, rgba(174, 132, 72, 0.1)) 1px,
            transparent 1px
        ),
        linear-gradient(
            to bottom,
            var(--sk-gallery-pattern-color, rgba(174, 132, 72, 0.1)) 1px,
            transparent 1px
        );
    background-size: 44px 44px;
}

.homepage-gallery-luxury-section.is-pattern-lines::after {
    background-image:
        linear-gradient(
            135deg,
            transparent 48%,
            var(--sk-gallery-pattern-color, rgba(174, 132, 72, 0.1)) 50%,
            transparent 52%
        );
    background-size: 70px 70px;
}

.homepage-gallery-luxury-section > * {
    position: relative;
    z-index: 1;
}

/* ========================================================================== 
   Header
   ========================================================================== */

.homepage-gallery__container {
    width: 100%;
    max-width: 1500px;
    margin: auto;
}

.homepage-gallery__header {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 0;
}

.homepage-gallery__header-intro {
    width: fit-content;
    max-width: 100%;
    margin-right: 0;
    margin-left: auto;
    text-align: right;
    direction: rtl;
}

.homepage-gallery__title-main {
    margin: 0;
    color: var(--sk-gallery-title-color, #3b2818);
    font-family: var(--sk-gallery-title-font, inherit);
    font-size: var(
        --sk-gallery-title-size,
        clamp(2rem, 3.4vw, 3.7rem)
    );
    line-height: 1.25;
    font-weight: 800;
}

.homepage-gallery__subtitle {
    margin: var(--sk-gallery-header-gap, 6px) 0 0;
    color: var(--sk-gallery-subtitle-color, #8c6b4b);
    font-family: var(--sk-gallery-body-font, inherit);
    font-size: var(
        --sk-gallery-subtitle-size,
        clamp(0.95rem, 1.35vw, 1.25rem)
    );
}

/* ========================================================================== 
   Tabs & Filter Chips
   ========================================================================== */

.homepage-gallery__topics {
    display: flex;
    justify-content: flex-start;
    gap: 13px;
    overflow-x: auto;
    padding: 4px 2px 8px;
    margin: 28px 0 24px;
    scrollbar-width: thin;
}

.homepage-gallery__topics button {
    position: relative;
    min-width: 120px;
    padding: 12px 22px;
    border: 1px solid var(--sk-gallery-chip-border, #e8d4b4);
    border-radius: 16px;
    background: var(
        --sk-gallery-chip-bg,
        rgba(255, 255, 255, 0.45)
    );
    color: var(--sk-gallery-chip-text, #4a3424);
    font-family: var(--sk-gallery-chip-font, inherit);
    font-size: var(--sk-gallery-chip-size, 15px);
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(98, 65, 29, 0.05);
    cursor: pointer;
    white-space: nowrap;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.homepage-gallery__topics button:hover {
    transform: translateY(-2px);
    border-color: var(--sk-gallery-btn-hover-bg, #b9802b);
    box-shadow: 0 10px 20px rgba(109, 71, 25, 0.12);
}

.homepage-gallery__topics button.is-active {
    border-color: transparent;
    background: var(--sk-gallery-chip-active-bg, #b9802b);
    color: var(--sk-gallery-chip-active-text, #fff);
    box-shadow: 0 8px 18px rgba(119, 75, 22, 0.18);
}

.homepage-gallery__topics button.is-active::after {
    content: "";
    position: absolute;
    right: 20px;
    bottom: 5px;
    left: 20px;
    height: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.6);
}

.homepage-gallery__panel {
    display: none;
}

.homepage-gallery__panel.is-active {
    display: block;
}

/* ========================================================================== 
   True JavaScript Masonry Layout
   ========================================================================== */

.homepage-gallery__container-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    margin: 0 auto;
    gap: var(--sk-gallery-gap, 18px);
    direction: rtl;
}

.homepage-gallery__container-grid.is-masonry-ready {
    position: relative;
    display: block;
    min-height: 1px;
}

.homepage-gallery__row {
    display: contents !important;
}

.homepage-gallery__luxury-item,
.homepage-gallery__row .homepage-gallery__luxury-item {
    position: relative;
    display: block;

    width: calc(25% - (var(--sk-gallery-gap, 18px) * 3 / 4));
    max-width: 100%;
    height: auto !important;
    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    padding: 0;

    color: inherit;
    text-decoration: none;
    vertical-align: top;

    transition:
        transform 0.24s cubic-bezier(0.33, 1, 0.68, 1),
        opacity 0.2s ease;
}

.homepage-gallery__container-grid.is-masonry-ready
.homepage-gallery__luxury-item {
    position: absolute;
    margin: 0 !important;
    will-change: transform;
}

/* ========================================================================== 
   Media Card & Elegant Curved Glass Frame
   ========================================================================== */

.homepage-gallery__luxury-media {
    position: relative;
    isolation: isolate;

    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 0;

    overflow: hidden;
    border: 1px solid var(
        --sk-gallery-card-border,
        rgba(215, 182, 126, 0.65)
    );
    border-radius: var(--sk-gallery-card-radius, 20px);
    background: #eadecc;

    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.95),
        inset 0 -1px 2px rgba(0, 0, 0, 0.22),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4),
        0 12px 28px rgba(70, 42, 16, 0.12);

    transition:
        transform 0.35s cubic-bezier(0.33, 1, 0.68, 1),
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

.homepage-gallery__luxury-img {
    position: relative;
    z-index: 0;

    display: block;
    width: 100%;
    max-width: 100%;
    height: auto !important;
    min-height: 0;

    object-fit: cover;
    object-position: center;
    border: 0;
    transform: scale(1.001);

    transition:
        transform 0.5s cubic-bezier(0.33, 1, 0.68, 1),
        filter 0.45s ease;
}

/* لبه داخلی کریستالی */
.homepage-gallery__luxury-media::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;

    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: inherit;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.3) 0%,
            transparent 16%,
            transparent 82%,
            rgba(0, 0, 0, 0.16) 100%
        );

    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.75),
        inset 0 -1px 1px rgba(0, 0, 0, 0.18);
}

/* بازتاب واضح و مورب شیشه */
.homepage-gallery__luxury-media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;

    border-radius: inherit;

    background:
        /* نوار اصلی بازتاب */
        linear-gradient(
            112deg,
            transparent 0%,
            transparent 31%,
            rgba(255, 255, 255, 0.03) 33%,
            rgba(255, 255, 255, 0.38) 37%,
            rgba(255, 255, 255, 0.2) 41%,
            rgba(255, 255, 255, 0.025) 45%,
            transparent 48%,
            transparent 100%
        ),

        /* درخشش سطح بالایی */
        linear-gradient(
            120deg,
            rgba(255, 255, 255, 0.22) 0%,
            rgba(255, 255, 255, 0.08) 18%,
            transparent 34%,
            transparent 100%
        ),

        /* سایه بسیار نرم پایین کارت */
        linear-gradient(
            180deg,
            transparent 58%,
            rgba(20, 12, 5, 0.08) 100%
        );

    opacity: 1;
    mix-blend-mode: screen;

    transition:
        opacity 0.35s ease,
        transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

.homepage-gallery__luxury-item:hover
.homepage-gallery__luxury-media {
    transform: translateY(-5px);
    border-color: var(
        --sk-gallery-card-border-hover,
        #c8933b
    );
    box-shadow:
        inset 0 1px 2px 0 rgba(255, 255, 255, 0.95),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5),
        0 18px 36px rgba(70, 42, 16, 0.22);
}

.homepage-gallery__luxury-item:hover
.homepage-gallery__luxury-media::after {
    opacity: 1;
    transform: translateX(2px);
}

.homepage-gallery__luxury-item:hover
.homepage-gallery__luxury-img {
    transform: scale(1.035);
    filter: saturate(1.05) contrast(1.02);
}

/* ========================================================================== 
   Hover Overlay & Central Zoom Icon
   ========================================================================== */

.homepage-gallery__luxury-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            180deg,
            rgba(20, 15, 10, 0.02) 0%,
            rgba(35, 22, 12, 0.34) 100%
        );

    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.homepage-gallery__luxury-item:hover
.homepage-gallery__luxury-overlay {
    opacity: 1;
}

.homepage-gallery__luxury-zoom {
    position: relative;
    z-index: 4;

    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.7);

    background: rgba(255, 255, 255, 0.92);
    color: #241507;

    font-size: 24px;
    transform: scale(0.75);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);

    transition:
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.25s ease,
        color 0.25s ease;
}

.homepage-gallery__luxury-item:hover
.homepage-gallery__luxury-zoom {
    transform: scale(1);
    background: var(--sk-gallery-zoom-hover-bg, #e7c16a);
    color: #241507;
}

/* ========================================================================== 
   Card Content / Typography
   ========================================================================== */

.homepage-gallery__card-copy {
    position: absolute;
    right: 16px;
    bottom: 14px;
    left: 88px;
    z-index: 7;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 3px;

    color: var(--sk-gallery-card-text, #fff);
    text-align: right;
    direction: rtl;
    pointer-events: none;
}

.homepage-gallery__card-copy strong,
.homepage-gallery__card-copy small {
    display: block;
    width: 100%;

    text-align: right;
    direction: rtl;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
}

.homepage-gallery__card-copy strong {
    font-family: var(--sk-gallery-body-font, inherit);
    font-size: var(--sk-gallery-card-title-size, 15px);
    font-weight: 800;
}

.homepage-gallery__card-copy small {
    font-family: var(--sk-gallery-body-font, inherit);
    font-size: var(--sk-gallery-salon-size, 12px);
    font-weight: 600;
    color: var(--sk-gallery-salon-color, #f4d597);
}

/* ========================================================================== 
   Bottom-Left Action CTA Button ("مشاهده ‹")
   ========================================================================== */

.homepage-gallery__card-cta {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 7;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;

    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 999px;

    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;

    background: rgba(35, 20, 9, 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);

    transition:
        transform 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease;
}

.homepage-gallery__luxury-item:hover
.homepage-gallery__card-cta {
    transform: translateY(-2px);
    background: var(--sk-gallery-btn-bg, #b9802b);
    border-color: #fff;
}

/* ========================================================================== 
   Footer / Main CTA Button
   ========================================================================== */

.homepage-gallery__footer-action {
    display: flex;
    justify-content: center;
    margin-top: 36px;
}

.sk-gallery-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 13px 34px;
    border: 1px solid var(
        --sk-gallery-btn-hover-bg,
        #b7802b
    );
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.5);
    color: var(--sk-gallery-btn-text, #3d2818) !important;

    font-family: var(--sk-gallery-body-font, inherit);
    font-size: 16px;
    font-weight: 800;
    text-decoration: none !important;

    box-shadow: 0 4px 14px rgba(91, 70, 48, 0.06);
    cursor: pointer;

    transition:
        background 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sk-gallery-cta-btn:hover {
    background: var(
        --sk-gallery-btn-bg,
        linear-gradient(135deg, #e7c16a, #b9802b)
    );
    color: var(--sk-gallery-btn-hover-text, #fff) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(183, 128, 43, 0.25);
}

/* ========================================================================== 
   Lightbox Overrides
   ========================================================================== */

.fslightbox-container {
    background: rgba(10, 10, 10, 0.96) !important;
}

.fslightbox-source {
    border-radius: 14px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8) !important;
}

/* ========================================================================== 
   Responsive Masonry Columns
   ========================================================================== */

@media (max-width: 1400px) {
    .homepage-gallery__luxury-item {
        width: calc(33.333% - (var(--sk-gallery-gap, 18px) * 2 / 3));
    }
}

@media (max-width: 900px) {
    .homepage-gallery-luxury-section {
        width: calc(100% - 32px);
        padding: 36px 20px;
    }

    .homepage-gallery__header {
        flex-direction: column;
        gap: 16px;
    }

    .homepage-gallery__header-intro {
        width: 100%;
        margin-left: 0;
    }

    .homepage-gallery__luxury-item {
        width: calc(50% - (var(--sk-gallery-gap, 18px) / 2));
    }
}

@media (max-width: 640px) {
    .homepage-gallery-luxury-section {
        width: 100%;
        max-width: 100%;
        margin: 24px 0;
        padding: 28px 12px 34px;
        border-radius: 0;

        --sk-gallery-gap: 10px;
    }

    .homepage-gallery__topics {
        gap: 8px;
        margin: 18px 0;
    }

    .homepage-gallery__topics button {
        min-width: 100px;
        padding: 9px 14px;
        border-radius: 12px;
        font-size: 13px;
    }

    .homepage-gallery__card-copy {
        right: 10px;
        bottom: 10px;
        left: 72px;
    }

    .homepage-gallery__card-copy strong {
        font-size: 13px;
    }

    .homepage-gallery__card-copy small {
        font-size: 11px;
    }

    .homepage-gallery__card-cta {
        left: 8px;
        bottom: 8px;
        padding: 4px 9px;
        font-size: 10px;
    }

    .sk-gallery-cta-btn {
        width: 100%;
    }
}

@media (max-width: 359px) {
    .homepage-gallery__luxury-item {
        width: 100%;
    }
}

/* ========================================================================== 
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .homepage-gallery__luxury-media,
    .homepage-gallery__luxury-img,
    .homepage-gallery__luxury-overlay,
    .homepage-gallery__luxury-zoom,
    .homepage-gallery__card-cta,
    .homepage-gallery__topics button,
    .sk-gallery-cta-btn {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
