/* ─────────────────────────────────────────────────────────────
   GALERİ — Faz 8
   ─────────────────────────────────────────────────────────────
   public/frontend/css/gallery.css
   main.css'in altına yüklenir.
*/

/* ═══ GRID ═══ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 40px;
}

.gallery-grid-full {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.gallery-cell {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 6px;
    background: var(--paper-warm);
    aspect-ratio: 4 / 3;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border: 0;
    padding: 0;
    transition: transform .35s ease, box-shadow .35s ease;
}

.gallery-cell:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(8, 42, 63, .15);
}

.gallery-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s ease, filter .35s ease;
}

.gallery-cell:hover img {
    transform: scale(1.04);
    filter: brightness(.95);
}

/* Magazine layout — geniş */
.gallery-cell-wide {
    grid-column: span 2;
    aspect-ratio: 16 / 9;
}

/* Magazine layout — uzun */
.gallery-cell-tall {
    grid-row: span 2;
    aspect-ratio: 3 / 4;
}

/* Caption — hover ile alttan kayar */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 36px 18px 14px;
    color: #fff;
    font-family: var(--serif, 'Fraunces', serif);
    font-size: 14px;
    font-style: italic;
    font-weight: 400;
    letter-spacing: .02em;
    text-align: left;
    line-height: 1.4;
    background: linear-gradient(to top, rgba(8, 42, 63, .85) 0%, rgba(8, 42, 63, .4) 60%, transparent 100%);
    transform: translateY(8px);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
    pointer-events: none;
}

.gallery-cell:hover .gallery-caption,
.gallery-cell:focus-visible .gallery-caption {
    transform: translateY(0);
    opacity: 1;
}

/* Mobil */
@media (max-width: 768px) {
    .gallery-grid,
    .gallery-grid-full {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .gallery-cell-wide {
        grid-column: span 2;
        aspect-ratio: 16 / 9;
    }

    .gallery-cell-tall {
        grid-row: auto;
        aspect-ratio: 4 / 3;
    }

    .gallery-caption {
        font-size: 12px;
        padding: 24px 12px 10px;
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 480px) {
    .gallery-grid,
    .gallery-grid-full {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .gallery-cell-wide {
        grid-column: span 1;
    }
}

/* ═══ LIGHTBOX ═══ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 42, 63, .96);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 40px;
    backdrop-filter: blur(8px);
}

.lightbox.lightbox-open {
    display: flex;
    animation: lightbox-fade-in .25s ease;
}

@keyframes lightbox-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
    background: #000;
}

.lightbox-caption {
    color: rgba(255, 255, 255, .85);
    font-family: var(--serif, 'Fraunces', serif);
    font-style: italic;
    font-size: 15px;
    letter-spacing: .02em;
    text-align: center;
    max-width: 600px;
    min-height: 22px;
}

.lightbox-counter {
    position: absolute;
    top: 24px;
    left: 24px;
    color: rgba(255, 255, 255, .7);
    font-family: var(--mono, 'JetBrains Mono', monospace);
    font-size: 12px;
    letter-spacing: .14em;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15);
    color: #fff;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
    backdrop-filter: blur(6px);
}

.lightbox-close {
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 30px;
    font-weight: 200;
    line-height: 1;
    font-family: var(--serif, 'Fraunces', serif);
}

.lightbox-prev { left: 30px; }
.lightbox-next { right: 30px; }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, .18);
}

.lightbox-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lightbox-next:hover { transform: translateY(-50%) translateX(3px); }

@media (max-width: 768px) {
    .lightbox { padding: 16px; }

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 24px;
    }

    .lightbox-prev { left: 12px; }
    .lightbox-next { right: 12px; }

    .lightbox-counter { top: 12px; left: 12px; font-size: 11px; }
}
