/* Property gallery lightbox. Scoped under .plb; no dependencies.
 * White, Rightmove-style chrome: header (Back / name / price / phone),
 * a centred image area, and a footer (image count + caption). */

.plb-enabled img {
    cursor: pointer;
}

.plb {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #fff;
    color: #333;
    overscroll-behavior: contain;
}

/* The column layout only applies while open — leave the UA stylesheet's
 * `dialog:not([open]) { display: none }` in force when closed. */
.plb[open] {
    display: flex;
    flex-direction: column;
}

.plb::backdrop {
    background: #fff;
}

/* --- Header --------------------------------------------------------------- */

.plb-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    border-bottom: 1px solid #e6e6e6;
}

.plb-back {
    flex: 0 0 auto;
    border: 0;
    padding: 6px 4px;
    background: none;
    color: #009ca6;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.plb-back:hover,
.plb-back:focus-visible {
    text-decoration: underline;
}

.plb-back-icon {
    font-size: 20px;
}

.plb-heading {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.plb-title {
    font-weight: 700;
    font-size: 18px;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plb-title .pipe--blue {
    color: #75CFD7;
}

.plb-price {
    font-size: 15px;
    color: #666;
}

/* Call-to-action styled after the site's pink primary button (.button--pink). */
.plb-call {
    flex: 0 0 auto;
    display: inline-block;
    padding: 9px 18px;
    background: #EF5884;
    color: #fff;
    text-decoration: none;
    text-align: left;
    line-height: 1.25;
    transition: background-color .2s ease-in-out;
}

.plb-call:hover,
.plb-call:focus-visible {
    background: #d8446f;
}

.plb-call-label {
    display: block;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.plb-phone {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

/* --- Image track ---------------------------------------------------------- */

.plb-track {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    cursor: grab;
}

/* The track is focused programmatically on open (so arrow keys work); its
 * default focus ring otherwise shows as heavy lines against the thin grey
 * header/footer borders. Navigation is discoverable via the visible arrows. */
.plb-track:focus,
.plb-track:focus-visible {
    outline: none;
}

/* Snap is disabled during a drag and kept off through the release settle
 * animation (.plb-animating); re-arming mandatory snap mid-animation would
 * jump instantly to the nearest slide instead of gliding. */
.plb-track.plb-dragging,
.plb-track.plb-animating {
    scroll-snap-type: none;
}

.plb-track.plb-dragging {
    cursor: grabbing;
    user-select: none;
}

.plb-track::-webkit-scrollbar {
    display: none;
}

.plb-slide {
    flex: 0 0 100%;
    height: 100%;
    margin: 0;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.plb-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: inherit;
}

/* Ignore pointer events on the image mid-drag so it doesn't hijack the
 * gesture or show a drag ghost. */
.plb-track.plb-dragging .plb-slide img {
    pointer-events: none;
}

/* --- Navigation arrows ---------------------------------------------------- */

.plb-prev,
.plb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 34px;
    /* The chevron glyphs sit slightly high in their em box; nudge down so they
     * sit optically centred in the circle. */
    line-height: 1;
    padding-bottom: 4px;
    cursor: pointer;
}

.plb-prev:hover,
.plb-prev:focus-visible,
.plb-next:hover,
.plb-next:focus-visible {
    background: #f2f2f2;
}

.plb-prev { left: 16px; }
.plb-next { right: 16px; }

/* --- Footer --------------------------------------------------------------- */

.plb-footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid #e6e6e6;
    text-align: center;
}

.plb-counter {
    font-weight: 700;
    color: #222;
    white-space: nowrap;
}

.plb-caption {
    color: #777;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* On coarse pointers the swipe gesture replaces the arrows. */
@media (pointer: coarse) {
    .plb-prev,
    .plb-next {
        display: none;
    }

    .plb-track {
        cursor: default;
    }
}

/* Narrow screens: tighten the header so Back + title + call box fit. */
@media (max-width: 600px) {
    .plb-header {
        gap: 12px;
        padding: 10px 14px;
    }

    .plb-back {
        font-size: 0;
    }

    .plb-back-icon {
        font-size: 22px;
    }

    .plb-call {
        padding: 6px 10px;
    }

    .plb-title { font-size: 14px; }
    .plb-phone { font-size: 14px; }
}
