/* Pointer Gallery 1.0.4 — desktop/tablet grid, mobile auto-height swipe carousel. */
.pg-gallery {
    --pg-gap: 8px;
    --pg-radius: 12px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.pg-gallery *, .pg-gallery *::before, .pg-gallery *::after { box-sizing: border-box; }

.pg-grid {
    display: grid;
    width: 100%;
    height: 480px;
    gap: var(--pg-gap);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    min-width: 0;
    min-height: 0;
}
.pg-layout-5 .pg-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.pg-layout-3 .pg-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.pg-tile {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--pg-radius);
    background: #e9e9e9;
}
.pg-tile-1 { grid-row: 1 / span 2; grid-column: 1; }
.pg-layout-5 .pg-tile-2 { grid-column: 2; grid-row: 1; }
.pg-layout-5 .pg-tile-3 { grid-column: 3; grid-row: 1; }
.pg-layout-5 .pg-tile-4 { grid-column: 2; grid-row: 2; }
.pg-layout-5 .pg-tile-5 { grid-column: 3; grid-row: 2; }
.pg-layout-3 .pg-tile-2 { grid-column: 2; grid-row: 1; }
.pg-layout-3 .pg-tile-3 { grid-column: 2; grid-row: 2; }
/* Graceful layouts when an editor has uploaded fewer than the selected amount. */
.pg-count-1 .pg-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.pg-count-1 .pg-tile-1 { grid-column: 1; grid-row: 1; }
.pg-count-2 .pg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
.pg-count-2 .pg-tile-1 { grid-column: 1; grid-row: 1; }
.pg-count-2 .pg-tile-2 { grid-column: 2; grid-row: 1; }
.pg-layout-5.pg-count-3 .pg-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.pg-layout-5.pg-count-3 .pg-tile-2 { grid-column: 2; grid-row: 1; }
.pg-layout-5.pg-count-3 .pg-tile-3 { grid-column: 2; grid-row: 2; }
.pg-layout-5.pg-count-4 .pg-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.pg-layout-5.pg-count-4 .pg-tile-4 { grid-column: 2 / span 2; grid-row: 2; }

/* The photo is a normal image layer, not a button. High specificity beats
   Elementor's generic .elementor img { height:auto; } rule. */
.pg-gallery .pg-tile > img.pg-tile-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center;
    margin: 0;
    padding: 0;
    border: 0;
    transition: transform 240ms ease;
    pointer-events: none;
}
.pg-gallery .pg-tile > a.pg-tile-hit-area {
    position: absolute;
    z-index: 1;
    display: block;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    border-radius: inherit;
    text-decoration: none;
    cursor: pointer !important;
}
.pg-gallery .pg-tile > a.pg-tile-hit-area:hover,
.pg-gallery .pg-tile > a.pg-tile-hit-area:focus { background: transparent; }
.pg-tile-hit-area:focus-visible, .pg-view-all:focus-visible {
    outline: 3px solid #6db8ff;
    outline-offset: -3px;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .pg-tile:has(> .pg-tile-hit-area:hover) > .pg-tile-image { transform: scale(1.025); }
}
.pg-view-all {
    position: absolute;
    z-index: 2;
    right: 14px;
    bottom: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: calc(100% - 16px);
    min-height: 42px;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background-color: #20262b;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease;
}
.pg-view-all--bottom-left { right: auto; left: 14px; }
.pg-view-all--center { right: auto; bottom: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.pg-view-all-text { min-width: 0; }
.pg-view-all-icon { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; }
.pg-view-all-icon svg, .pg-view-all-icon i { display: block; width: 1em; height: 1em; font-size: 1em; fill: currentColor; }
.pg-mobile { display: none; }
.pg-editor-empty {
    padding: 32px;
    border: 1px dashed #bbb;
    border-radius: 8px;
    color: #666;
    background: #fafafa;
    text-align: center;
}

/* Use Elementor's standard mobile breakpoint. The tablet layout remains the grid. */
@media (max-width: 767px) {
    .pg-grid { display: none !important; }
    .pg-mobile {
        position: relative;
        display: block;
        width: 100%;
        height: auto;
        max-height: 95vh;
        min-width: 0;
        aspect-ratio: 4 / 3; /* Fallback while the first photo loads. JS replaces height. */
        --pg-mobile-min-height: 300px;
        transition: height 300ms ease;
        overflow: hidden;
        border-radius: var(--pg-radius);
        /* Hide the outermost 1 CSS px on BOTH sides to mask a neighboring
           Swiper slide occasionally visible after subpixel compositing on
           physical phones. This clips only the paint, never Swiper's width,
           transform, finger tracking or dynamic height calculations. */
        clip-path: inset(0 1px 0 1px round var(--pg-radius));
        background: #e9e9e9;
        touch-action: pan-y pinch-zoom;
        outline-offset: 3px;
    }
    .pg-mobile:focus-visible { outline: 2px solid #6db8ff; }
    /* Swiper owns the track transform while the finger moves. Do not impose
       an independent CSS transition, which would make dragging feel delayed. */
    .pg-mobile-track.swiper-wrapper {
        display: flex;
        width: 100%;
        height: 100%;
        will-change: transform;
    }
    .pg-mobile-slide.swiper-slide {
        position: relative;
        /* Use Swiper's inline pixel width when initialized. A 100% flex-basis
           can disagree with Swiper's rounded slide widths by a fraction of a
           pixel and reveal a strip of the preceding slide. */
        flex: 0 0 auto;
        width: 100%;
        height: 100%;
        min-width: 0;
        overflow: hidden;
    }
    .pg-gallery .pg-mobile-slide > img.pg-mobile-image {
        display: block;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: center;
        pointer-events: none;
        user-select: none;
        -webkit-user-drag: none;
    }
    /* A subtle overlay keeps the progress indicator readable over light photos. */
    .pg-mobile-navigation {
        position: absolute;
        z-index: 2;
        display: flex;
        align-items: center;
        gap: 12px;
        right: 14px;
        bottom: 12px;
        left: 14px;
        min-height: 24px;
        color: #fff;
        pointer-events: none;
        text-shadow: 0 1px 5px rgba(0, 0, 0, .7);
    }
    .pg-mobile-navigation::before {
        content: '';
        position: absolute;
        z-index: -1;
        inset: -14px -14px -12px;
        background: linear-gradient(to top, rgba(0, 0, 0, .38), transparent);
    }
    .pg-mobile-progress {
        display: block;
        flex: 1;
        height: 2px;
        border-radius: 100px;
        background: rgba(255, 255, 255, .45);
        overflow: hidden;
    }
    .pg-mobile-progress-fill {
        display: block;
        height: 100%;
        width: 0;
        border-radius: inherit;
        background: #fff;
        transition: width 260ms ease;
    }
    .pg-mobile-counter {
        flex: 0 0 auto;
        font: 600 12px/1.2 Arial, sans-serif;
        font-variant-numeric: tabular-nums;
        letter-spacing: .02em;
        color: #fff;
        white-space: nowrap;
    }
}
.pg-screen-reader {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
    .pg-mobile, .pg-mobile-track, .pg-mobile-progress-fill, .pg-tile-image { transition: none !important; }
}
