/* Custom property values now live in assets/css/variables.css, loaded first
   as a dependency (see includes/enqueue.php). */

/* Hero gallery */
.br-hero-gallery__stage {
    position: relative;
      height: clamp(320px, 30vh, 560px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    cursor: zoom-in;
    background: var(--sand);
}

.br-hero-gallery__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.9s var(--ease);
}

.br-hero-gallery__slide.is-active {
    opacity: 1;
}

.br-hero-gallery__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.br-hero-gallery__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(28, 22, 16, 0.55), rgba(28, 22, 16, 0.05) 45%, transparent 70%);
    pointer-events: none;
}

.br-hero-gallery__badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.br-hero-gallery__badge {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-pill);
    color: var(--white);
}

.br-hero-gallery__badge--status {
    background: var(--ember);
}

.br-hero-gallery__badge--stat {
    background: rgba(28, 22, 16, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.br-hero-gallery__footer {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.br-hero-gallery__dots {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.br-hero-gallery__dot {
    width: 9px;
    height: 9px;
    border-radius: var(--radius-pill);
    background: rgba(255, 252, 245, 0.55);
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: width 0.4s var(--ease), background 0.4s var(--ease);
}

.br-hero-gallery__dot.is-active {
    width: 24px;
    background: var(--ember);
}

.br-hero-gallery__dot:hover,
.br-hero-gallery__dot:focus-visible,
.br-hero-gallery__dot:active {
    background: var(--ember) !important;
    outline-color: var(--ember);
}

.br-hero-gallery__viewall {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 252, 245, 0.94);
    color: var(--ink);
    border: 0;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: background 0.3s, transform 0.3s var(--ease);
}

.br-hero-gallery__viewall:hover,
.br-hero-gallery__viewall:focus-visible,
.br-hero-gallery__viewall:active {
    background: var(--white);
    color: var(--ember) !important;
    outline-color: var(--ember);
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    .br-hero-gallery__stage {
        height: clamp(240px, 70vw, 360px);
        border-radius: var(--radius-md);
    }

    .br-hero-gallery__badge {
        font-size: 0.6rem;
        padding: 0.32rem 0.6rem;
    }

    .br-hero-gallery__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .br-hero-gallery__viewall {
        font-size: 0.72rem;
        padding: 0.45rem 0.8rem;
    }
}

/* Gallery lightbox */
.br-lightbox[hidden] {
    display: none;
}

.br-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(16, 10, 5, 0.94);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: clamp(1rem, 3vw, 2.2rem);
}

body.br-lightbox-open {
    overflow: hidden;
}

.br-lightbox__header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--ivory);
}

.br-lightbox__title b {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 400;
}

.br-lightbox__count {
    display: block;
    font-size: 0.78rem;
    color: var(--sand);
}

.br-lightbox__controls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.br-lightbox__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.6rem 1.15rem;
    border-radius: var(--radius-pill);
    border: 0;
    background: var(--ember);
    color: var(--white);
    cursor: pointer;
    transition: background 0.3s;
}

.br-lightbox__cta:hover,
.br-lightbox__cta:focus-visible {
    background: var(--ember-deep) !important;
    color: var(--white) !important;
}

.br-lightbox__close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(251, 246, 239, 0.3);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s;
}

.br-lightbox__close:hover,
.br-lightbox__close:focus-visible,
.br-lightbox__close:active {
    border-color: var(--ember) !important;
    outline-color: var(--ember);
    background: #ffffff !important;
}

.br-lightbox__close:hover svg,
.br-lightbox__close:focus-visible svg,
.br-lightbox__close:active svg {
    stroke: var(--ember) !important;
}

.br-lightbox__close svg {
    width: 18px;
    height: 18px;
    stroke: var(--ivory);
    fill: none;
    stroke-width: 2;
}

.br-lightbox__stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.br-lightbox__frame {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: pan-y;
}

.br-lightbox__slide {
    display: none;
}

.br-lightbox__slide.is-active {
    /* inline-flex shrink-wraps to the scaled image's own rendered box, so
       border-radius + overflow here clips exactly to the image's visible
       edges regardless of its orientation/aspect ratio (portrait images
       were losing their rounded corners when this lived on the <img> and
       the wrapper stayed full-width/height instead of hugging the image). */
    display: inline-flex;
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.br-lightbox__slide img {
    display: block;
    max-width: 100%;
    /* predefined height cap - width scales naturally to keep aspect ratio */
    max-height: min(65vh, 100%);
    width: auto;
    height: auto;
    object-fit: contain;
}

.br-lightbox__video {
    display: block;
    max-width: 100%;
    max-height: min(65vh, 100%);
    width: auto;
    height: auto;
    object-fit: contain;
}

.br-lightbox__nav {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 252, 245, 0.9);
    border: 1.5px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s, border-color 0.3s;
}

.br-lightbox__nav:hover,
.br-lightbox__nav:focus-visible,
.br-lightbox__nav:active {
    background: var(--white);
    border-color: var(--ember) !important;
    outline-color: var(--ember);
    transform: scale(1.06);
}

.br-lightbox__nav:hover svg,
.br-lightbox__nav:focus-visible svg,
.br-lightbox__nav:active svg {
    stroke: var(--ember) !important;
}

.br-lightbox__nav svg {
    width: 18px;
    height: 18px;
    stroke: var(--ink);
    fill: none;
    stroke-width: 2;
}

.br-lightbox__rail {
    flex: 0 0 auto;
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding: 0.3rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.br-lightbox__rail::-webkit-scrollbar {
    display: none;
}

.br-lightbox__thumb {
    flex: 0 0 auto;
    width: 96px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    border: 0;
    padding: 0;
    cursor: pointer;
    outline: 2px solid transparent;
    outline-offset: 2px;
    opacity: 0.6;
    transition: opacity 0.3s, outline-color 0.3s;
}

.br-lightbox__thumb.is-active,
.br-lightbox__thumb:hover,
.br-lightbox__thumb:focus-visible,
.br-lightbox__thumb:active {
    opacity: 1;
    outline-color: var(--ember) !important;
}

.br-lightbox__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.br-lightbox__thumb--video {
    position: relative;
}

.br-lightbox__thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.br-lightbox__thumb-play::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(16, 10, 5, 0.35);
}

.br-lightbox__thumb-play svg {
    position: relative;
    width: 18px;
    height: 18px;
    fill: var(--white);
}

@media (max-width: 640px) {
    .br-lightbox__nav {
        width: 38px;
        height: 38px;
    }

    .br-lightbox__nav svg {
        width: 16px;
        height: 16px;
    }

    .br-lightbox__thumb {
        width: 72px;
        height: 48px;
    }

    .br-lightbox__title b {
        display: none;
    }

    .br-lightbox__cta {
        font-size: 0.76rem;
        padding: 0.5rem 0.9rem;
    }

    .br-lightbox__slide img,
    .br-lightbox__video {
        max-height: min(45vh, 100%);
    }

    .br-lightbox__stage {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 0.5rem;
    }

    .br-lightbox__frame {
        order: 1;
        flex-basis: 100%;
        height: auto;
        max-height: 55vh;
    }

    .br-lightbox__nav {
        order: 2;
    }
}
