/* ================================================
   MARTA GALLERY - Elegancka galeria zdjęć
   Kolor główny: #C67B8B
   Wersja: 1.0.2 - Optymalizacja dla zdjęć pionowych
   ================================================ */

/* Reset i podstawy */
.marta-gallery-section *,
.marta-gallery-lightbox * {
    box-sizing: border-box;
}

/* ================================================
   SEKCJA GALERII
   ================================================ */
.marta-gallery-section {
    background: #ffffff;
    padding: 60px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marta-gallery-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ================================================
   GŁÓWNE ZDJĘCIE
   ================================================ */
.marta-gallery-main {
    position: relative;
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.marta-gallery-image-wrapper {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
}

/* Slajdy */
.marta-gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s ease;
    transform: scale(1.02);
}

.marta-gallery-slide.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 1;
}

.marta-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.2),
        0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Podpis zdjęcia */
.marta-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    color: #fff;
    font-size: 15px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.marta-gallery-main:hover .marta-gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================
   NAWIGACJA - STRZAŁKI
   ================================================ */
.marta-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #C67B8B;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(198, 123, 139, 0.4);
}

.marta-gallery-nav:hover {
    background: #b56a7a;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 25px rgba(198, 123, 139, 0.5);
}

.marta-gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.marta-gallery-nav svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.marta-gallery-prev {
    left: 20px;
}

.marta-gallery-next {
    right: 20px;
}

/* ================================================
   LICZNIK
   ================================================ */
.marta-gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    z-index: 10;
}

.marta-gallery-counter .current {
    color: #C67B8B;
    font-weight: 700;
}

/* ================================================
   PRZYCISK FULLSCREEN
   ================================================ */
.marta-gallery-fullscreen {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.marta-gallery-fullscreen:hover {
    background: #C67B8B;
    transform: scale(1.1);
}

.marta-gallery-fullscreen svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

/* ================================================
   MINIATURKI
   ================================================ */
.marta-gallery-thumbs-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 10px;
}

.marta-gallery-thumbs {
    flex: 1;
    overflow: hidden;
    border-radius: 12px;
}

.marta-gallery-thumbs-track {
    display: flex;
    gap: 10px;
    transition: transform 0.4s ease;
    padding: 5px 0;
}

.marta-gallery-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f5f5f5;
    padding: 0;
}

.marta-gallery-thumb:hover {
    border-color: rgba(198, 123, 139, 0.5);
    transform: translateY(-3px);
}

.marta-gallery-thumb.active {
    border-color: #C67B8B;
    box-shadow: 0 4px 15px rgba(198, 123, 139, 0.4);
}

.marta-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.marta-gallery-thumb:hover img,
.marta-gallery-thumb.active img {
    opacity: 1;
}

/* Nawigacja miniaturek */
.marta-gallery-thumbs-nav {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #C67B8B;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.marta-gallery-thumbs-nav:hover {
    background: #C67B8B;
}

.marta-gallery-thumbs-nav svg {
    width: 18px;
    height: 18px;
    color: #C67B8B;
    transition: color 0.3s ease;
}

.marta-gallery-thumbs-nav:hover svg {
    color: #fff;
}

.marta-gallery-thumbs-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ================================================
   LIGHTBOX
   ================================================ */
.marta-gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.marta-gallery-lightbox.active {
    opacity: 1;
    visibility: visible;
}

/* Przycisk zamknięcia */
.marta-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.marta-lightbox-close:hover {
    background: #C67B8B;
    transform: rotate(90deg);
}

.marta-lightbox-close svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

/* Nawigacja lightbox */
.marta-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.marta-lightbox-nav:hover {
    background: #C67B8B;
}

.marta-lightbox-nav svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.marta-lightbox-prev {
    left: 30px;
}

.marta-lightbox-next {
    right: 30px;
}

/* Zawartość lightbox */
.marta-lightbox-content {
    max-width: 90%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.marta-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s ease;
}

.marta-gallery-lightbox.active .marta-lightbox-image {
    opacity: 1;
    transform: scale(1);
}

.marta-lightbox-caption {
    margin-top: 20px;
    color: #fff;
    font-size: 16px;
    text-align: center;
    max-width: 600px;
    opacity: 0.8;
}

/* Licznik lightbox */
.marta-lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 2px;
}

.marta-lightbox-counter .current {
    color: #C67B8B;
    font-weight: 700;
}

/* ================================================
   PUSTA GALERIA
   ================================================ */
.marta-gallery-empty {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f5e1e4 0%, #e8c4ca 100%);
    border-radius: 16px;
    color: #666;
    font-size: 16px;
}

/* ================================================
   ANIMACJE
   ================================================ */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.marta-gallery-slide.slide-in-right {
    animation: slideInRight 0.4s ease forwards;
}

.marta-gallery-slide.slide-in-left {
    animation: slideInLeft 0.4s ease forwards;
}

/* ================================================
   RESPONSYWNOŚĆ
   ================================================ */
@media (max-width: 1024px) {
    .marta-gallery-section {
        padding: 40px 15px;
    }
    
    .marta-gallery-image-wrapper {
        max-width: 500px;
    }
    
    .marta-gallery-nav {
        width: 48px;
        height: 48px;
    }
    
    .marta-gallery-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .marta-gallery-prev {
        left: 15px;
    }
    
    .marta-gallery-next {
        right: 15px;
    }
    
    .marta-gallery-thumb {
        width: 55px;
        height: 73px;
    }
}

@media (max-width: 768px) {
    .marta-gallery-section {
        padding: 30px 10px;
        min-height: auto;
    }
    
    .marta-gallery-main {
        border-radius: 12px;
        margin-bottom: 15px;
    }
    
    .marta-gallery-image-wrapper {
        aspect-ratio: 3 / 4;
        max-width: 400px;
    }
    
    .marta-gallery-slide img {
        border-radius: 12px;
    }
    
    .marta-gallery-nav {
        width: 44px;
        height: 44px;
    }
    
    .marta-gallery-prev {
        left: 10px;
    }
    
    .marta-gallery-next {
        right: 10px;
    }
    
    .marta-gallery-counter {
        bottom: 15px;
        left: 15px;
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .marta-gallery-fullscreen {
        width: 42px;
        height: 42px;
        bottom: 15px;
        right: 15px;
    }
    
    .marta-gallery-thumbs-wrapper {
        gap: 10px;
        padding: 0 5px;
    }
    
    .marta-gallery-thumbs-nav {
        width: 36px;
        height: 36px;
    }
    
    .marta-gallery-thumbs-nav svg {
        width: 16px;
        height: 16px;
    }
    
    .marta-gallery-thumb {
        width: 50px;
        height: 67px;
        border-width: 2px;
    }
    
    /* Lightbox mobile */
    .marta-lightbox-nav {
        width: 50px;
        height: 50px;
    }
    
    .marta-lightbox-prev {
        left: 15px;
    }
    
    .marta-lightbox-next {
        right: 15px;
    }
    
    .marta-lightbox-close {
        top: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .marta-gallery-image-wrapper {
        max-width: 100%;
    }
    
    .marta-gallery-nav {
        width: 40px;
        height: 40px;
    }
    
    .marta-gallery-nav svg {
        width: 18px;
        height: 18px;
    }
    
    .marta-gallery-prev {
        left: 8px;
    }
    
    .marta-gallery-next {
        right: 8px;
    }
    
    .marta-gallery-thumb {
        width: 45px;
        height: 60px;
    }
    
    .marta-gallery-thumbs-track {
        gap: 8px;
    }
    
    /* Ukryj nawigację miniaturek na bardzo małych ekranach */
    .marta-gallery-thumbs-nav {
        display: none;
    }
    
    .marta-gallery-thumbs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .marta-gallery-thumbs::-webkit-scrollbar {
        display: none;
    }
    
    /* Lightbox mobile */
    .marta-lightbox-nav {
        width: 44px;
        height: 44px;
    }
    
    .marta-lightbox-prev {
        left: 10px;
    }
    
    .marta-lightbox-next {
        right: 10px;
    }
    
    .marta-lightbox-counter {
        bottom: 20px;
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ================================================
   TOUCH DEVICE OPTIMIZATIONS
   ================================================ */
@media (hover: none) and (pointer: coarse) {
    .marta-gallery-caption {
        opacity: 1;
        transform: translateY(0);
    }
    
    .marta-gallery-nav:hover {
        transform: translateY(-50%);
    }
    
    .marta-gallery-thumb:hover {
        transform: none;
    }
}

/* ================================================
   PREFERS REDUCED MOTION
   ================================================ */
@media (prefers-reduced-motion: reduce) {
    .marta-gallery-slide,
    .marta-gallery-thumbs-track,
    .marta-gallery-nav,
    .marta-gallery-thumb,
    .marta-lightbox-image,
    .marta-gallery-lightbox {
        transition: none;
    }
    
    .marta-gallery-slide.slide-in-right,
    .marta-gallery-slide.slide-in-left {
        animation: none;
    }
}
