﻿/* =========================================================
   ANA SAYFA KATEGORİ GALERİLERİ
   ========================================================= */

.gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: stretch;
    width: 100%;
    max-width: 1050px;
    margin: 32px auto 0;
    padding: 0;
    gap: 14px;
}

    .gallery-grid .gallery-item {
        position: relative;
        display: block !important;
        width: 100% !important;
        min-width: 0;
        height: auto !important;
        aspect-ratio: 4 / 3;
        margin: 0 !important;
        padding: 0;
        overflow: hidden;
        appearance: none;
        background: #e7edf2;
        border: 0;
        border-radius: 10px;
        box-shadow: 0 5px 18px rgba(11, 37, 69, 0.12);
        cursor: pointer;
        text-align: initial;
    }

        .gallery-grid .gallery-item::before,
        .gallery-grid .gallery-item::after {
            display: none;
            content: none;
        }

        .gallery-grid .gallery-item img {
            display: block !important;
            width: 100% !important;
            height: 100% !important;
            max-width: none;
            margin: 0;
            object-fit: cover;
            object-position: center;
            border: 0;
            border-radius: 0;
            transition: transform 0.25s ease, filter 0.25s ease;
        }

        .gallery-grid .gallery-item:hover img {
            transform: scale(1.035);
            filter: brightness(0.94);
        }

        .gallery-grid .gallery-item:focus {
            outline: none;
        }

        .gallery-grid .gallery-item:focus-visible {
            outline: 3px solid #2596be;
            outline-offset: 3px;
        }

    /*
 * Eski tek görsellik slider kuralları varsa
 * ana sayfa galeri düzenini etkilemesini engeller.
 */

    .gallery-grid .category-gallery-slide,
    .gallery-grid .category-gallery-slide.is-active {
        display: block !important;
    }

    .gallery-grid
    .category-gallery-button,
    .gallery-grid
    .category-gallery-counter {
        display: none !important;
    }

/* =========================================================
   BÜYÜTÜLMÜŞ GÖRSEL MODALI
   ========================================================= */

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 24px;
    overflow: hidden;
}

    .image-modal.is-open {
        display: flex;
    }

    .image-modal[aria-hidden="true"] {
        display: none;
    }

    .image-modal[aria-hidden="false"] {
        display: flex;
    }

.image-modal-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    background: rgba(2, 13, 27, 0.92);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.image-modal-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(1200px, 94vw);
    height: min(820px, 88vh);
    margin: auto;
}

.image-modal-picture-area {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 150px);
    height: 100%;
    min-width: 0;
    overflow: hidden;
}

    .image-modal-picture-area img {
        display: block;
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
        margin: auto;
        object-fit: contain;
        object-position: center;
        border-radius: 12px;
        box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
    }

/* =========================================================
   MODAL KAPATMA BUTONU
   ========================================================= */

.image-modal-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    appearance: none;
    color: #ffffff;
    background: rgba(11, 37, 69, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

    .image-modal-close:hover {
        color: #ffffff;
        background: #2596be;
        transform: scale(1.06);
    }

    .image-modal-close:focus {
        outline: none;
    }

    .image-modal-close:focus-visible {
        outline: 3px solid rgba(37, 150, 190, 0.65);
        outline-offset: 3px;
    }

/* =========================================================
   MODAL SAĞ-SOL OKLARI
   ========================================================= */

.image-modal-navigation {
    position: absolute;
    top: 50%;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 0;
    padding: 0;
    appearance: none;
    color: #ffffff;
    background: rgba(11, 37, 69, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

    .image-modal-navigation:hover {
        color: #ffffff;
        background: #2596be;
        transform: translateY(-50%) scale(1.07);
    }

    .image-modal-navigation:focus {
        outline: none;
    }

    .image-modal-navigation:focus-visible {
        outline: 3px solid rgba(37, 150, 190, 0.65);
        outline-offset: 3px;
    }

    .image-modal-navigation[hidden] {
        display: none !important;
    }

.image-modal-previous {
    left: 0;
}

.image-modal-next {
    right: 0;
}

/* =========================================================
   MODAL GÖRSEL SAYACI
   ========================================================= */

.image-modal-counter {
    position: absolute;
    bottom: 2px;
    left: 50%;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 65px;
    padding: 8px 15px;
    color: #ffffff;
    background: rgba(11, 37, 69, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    transform: translateX(-50%);
}

/* Modal açıkken arka sayfanın kaymasını engeller. */

body.image-modal-open {
    overflow: hidden !important;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 850px) {

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        max-width: 720px;
    }

    .image-modal {
        padding: 18px;
    }

    .image-modal-content {
        width: 96vw;
        height: 88vh;
    }

    .image-modal-picture-area {
        width: calc(100% - 118px);
    }

    .image-modal-navigation {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .image-modal-close {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

/* =========================================================
   TELEFON
   ========================================================= */

@media (max-width: 560px) {

    .gallery-grid {
        grid-template-columns: 1fr !important;
        max-width: 420px;
        gap: 12px;
    }

        .gallery-grid .gallery-item {
            aspect-ratio: 4 / 3;
        }

    .image-modal {
        padding: 10px;
    }

    .image-modal-content {
        width: 100%;
        height: 88vh;
    }

    .image-modal-picture-area {
        width: calc(100% - 84px);
        height: calc(100% - 40px);
    }

        .image-modal-picture-area img {
            border-radius: 8px;
        }

    .image-modal-navigation {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .image-modal-previous {
        left: 0;
    }

    .image-modal-next {
        right: 0;
    }

    .image-modal-close {
        top: 0;
        right: 0;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .image-modal-counter {
        bottom: 0;
        padding: 7px 12px;
        font-size: 13px;
    }
}
