/* =========================================================
   album-variants.css — ألبوم الصور + Lightbox
   نسخة محسّنة: بطاقات ثابتة، تصميم Bento متوازن، وLightbox مستجيب
   يُضاف هذا الملف بعد style.css
   ========================================================= */

.album-section {
    --album-gap: clamp(10px, 1.4vw, 16px);
    padding: clamp(42px, 6vw, 72px) 0;
    position: relative;
    overflow: hidden;
}

    .album-section .alb-img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        cursor: zoom-in;
        user-select: none;
        -webkit-user-drag: none;
        transition: transform .55s cubic-bezier(.2, .8, .2, 1), filter .35s ease;
    }

.album-figure {
    position: relative;
    isolation: isolate;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(14, 68, 80, .08);
    border-radius: clamp(14px, 1.8vw, 22px);
    background: var(--gray-100);
    box-shadow: 0 8px 24px rgba(14, 68, 80, .08);
    cursor: zoom-in;
    outline: none;
    transform: translateZ(0);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

    .album-figure::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 1;
        pointer-events: none;
        background: linear-gradient(180deg, rgba(14, 68, 80, 0) 42%, rgba(5, 35, 43, .62) 100%);
        opacity: .55;
        transition: opacity .3s ease;
    }

    .album-figure::after {
        content: '\f00e';
        position: absolute;
        top: 50%;
        left: 50%;
        z-index: 2;
        width: 48px;
        height: 48px;
        display: grid;
        place-items: center;
        border: 1px solid rgba(255, 255, 255, .55);
        border-radius: 50%;
        color: #fff;
        background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
        box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
        font-family: 'Font Awesome 6 Free';
        font-size: 1rem;
        font-weight: 900;
        pointer-events: none;
        opacity: 0;
        transform: translate(-50%, -50%) scale(.7);
        transition: opacity .3s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1);
    }

    .album-figure:hover,
    .album-figure:focus-visible {
        border-color: rgba(193, 145, 57, .58);
        box-shadow: 0 16px 36px rgba(14, 68, 80, .16);
        transform: translateY(-4px);
    }

        .album-figure:hover::before,
        .album-figure:focus-visible::before {
            opacity: .92;
        }

        .album-figure:hover::after,
        .album-figure:focus-visible::after {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }

        .album-figure:hover .alb-img,
        .album-figure:focus-visible .alb-img {
            filter: saturate(1.08);
            transform: scale(1.06);
        }

    .album-figure .alb-badge {
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 3;
        width: 30px;
        height: 30px;
        display: grid;
        place-items: center;
        border: 1px solid rgba(255, 255, 255, .42);
        border-radius: 10px;
        color: #fff;
        background: rgba(14, 68, 80, .58);
        backdrop-filter: blur(8px);
        font-size: .78rem;
        font-weight: 800;
        transition: background .3s ease, transform .3s ease;
    }

    .album-figure:hover .alb-badge,
    .album-figure:focus-visible .alb-badge {
        background: linear-gradient(135deg, var(--teal), var(--teal-dark));
        transform: translateY(-1px);
    }

/* ---------- 1) معرض بمصغّرات: صورة رئيسية + شريط ---------- */
.album-section--showcase {
    padding-block: clamp(38px, 5vw, 64px);
    background: radial-gradient(circle at 8% 18%, rgba(193, 145, 57, .10), transparent 28%), var(--bg-light);
}

.album-showcase-head {
    width: min(100%, 1040px);
    margin: 0 auto clamp(18px, 3vw, 28px);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

    .album-showcase-head .section-title {
        margin: 6px 0 0;
    }

    .album-showcase-head .section-desc {
        margin: 8px 0 0;
    }

.album-showcase-count {
    flex: 0 0 auto;
    padding: 8px 14px;
    border: 1px solid rgba(193, 145, 57, .28);
    border-radius: 50px;
    color: var(--teal-dark);
    background: rgba(255, 255, 255, .7);
    box-shadow: 0 6px 18px rgba(14, 68, 80, .06);
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
}

.alb1-showcase {
    width: min(100%, 1040px);
    margin-inline: auto;
}

.alb1-stage {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    aspect-ratio: 16 / 8.8;
    min-height: 280px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: clamp(18px, 2.4vw, 30px);
    background: #123940;
    box-shadow: 0 22px 52px rgba(14, 68, 80, .18);
}

    .alb1-stage::after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 1;
        pointer-events: none;
        background: linear-gradient(180deg, rgba(5, 30, 36, 0) 46%, rgba(5, 30, 36, .58) 100%);
    }

.alb1-stage-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(110deg, rgba(255, 255, 255, .08), transparent 34%);
}

.alb1-stage .alb1-stage-img {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: zoom-in;
    opacity: 1;
    transition: opacity .16s ease, transform .6s cubic-bezier(.2, .8, .2, 1), filter .35s ease;
}

.alb1-stage:hover .alb1-stage-img {
    filter: saturate(1.06);
    transform: scale(1.025);
}

.alb1-stage .alb1-stage-img.is-changing {
    opacity: 0;
}

.alb1-stage .alb1-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .56);
    border-radius: 50%;
    color: var(--teal-dark);
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background .25s ease, color .25s ease, transform .25s ease;
}

    .alb1-stage .alb1-arrow:hover,
    .alb1-stage .alb1-arrow:focus-visible {
        color: #fff;
        background: var(--gold);
        outline: none;
        transform: translateY(-50%) scale(1.07);
    }

.alb1-stage .alb1-prev {
    right: clamp(12px, 2vw, 22px);
}

.alb1-stage .alb1-next {
    left: clamp(12px, 2vw, 22px);
}

.alb1-stage .alb1-count {
    position: absolute;
    right: clamp(14px, 2vw, 24px);
    bottom: clamp(14px, 2vw, 22px);
    z-index: 4;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50px;
    color: #fff;
    background: rgba(14, 68, 80, .68);
    backdrop-filter: blur(9px);
    font-size: .82rem;
    font-weight: 700;
}

.alb1-stage-zoom {
    position: absolute;
    bottom: clamp(14px, 2vw, 22px);
    left: clamp(14px, 2vw, 24px);
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 50px;
    color: #fff;
    background: rgba(14, 68, 80, .65);
    backdrop-filter: blur(9px);
    cursor: pointer;
    font: inherit;
    font-size: .78rem;
    font-weight: 700;
    transition: background .25s ease, transform .25s ease;
}

    .alb1-stage-zoom:hover,
    .alb1-stage-zoom:focus-visible {
        background: var(--gold);
        outline: none;
        transform: translateY(-2px);
    }

.alb1-gallery-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 13px;
    padding: 10px 12px 8px;
    border: 1px solid rgba(14, 68, 80, .08);
    border-radius: 18px;
    background: rgba(255, 255, 255, .75);
    box-shadow: 0 10px 28px rgba(14, 68, 80, .07);
}

.alb1-thumbs {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 7px;
    scroll-snap-type: x proximity;
    scrollbar-color: var(--teal) var(--gray-200);
    scrollbar-width: thin;
}

.alb1-thumb {
    position: relative;
    flex: 0 0 clamp(86px, 10vw, 112px);
    width: clamp(86px, 10vw, 112px);
    height: clamp(60px, 7vw, 76px);
    overflow: hidden;
    padding: 0;
    border: 3px solid transparent;
    border-radius: 13px;
    background: var(--gray-100);
    cursor: pointer;
    opacity: .62;
    scroll-snap-align: start;
    transition: opacity .25s ease, border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.alb1-thumb-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.alb1-thumb-index {
    position: absolute;
    right: 6px;
    bottom: 5px;
    min-width: 20px;
    padding: 2px 5px;
    border-radius: 7px;
    color: #fff;
    background: rgba(14, 68, 80, .68);
    font-size: .68rem;
    font-weight: 800;
}

.alb1-thumb:hover,
.alb1-thumb:focus-visible {
    opacity: 1;
    outline: none;
    transform: translateY(-2px);
}

.alb1-thumb.active {
    opacity: 1;
    border-color: var(--gold);
    box-shadow: 0 7px 18px rgba(193, 145, 57, .3);
}

    .alb1-thumb.active .alb1-thumb-index {
        background: var(--gold-dark);
    }

.alb1-hint {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--teal-dark);
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- 2) شبكة منتظمة ---------- */
.album-section--grid {
    background: radial-gradient(circle at 92% 12%, rgba(14, 68, 80, .06), transparent 26%), var(--white);
}

.album-grid-head {
    position: relative;
}

.album-grid-count {
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
    padding: 6px 13px;
    border: 1px solid rgba(14, 68, 80, .12);
    border-radius: 50px;
    color: var(--teal-dark);
    background: var(--bg-light);
    font-size: .78rem;
    font-weight: 800;
}

.alb2-viewport {
    padding: 8px;
    border: 1px solid rgba(14, 68, 80, .07);
    background: rgba(255, 255, 255, .56);
    box-shadow: 0 14px 34px rgba(14, 68, 80, .07);
}

.alb2-viewport,
.alb3-viewport {
    width: 100%;
    max-height: min(62vh, 600px);
    overflow-y: auto;
    padding: 4px 5px 8px 4px;
    border-radius: 20px;
    scrollbar-color: var(--teal) var(--gray-100);
    scrollbar-width: thin;
}

.alb2-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--album-gap);
}

    .alb2-grid .album-figure {
        aspect-ratio: 1 / 1;
    }

/* ---------- 3) Bento: حجم ثابت لا يتأثر بدقة الصور أو عددها ---------- */
.album-section--bento {
    background: var(--bg-light);
}

.alb3-bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    /* بطاقات أصغر: تعرض صورًا أكثر قبل فتح الـ Lightbox */
    grid-auto-rows: clamp(72px, 6vw, 96px);
    gap: var(--album-gap);
}

    .alb3-bento .album-figure {
        width: 100%;
        height: 100%;
    }

        .alb3-bento .album-figure:nth-child(1) {
            grid-column: span 2;
            grid-row: span 2;
        }

        .alb3-bento .album-figure:nth-child(6) {
            grid-column: span 2;
        }

/* ---------- 4) شريط أفقي ---------- */
.album-section--carousel {
    background: radial-gradient(circle at 10% 12%, rgba(193, 145, 57, .09), transparent 27%), var(--white);
}

.album-carousel-head {
    margin-bottom: clamp(18px, 3vw, 28px);
}

.alb4-shell {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.alb4-scroll {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    gap: var(--album-gap);
    overflow-x: auto;
    padding: 8px 4px 20px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-color: var(--teal) var(--gray-100);
    scrollbar-width: thin;
}

    .alb4-scroll .album-figure {
        position: relative;
        flex: 0 0 clamp(238px, 29vw, 328px);
        width: clamp(238px, 29vw, 328px);
        height: clamp(168px, 21vw, 226px);
        scroll-snap-align: center;
    }

        .alb4-scroll .album-figure::before {
            background: linear-gradient(180deg, rgba(5, 30, 36, 0) 45%, rgba(5, 30, 36, .7) 100%);
        }

        .alb4-scroll .album-figure figcaption {
            position: absolute;
            right: 14px;
            bottom: 12px;
            z-index: 3;
            color: rgba(255, 255, 255, .94);
            font-size: .78rem;
            font-weight: 700;
            pointer-events: none;
        }

.alb4-scroll-btn {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(14, 68, 80, .12);
    border-radius: 50%;
    color: var(--teal-dark);
    background: #fff;
    box-shadow: 0 8px 20px rgba(14, 68, 80, .12);
    cursor: pointer;
    transition: background .25s ease, color .25s ease, transform .25s ease;
}

    .alb4-scroll-btn:hover,
    .alb4-scroll-btn:focus-visible {
        color: #fff;
        background: var(--gold);
        outline: none;
        transform: scale(1.06);
    }

.alb4-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 58px;
    color: var(--teal-dark);
    font-size: .76rem;
    font-weight: 700;
}

    .alb4-footer span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

/* ---------- Scrollbars ---------- */
.alb1-thumbs::-webkit-scrollbar,
.alb4-scroll::-webkit-scrollbar {
    height: 7px;
}

.alb2-viewport::-webkit-scrollbar,
.alb3-viewport::-webkit-scrollbar {
    width: 7px;
}

.alb1-thumbs::-webkit-scrollbar-track,
.alb2-viewport::-webkit-scrollbar-track,
.alb3-viewport::-webkit-scrollbar-track,
.alb4-scroll::-webkit-scrollbar-track {
    border-radius: 50px;
    background: var(--gray-100);
}

.alb1-thumbs::-webkit-scrollbar-thumb,
.alb2-viewport::-webkit-scrollbar-thumb,
.alb3-viewport::-webkit-scrollbar-thumb,
.alb4-scroll::-webkit-scrollbar-thumb {
    border-radius: 50px;
    background: linear-gradient(var(--teal), var(--gold));
}

/* ---------- Lightbox مشترك ---------- */
.alb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    padding: clamp(60px, 8vw, 88px) clamp(54px, 9vw, 120px);
    background: rgba(5, 28, 35, .94);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
}

    .alb-lightbox.open {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    .alb-lightbox img {
        display: block;
        width: auto;
        height: auto;
        max-width: min(92vw, 1200px);
        max-height: 82vh;
        object-fit: contain;
        border: 3px solid rgba(255, 255, 255, .92);
        border-radius: 16px;
        background: #102f36;
        box-shadow: 0 28px 80px rgba(0, 0, 0, .52);
        cursor: zoom-out;
        animation: albzoom .32s cubic-bezier(.34, 1.56, .64, 1);
    }

@keyframes albzoom {
    from {
        opacity: 0;
        transform: scale(.88);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.alb-lb-close,
.alb-lb-prev,
.alb-lb-next {
    position: absolute;
    z-index: 2;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .13);
    cursor: pointer;
    font-size: 1.05rem;
    transition: background .25s ease, border-color .25s ease, transform .25s ease;
}

    .alb-lb-close:hover,
    .alb-lb-prev:hover,
    .alb-lb-next:hover,
    .alb-lb-close:focus-visible,
    .alb-lb-prev:focus-visible,
    .alb-lb-next:focus-visible {
        border-color: var(--gold);
        background: var(--gold);
        outline: none;
    }

.alb-lb-close {
    top: 22px;
    left: 22px;
}

.alb-lb-prev {
    top: 50%;
    left: 22px;
    transform: translateY(-50%);
}

.alb-lb-next {
    top: 50%;
    right: 22px;
    transform: translateY(-50%);
}

.alb-lb-prev:hover {
    transform: translateY(-50%) scale(1.06);
}

.alb-lb-next:hover {
    transform: translateY(-50%) scale(1.06);
}

.alb-lb-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50px;
    color: rgba(255, 255, 255, .9);
    background: rgba(0, 0, 0, .2);
    font-size: .88rem;
    font-weight: 600;
    transform: translateX(-50%);
}

@media (max-width: 900px) {
    .alb2-grid,
    .alb3-bento {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .alb3-bento {
        grid-auto-rows: clamp(68px, 9vw, 88px);
    }

        .alb3-bento .album-figure:nth-child(6) {
            grid-column: auto;
        }
}

@media (max-width: 600px) {
    .album-showcase-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .album-showcase-count {
        align-self: flex-start;
    }

    .alb1-stage {
        aspect-ratio: 4 / 3;
        min-height: 230px;
    }

    .alb1-gallery-footer {
        display: block;
        padding: 9px 10px 7px;
    }

    .alb1-hint {
        display: flex;
        justify-content: center;
        margin-top: 5px;
    }

    .alb1-stage-zoom span {
        display: none;
    }

    .alb1-thumb {
        flex-basis: 84px;
        width: 84px;
        height: 60px;
    }

    .alb2-grid,
    .alb3-bento {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .alb2-viewport,
    .alb3-viewport {
        max-height: 58vh;
    }

    .alb3-bento {
        grid-auto-rows: clamp(64px, 15vw, 82px);
    }

        .alb3-bento .album-figure:nth-child(1) {
            grid-column: span 2;
            grid-row: span 2;
        }

        .alb3-bento .album-figure:nth-child(6) {
            grid-column: span 2;
        }

    .alb4-shell {
        gap: 5px;
    }

    .alb4-scroll-btn {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

    .alb4-scroll .album-figure {
        flex-basis: 74vw;
        width: 74vw;
        height: 205px;
    }

    .alb4-footer {
        padding: 0 42px;
        font-size: .7rem;
    }

    .alb-lightbox {
        padding: 64px 44px;
    }

        .alb-lightbox img {
            max-width: 94vw;
            max-height: 76vh;
            border-width: 2px;
        }

    .alb-lb-close {
        top: 14px;
        left: 14px;
    }

    .alb-lb-prev {
        left: 8px;
    }

    .alb-lb-next {
        right: 8px;
    }

    .alb-lb-close,
    .alb-lb-prev,
    .alb-lb-next {
        width: 42px;
        height: 42px;
    }

    .alb-lb-counter {
        bottom: 14px;
    }
}

@media (max-width: 380px) {
    .alb3-bento {
        grid-auto-rows: 62px;
    }

    .alb-lightbox {
        padding-inline: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .album-figure,
    .album-figure::before,
    .album-figure::after,
    .album-figure .alb-img,
    .alb-lightbox,
    .alb-lightbox img {
        transition: none;
        animation: none;
    }
}
