/* =========================================================
   PROPERTY BROKERS INTERNATIONAL — GALLERY
   ========================================================= */

.pbi-home-gallery,
.pbi-gallery-page {
    --pbi-gallery-red: #d20a0a;
    --pbi-gallery-dark: #111827;
    --pbi-gallery-text: #4b5563;
    --pbi-gallery-light: #f7f7f5;
    --pbi-gallery-border: rgba(17, 24, 39, 0.1);

    position: relative;
    overflow: hidden;
}

.pbi-home-gallery *,
.pbi-gallery-page *,
.pbi-lightbox * {
    box-sizing: border-box;
}

/* =========================================================
   HOMEPAGE GALLERY PREVIEW
   ========================================================= */

.pbi-home-gallery {
    padding: 90px 0;
    background:
        radial-gradient(
            circle at top right,
            rgba(210, 10, 10, 0.07),
            transparent 35%
        ),
        #f7f7f5;
}

.pbi-home-gallery__heading {
    width: min(760px, 100%);
    margin: 0 auto 44px;
    text-align: center;
}

.pbi-home-gallery__eyebrow,
.pbi-gallery-page__eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--pbi-gallery-red);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.4;
    text-transform: uppercase;
}

.pbi-home-gallery__heading h2 {
    margin: 0 0 18px;
    color: var(--pbi-gallery-dark);
    font-size: clamp(34px, 4vw, 54px);
    font-weight: 700;
    line-height: 1.08;
}

.pbi-home-gallery__heading p {
    max-width: 680px;
    margin: 0 auto;
    color: var(--pbi-gallery-text);
    font-size: 17px;
    line-height: 1.8;
}

/* Preview grid */

.pbi-home-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 220px;
    gap: 16px;
}

.pbi-gallery-item {
    position: relative;
    display: block;
    min-height: 220px;
    overflow: hidden;
    border-radius: 16px;
    background: #e5e7eb;
    box-shadow: 0 14px 35px rgba(17, 24, 39, 0.08);
}

.pbi-gallery-item--large {
    grid-column: span 2;
    grid-row: span 2;
}

.pbi-gallery-item--wide {
    grid-column: span 2;
}

.pbi-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 0.6s ease,
        filter 0.6s ease;
}

.pbi-gallery-item::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    background: linear-gradient(
        180deg,
        transparent 35%,
        rgba(0, 0, 0, 0.78) 100%
    );
    transition: background 0.35s ease;
}

.pbi-gallery-item:hover img {
    transform: scale(1.06);
    filter: saturate(1.05);
}

.pbi-gallery-item:hover::after {
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.04) 15%,
        rgba(0, 0, 0, 0.85) 100%
    );
}

.pbi-gallery-item__overlay {
    position: absolute;
    right: 22px;
    bottom: 20px;
    left: 22px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    transform: translateY(4px);
    transition: transform 0.35s ease;
}

.pbi-gallery-item:hover .pbi-gallery-item__overlay {
    transform: translateY(0);
}

.pbi-gallery-item__overlay strong {
    margin-bottom: 3px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.pbi-gallery-item__overlay small {
    font-size: 13px;
    opacity: 0.82;
}

.pbi-home-gallery__action {
    margin-top: 42px;
    text-align: center;
}

.pbi-gallery-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 54px;
    padding: 14px 30px;
    border: 1px solid var(--pbi-gallery-red);
    border-radius: 6px;
    background: var(--pbi-gallery-red);
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.pbi-gallery-button:hover {
    background: #ffffff;
    color: var(--pbi-gallery-red) !important;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(210, 10, 10, 0.17);
}

/* =========================================================
   FULL GALLERY PAGE
   ========================================================= */

.pbi-gallery-page {
    padding: 90px 0 110px;
    background: #ffffff;
}

.pbi-gallery-page__intro {
    width: min(820px, 100%);
    margin: 0 auto 65px;
    text-align: center;
}

.pbi-gallery-page__intro h1 {
    margin: 0 0 18px;
    color: var(--pbi-gallery-dark);
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 700;
    line-height: 1.08;
}

.pbi-gallery-page__intro p {
    max-width: 700px;
    margin: 0 auto;
    color: var(--pbi-gallery-text);
    font-size: 17px;
    line-height: 1.8;
}

.pbi-gallery-album + .pbi-gallery-album {
    margin-top: 90px;
    padding-top: 75px;
    border-top: 1px solid var(--pbi-gallery-border);
}

.pbi-gallery-album__heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 35px;
    margin-bottom: 32px;
}

.pbi-gallery-album__heading span {
    display: block;
    margin-bottom: 7px;
    color: var(--pbi-gallery-red);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.7px;
    text-transform: uppercase;
}

.pbi-gallery-album__heading h2 {
    margin: 0;
    color: var(--pbi-gallery-dark);
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.2;
}

.pbi-gallery-album__heading p {
    max-width: 420px;
    margin: 0;
    color: var(--pbi-gallery-text);
    line-height: 1.7;
}

.pbi-gallery-page__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.pbi-gallery-page__item {
    position: relative;
    display: block;
    height: 250px;
    overflow: hidden;
    border-radius: 14px;
    background: #eeeeee;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.07);
}

.pbi-gallery-page__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.pbi-gallery-page__item:hover img {
    transform: scale(1.07);
}

.pbi-gallery-page__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.62);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pbi-gallery-page__overlay span {
    padding: 10px 17px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transform: translateY(8px);
    transition: transform 0.3s ease;
}

.pbi-gallery-page__item:hover .pbi-gallery-page__overlay {
    opacity: 1;
}

.pbi-gallery-page__item:hover .pbi-gallery-page__overlay span {
    transform: translateY(0);
}

/* =========================================================
   LIGHTBOX
   ========================================================= */

.pbi-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 60px 90px;
    background: rgba(0, 0, 0, 0.94);
}

.pbi-lightbox.is-open {
    display: flex;
}

.pbi-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 110px);
    border-radius: 5px;
    object-fit: contain;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

.pbi-lightbox__close,
.pbi-lightbox__previous,
.pbi-lightbox__next {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    transition:
        background 0.25s ease,
        transform 0.25s ease;
}

.pbi-lightbox__close:hover,
.pbi-lightbox__previous:hover,
.pbi-lightbox__next:hover {
    background: var(--pbi-gallery-red);
}

.pbi-lightbox__close {
    top: 22px;
    right: 25px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 32px;
    line-height: 1;
}

.pbi-lightbox__previous,
.pbi-lightbox__next {
    top: 50%;
    width: 52px;
    height: 70px;
    border-radius: 6px;
    font-size: 44px;
    transform: translateY(-50%);
}

.pbi-lightbox__previous {
    left: 22px;
}

.pbi-lightbox__next {
    right: 22px;
}

.pbi-lightbox__previous:hover,
.pbi-lightbox__next:hover {
    transform: translateY(-50%) scale(1.04);
}

body.pbi-lightbox-open {
    overflow: hidden;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 991px) {
    .pbi-home-gallery {
        padding: 70px 0;
    }

    .pbi-home-gallery__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 220px;
    }

    .pbi-gallery-item--large,
    .pbi-gallery-item--wide {
        grid-column: span 2;
    }

    .pbi-gallery-item--large {
        grid-row: span 2;
    }

    .pbi-gallery-page__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pbi-gallery-album__heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .pbi-lightbox {
        padding: 60px;
    }
}

@media (max-width: 575px) {
    .pbi-home-gallery,
    .pbi-gallery-page {
        padding: 58px 0;
    }

    .pbi-home-gallery__heading {
        margin-bottom: 30px;
    }

    .pbi-home-gallery__heading p,
    .pbi-gallery-page__intro p {
        font-size: 15px;
        line-height: 1.7;
    }

    .pbi-home-gallery__grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 12px;
    }

    .pbi-gallery-item,
    .pbi-gallery-item--large,
    .pbi-gallery-item--wide {
        grid-column: auto;
        grid-row: auto;
        height: 260px;
        min-height: 0;
        border-radius: 11px;
    }

    .pbi-gallery-page__intro {
        margin-bottom: 45px;
    }

    .pbi-gallery-page__grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .pbi-gallery-page__item {
        height: 270px;
        border-radius: 11px;
    }

    .pbi-gallery-album + .pbi-gallery-album {
        margin-top: 60px;
        padding-top: 55px;
    }

    .pbi-lightbox {
        padding: 65px 12px 35px;
    }

    .pbi-lightbox__previous,
    .pbi-lightbox__next {
        top: auto;
        bottom: 16px;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        font-size: 34px;
        transform: none;
    }

    .pbi-lightbox__previous {
        left: calc(50% - 58px);
    }

    .pbi-lightbox__next {
        right: calc(50% - 58px);
    }

    .pbi-lightbox__previous:hover,
    .pbi-lightbox__next:hover {
        transform: scale(1.04);
    }

    .pbi-lightbox__close {
        top: 14px;
        right: 14px;
    }
}