/* ======================================================
   SpencoGEL Responsive Hero Slider
   Desktop image: 2400 × 800  (3:1)
   Mobile image:  1080 × 810  (4:3)
   ====================================================== */

/* ساختار اصلی اسلایدر */
.hero-slider {
    position: relative;
    width: 100%;
    height: clamp(256px, 33.333vw, 720px);
    margin: 0;
    overflow: hidden;
    isolation: isolate;
    background: #f6f2f7;
}

/* نگهدارنده اسلایدها */
.hero-slider .slides {
    position: relative;
    width: 100%;
    height: 100%;
}

/* هر اسلاید */
.hero-slider .slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 0;
    transition:
        opacity 700ms ease,
        visibility 700ms ease;
}

/* اسلاید فعال */
.hero-slider .slide.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
}

/* لینک، picture و تصویر */
.hero-slider .hero-slide-link,
.hero-slider picture,
.hero-slider .hero-image {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-slider .hero-slide-link {
    text-decoration: none;
    color: inherit;
}

/* تصویر بنر */
.hero-slider .hero-image {
    object-fit: cover;
    object-position: center;
    user-select: none;
    -webkit-user-drag: none;
}

/* ======================================================
   دکمه‌های قبلی و بعدی
   ====================================================== */

.hero-arrow {
    position: absolute;
    top: 50%;
    width: 46px;
    height: 46px;
    padding: 0;
    display: none;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.82);
    color: #592058;
    box-shadow: 0 6px 20px rgba(25, 15, 25, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: inherit;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
    transition:
        background-color 180ms ease,
        color 180ms ease,
        transform 180ms ease;
}

.hero-prev {
    right: 22px;
}

.hero-next {
    left: 22px;
}

/* کنترل‌ها فقط در صورت وجود چند اسلاید نمایش داده می‌شوند */
.hero-slider.is-ready.has-multiple .hero-arrow {
    display: grid;
}

@media (hover: hover) {
    .hero-arrow:hover {
        color: #fff;
        background: #7f2a7d;
        transform: translateY(-50%) scale(1.05);
    }
}

/* ======================================================
   نقاط اسلایدر و دکمه توقف
   ====================================================== */

.hero-controls {
    position: absolute;
    left: 50%;
    bottom: 16px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 3px 7px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 5px 18px rgba(20, 10, 20, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 6;
}

.hero-slider.is-ready.has-multiple .hero-controls {
    display: flex;
}

.hero-dots {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* خود دکمه فضای لمس کافی دارد */
.hero-dot {
    position: relative;
    width: 32px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

/* شکل قابل‌مشاهده نقطه */
.hero-dot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: #a797aa;
    transition:
        width 200ms ease,
        background-color 200ms ease;
}

.hero-dot.active::before {
    width: 23px;
    background: #7f2a7d;
}

/* دکمه توقف و ادامه حرکت */
.hero-autoplay-button {
    width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #7f2a7d;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 180ms ease;
}

@media (hover: hover) {
    .hero-autoplay-button:hover {
        background: rgba(127, 42, 125, 0.1);
    }
}

/* فوکوس کیبورد */
.hero-arrow:focus-visible,
.hero-dot:focus-visible,
.hero-autoplay-button:focus-visible,
.hero-slide-link:focus-visible {
    outline: 3px solid rgba(127, 42, 125, 0.42);
    outline-offset: 3px;
}

/* ======================================================
   موبایل
   ====================================================== */

@media (max-width: 768px) {

    /* فقط صفحه خانه زیر هدر ثابت فاصله می‌گیرد */
    body.home-page {
        padding-top: 58px;
    }

    .hero-slider {
        width: calc(100% - 24px);
        height: auto;
        aspect-ratio: 4 / 3;
        margin: 22px auto 0;
        border-radius: 16px;
        background: #f6f2f7;
        box-shadow: 0 3px 15px rgba(30, 15, 30, 0.06);
        touch-action: pan-y;
    }

    /* در موبایل سوایپ جایگزین فلش‌ها است */
    .hero-slider.is-ready.has-multiple .hero-arrow {
        display: none;
    }

    .hero-controls {
        bottom: 8px;
        min-height: 38px;
        padding: 1px 5px;
    }

    .hero-dot {
        width: 29px;
        height: 34px;
    }

    .hero-autoplay-button {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        font-size: 12px;
    }
}

/* موبایل‌های کوچک */
@media (max-width: 380px) {
    .hero-slider {
        width: calc(100% - 16px);
        margin-top: 16px;
        border-radius: 13px;
    }

    .hero-dot {
        width: 26px;
    }
}

/* ======================================================
   کاهش حرکت برای کاربران حساس به انیمیشن
   ====================================================== */

@media (prefers-reduced-motion: reduce) {
    .hero-slider .slide,
    .hero-arrow,
    .hero-dot::before,
    .hero-autoplay-button {
        transition: none !important;
    }
}


/* ======================================================
   کنترل مینیمال اسلایدر
   ====================================================== */

.hero-controls {
    bottom: 11px;
    gap: 0;
    min-height: 32px;
    padding: 0 4px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 2px 10px rgba(25, 15, 25, 0.1);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.hero-dot {
    width: 25px;
    height: 30px;
}

.hero-dot::before {
    width: 6px;
    height: 6px;
    background: #b4a8b6;
}

.hero-dot.active::before {
    width: 18px;
    background: #7f2a7d;
}

.hero-autoplay-button {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
    font-size: 10px;
    color: #7f2a7d;
}

/* نسخه باریک‌تر موبایل */
@media (max-width: 768px) {
    .hero-controls {
        bottom: 6px;
        min-height: 26px;
        padding: 0 2px;
        border-radius: 999px;
        box-shadow: 0 2px 7px rgba(25, 15, 25, 0.08);
    }

    .hero-dot {
        width: 21px;
        height: 25px;
    }

    .hero-dot::before {
        width: 5px;
        height: 5px;
    }

    .hero-dot.active::before {
        width: 15px;
    }

    .hero-autoplay-button {
        width: 23px;
        height: 23px;
        flex-basis: 23px;
        font-size: 9px;
    }
}
/* نقاط تعاملی بنر */

.hero-media {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-media picture,
.hero-media .hero-slide-link {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-hotspots {
    position: absolute;
    visibility: hidden;
    z-index: 30;
    pointer-events: none;
}

.hero-hotspots[data-image-ready="true"] {
    visibility: inherit;
}

.hero-hotspot {
    position: absolute;
    left: var(--desktop-x);
    top: var(--desktop-y);

    /* Center the circle itself; label length and RTL must not move it. */
    display: block;
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    right: auto;

    transform: translate(-50%, -50%);
    text-decoration: none;

    pointer-events: auto;
}

.hero-hotspot-dot {
    position: relative;
    display: block;

    box-sizing: border-box;
    width: 100%;
    height: 100%;

    border: 3px solid #ffffff;
    border-radius: 50%;

    background: #994099;

    box-shadow:
        0 0 0 4px rgba(153, 64, 153, 0.25),
        0 8px 22px rgba(0, 0, 0, 0.25);
}

.hero-hotspot-dot::before {
    content: "";
    position: absolute;
    inset: -10px;

    border: 2px solid rgba(153, 64, 153, 0.5);
    border-radius: 50%;

    /* Settle after two pulses while preserving the permanent hotspot dot. */
    opacity: 0;
    animation: heroHotspotPulse 2s ease-out infinite;
}

.hero-hotspot-label {
    position: absolute;
    inset-inline-start: calc(100% + 9px);
    top: 50%;
    padding: 8px 12px;

    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.86);
    color: #222222;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;

    opacity: 0;
    visibility: hidden;
    transform: translate(6px, -50%);

    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}

.hero-hotspot:hover .hero-hotspot-label,
.hero-hotspot:focus-visible .hero-hotspot-label {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
}

@keyframes heroHotspotPulse {
    0% {
        opacity: 0.85;
        transform: scale(0.7);
    }

    100% {
        opacity: 0;
        transform: scale(1.6);
    }
}

@media (max-width: 768px) {
    .hero-hotspot {
        left: var(--mobile-x);
        top: var(--mobile-y);

        width: 16px;
        height: 16px;
    }

    .hero-hotspot-dot {
        border-width: 2px;
    }

    .hero-hotspot-dot::before {
        inset: -6px;
        border-width: 1px;
    }

    .hero-hotspot-label {
        display: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .hero-hotspot-dot::before {
        animation: none;
    }
}
