/* =========================================
   GALERIA ZDJĘĆ - DARK PREMIUM (Bezkonfliktowe Klasy MS)
   ========================================= */

.ms-foto-wrapper {
    background-color: var(--bg-color, #0d0e12);
    padding: 60px 0;
    width: 100%;
}

.ms-foto-container {
    max-width: var(--container, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Sekcja Nagłówka --- */
.ms-foto-header {
    text-align: left;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color, #1f222e);
    padding-bottom: 20px;
}

.ms-foto-eyebrow {
    color: var(--accent-color, #d4af37);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 10px 0;
}

.ms-foto-title {
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 15px 0;
    letter-spacing: 0.5px;
}

.ms-foto-desc {
    color: #a0a0a0;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 700px;
    margin: 0;
}

/* --- Siatka Zdjęć --- */
.ms-foto-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Pojedynczy box z foto */
.ms-foto-item {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2; /* Dokładnie ten wymiar co w bazams.md: 1000x668 */
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background-color: #161920;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.ms-foto-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.4s ease;
    z-index: 1;
}

/* Subtelny szklany overlay po najechaniu */
.ms-foto-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Ciemne tło, bez żółtej poświaty */
    z-index: 2;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.ms-foto-zoom-icon {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(13, 14, 18, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(212, 175, 55, 0.5);
    position: relative;
    transform: scale(0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ms-foto-zoom-icon::before, .ms-foto-zoom-icon::after {
    content: '';
    position: absolute;
    background: #d4af37;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.ms-foto-zoom-icon::before { width: 14px; height: 2px; }
.ms-foto-zoom-icon::after { width: 2px; height: 14px; }

/* --- Efekty Hover na Siatce --- */
.ms-foto-grid:hover .ms-foto-item {
    filter: brightness(0.6) grayscale(20%);
}

.ms-foto-grid .ms-foto-item:hover {
    filter: none;
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.6);
    z-index: 5;
}

.ms-foto-item:hover img {
    transform: scale(1.08);
}

.ms-foto-item:hover .ms-foto-overlay {
    opacity: 1;
}

.ms-foto-item:hover .ms-foto-zoom-icon {
    transform: scale(1);
}

/* =========================================
   LIGHTBOX FOTO (Niezależny od Wideo)
   ========================================= */

.ms-foto-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.ms-foto-lightbox.is-active {
    opacity: 1;
    pointer-events: auto;
}

.ms-foto-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 15, 0.98); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.ms-foto-lightbox-content {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ms-foto-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

/* Nawigacja w Lightboxie */
.ms-foto-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 50px;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
}

.ms-foto-lightbox-close:hover {
    color: var(--accent-color, #d4af37);
}

.ms-foto-lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ms-foto-lightbox-btn:hover {
    background: var(--accent-color, #d4af37);
    border-color: var(--accent-color, #d4af37);
    color: #000;
}

.ms-foto-lightbox-prev { left: 30px; }
.ms-foto-lightbox-next { right: 30px; }

/* Responsywność */
@media (max-width: 980px) {
    .ms-foto-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .ms-foto-grid {
        grid-template-columns: 1fr;
    }
    .ms-foto-header {
        text-align: center;
    }
    .ms-foto-title {
        font-size: 1.5rem;
    }
    .ms-foto-lightbox-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .ms-foto-lightbox-prev { left: 10px; }
    .ms-foto-lightbox-next { right: 10px; }
    .ms-foto-lightbox-close { top: 10px; right: 10px; font-size: 40px; }
}
