/**
 * Genel galeri sayfası (/galeri) — sade, kompakt
 */
.gallery-page {
    max-width: min(1100px, 100%);
    margin: 0 auto;
    padding: 1rem 0.75rem 2rem;
}

.gallery-page__head {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.gallery-page__title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--gray-900);
}

.gallery-page__lead {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--gray-600);
    max-width: 52ch;
}

.gallery-page__empty {
    text-align: center;
    padding: 1.25rem 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.gallery-page__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    /* Geniş ekranda çok dar sütun (6+) yerine daha az, daha okunaklı sütun */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: clamp(0.65rem, 2vw, 1rem);
}

.gallery-page__item {
    margin: 0;
}

.gallery-page__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 180px;
    padding: 0.35rem;
    box-sizing: border-box;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    background: var(--gray-100);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gallery-page__thumb:hover {
    border-color: var(--gray-300);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.gallery-page__thumb img {
    display: block;
    max-width: 100%;
    max-height: min(42vh, 320px);
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    vertical-align: middle;
}

.gallery-page__caption {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--gray-600);
}

/* Native <dialog>: tam genişlik + sol üst hizası yerine viewport ortasında */
.gallery-page__lightbox {
    position: fixed;
    inset: 0;
    width: fit-content;
    max-width: min(96vw, 960px);
    height: fit-content;
    max-height: min(92vh, 900px);
    margin: auto;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: auto;
}

.gallery-page__lightbox::backdrop {
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(3px);
}

.gallery-page__lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s ease;
}

.gallery-page__lightbox-close:hover {
    background: rgba(255, 255, 255, 0.16);
}

.gallery-page__lightbox-fig {
    margin: 0;
    padding: 44px 12px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.gallery-page__lightbox-fig img {
    display: block;
    max-width: min(92vw, 920px);
    max-height: calc(88vh - 7rem);
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    margin: 0 auto;
    border-radius: 6px;
}

.gallery-page__lightbox-cap {
    margin: 10px 0 0;
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.88);
    max-width: 48ch;
    margin-left: auto;
    margin-right: auto;
}

/* Dar / tablet: sabit 2 sütun — ince telefon posterleri burada da okunaklı */
@media (max-width: 720px) {
    .gallery-page__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .gallery-page__grid {
        gap: 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-page__thumb {
        transition: none;
    }
}
