/* GENEL AYARLAR */
.mw-gallery-section {
    font-family: 'DM Sans', sans-serif;
    padding: 40px 20px;
    max-width: 1300px;
    margin: 0 auto;
}

/* SEKMELER */
.mw-gallery-tabs {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 50px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    flex-wrap: wrap;
}

.mw-tab-btn {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 700;
    color: #bbb;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    padding: 10px 0;
    transition: color 0.3s ease;
    text-transform: uppercase;
    margin: 5px;
}

.mw-tab-btn.active {
    color: #F37021;
}

.mw-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #F37021;
}

/* GALERİ GRİD */
.mw-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.mw-gallery-item {
    position: relative;
    overflow: hidden;
    height: 350px;
    cursor: pointer;
    transition: all 0.4s ease;
    display: block;
}

/* .mw-gallery-item.large { grid-column: span 2; height: 500px; } */
/* Removed explicit large class requirement unless user specifically sets it. I'll leave it as fallback style just in case */
.mw-gallery-item.large {
    grid-column: span 2;
    height: 500px;
}

.mw-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.mw-gallery-item:hover img {
    transform: scale(1.08);
}

/* --- POPUP (LIGHTBOX) STİLLERİ --- */
.mw-lightbox {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 18, 18, 0.98);
    align-items: center;
    justify-content: center;
}

.mw-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 80%;
    text-align: center;
}

.mw-lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.mw-lightbox-caption {
    margin-top: 30px;
    animation: slideUp 0.5s ease;
}

#mwLightboxCat {
    color: #F37021;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 10px;
}

#mwLightboxTitle {
    color: #ffffff;
    font-size: 42px;
    font-weight: 700;
    margin: 0;
    font-family: 'DM Sans', sans-serif;
}

.mw-close-lightbox {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    transition: transform 0.3s;
    z-index: 1000002;
}

.mw-close-lightbox:hover {
    transform: rotate(90deg);
    color: #F37021;
}

.mw-lightbox-nav {
    cursor: pointer;
    position: fixed;
    /* Fixed to screen */
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.5);
    /* Always visible background */
    color: #fff;
    font-weight: bold;
    font-size: 34px;
    line-height: 60px;
    text-align: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    z-index: 1000001;
    /* High z-index */
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    /* Flex to center content */
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.mw-nav-prev {
    left: 20px;
}

.mw-nav-next {
    right: 20px;
}

.mw-lightbox-nav:hover {
    background-color: #F37021;
    border-color: #F37021;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(243, 112, 33, 0.6);
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MOBİL UYUM */
@media (max-width: 992px) {
    .mw-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #mwLightboxTitle {
        font-size: 28px;
    }
}

@media (max-width: 600px) {
    .mw-gallery-grid {
        grid-template-columns: 1fr;
    }

    .mw-gallery-item.large {
        grid-column: span 1;
        height: 350px;
    }
}

/* --- MASONRY LAYOUT (Tumblr/Pinterest Style) --- */
.mw-gallery-grid.masonry {
    display: block;
    column-count: 3;
    column-gap: 20px;
}

.mw-gallery-grid.masonry .mw-gallery-item {
    display: inline-block;
    width: 100%;
    height: auto !important;
    /* Override fixed height */
    margin-bottom: 20px;
    break-inside: avoid;
    /* Prevent split */
    vertical-align: top;
}

.mw-gallery-grid.masonry .mw-gallery-item img {
    width: 100% !important;
    height: auto !important;
    /* Preserve aspect ratio */
    object-fit: contain !important;
    /* Disable 'cover' which forces cropping */
    display: block;
}

@media (max-width: 992px) {
    .mw-gallery-grid.masonry {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .mw-gallery-grid.masonry {
        column-count: 1;
    }
}