/* Extracted verbatim from template-parts/gallery-styles.php (1 inline block(s)).
   Order preserved; enqueue order in functions.php reproduces the original cascade. */

/* ---- Filters ---- */
.rn-gal__filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
    direction: rtl;
}

.rn-gal__pill {
    background: rgba(13, 13, 24, 0.6);
    border: 1px solid rgba(208, 177, 212, 0.28);
    color: var(--ct-muted);
    border-radius: 999px;
    padding: 0.5rem 1.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.rn-gal__pill:hover {
    color: var(--ct-text);
    border-color: var(--ct-accent);
    transform: translateY(-2px);
}

.rn-gal__pill.is-active {
    background: var(--ct-accent-gradient);
    border-color: var(--ct-accent);
    color: #14121c;
    box-shadow: 0 8px 22px rgba(191, 171, 211, 0.32);
}

.rn-gal__pill-count {
    opacity: 0.65;
    font-size: 0.82em;
    margin-inline-start: 0.35rem;
}

/* ---- Grid ---- */
.rn-gal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.25rem;
    direction: rtl;
}

.rn-gal__item.is-hidden {
    display: none;
}

.rn-gal__frame {
    position: relative;
    display: block;
    width: 100%;
    /* One ratio for every tile. This library mixes 1600/900 landscape with
       1080/1920 portrait, and a CSS grid row is as tall as its tallest item, so
       per-item ratios left large holes beneath the shorter tiles. 4:5 suits the
       mostly-portrait phone footage while staying tolerable for landscape.
       Nothing is lost: the lightbox still shows each item uncropped. */
    aspect-ratio: 4 / 5;
    padding: 0;
    border: 1px solid rgba(208, 177, 212, 0.25);
    border-radius: 1rem;
    overflow: hidden;
    background: #0d0d18;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.rn-gal__frame:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(191, 171, 211, 0.3);
    border-color: var(--ct-accent);
}

.rn-gal__frame:focus-visible {
    outline: 2px solid var(--ct-accent);
    outline-offset: 3px;
}

.rn-gal__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video tile with no poster: branded placeholder, zero bytes fetched. */
.rn-gal__placeholder {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 35%, rgba(191, 171, 211, 0.22) 0%, transparent 62%),
        linear-gradient(160deg, #16162a 0%, #0d0d18 100%);
}

.rn-gal__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(13, 13, 24, 0.72);
    border: 2px solid var(--ct-accent);
    color: var(--ct-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.rn-gal__frame:hover .rn-gal__play {
    background: var(--ct-accent-gradient);
    color: #14121c;
    transform: translate(-50%, -50%) scale(1.1);
}

.rn-gal__badge {
    position: absolute;
    bottom: 0.6rem;
    inset-inline-start: 0.6rem;
    background: rgba(13, 13, 24, 0.82);
    color: var(--ct-text);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    pointer-events: none;
}

.rn-gal__terms {
    position: absolute;
    top: 0.6rem;
    inset-inline-end: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    pointer-events: none;
}

.rn-gal__term {
    background: rgba(191, 171, 211, 0.9);
    color: #14121c;
    border-radius: 999px;
    padding: 0.12rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
}

.rn-gal__empty {
    text-align: center;
    color: var(--ct-muted);
    padding: 3rem 1rem;
    direction: rtl;
}

/* ---- Lightbox ---- */
.rn-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(4, 4, 12, 0.96);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1rem;
}

.rn-lightbox.is-open {
    display: flex;
}

.rn-lightbox__stage {
    position: relative;
    max-width: min(1100px, 94vw);
    max-height: 86vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rn-lightbox__stage img,
.rn-lightbox__stage video {
    max-width: 100%;
    max-height: 86vh;
    width: auto;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.rn-lightbox__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(13, 13, 24, 0.8);
    border: 1px solid rgba(208, 177, 212, 0.4);
    color: var(--ct-text);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.25s ease;
}

.rn-lightbox__btn:hover {
    background: var(--ct-accent-gradient);
    color: #14121c;
    border-color: var(--ct-accent);
}

.rn-lightbox__prev { inset-inline-start: 1rem; }
.rn-lightbox__next { inset-inline-end: 1rem; }

.rn-lightbox__close {
    position: absolute;
    top: 1rem;
    inset-inline-end: 1rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(13, 13, 24, 0.8);
    border: 1px solid rgba(208, 177, 212, 0.4);
    color: var(--ct-text);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: all 0.25s ease;
}

.rn-lightbox__close:hover {
    background: #d9534f;
    border-color: #d9534f;
    color: #fff;
}

.rn-lightbox__counter {
    position: absolute;
    top: 1.4rem;
    inset-inline-start: 1.5rem;
    color: var(--ct-muted);
    font-size: 0.95rem;
    font-weight: 600;
    direction: ltr;
    z-index: 3;
}

.rn-lightbox__caption {
    position: absolute;
    bottom: 1.2rem;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--ct-muted);
    font-size: 0.95rem;
    direction: rtl;
    padding: 0 1rem;
}

@media (max-width: 767.98px) {
    .rn-gal__grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .rn-gal__play {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .rn-lightbox__btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .rn-lightbox__prev { inset-inline-start: 0.35rem; }
    .rn-lightbox__next { inset-inline-end: 0.35rem; }
}
