/* ============================================================
   GALLERY PAGE — /galeri
============================================================ */

.gl-page {
    padding: 30px 20px 60px;
    background: var(--bg-page, #f9fafb);
    min-height: calc(100vh - var(--header-height, 60px));
}

.gl-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ─── Header ─── */
.gl-header {
    text-align: center;
    margin-bottom: 32px;
}
.gl-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text, #111827);
    margin: 0 0 8px;
}
.gl-subtitle {
    color: var(--muted, #6b7280);
    font-size: 14px;
    margin: 0;
}

/* ─── Empty state ─── */
.gl-empty {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card, #fff);
    border-radius: 12px;
    border: 1px solid var(--border, #e5e7eb);
    color: var(--muted, #6b7280);
}
.gl-empty svg {
    color: var(--border, #d1d5db);
    margin-bottom: 12px;
}
.gl-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text, #111827);
    margin: 0 0 6px;
}
.gl-empty p {
    margin: 0;
    font-size: 14px;
}

/* ─── Grid — Dinamik boyutlar, masonry hissi ─── */
/*
 * CSS-only "masonry" — bazı item'ları büyük (col/row span 2) yaparız.
 * Her N item'da bir "featured" item daha büyük olur.
 * Mobilde 2 sütun, tablette 3, desktop 4.
 *
 * .gl-item-l → 2x boyut (geniş+yüksek)
 * .gl-item-w → 2x genişlik (panoramik hissi)
 * .gl-item-t → 2x yükseklik (portre hissi)
 */
.gl-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
    grid-auto-flow: dense; /* boş yerleri doldur */
    gap: 6px;
}

@media (min-width: 640px) {
    .gl-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 200px;
        gap: 8px;
    }
}

@media (min-width: 1024px) {
    .gl-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 220px;
        gap: 10px;
    }
}

/* Featured boyutlar — sınıf bazlı */
.gl-item.gl-item-l {
    grid-column: span 2;
    grid-row: span 2;
}

.gl-item.gl-item-w {
    grid-column: span 2;
}

.gl-item.gl-item-t {
    grid-row: span 2;
}

/* Mobilde "L" özelliğini azalt (çok dolduruyor) */
@media (max-width: 639px) {
    .gl-item.gl-item-l {
        grid-column: span 2;
        grid-row: span 1;  /* mobilde "L" sadece genişler, yükselmez */
    }
}

.gl-item {
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: var(--bg-card, #fff);
    /* aspect-ratio kaldırıldı — grid-auto-rows belirler */
}

.gl-item-btn {
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
    position: relative;
    display: block;
    overflow: hidden;
}

.gl-item-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.gl-item-btn:hover img,
.gl-item-btn:focus img {
    transform: scale(1.05);
}

.gl-item-btn:focus {
    outline: 3px solid var(--primary, #f97316);
    outline-offset: 2px;
}

.gl-item-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%);
    color: white;
    padding: 24px 12px 10px;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
}

.gl-item-btn:hover .gl-item-caption,
.gl-item-btn:focus .gl-item-caption {
    opacity: 1;
}

/* ─── Lightbox ─── */
.gl-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gl-lb-in 0.2s ease-out;
}

.gl-lightbox[hidden] { display: none; }

@keyframes gl-lb-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gl-lb-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 10;
}
.gl-lb-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gl-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 10;
}
.gl-lb-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gl-lb-prev { left: 20px; }
.gl-lb-next { right: 20px; }

@media (max-width: 640px) {
    .gl-lb-prev { left: 8px; }
    .gl-lb-next { right: 8px; }
    .gl-lb-nav { width: 40px; height: 40px; }
}

.gl-lb-figure {
    margin: 0;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#gl-lb-image {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.gl-lb-caption {
    color: white;
    text-align: center;
    margin-top: 16px;
    max-width: 600px;
    padding: 0 20px;
}
.gl-lb-caption[hidden] { display: none; }
.gl-lb-caption strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}
.gl-lb-caption p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.gl-lb-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
}
