/* ═══════════════════════════════════════════════════════════
   Suski Galeria Masonry v2
   ═══════════════════════════════════════════════════════════ */

/* ── Filtry ──────────────────────────────────────────────── */
.sg-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.sg-filter {
    background: #3a3a3a;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 22px 20px;
    cursor: pointer;
    transition: background 0.22s;
    border-radius: 999px;
    outline: none;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    width: 100%;
}

.sg-filter:hover {
    background: #222;
}

.sg-filter.active {
    background: #111;
}

/* Telefon: jedna kolumna, pełna szerokość */
@media (max-width: 560px) {
    .sg-filters {
        grid-template-columns: 1fr;
    }
}

/* ── Masonry grid (CSS columns) ──────────────────────────── */
.sg-masonry {
    columns: 3;
    column-gap: 12px;
}

/* ── Kafelek ─────────────────────────────────────────────── */
.sg-brick {
    break-inside: avoid;
    margin-bottom: 12px;
    /* filtrowanie */
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.sg-brick.sg-hiding {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.sg-brick.sg-hidden {
    display: none;
}

/* ── Kafelek — wspólne ───────────────────────────────────── */
.sg-item {
    position: relative;
    display: block;
    overflow: hidden;
    background: #111;
    text-decoration: none;
    cursor: pointer;
    line-height: 0;
}

.sg-item img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

/* ── Overlay ─────────────────────────────────────────────── */
.sg-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.38);
    opacity: 0;
    transition: opacity 0.4s ease;
    line-height: 1;
}

.sg-zoom {
    font-size: 2.4rem;
    color: #fff;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0,0,0,.7);
}

.sg-play-icon span {
    font-size: 3rem;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0,0,0,.8);
}

.sg-item:hover img {
    opacity: 0.18;
    transform: scale(1.04);
}

.sg-item:hover .sg-overlay {
    opacity: 1;
}

/* ── Video placeholder (Vimeo bez thumb) ─────────────────── */
.sg-video-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: #111;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
}

.sg-video-placeholder span { font-size: 2.5rem; }
.sg-video-placeholder small { font-size: 0.75rem; font-family: inherit; letter-spacing: 0.1em; opacity: .6; }

/* ── Responsywność gridu ─────────────────────────────────── */
@media (max-width: 900px) {
    .sg-masonry { columns: 2 !important; }
}

@media (max-width: 560px) {
    .sg-masonry { columns: 1 !important; }
    .sg-filter { font-size: 0.75rem; padding: 10px 18px; }
}

/* ══════════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════════ */
.sg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sg-lightbox.sg-lb-open {
    opacity: 1;
    pointer-events: all;
}

.sg-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.92);
    cursor: pointer;
}

/* Zawartość */
.sg-lb-content {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 86vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sg-lb-content img {
    max-width: 90vw;
    max-height: 84vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    filter: none;
    box-shadow: 0 8px 60px rgba(0,0,0,.8);
}

.sg-lb-content iframe {
    width: min(880px, 90vw);
    height: min(495px, 50vw);
    border: none;
    display: block;
    box-shadow: 0 8px 60px rgba(0,0,0,.8);
}

/* Spinner */
.sg-lb-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sg-spin .7s linear infinite;
}

@keyframes sg-spin {
    to { transform: rotate(360deg); }
}

/* Przyciski */
.sg-lb-close,
.sg-lb-prev,
.sg-lb-next {
    position: absolute;
    z-index: 3;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    opacity: .75;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

.sg-lb-close:hover,
.sg-lb-prev:hover,
.sg-lb-next:hover { opacity: 1; }

.sg-lb-close {
    top: 18px;
    right: 22px;
    font-size: 2.4rem;
}

.sg-lb-prev,
.sg-lb-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 3.5rem;
    font-weight: 200;
}

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

/* Podpis */
.sg-lb-caption {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    color: rgba(255,255,255,.65);
    font-family: inherit;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Ukryj strzałki gdy tylko 1 element */
.sg-lightbox.sg-lb-single .sg-lb-prev,
.sg-lightbox.sg-lb-single .sg-lb-next { display: none; }

@media (max-width: 600px) {
    .sg-lb-prev { left: 4px; }
    .sg-lb-next { right: 4px; }
    .sg-lb-prev, .sg-lb-next { font-size: 2.5rem; }
}
