/* ═══ Banner Hero — شهرری میدان نماز ═══ */

.hero-banner {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: clamp(520px, 88vh, 780px);
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
    contain: layout style paint;
}

/* ─── Slider shell ─── */
.hero-banner-slides {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
}

.hero-banner-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 1.15s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.15s;
    z-index: 0;
}

.hero-banner-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
}

.hero-banner-slide.is-entering .hero-banner-badge,
.hero-banner-slide.is-active:first-child .hero-banner-badge,
.hero-banner-slide.is-active .hero-banner-badge {
    opacity: 0;
    transform: translateY(16px);
    animation: bannerFadeUp 0.8s ease forwards 0.15s;
}

.hero-banner-slide:not(.is-active) .hero-banner-badge,
.hero-banner-slide:not(.is-active) .hero-banner-line,
.hero-banner-slide:not(.is-active) .hero-banner-desc,
.hero-banner-slide:not(.is-active) .hero-banner-actions,
.hero-banner-slide:not(.is-active) .hero-banner-stats {
    opacity: 0;
    animation: none !important;
    transform: translateY(20px);
}

.hero-banner-slide.is-active .hero-banner-line.line-1 { animation: bannerFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.3s; }
.hero-banner-slide.is-active .hero-banner-line.line-2 { animation: bannerFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.5s; }
.hero-banner-slide.is-active .hero-banner-line.line-3 { animation: bannerFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.7s; }
.hero-banner-slide.is-active .hero-banner-desc { animation: bannerFadeUp 0.8s ease forwards 0.85s; }
.hero-banner-slide.is-active .hero-banner-actions { animation: bannerFadeUp 0.8s ease forwards 1s; }
.hero-banner-slide.is-active .hero-banner-stats { animation: bannerFadeUp 0.8s ease forwards 1.15s; }

.hero-banner-slide.is-active .hero-banner-line {
    opacity: 0;
    transform: translateY(28px);
}

.hero-banner-slide.is-active .hero-banner-desc,
.hero-banner-slide.is-active .hero-banner-actions,
.hero-banner-slide.is-active .hero-banner-stats {
    opacity: 0;
    transform: translateY(20px);
}

/* ─── Slider controls ─── */
.hero-banner-controls {
    position: absolute;
    bottom: 4.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(4, 24, 12, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hero-banner-arrow {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, transform 0.25s, border-color 0.25s;
}

.hero-banner-arrow:hover {
    background: rgba(74, 222, 128, 0.25);
    border-color: rgba(74, 222, 128, 0.5);
    transform: scale(1.06);
}

.hero-banner-dots {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.hero-banner-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: transform 0.3s, background 0.3s, width 0.3s;
}

.hero-banner-dot.is-active {
    width: 26px;
    border-radius: 999px;
    background: linear-gradient(90deg, #4ade80, #86efac);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.45);
}

/* ─── Bottom wave ─── */
.hero-banner-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 11;
    line-height: 0;
    pointer-events: none;
}

.hero-banner-wave svg {
    width: 100%;
    height: clamp(36px, 5vw, 64px);
    display: block;
}

.hero-banner-wave-path {
    animation: heroWaveMorph 8s ease-in-out infinite;
}

@keyframes heroWaveMorph {
    0%, 100% { d: path("M0,64 C360,120 720,0 1080,64 C1260,96 1380,80 1440,64 L1440,120 L0,120 Z"); }
    50% { d: path("M0,80 C360,40 720,100 1080,50 C1260,70 1380,90 1440,70 L1440,120 L0,120 Z"); }
}

@keyframes bannerKenBurns {
    from {
        opacity: 0.6;
        transform: scale(1.08);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-banner-slide.is-active .hero-banner-img {
    animation: bannerKenBurns 22s ease-in-out infinite alternate, heroSlideMediaIn 1.4s ease forwards;
}

.hero-banner-slide:not(.is-active) .hero-banner-img {
    animation: none;
    transform: scale(1.06);
}

/* ─── Stats-only hero (no title/buttons) ─── */
.hero-banner--stats-only .hero-banner-inner--stats {
    position: absolute;
    inset: auto 0 4.5rem;
    z-index: 10;
    width: 100%;
    padding: 0 0 0.5rem;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
}

.hero-banner--stats-only .hero-banner-stats {
    opacity: 0;
    transform: translateY(20px);
    animation: bannerFadeUp 0.8s ease forwards 0.45s;
    pointer-events: auto;
}

.hero-banner--stats-only.hero-banner--slider .hero-banner-controls {
    bottom: 7.5rem;
}

/* ─── Hero logo (top-right) ─── */
.hero-banner-logo {
    position: absolute;
    top: 1.15rem;
    right: 1.15rem;
    z-index: 11;
    display: block;
    padding: 0;
    background: none;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    pointer-events: auto;
}

.hero-banner-logo:hover {
    transform: scale(1.03);
    opacity: 0.92;
}

.hero-banner-logo img {
    display: block;
    height: clamp(132px, 19.5vw, 228px);
    width: auto;
    max-width: 390px;
    object-fit: contain;
    filter: none;
}

/* ─── Background image ─── */
.hero-banner-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform: scale(1);
    will-change: transform;
}

/* ─── Overlays ─── */
.hero-banner-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg,
            rgba(4, 24, 12, 0.08) 0%,
            rgba(4, 24, 12, 0.05) 38%,
            rgba(4, 20, 10, 0.45) 62%,
            rgba(4, 20, 10, 0.92) 100%);
    pointer-events: none;
}

.hero-banner-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(ellipse at 30% 50%, transparent 30%, rgba(0, 0, 0, 0.45) 100%);
    pointer-events: none;
}

.hero-banner-shimmer {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(
        115deg,
        transparent 30%,
        rgba(255, 255, 255, 0.04) 45%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.04) 55%,
        transparent 70%
    );
    background-size: 200% 100%;
    animation: bannerShimmer 7s ease-in-out infinite;
    pointer-events: none;
}

/* ─── Light rays (desktop) ─── */
.hero-banner-rays {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.5;
}

.hero-banner-rays span {
    position: absolute;
    top: -20%;
    width: 2px;
    height: 140%;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transform-origin: top center;
    animation: bannerRaySweep 9s ease-in-out infinite;
}

.hero-banner-rays span:nth-child(1) { left: 22%; animation-delay: 0s; }
.hero-banner-rays span:nth-child(2) { left: 48%; animation-delay: -3s; height: 120%; }
.hero-banner-rays span:nth-child(3) { left: 72%; animation-delay: -5s; }

/* ─── Particles (desktop) ─── */
.hero-banner-particles {
    position: absolute;
    inset: 0;
    z-index: 4;
    overflow: hidden;
    pointer-events: none;
}

.hero-banner-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 8px rgba(180, 255, 200, 0.4);
    animation: bannerParticleFloat var(--bp-dur, 10s) ease-in-out infinite;
    animation-delay: var(--bp-delay, 0s);
    opacity: 0;
}

/* ─── Decorative frame corners ─── */
.hero-banner-frame {
    position: absolute;
    inset: 1.25rem;
    z-index: 5;
    pointer-events: none;
}

.hero-banner-corner {
    position: absolute;
    width: 48px;
    height: 48px;
    border-color: rgba(255, 255, 255, 0.25);
    border-style: solid;
    opacity: 0;
    animation: bannerCornerIn 1s ease forwards;
}

.hero-banner-corner-tl {
    top: 0; right: 0;
    border-width: 2px 0 0 2px;
    animation-delay: 0.8s;
}
.hero-banner-corner-tr {
    top: 0; left: 0;
    border-width: 2px 2px 0 0;
    animation-delay: 0.9s;
}
.hero-banner-corner-bl {
    bottom: 0; right: 0;
    border-width: 0 0 2px 2px;
    animation-delay: 1s;
}
.hero-banner-corner-br {
    bottom: 0; left: 0;
    border-width: 0 2px 2px 0;
    animation-delay: 1.1s;
}

/* ─── Content ─── */
.hero-banner-inner {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 5rem 0 5.5rem;
}

.hero-banner-content {
    max-width: 680px;
}

.hero-banner-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 1.15rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
}

.hero-banner:not(.hero-banner--slider) .hero-banner-slide.is-active .hero-banner-badge,
.hero-banner-slide.is-active .hero-banner-badge {
    opacity: 0;
    transform: translateY(16px);
}

.hero-banner-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
    animation: bannerPulse 2s ease infinite;
    flex-shrink: 0;
}

.hero-banner-title {
    margin: 0 0 1.25rem;
    line-height: 1.25;
}

.hero-banner-line {
    display: block;
    font-size: clamp(2rem, 5.5vw, 3.6rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.hero-banner-line.line-2 {
    margin: 0.15rem 0;
}

.hero-banner-line em {
    font-style: normal;
    background: linear-gradient(135deg, #86efac, #4ade80, #bbf7d0, #86efac);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: bannerTextShine 5s linear infinite;
    filter: drop-shadow(0 2px 12px rgba(74, 222, 128, 0.35));
}

.hero-banner-desc {
    font-size: clamp(0.95rem, 2.2vw, 1.12rem);
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.88);
    max-width: 540px;
    margin: 0 0 2rem;
}

.hero-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.hero-banner-actions .btn-glass {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    backdrop-filter: blur(8px);
}

.hero-banner-actions .btn-glass:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.btn-label-short { display: none; }

/* ─── Stats strip ─── */
.hero-banner-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    max-width: 520px;
}

.hero-stat {
    text-align: center;
    padding: 0.85rem 0.5rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    transition: background 0.3s, border-color 0.3s;
}

.hero-stat:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
}

.hero-stat-num {
    display: block;
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
}

.hero-stat-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.2rem;
}

@keyframes heroSlideMediaIn {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.07) translate(-1%, -0.5%); }
}

@keyframes bannerShimmer {
    0%, 100% { background-position: 200% 0; opacity: 0.4; }
    50% { background-position: -200% 0; opacity: 0.8; }
}

@keyframes bannerRaySweep {
    0%, 100% { opacity: 0.2; transform: rotate(-8deg); }
    50% { opacity: 0.7; transform: rotate(8deg); }
}

@keyframes bannerParticleFloat {
    0% { opacity: 0; transform: translateY(20px) scale(0.5); }
    20% { opacity: 0.8; }
    80% { opacity: 0.4; }
    100% { opacity: 0; transform: translateY(-30px) scale(1); }
}

@keyframes bannerFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bannerCornerIn {
    to { opacity: 1; }
}

@keyframes bannerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
    50% { box-shadow: 0 0 0 8px transparent; }
}

@keyframes bannerTextShine {
    0% { background-position: 0% center; }
    100% { background-position: 300% center; }
}

/* ─── Desktop: show desktop image via picture (handled in HTML) ─── */
@media (min-width: 769px) {
    .hero-banner {
        min-height: clamp(560px, 90vh, 820px);
    }

    .hero-banner-img {
        object-position: center center;
    }
}

/* ─── Tablet ─── */
@media (max-width: 1024px) {
    .hero-banner-inner {
        padding: 4rem 0 5rem;
    }

    .hero-banner-stats {
        max-width: 100%;
    }
}

/* ─── Mobile: compact content + full animations (overflow-safe) ─── */
@media (max-width: 768px) {
    .hero-banner {
        min-height: auto;
        aspect-ratio: 9 / 16;
        max-height: min(92vh, 720px);
    }

    .hero-banner-img {
        object-position: center 12%;
        will-change: transform;
    }

    .hero-banner-slide.is-active .hero-banner-img {
        animation: bannerKenBurnsMobile 18s ease-in-out infinite alternate, heroSlideMediaIn 1.2s ease forwards;
    }

    .hero-banner-shimmer {
        opacity: 0.6;
        animation: bannerShimmer 9s ease-in-out infinite;
    }

    .hero-banner-rays {
        display: block;
        opacity: 0.35;
    }

    .hero-banner-rays span {
        animation: bannerRaySweep 11s ease-in-out infinite;
    }

    .hero-banner-frame {
        display: block;
        inset: 0.65rem;
    }

    .hero-banner-corner {
        width: 28px;
        height: 28px;
    }

    .hero-banner-vignette {
        background: radial-gradient(ellipse at center 28%, transparent 35%, rgba(0, 0, 0, 0.2) 100%);
    }

    .hero-banner-inner {
        padding: 0 0 3.25rem;
        display: flex;
        align-items: flex-end;
        min-height: 100%;
    }

    .hero-banner--stats-only .hero-banner-inner--stats {
        inset: auto 0 3.5rem;
        padding: 0;
        min-height: 0;
        justify-content: center;
    }

    .hero-banner--stats-only.hero-banner--slider .hero-banner-controls {
        bottom: 5.75rem;
    }

    .hero-banner-logo {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0;
    }

    .hero-banner-logo img {
        height: clamp(108px, 30vw, 156px);
        max-width: 288px;
    }

    .hero-banner-content {
        max-width: 100%;
        text-align: center;
        width: 100%;
    }

    .hero-banner-badge {
        margin-bottom: 0.45rem;
        padding: 0.28rem 0.65rem;
        font-size: 0.62rem;
        gap: 0.35rem;
    }

    .hero-banner-slide.is-active .hero-banner-badge {
        animation: bannerFadeUp 0.7s ease forwards 0.15s;
    }

    .hero-banner-pulse {
        width: 6px;
        height: 6px;
        animation: bannerPulse 2.5s ease infinite;
    }

    .hero-banner-title {
        margin-bottom: 0.4rem;
    }

    .hero-banner-line {
        font-size: clamp(1rem, 4.2vw, 1.28rem);
        line-height: 1.35;
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
    }

    .hero-banner-slide.is-active .hero-banner-line.line-1 { animation-delay: 0.3s; }
    .hero-banner-slide.is-active .hero-banner-line.line-2 {
        animation-delay: 0.45s;
        margin: 0.05rem 0;
    }
    .hero-banner-slide.is-active .hero-banner-line.line-3 { animation-delay: 0.6s; }

    .hero-banner-line em {
        animation: bannerTextShine 5s linear infinite;
        -webkit-text-fill-color: transparent;
        background: linear-gradient(135deg, #86efac, #4ade80, #bbf7d0, #86efac);
        background-size: 300% auto;
        background-clip: text;
        filter: drop-shadow(0 1px 6px rgba(74, 222, 128, 0.3));
    }

    .hero-banner-desc {
        font-size: 0.68rem;
        line-height: 1.55;
        margin: 0 auto 0.55rem;
        max-width: 92%;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .hero-banner-slide.is-active .hero-banner-desc {
        animation: bannerFadeUp 0.7s ease forwards 0.75s;
    }

    .hero-banner-actions {
        justify-content: center;
        gap: 0.35rem;
        margin-bottom: 0.55rem;
    }

    .hero-banner-slide.is-active .hero-banner-actions {
        animation: bannerFadeUp 0.7s ease forwards 0.9s;
    }

    .hero-banner-actions .btn {
        padding: 0.38rem 0.62rem;
        font-size: 0.65rem;
        border-radius: 10px;
        gap: 0.3rem;
    }

    .hero-banner-actions .btn span:not(.live-dot) {
        font-size: 0.75rem;
    }

    .hero-banner-actions .btn-label-full { display: none; }
    .hero-banner-actions .btn-label-short { display: inline; }

    .hero-banner-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.3rem;
        max-width: 100%;
    }

    .hero-banner-slide.is-active .hero-banner-stats {
        animation: bannerFadeUp 0.7s ease forwards 1.05s;
    }

    .hero-banner-controls {
        bottom: 3.25rem;
        gap: 0.45rem;
        padding: 0.25rem 0.5rem;
    }

    .hero-banner-arrow {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }

    .hero-stat {
        padding: 0.32rem 0.15rem;
        border-radius: 10px;
    }

    .hero-stat-num {
        font-size: 0.85rem;
    }

    .hero-stat-label {
        font-size: 0.52rem;
        margin-top: 0.1rem;
    }
}

@keyframes bannerKenBurnsMobile {
    0% { transform: scale(1); }
    100% { transform: scale(1.025); }
}

@keyframes bannerMobileFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-banner-img,
    .hero-banner-shimmer,
    .hero-banner-rays span,
    .hero-banner-line,
    .hero-banner-line em,
    .hero-banner-badge,
    .hero-banner-desc,
    .hero-banner-actions,
    .hero-banner-stats,
    .hero-banner-corner,
    .hero-banner-particle,
    .hero-banner-wave-path {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
