/* Section: image-gallery — navy/blue design system
 * Three variants: masonry / swiper / before_after.
 * Real class hooks from template-parts/sections/image-gallery.php.
 * All brand colours/fonts/radii via tokens.css (var(--…)) only.
 */

.image-gallery { position: relative; overflow: hidden; padding: 80px 0 100px 0; background: var(--card); }
.image-gallery::after { content: ""; position: absolute; right: 0; bottom: 0; width: 380px; height: 380px; background: url("https://wordpress-899356-6390615.cloudwaysapps.com/wp-content/uploads/2026/07/watermerk-onder-gesneden-02.svg") no-repeat right bottom; background-size: contain; pointer-events: none; z-index: 0; }
.image-gallery > .container { position: relative; z-index: 1; }
.image-gallery-masonry { background: var(--surface); }
.image-gallery-header { max-width: 760px; margin-bottom: 36px; }
.image-gallery-header .eyebrow {
    display: inline-block;
    font-family: var(--font);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--blue);
}
.image-gallery-header h2 {
    font-family: var(--display);
    font-weight: 700;
    font-size: 32px;
    line-height: 1.18;
    color: var(--ink);
    margin: 0 0 12px;
}
.image-gallery-intro {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--muted);
}

/* ============================================================
 * Masonry variant (photo gallery with caption overlay)
 * ============================================================ */
.ig-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}
.ig-chip {
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--muted);
    padding: 7px 16px;
    border-radius: 999px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.ig-chip:hover { border-color: var(--blue); color: var(--ink); }
.ig-chip.is-active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

/* Gallery grid: 3 → 2 → 1 columns */
.ig-masonry {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.ig-tile {
    position: relative;
    margin: 0;
    overflow: hidden;
    border-radius: 5px;
    aspect-ratio: 16 / 10;
    background: #13315c;
    cursor: zoom-in;
    box-shadow: var(--sh-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
/* The PHP still emits ig-span-2 on some tiles; in the uniform photo grid we
   keep every tile the same size for a clean navy gallery look. */
.ig-tile.ig-span-2 { grid-row: auto; }
.ig-tile:hover { transform: translateY(-2px); box-shadow: var(--sh); }
.ig-tile:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.ig-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.ig-tile:hover img { transform: scale(1.06); }

.ig-tile-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 30px 16px 14px;
    background: linear-gradient(transparent, rgba(8, 18, 38, 0.9));
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ig-tile-cat {
    align-self: flex-start;
    background: var(--blue);
    color: #fff;
    font-family: var(--font);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 7px;
}
.ig-tile-title {
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}
.ig-tile-sub {
    font-family: var(--font);
    font-size: 0.86rem;
    font-weight: 600;
    color: #cdd7e6;
}
.ig-tile[hidden] { display: none; }

@media (max-width: 900px) {
    .ig-masonry { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .ig-masonry { grid-template-columns: 1fr; }
}

/* ============================================================
 * Swiper variant
 * ============================================================ */
.ig-swiper-wrap { position: relative; }
.ig-swiper {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 360px;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 8px;
    scroll-padding-left: 0;
}
.ig-swiper::-webkit-scrollbar { display: none; }
.ig-swiper:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; border-radius: 4px; }
.ig-card {
    margin: 0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ig-card-frame {
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    overflow: hidden;
    background: #13315c;
    box-shadow: var(--sh-sm);
}
.ig-card-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.ig-card:hover .ig-card-frame img { transform: scale(1.06); }
.ig-card-caption {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 4px;
}
.ig-card-title {
    font-family: var(--display);
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
}
.ig-card-sub {
    font-family: var(--font);
    font-size: 13px;
    color: var(--muted);
}

.ig-swiper-progress {
    margin-top: 14px;
    height: 4px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}
.ig-swiper-bar {
    display: block;
    height: 100%;
    width: 30%;
    background: var(--blue);
    border-radius: inherit;
    transform-origin: left;
    transition: width 0.18s ease;
}
.ig-swiper-arrow {
    position: absolute;
    top: calc(50% - 28px);
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--sh);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.ig-swiper-prev { left: -8px; }
.ig-swiper-next { right: -8px; }
.ig-swiper-wrap:hover .ig-swiper-arrow { opacity: 1; }
.ig-swiper-arrow:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.ig-swiper-arrow:focus-visible { opacity: 1; outline: 3px solid var(--blue); outline-offset: 2px; }


@media (max-width:768px){
    .image-gallery::after{
        width:250px;
        height:250px;
    }
	.image-gallery{
		padding: 50px 0 70px 0;
    }
}
@media (max-width: 720px) {
    .ig-swiper { grid-auto-columns: 78vw; gap: 14px; }
    .ig-swiper-arrow { display: none; }
}

/* ============================================================
 * Before/After variant
 * ============================================================ */
.ig-baw-list {
    display: flex;
    flex-direction: column;
    gap: 36px;
}
.ig-baw-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--r);
    overflow: hidden;
    background: #13315c;
    box-shadow: var(--sh);
    user-select: none;
    touch-action: pan-y;
}
.ig-baw-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.ig-baw-after-clip {
    position: absolute;
    inset: 0;
    width: 50%;
    overflow: hidden;
    will-change: width;
}
.ig-baw-after-clip img {
    width: calc(100% * (100 / var(--ig-baw-clip, 50)));
    max-width: none;
}
.ig-baw-label {
    position: absolute;
    top: 14px;
    padding: 5px 12px;
    background: rgba(8, 18, 38, 0.85);
    color: #fff;
    font-family: var(--font);
    font-weight: 700;
    font-size: 11.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    pointer-events: none;
    z-index: 2;
}
.ig-baw-label-before { left: 14px; }
.ig-baw-label-after  { right: 14px; background: var(--blue); }
.ig-baw-handle {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 44px;
    transform: translateX(-50%);
    background: transparent;
    border: 0;
    padding: 0;
    cursor: ew-resize;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ig-baw-handle-line {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    background: #fff;
    box-shadow: 0 0 0 1px rgba(8, 18, 38, 0.18);
}
.ig-baw-handle-knob {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    color: var(--blue);
    box-shadow: 0 4px 12px rgba(8, 18, 38, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ig-baw-handle:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.ig-baw-caption {
    margin-top: 12px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--muted);
    text-align: center;
}

/* ============================================================
 * Lightbox (mounted on body, single instance)
 * ============================================================ */
.ig-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 18, 38, 0.94);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 40px;
}
.ig-lightbox.is-open { display: flex; }
.ig-lightbox-figure {
    margin: 0;
    max-width: min(1200px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.ig-lightbox img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: var(--sh-lg);
}
.ig-lightbox-caption {
    color: #cdd7e6;
    text-align: center;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
}
.ig-lightbox-caption strong {
    color: #fff;
    font-weight: 700;
    display: block;
    font-family: var(--display);
    font-size: 16px;
    margin-bottom: 2px;
}
.ig-lightbox-close,
.ig-lightbox-nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    transition: background 0.18s ease;
}
.ig-lightbox-close:hover,
.ig-lightbox-nav:hover { background: var(--blue); border-color: var(--blue); }
.ig-lightbox-close { top: 24px; right: 24px; }
.ig-lightbox-prev  { left: 24px; }
.ig-lightbox-next  { right: 24px; }
.ig-lightbox-prev,
.ig-lightbox-next  { top: calc(50% - 22px); }

@media (prefers-reduced-motion: reduce) {
    .ig-tile,
    .ig-tile img,
    .ig-card-frame img,
    .ig-tile-caption,
    .ig-swiper-bar { transition: none; }
}
