/* ================= Legends Page — Transformation Slider ================= */

.legends-page {
    background: var(--theme-bg);
    overflow-x: hidden;
}

.legends-page .page-title h1 {
    font-size: clamp(2.4rem, 6vw, 5rem);
    font-weight: 900;
    margin: 0 0 15px;
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke: 1px var(--theme-slide-text);
    background: url('https://images.unsplash.com/photo-1534438327276-14e5300c3a48?q=80&w=1920&auto=format&fit=crop') center/cover;
    -webkit-background-clip: text;
    background-clip: text;
    transition: all 0.5s ease;
}

.legends-page .page-title:hover h1 {
    color: var(--theme-slide-text);
    -webkit-text-stroke: 0;
}

.legends-page .page-title p {
    font-size: 1.25rem;
    color: var(--theme-hero-subtitle);
    margin: 0;
    font-weight: 600;
}

.legends-page .page-title i {
    color: var(--primary-red);
    margin-inline-end: 10px;
}

/* ================= Slider Section ================= */

.legends-slider-section {
    padding: 40px 0 90px;
    position: relative;
}

.legends-slider-section::before,
.legends-slider-section::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 3;
    pointer-events: none;
}

.legends-slider-section::before {
    left: 0;
    background: linear-gradient(90deg, var(--theme-bg), transparent);
}

.legends-slider-section::after {
    right: 0;
    background: linear-gradient(270deg, var(--theme-bg), transparent);
}

[dir="rtl"] .legends-slider-section::before {
    left: auto;
    right: 0;
    background: linear-gradient(270deg, var(--theme-bg), transparent);
}

[dir="rtl"] .legends-slider-section::after {
    right: auto;
    left: 0;
    background: linear-gradient(90deg, var(--theme-bg), transparent);
}

#transformations .legends-slider-section {
    padding: 10px 0 30px;
}

#transformations .legends-empty {
    padding: 40px 24px;
}

.legends-slider {
    width: 100%;
    padding: 10px 24px 40px;
    overflow: hidden;
}

.legends-slider--single .swiper-wrapper {
    justify-content: center;
}

.legends-slider .swiper-slide {
    width: auto;
    height: auto;
}

/* ================= Card ================= */

.legend-slide-card {
    --legend-card-w: 270px;
    --legend-card-h: 400px;
    width: var(--legend-card-w);
    height: var(--legend-card-h);
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    background: #0a0a0a;
}

.legend-card-visual,
.legend-card-story {
    position: absolute;
    inset: 0;
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.legend-card-visual {
    z-index: 2;
}

.legend-card-story {
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    padding: 22px 18px 18px;
    display: flex;
    flex-direction: column;
    background:
        repeating-linear-gradient(
            -35deg,
            rgba(255, 255, 255, 0.04) 0,
            rgba(255, 255, 255, 0.04) 2px,
            transparent 2px,
            transparent 14px
        ),
        rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    color: #fff;
}

.legend-slide-card:hover .legend-card-visual,
.legend-slide-card.is-active .legend-card-visual {
    transform: scale(1.03);
}

.legend-slide-card:hover .legend-card-story,
.legend-slide-card.is-active .legend-card-story {
    opacity: 1;
    pointer-events: auto;
}

/* Before / After split */

.legend-ba-split {
    display: flex;
    width: 100%;
    height: 100%;
}

.legend-ba {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.legend-ba img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.legend-ba--before img {
    filter: grayscale(0.15) contrast(1.05) brightness(0.92);
}

.legend-ba--after::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(220, 20, 40, 0.52);
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 1;
}

.legend-slide-card:hover .legend-ba img {
    transform: scale(1.06);
}

.legend-ba-label {
    position: absolute;
    bottom: 14px;
    z-index: 2;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    line-height: 1;
}

.legend-ba--before .legend-ba-label {
    inset-inline-end: 12px;
}

.legend-ba--after .legend-ba-label {
    inset-inline-start: 12px;
}

/* Story overlay */

.legend-story-name {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

.legend-story-kicker {
    margin: 0 0 8px;
    color: var(--primary-red);
    font-weight: 800;
    font-size: 0.95rem;
}

.legend-story-text {
    margin: 0;
    flex: 1;
    overflow: hidden;
    font-size: 0.88rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
    display: -webkit-box;
    -webkit-line-clamp: 7;
    -webkit-box-orient: vertical;
}

.legend-story-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 700;
}

.legend-story-meta i {
    color: var(--primary-red);
}

.legend-story-btn {
    margin-top: 14px;
    align-self: stretch;
    border: 1px solid rgba(255, 42, 42, 0.55);
    background: rgba(255, 42, 42, 0.08);
    color: #fff;
    padding: 11px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.legend-story-btn:hover {
    background: rgba(255, 42, 42, 0.2);
    border-color: var(--primary-red);
    transform: translateY(-1px);
}

/* Empty state */

.legends-empty {
    text-align: center;
    color: var(--theme-text-muted);
    padding: 80px 24px;
    max-width: 700px;
    margin: 0 auto;
}

.legends-empty i {
    font-size: 5rem;
    margin-bottom: 20px;
    color: var(--theme-border);
}

.legends-empty h3 {
    font-size: 2rem;
    color: var(--theme-text);
    margin-bottom: 12px;
}

/* Modal */

.legend-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.legend-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.legend-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
}

.legend-modal-panel {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(85vh, 760px);
    overflow: auto;
    background: linear-gradient(160deg, #141414, #080808);
    border: 1px solid rgba(255, 42, 42, 0.35);
    border-radius: 18px;
    padding: 28px 24px;
    color: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    transform: translateY(16px);
    transition: transform 0.3s ease;
}

.legend-modal.is-open .legend-modal-panel {
    transform: translateY(0);
}

.legend-modal-close {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.legend-modal-close:hover {
    background: rgba(255, 42, 42, 0.25);
}

.legend-modal-body {
    font-size: 1rem;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.9);
    white-space: pre-line;
}

.legend-modal-images {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.legend-modal-images img {
    flex: 1;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .legend-slide-card {
        --legend-card-w: 240px;
        --legend-card-h: 360px;
    }

    .legends-slider-section::before,
    .legends-slider-section::after {
        width: 40px;
    }

    .legend-modal-images {
        flex-direction: column;
    }

    .legend-modal-images img {
        height: 160px;
    }
}

@media (hover: none) {
    .legend-slide-card .legend-card-story {
        opacity: 0;
    }

    .legend-slide-card.is-active .legend-card-story {
        opacity: 1;
        pointer-events: auto;
    }

    .legend-slide-card.is-active .legend-card-visual {
        opacity: 1;
    }
}
