/* ============================================
   SECTION: Center — Photo gallery
   Header + arrow-scrollable row of 400x260 photo cards.
   Reuses the generic carousel (js/sections/home/carousel.js).
   ============================================ */

.center-gallery {
    padding: 64px var(--section-side-padding) 80px;
    background: var(--color-white);
    overflow: hidden;
}

/* ----- Header ----- */
.center-gallery__head {
    max-width: var(--container-max);
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.center-gallery__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--color-primary-light);   /* #ffebf0 */
    flex-shrink: 0;
}
.center-gallery__icon {
    width: 24px;
    height: 24px;
    background-color: #4f2a33;
    -webkit-mask: var(--i) no-repeat center / contain;
    mask: var(--i) no-repeat center / contain;
}

.center-gallery__titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.center-gallery__title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: var(--font-weight-medium);
    line-height: 36px;
    color: var(--color-text-heading);
    margin: 0;
}
.center-gallery__sub {
    max-width: 620px;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-text-body);
    margin: 0;
}

/* ----- Carousel ----- */
.center-gallery__carousel {
    position: relative;
}

.center-gallery__row {
    list-style: none;
    margin: 0;
    padding: 8px 4px;
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.center-gallery__row::-webkit-scrollbar {
    display: none;
}

/* Scroll-position bars — phones only (arrows take over above). Aligned to
   the container so they sit under the header, not the full-bleed track. */
.center-gallery__bars {
    display: none;
    gap: 7px;
    max-width: var(--container-max);
    margin: 24px auto 0;
}

.center-gallery__bar {
    flex: 1 1 0;
    height: 4px;
    border-radius: 100px;
    background: var(--color-primary-light);
    transition: background-color var(--transition-fast);
}

.center-gallery__bar.is-active {
    background: var(--color-primary);
}

.center-gallery__arrow {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-white);
    border: 2px solid var(--color-primary-light);
    box-shadow: var(--shadow-card);
    color: var(--color-primary);
    cursor: pointer;
    transition: background-color var(--transition-fast), opacity var(--transition-fast);
}
.center-gallery__arrow:hover {
    background: var(--color-primary-light);
}
.center-gallery__arrow--prev {
    left: 0;
}
.center-gallery__arrow--next {
    left: auto;
    right: 0;
    transform: translate(50%, -50%);
}
.center-gallery__arrow[hidden] {
    display: none;
}
.center-gallery__arrow:disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
}

/* ----- Photo card ----- */
.center-gallery__item {
    flex: 0 0 400px;
    max-width: 88vw;
    height: 260px;
    border-radius: 12px;
    overflow: hidden;
    background: #afafaf;
    scroll-snap-align: start;
}
.center-gallery__btn {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}
.center-gallery__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-base);
}
.center-gallery__btn:hover .center-gallery__img {
    transform: scale(1.04);
}

/* ----- Lightbox ----- */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.gallery-lightbox[hidden] {
    display: none;
}
.gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}
.gallery-lightbox__dialog {
    position: relative;
    z-index: 1;
    max-width: min(1000px, 100%);
}
.gallery-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 82vh;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.gallery-lightbox__close {
    position: absolute;
    top: -46px;
    right: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}
.gallery-lightbox__close:hover {
    opacity: 0.8;
}
.gallery-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: var(--color-white);
    border: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    color: var(--color-primary);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    transition: transform var(--transition-fast);
}
.gallery-lightbox__nav:hover {
    transform: translateY(-50%) scale(1.06);
}
.gallery-lightbox__nav--prev {
    left: 24px;
}
.gallery-lightbox__nav--next {
    right: 24px;
}

@media (max-width: 768px) {
    .center-gallery {
        padding: 48px var(--section-side-padding) 56px;
    }
    .center-gallery__arrow {
        display: none;
    }
}

/* ----- Phones: position bars stand in for the arrows ----- */
@media (max-width: 600px) {
    .center-gallery__bars {
        display: flex;
    }
}
