/* =========================================================
   KSR Realty — Gallery Stylesheet
   Brand: KSR cyan / luxury gold / Manrope typography
   Responsive editorial masonry & cinematic fullscreen lightbox
   ========================================================= */

.gallery-page {
    background: var(--cream-bg-soft, #f7f9fa);
    color: var(--text-dark, #121a21);
    font-family: var(--font-primary, "Manrope", sans-serif);
}

.gallery-page main {
    padding-top: 0;
}

/* ---------- Hero Section ---------- */
.gallery-hero {
    position: relative;
    min-height: clamp(400px, 56vh, 560px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    color: #ffffff;
    background-color: #0b1319;
}

.gallery-hero__media {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.gallery-hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.05);
    filter: brightness(0.72) saturate(1.1);
    transition: transform 1200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(180deg, rgba(11, 19, 25, 0.45) 0%, rgba(11, 19, 25, 0.72) 50%, rgba(11, 19, 25, 0.94) 100%),
        radial-gradient(ellipse at 18% 25%, rgba(17, 207, 224, 0.18), transparent 55%),
        radial-gradient(ellipse at 82% 80%, rgba(212, 175, 55, 0.12), transparent 50%);
}

.gallery-hero__content {
    position: relative;
    z-index: 3;
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
    padding-bottom: clamp(40px, 6vw, 64px);
    padding-top: calc(var(--nav-height, 76px) + 36px);
}

.gallery-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 14px;
}

.gallery-breadcrumb a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 180ms ease;
}

.gallery-breadcrumb a:hover {
    color: var(--blue-primary, #11cfe0);
}

.gallery-breadcrumb [aria-current="page"] {
    color: var(--blue-primary, #11cfe0);
}

.gallery-hero__eyebrow {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold, #d4af37);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-hero__eyebrow::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 2px;
    background: var(--gold-gradient, linear-gradient(90deg, #b8860b, #d4af37, #f4d06f));
    border-radius: 2px;
}

.gallery-hero__title {
    font-size: clamp(32px, 5.2vw, 56px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0 0 14px;
}

.gallery-hero__subtitle {
    font-size: clamp(15px, 1.8vw, 18px);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
    max-width: 640px;
    margin: 0;
    font-weight: 400;
}

/* ---------- Gallery Main Container ---------- */
.gallery-section {
    position: relative;
    padding: clamp(48px, 6vw, 84px) 0 clamp(64px, 8vw, 110px);
}

.gallery-container {
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
}

/* ---------- Section Meta Bar ---------- */
.gallery-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 36px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(17, 26, 33, 0.1);
}

.gallery-meta-bar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gallery-meta-bar__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-deep, #b8860b);
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.28);
    padding: 6px 14px;
    border-radius: 999px;
}

.gallery-meta-bar__tag-icon {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold, #d4af37);
}

.gallery-meta-bar__note {
    font-size: 14px;
    color: #5a6872;
    margin: 0;
}

.gallery-meta-bar__count {
    font-size: 13px;
    font-weight: 700;
    color: #485661;
}

.gallery-meta-bar__count strong {
    color: var(--text-dark, #121a21);
    font-size: 15px;
}

/* ---------- Featured Opening Card ---------- */
.gallery-featured-card {
    position: relative;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 32px;
    background: #0d161d;
    border: 1px solid rgba(17, 26, 33, 0.08);
    box-shadow: 0 10px 30px rgba(17, 26, 33, 0.08);
    cursor: pointer;
    text-align: left;
    padding: 0;
    display: block;
    appearance: none;
    transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 450ms ease, border-color 450ms ease;
}

.gallery-featured-card:hover,
.gallery-featured-card:focus-visible {
    transform: translateY(-4px);
    border-color: var(--gold, #d4af37);
    box-shadow: 0 20px 48px rgba(184, 134, 11, 0.2), 0 6px 18px rgba(17, 26, 33, 0.1);
    outline: none;
}

.gallery-featured-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 7.2;
    overflow: hidden;
    background: #0e171f;
}

@media (max-width: 767px) {
    .gallery-featured-card__media {
        aspect-ratio: 16 / 9;
    }
}

.gallery-featured-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-featured-card:hover .gallery-featured-card__media img,
.gallery-featured-card:focus-visible .gallery-featured-card__media img {
    transform: scale(1.03);
}

.gallery-featured-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 15, 21, 0.0) 40%, rgba(9, 15, 21, 0.75) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: clamp(18px, 3vw, 28px);
    transition: background 400ms ease;
}

.gallery-featured-card:hover .gallery-featured-card__overlay {
    background: linear-gradient(180deg, rgba(9, 15, 21, 0.1) 20%, rgba(9, 15, 21, 0.85) 100%);
}

.gallery-featured-card__info {
    color: #ffffff;
}

.gallery-featured-card__badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-light, #f4d06f);
    margin-bottom: 6px;
}

.gallery-featured-card__title {
    font-size: clamp(18px, 2.4vw, 26px);
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

.gallery-featured-card__action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(13, 22, 29, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 10px 18px;
    border-radius: 999px;
    transition: background 260ms ease, border-color 260ms ease, color 260ms ease;
}

.gallery-featured-card:hover .gallery-featured-card__action {
    background: var(--gold, #d4af37);
    border-color: var(--gold, #d4af37);
    color: #0b1319;
}

.gallery-featured-card__action-icon {
    width: 14px;
    height: 14px;
}

/* ---------- Masonry Grid ---------- */
.gallery-masonry {
    column-count: 3;
    column-gap: 24px;
    width: 100%;
}

@media (max-width: 1024px) and (min-width: 641px) {
    .gallery-masonry {
        column-count: 2;
        column-gap: 20px;
    }
}

@media (max-width: 640px) {
    .gallery-masonry {
        column-count: 1;
        column-gap: 16px;
    }
}

/* ---------- Individual Gallery Card ---------- */
.gallery-card {
    break-inside: avoid-column;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    display: block;
    width: 100%;
    margin-bottom: 24px;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(17, 26, 33, 0.08);
    box-shadow: 0 4px 16px rgba(17, 26, 33, 0.05);
    cursor: pointer;
    text-align: left;
    padding: 0;
    appearance: none;
    position: relative;
    transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 450ms ease, border-color 450ms ease;
}

.gallery-card:hover,
.gallery-card:focus-visible {
    transform: translateY(-4px);
    border-color: var(--gold, #d4af37);
    box-shadow: 0 16px 36px rgba(184, 134, 11, 0.16), 0 4px 12px rgba(17, 26, 33, 0.08);
    outline: none;
}

.gallery-card__media {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #eef2f5;
}

.gallery-card__media img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 550ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card:hover .gallery-card__media img,
.gallery-card:focus-visible .gallery-card__media img {
    transform: scale(1.03);
}

.gallery-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 14, 20, 0.0) 45%, rgba(8, 14, 20, 0.65) 100%);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    transition: opacity 400ms ease;
}

.gallery-card:hover .gallery-card__overlay,
.gallery-card:focus-visible .gallery-card__overlay {
    opacity: 1;
}

.gallery-card__badge {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold-light, #f4d06f);
    background: rgba(8, 14, 20, 0.72);
    backdrop-filter: blur(6px);
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.gallery-card__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.gallery-card__caption {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #121a21;
    border: 1px solid var(--gold, #d4af37);
    transition: transform 220ms ease, background 220ms ease, color 220ms ease;
}

.gallery-card:hover .gallery-card__action {
    transform: scale(1.1);
    background: var(--gold, #d4af37);
    color: #0b1319;
}

.gallery-card__action-icon {
    width: 14px;
    height: 14px;
}

/* ---------- Lightbox Modal ---------- */
.ksr-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 300ms ease, visibility 300ms ease;
}

.ksr-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ksr-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 13, 19, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1;
}

.ksr-lightbox__header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px clamp(16px, 4vw, 36px);
    background: linear-gradient(180deg, rgba(8, 13, 19, 0.8) 0%, transparent 100%);
}

.ksr-lightbox__counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.ksr-lightbox__counter strong {
    color: var(--gold-light, #f4d06f);
    font-size: 15px;
}

.ksr-lightbox__counter-sep {
    opacity: 0.5;
}

.ksr-lightbox__close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 220ms ease, border-color 220ms ease, color 220ms ease, transform 220ms ease;
}

.ksr-lightbox__close:hover,
.ksr-lightbox__close:focus-visible {
    background: rgba(212, 175, 55, 0.16);
    border-color: var(--gold, #d4af37);
    color: var(--gold-light, #f4d06f);
    transform: scale(1.08);
    outline: none;
}

.ksr-lightbox__close svg {
    width: 20px;
    height: 20px;
}

/* Lightbox Stage */
.ksr-lightbox__stage {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(10px, 3vw, 32px) clamp(16px, 3vw, 28px);
    overflow: hidden;
}

.ksr-lightbox__nav {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(18, 26, 34, 0.65);
    backdrop-filter: blur(8px);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 12;
    flex: 0 0 52px;
    opacity: 0.78;
    transition: opacity 220ms ease, background 220ms ease, border-color 220ms ease, color 220ms ease, transform 220ms ease;
}

.ksr-lightbox:hover .ksr-lightbox__nav {
    opacity: 1;
}

.ksr-lightbox__nav:hover,
.ksr-lightbox__nav:focus-visible {
    opacity: 1;
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold, #d4af37);
    color: var(--gold-light, #f4d06f);
    transform: scale(1.1);
    outline: none;
}

.ksr-lightbox__nav svg {
    width: 24px;
    height: 24px;
}

.ksr-lightbox__media-wrap {
    position: relative;
    max-width: min(1140px, 86vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    z-index: 8;
    user-select: none;
}

.ksr-lightbox__img {
    max-width: 100%;
    max-height: 74vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
    transition: opacity 220ms ease, transform 220ms ease;
}

.ksr-lightbox__img.is-loading {
    opacity: 0.3;
    transform: scale(0.98);
}

.ksr-lightbox__caption {
    margin-top: 14px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    max-width: 720px;
}

/* Lightbox Mobile Navigation adjustments */
@media (max-width: 640px) {
    .ksr-lightbox__stage {
        padding: 0 10px 18px;
    }
    .ksr-lightbox__nav {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }
    .ksr-lightbox__nav svg {
        width: 18px;
        height: 18px;
    }
    .ksr-lightbox__media-wrap {
        max-width: 96vw;
        max-height: 78vh;
    }
    .ksr-lightbox__img {
        max-height: 68vh;
    }
    .ksr-lightbox__caption {
        font-size: 12px;
        margin-top: 8px;
    }
}
