/* Explain: Styles for the homepage hero section, including animations and golden accents. */
/* =========================================================
   Homepage hero — "gilded showcase"
   الصورة والعنوان في لوحتين منفصلتين: لا يوجد أي نص فوق الصورة،
   فتبقى كل تفاصيلها (ومنها اسم البرنامج أعلى اللوحة) ظاهرة كاملة.
   كل صورة تحتفظ بنسبة أبعادها، فيمتلئ الإطار من الحافة إلى الحافة
   دون فراغات أعلى/أسفل — على الكمبيوتر والتابلت والجوال.
   ========================================================= */

.hero-section {
    position: relative;
    padding-top: clamp(4.5rem, 6.5vw, 6.25rem);
    padding-bottom: clamp(1rem, 2.2vw, 1.75rem);
}

/* ---------- Shell ---------- */
.hero-shell {
    position: relative;
    isolation: isolate;
    width: 100%;
    overflow: hidden;
    background:
        radial-gradient(circle at 86% 12%, rgba(212, 175, 55, 0.16), transparent 26rem),
        radial-gradient(circle at 8% 88%, rgba(25, 135, 84, 0.3), transparent 30rem),
        linear-gradient(140deg, #0e4d31 0%, #0a3a24 54%, #05170f 100%);
    box-shadow: 0 24px 60px rgba(15, 81, 50, 0.22);
}

.hero-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23D4AF37' stroke-width='1'%3E%3Cpath d='M40 8 72 40 40 72 8 40Z'/%3E%3Cpath d='M17 17 63 17 63 63 17 63Z'/%3E%3Cpath d='M40 30 50 40 40 50 30 40Z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 80px 80px;
    background-position: center;
    -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 88%);
    mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 88%);
}

/* Animated golden hairline along the top edge */
.hero-topline {
    position: absolute;
    top: 0;
    inset-inline: 10%;
    z-index: 6;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--logo-subtitle-color), var(--accent-color), var(--logo-subtitle-color), transparent);
    background-size: 200% 100%;
    animation: hero-topline-shimmer 6s linear infinite;
    pointer-events: none;
}

@keyframes hero-topline-shimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* Twinkling golden sparkles in the background band */
.hero-sparkle {
    position: absolute;
    z-index: 5;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: radial-gradient(circle, #ffffff 0%, rgba(212, 175, 55, 0.95) 45%, transparent 72%);
    box-shadow: 0 0 12px 3px rgba(212, 175, 55, 0.55);
    opacity: 0;
    pointer-events: none;
    animation: hero-sparkle 4.6s ease-in-out infinite;
}

.hero-sparkle-1 { top: 14%; inset-inline-start: 5%; animation-delay: 0s; }
.hero-sparkle-2 { bottom: 26%; inset-inline-end: 4%; width: 0.7rem; height: 0.7rem; animation-delay: 1.5s; }
.hero-sparkle-3 { bottom: 12%; inset-inline-start: 42%; width: 0.36rem; height: 0.36rem; animation-delay: 2.7s; }

@keyframes hero-sparkle {
    0%, 100% { opacity: 0; transform: scale(0.4); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ---------- Slider ---------- */
.heroSlider {
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.heroSlider .swiper-slide {
    display: flex;
}

.hero-slide {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    align-items: center;
    gap: clamp(0.85rem, 2vw, 1.4rem);
    width: 100%;
    padding: clamp(0.6rem, 1.6vw, 1.1rem);
}

@media (min-width: 1024px) {
    .hero-slide {
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
        gap: clamp(1.25rem, 2.4vw, 2.25rem);
        padding: clamp(1rem, 1.6vw, 1.5rem);
    }
}

/* ---------- Photo panel ---------- */
.hero-stage-wrap {
    position: relative;
    padding: clamp(0.3rem, 0.6vw, 0.5rem);
    border-radius: clamp(1rem, 1.5vw, 1.4rem);
    background: linear-gradient(145deg, rgba(240, 212, 122, 0.55), rgba(255, 255, 255, 0.1) 45%, rgba(212, 175, 55, 0.4));
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
}

.hero-stage {
    position: relative;
    width: 100%;
    aspect-ratio: var(--hero-ratio, 16 / 9);
    max-height: clamp(240px, 50svh, 520px);
    overflow: hidden;
    border-radius: clamp(0.75rem, 1.2vw, 1.1rem);
    background: #05170f;
    isolation: isolate;
}

.hero-ambient {
    position: absolute;
    inset: -8%;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: blur(28px) saturate(1.25) brightness(0.55);
    transform: scale(1.1);
    opacity: 0.9;
    pointer-events: none;
}

.hero-photo {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.45));
    transition: opacity 0.9s ease, transform 1.5s cubic-bezier(0.22, 1, 0.36, 1);
    /* Display-only artwork: cannot be selected, dragged or saved */
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

/* Entrance motion for the active slide only; the photo is never hidden outside of
   that, so the hero keeps rendering even when the slide state is refreshed. */
.heroSlider .swiper-slide-active .hero-photo {
    animation: hero-photo-in 1.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hero-photo-in {
    from { opacity: 0; transform: scale(1.04); }
    to { opacity: 1; transform: scale(1); }
}

/* Golden corner brackets sitting on the rim — never over the photo */
.hero-corner {
    position: absolute;
    z-index: 4;
    width: clamp(1.1rem, 1.8vw, 1.6rem);
    height: clamp(1.1rem, 1.8vw, 1.6rem);
    border-color: #f0d47a;
    pointer-events: none;
}

.hero-corner-tl {
    top: -0.1rem;
    inset-inline-start: -0.1rem;
    border-top: 2px solid;
    border-inline-start: 2px solid;
    border-start-start-radius: 0.55rem;
}

.hero-corner-br {
    bottom: -0.1rem;
    inset-inline-end: -0.1rem;
    border-bottom: 2px solid;
    border-inline-end: 2px solid;
    border-end-end-radius: 0.55rem;
}

/* ---------- Caption panel (no overlap with the photo) ---------- */
.hero-caption {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.15rem, 1.2vw, 0.75rem) clamp(0.2rem, 1.4vw, 0.6rem) clamp(0.5rem, 1.6vw, 1rem);
    text-align: center;
}

.hero-caption-inner {
    position: relative;
    width: 100%;
    max-width: 27rem;
}

@media (min-width: 1024px) {
    .hero-caption {
        justify-content: flex-start;
        text-align: start;
        padding-block: 0;
    }

    .hero-caption-inner {
        padding-inline-start: clamp(0.9rem, 1.6vw, 1.4rem);
        border-inline-start: 1px solid rgba(212, 175, 55, 0.35);
    }
}

.hero-count {
    display: inline-flex;
    align-items: baseline;
    gap: 0.28rem;
    font-family: var(--font-heading);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--logo-subtitle-color);
}

.hero-count em {
    font-style: normal;
    font-size: 0.66rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
}

.hero-title {
    margin: 0.5rem 0 0;
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 4.9vw, 1.5rem);
    font-weight: 800;
    line-height: 1.6;
    color: #ffffff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

.hero-underline {
    display: block;
    height: 0.22rem;
    width: 3.2rem;
    margin: 0.7rem auto 0;
    border-radius: 999px;
    background: linear-gradient(to left, var(--logo-subtitle-color), var(--accent-color));
    box-shadow: 0 3px 14px rgba(212, 175, 55, 0.45);
}

.hero-subtitle {
    margin: 0.6rem 0 0;
    font-size: clamp(0.88rem, 3.4vw, 1rem);
    font-weight: 500;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.78);
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: clamp(1.35rem, 1.9vw, 1.95rem);
        line-height: 1.55;
        margin-top: 0.6rem;
    }

    .hero-underline {
        margin-inline: 0;
        width: 3.6rem;
    }

    .hero-subtitle {
        font-size: clamp(0.95rem, 1.15vw, 1.08rem);
    }
}

/* Staggered entrance for the caption lines */
/* Caption lines rise in while their slide is active; outside of that they stay
   fully visible, so the hero can never end up as an empty panel. */
.heroSlider .swiper-slide-active .hero-count,
.heroSlider .swiper-slide-active .hero-title,
.heroSlider .swiper-slide-active .hero-underline,
.heroSlider .swiper-slide-active .hero-subtitle {
    animation: hero-caption-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.heroSlider .swiper-slide-active .hero-count { animation-delay: 0.1s; }
.heroSlider .swiper-slide-active .hero-title { animation-delay: 0.2s; }
.heroSlider .swiper-slide-active .hero-underline { animation-delay: 0.32s; }
.heroSlider .swiper-slide-active .hero-subtitle { animation-delay: 0.42s; }

@keyframes hero-caption-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Controls (arrows + progress) ---------- */
.hero-controls {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.7rem, 2vw, 1.2rem);
    padding: 0 clamp(0.8rem, 2vw, 1.5rem) clamp(0.9rem, 1.8vw, 1.35rem);
}

.hero-shell .hero-nav {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    display: inline-flex;
    height: 2.6rem;
    width: 2.6rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.82rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    transform: none;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-shell .hero-nav:hover,
.hero-shell .hero-nav:focus-visible {
    background: var(--logo-subtitle-color);
    border-color: var(--logo-subtitle-color);
    color: var(--primary-color);
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.4);
}

@media (min-width: 640px) {
    .hero-shell .hero-nav {
        height: 2.9rem;
        width: 2.9rem;
        font-size: 0.9rem;
    }
}

/* English (LTR) — mirror the navigation chevrons so prev/next still point the right way */
[dir="ltr"] .hero-shell .hero-prev i,
[dir="ltr"] .hero-shell .hero-next i {
    transform: rotate(180deg);
}

.hero-progress {
    position: static !important;
    inset: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: auto !important;
    margin: 0 !important;
    transform: none !important;
    text-align: center;
}

.hero-progress .swiper-pagination-bullet {
    position: relative;
    display: block;
    width: clamp(1.3rem, 3vw, 2.3rem);
    height: 0.28rem;
    margin: 0 !important;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.22);
    opacity: 1;
    transition: background 0.35s ease;
}

.hero-progress .swiper-pagination-bullet-active {
    background: rgba(255, 255, 255, 0.3);
}

.hero-bullet-fill {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--logo-subtitle-color), #f7e6ab);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

.hero-progress .swiper-pagination-bullet-active .hero-bullet-fill {
    animation: hero-bullet-fill 4.2s linear forwards;
}

@keyframes hero-bullet-fill {
    from { width: 0; }
    to { width: 100%; }
}

/* ---------- Mobile ---------- */
@media (max-width: 639px) {
    .hero-stage {
        max-height: none;
        border-radius: 0.8rem;
    }

    .hero-caption-inner {
        max-width: 100%;
    }

    .hero-title {
        line-height: 1.55;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-topline,
    .hero-sparkle,
    .hero-progress .swiper-pagination-bullet-active .hero-bullet-fill {
        animation: none;
    }

    .hero-progress .swiper-pagination-bullet-active .hero-bullet-fill {
        width: 100%;
    }

    .hero-photo,
    .heroSlider .swiper-slide-active .hero-photo {
        opacity: 1;
        transform: none;
        transition: none;
        animation: none;
    }

    .hero-count,
    .hero-title,
    .hero-underline,
    .hero-subtitle,
    .heroSlider .swiper-slide-active .hero-count,
    .heroSlider .swiper-slide-active .hero-title,
    .heroSlider .swiper-slide-active .hero-underline,
    .heroSlider .swiper-slide-active .hero-subtitle {
        opacity: 1;
        transform: none;
        transition: none;
        animation: none;
    }

    .hero-shell .hero-nav {
        transition: none;
    }
}