/* Smart Gallery — Toro Steel Design Language */
*, *::before, *::after { box-sizing: border-box; }

.sg-gallery {
    --gold:       #F5C800;
    --navy:       #0A0E19;
    --navy-2:     #101627;
    --steel:      #7C8798;
    --steel-line: #232B3D;
    --paper:      #F3F1EA;
    --ink:        #10141F;
    --gap:        0px;
    --radius:     2px;
    --row-h:      260px; /* fallback only — shortcode.php sets the real
                             value inline from the `row_height` attribute */
    margin: 0;
}

/* ── HERO ──────────────────────────────────── */
.sg-hero {
    position: relative;
    background: var(--navy);
    color: #fff;
    overflow: hidden;
    padding: 64px 0 48px;
    text-align: center;
}
.sg-hero::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(124,135,152,.10) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124,135,152,.10) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at 50% 0%, rgba(0,0,0,.9), transparent 75%);
    pointer-events: none;
}
.sg-hero__bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    filter: brightness(.35) saturate(.8);
}
.sg-hero__content {
    position: relative; z-index: 1;
    padding: 0 24px;
    max-width: 760px; margin: 0 auto;
}
.sg-hero__title {
    color: #fff;
    margin: 0 0 28px;
}

/* Search bar */
.sg-hero__searchbar {
    display: flex;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 6px;
    overflow: hidden;
    margin: 0 auto 20px;
    max-width: 500px;
    backdrop-filter: blur(6px);
    transition: border-color .15s;
}
.sg-hero__searchbar:focus-within { border-color: var(--gold); }
.sg-hero__searchbar svg {
    width: 16px; height: 16px;
    margin: auto 0 auto 14px;
    color: var(--steel); flex-shrink: 0;
}
.sg-search-input {
    flex: 1; border: none; outline: none;
    padding: 13px 16px;
    color: #fff; background: transparent;
}
.sg-search-input::placeholder { color: var(--steel); }

/* Filter pills */
.sg-hero__pills {
    display: flex; flex-wrap: wrap;
    justify-content: center; gap: 6px;
}
.sg-pill-btn {
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.7);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 2px;
    padding: 5px 13px;
    font-weight: 600; cursor: pointer;
    transition: all .12s;
}
.sg-pill-btn:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
    border-color: rgba(255,255,255,.3);
}
.sg-pill-btn--active {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
    font-weight: 800;
}
.sg-pill-count {
    background: rgba(0,0,0,.15);
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 4px;
}
.sg-clear-tags {
    background: rgba(231,76,60,.2);
    color: #ff6b6b;
    border: 1px solid rgba(231,76,60,.4);
    border-radius: 2px;
    padding: 5px 13px;
    font-weight: 700; cursor: pointer;
    transition: all .12s;
}
.sg-clear-tags:hover { background: rgba(231,76,60,.35); }

/* ── GRID WRAP ─────────────────────────────── */
.sg-pub-wrap { width: 100%; padding-bottom: 0; }

/* CSS Grid — 4 cols, base row = --row-h, tall images span 2 rows.
   dense packing fills gaps so no holes appear. */
.sg-masonry {
    display: grid;
    /* Dynamic cols: fit as many as possible at --min-w each, never less than 1 */
    grid-template-columns: repeat(auto-fill, minmax(var(--min-w, 260px), 1fr));
    grid-auto-rows: var(--row-h, 260px);
    grid-auto-flow: dense;
    gap: var(--gap, 4px);
    width: 100%;
}

.sg-pub-item {
    display: block;
    overflow: hidden;
    position: relative;
    background: var(--navy-2);
}
/* Portrait images span 2 rows */
.sg-pub-item.sg-tall  { grid-row:    span 2; }
/* Landscape images span 2 columns */
.sg-pub-item.sg-wide  { grid-column: span 2; }
.sg-pub-item.sg-hidden { display: none; }

/* ── INDIVIDUAL IMAGE WRAPPER ───────────────── */
.sg-pub-item__btn {
    all: unset;
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.sg-pub-item__btn img {
    display: block;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .5s ease, filter .3s ease;
    filter: saturate(.85) brightness(.9);
}
.sg-pub-item__btn:hover img {
    transform: scale(1.06);
    filter: saturate(1) brightness(.6);
}
.sg-pub-item__btn:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* Caption — always visible now (title/location + the gradient behind
   them for legibility). The separate darken-on-hover effect lives on
   the img itself below (:hover filter: brightness), so it keeps working
   independently of the caption's own visibility. */
.sg-pub-item__overlay {
    position: absolute; inset: 0;
    background: none;
    display: flex; flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 10px;
    gap: 5px;
    pointer-events: none;
}

/* Title pill — white bg, black text */
.sg-pub-item__title {
    display: inline-block;
    background: #fff;
    color: #111 !important;
    margin: 0;
    padding: 3px 9px !important;
    border-radius: 4px;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Location pill — black bg, white text */
.sg-pub-item__loc {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #111;
    color: #fff !important;
    margin: 0;
    padding: 3px 9px !important;
    border-radius: 4px;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sg-pub-item__loc svg { width: 10px; height: 10px; flex-shrink: 0; fill: #fff; }

.sg-no-results {
    text-align: center; padding: 60px;
    color: var(--steel);
    background: var(--navy-2); width: 100%;
}

/* ── LIGHTBOX ──────────────────────────────── */
.sg-lightbox {
    --sg-lb-arrow: 44px;
    --sg-lb-gap:   16px;
    --sg-lb-pad:   16px;
    --sg-lb-close: #0a0e19;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(10,12,18,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(32px + env(safe-area-inset-top,0px)) 24px calc(32px + env(safe-area-inset-bottom,0px));
    box-sizing: border-box;
    opacity: 0;
    transition: opacity .2s ease;
    touch-action: pan-y pinch-zoom;
    -webkit-tap-highlight-color: transparent;
}
.sg-lightbox.is-open  { opacity: 1; }
.sg-lightbox[hidden]  { display: none; }

.sg-lightbox-dialog {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    padding: 0 calc(var(--sg-lb-arrow) + var(--sg-lb-gap));
    box-sizing: border-box;
    transform: scale(.96);
    transition: transform .2s ease;
}
.sg-lightbox.is-open .sg-lightbox-dialog { transform: scale(1); }
.sg-lightbox.is-single .sg-lightbox-dialog { padding: 0; }

/* White card — shrinks to the photo */
.sg-lightbox-figure {
    position: relative;
    margin: 0;
    padding: var(--sg-lb-pad);
    line-height: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0,0,0,.35);
}

.sg-lightbox-img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: min(1100px, calc(100vw - 48px - 2 * var(--sg-lb-pad) - 2 * (var(--sg-lb-arrow) + var(--sg-lb-gap)))) !important;
    max-height: calc(100vh - 64px - 2 * var(--sg-lb-pad) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)) !important;
    max-height: calc(100dvh - 64px - 2 * var(--sg-lb-pad) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)) !important;
    min-width: 240px;
    min-height: 160px;
    object-fit: contain !important;
    border-radius: 8px;
    margin: 0 !important;
    user-select: none;
    -webkit-user-drag: none;
}
.sg-lightbox.is-single .sg-lightbox-img {
    max-width: min(1100px, calc(100vw - 48px - 2 * var(--sg-lb-pad))) !important;
}

/* Tag — top-right of photo inside white card */
.sg-lightbox-tag {
    position: absolute;
    top: calc(var(--sg-lb-pad) + 12px);
    right: calc(var(--sg-lb-pad) + 12px);
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 5px 10px;
    border-radius: 4px;
    pointer-events: none;
    line-height: 1.2;
}
.sg-lightbox-tag:empty { display: none; }

/* Counter — bottom center of photo */
.sg-lightbox-counter {
    position: absolute;
    bottom: calc(var(--sg-lb-pad) + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 12px;
    letter-spacing: .04em;
    padding: 4px 10px;
    border-radius: 20px;
    pointer-events: none;
    line-height: 1.2;
}

/* Nav buttons */
.sg-lightbox-btn {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    z-index: 2;
    width: var(--sg-lb-arrow) !important;
    height: var(--sg-lb-arrow) !important;
    min-width: 0 !important; min-height: 0 !important;
    margin: 0 !important; padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.92) !important;
    color: #0a0e19 !important;
    box-shadow: 0 4px 14px rgba(0,0,0,.3) !important;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .2s, transform .2s;
    font-size: 0; line-height: 0;
}
.sg-lightbox-btn:hover,
.sg-lightbox-btn:focus-visible {
    background: #F5C800 !important;
    color: #0a0e19 !important;
    outline: none;
}
.sg-lightbox-btn svg {
    width: 20px; height: 20px;
    fill: none; stroke: currentColor;
    stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
    display: block;
}

/* Arrows outside the card, vertically centred */
.sg-lightbox-prev { left: 0;  top: 50%; transform: translateY(-50%); }
.sg-lightbox-next { right: 0; top: 50%; transform: translateY(-50%); }

/* Close button — on the card's top-right corner */
.sg-lightbox-close {
    top: -14px !important; right: -14px !important;
    width: 34px !important; height: 34px !important;
    background: var(--sg-lb-close) !important;
    color: #fff !important;
    border: 2px solid #fff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.3) !important;
}
.sg-lightbox-close svg { width: 16px; height: 16px; stroke-width: 2.6; }
.sg-lightbox-close:hover,
.sg-lightbox-close:focus-visible {
    background: #F5C800 !important;
    color: #0a0e19 !important;
}

.sg-lightbox.is-single .sg-lightbox-prev,
.sg-lightbox.is-single .sg-lightbox-next,
.sg-lightbox.is-single .sg-lightbox-counter { display: none; }

html.sg-lightbox-lock,
html.sg-lightbox-lock body { overflow: hidden !important; }

@media (max-width: 600px) {
    .sg-lightbox {
        --sg-lb-arrow: 38px;
        --sg-lb-gap: 8px;
        --sg-lb-pad: 10px;
        padding-left: 10px; padding-right: 10px;
    }
    .sg-lightbox-dialog { padding: 0 calc(var(--sg-lb-arrow) + var(--sg-lb-gap)); }
    .sg-lightbox-img {
        max-width: calc(100vw - 20px - 2 * var(--sg-lb-pad) - 2 * (var(--sg-lb-arrow) + var(--sg-lb-gap))) !important;
        max-height: 80dvh !important;
        min-width: 160px; min-height: 100px;
    }
}
@media (max-width: 600px) {
    .sg-masonry {
        grid-template-columns: repeat(2, 1fr) !important;
		grid-auto-rows: 150px !important;
    }
}
/* ── QUICK FILTERS ─────────────────────────── */
.sg-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 0;
}
.sg-qf-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    font-weight: 600;
    transition: all .15s;
}
.sg-qf-btn:hover {
    background: #e0e0e0;
}
.sg-qf-btn--active {
    background: #111;
    color: #fff;
}
.sg-qf-btn--active:hover {
    background: #333;
}
.sg-qf-count {
    background: var(--gold);
    color: #111;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
}

/* ── PHONES: "SEE MORE" (v3.18.0) ──────────────
   gallery.js marks the images past `mobile_limit` with .sg-trunc and adds
   .sg-is-collapsed to the gallery. Only phones (max-width 767px) hide them;
   the first ones (.sg-trunc-keep) drop their wide/tall spans so the
   collapsed view is a clean 2 x 2 block. Desktop and tablet are unchanged. */
.sg-more-wrap[hidden] { display: none !important; }
.sg-more-wrap {
    margin: 16px 0 0;
    text-align: center;
}
.sg-more-btn {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    margin: 0;
    padding: 13px 24px;
    background: var(--gold, #F5C800);
    color: var(--navy, #0A0E19);
    border: 2px solid var(--gold, #F5C800);
    border-radius: 3px;
    box-shadow: rgba(10,10,10,.1) 2px 4px 2px 0;
    font-family: Inter, sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: normal;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.sg-more-btn:hover {
    background: #FFD633;
    border-color: #FFD633;
    color: var(--navy, #0A0E19);
}
.sg-more-btn:focus-visible {
    outline: 2px solid var(--navy, #0A0E19);
    outline-offset: 2px;
}
@media (max-width: 767px) {
    .sg-gallery.sg-is-collapsed .sg-pub-item.sg-trunc { display: none !important; }
    .sg-gallery.sg-is-collapsed .sg-pub-item.sg-trunc-keep {
        grid-row: auto;
        grid-column: auto;
    }
}
@media (min-width: 768px) {
    .sg-more-wrap { display: none !important; }
}
