/* ==========================================================================
   Galeria zdjęć w artykułach bloga.

   Przeniesiona ze starego motywu bez zmian w działaniu: ta sama siatka,
   ikona lupy i lightbox z nawigacją (skrypt js/gallery.js). Nazwy klas
   gallery-* i lightbox-* są własne, więc nie zderzają się z Tailwindem.

   Plik jest statyczny — NIE przechodzi przez build Tailwinda.
   ========================================================================== */

/* ═══════════════════════════════════════════════════════
   GALERIA ZDJĘĆ — nowoczesny styl
   ═══════════════════════════════════════════════════════ */

/* ── Nagłówek sekcji ────────────────────────────────── */
.page-gallery {
    margin: 2.5rem 0;
    padding: 2rem;
    border: 1px solid #DDE4EC;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(13, 35, 58, 0.07);
}

.page-gallery > h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0D233A;
    margin: 0 0 1.5rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.page-gallery > h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 1.2em;
    background: #C82333;
    border-radius: 2px;
    flex-shrink: 0;
}

.gallery-badge {
    background: #F2F5F8;
    color: #2F4C6F;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    text-transform: none;
}

/* ── Siatka ─────────────────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 0;
}

/* ── Kafelek ─────────────────────────────────────────── */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #DDE4EC;
    aspect-ratio: 4 / 3;
    cursor: zoom-in;
}


.gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Overlay z ikoną lupy ───────────────────────────── */
.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(15, 17, 23, 0) 40%,
        rgba(15, 17, 23, 0.55) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item .zoom-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.gallery-item .zoom-icon svg {
    width: 36px;
    height: 36px;
    color: #fff;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

/* Hover */
.gallery-item:hover img {
    transform: scale(1.06);
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-item:hover .zoom-icon {
    opacity: 1;
}

/* ── Ripple ─────────────────────────────────────────── */
@keyframes wave-animation {
    0%   { transform: scale(0); opacity: 0.55; }
    70%  { opacity: 0.2; }
    100% { transform: scale(2.8); opacity: 0; }
}

.wave-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    transform: scale(0);
    animation: wave-animation 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 3;
}

/* ════════════════════════════════════════════════════════
   LIGHTBOX
   ════════════════════════════════════════════════════════ */

.custom-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 9, 14, 0.97);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.custom-lightbox-overlay img {
    max-width: 90vw;
    max-height: 82vh;
    display: block;
    border-radius: 3px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transform: scale(0.93) translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    object-fit: contain;
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Caption */
.lightbox-caption {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.04em;
    text-align: center;
    max-width: 600px;
    min-height: 1em;
}

/* ── Nawigacja ──────────────────────────────────────── */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    z-index: 10002;
    padding: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-nav svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.08);
}

/* ── Przycisk zamknięcia ────────────────────────────── */
.lightbox-close {
    position: fixed;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    z-index: 10002;
    padding: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lightbox-close svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    flex-shrink: 0;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* ── Licznik ────────────────────────────────────────── */
.lightbox-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ── Outline na przyciskach ─────────────────────────── */
.lightbox-nav:focus-visible,
.lightbox-close:focus-visible {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: 3px;
}

/* ════════════════════════════════════════════════════════
   RESPONSYWNOŚĆ
   ════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
    .lightbox-nav {
        width: 44px;
        height: 44px;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3px;
    }
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    .lightbox-counter {
        font-size: 0.72rem;
        padding: 5px 12px;
    }
}

/* Portrety i krajobrazy w lightbox */
.custom-lightbox-overlay img.portrait {
    max-height: 85vh;
    max-width: min(60vw, 600px);
}
