/* ============================================
   ELMAS KURUYEMİŞ - GALERİ SAYFA STİLLERİ
   GLightbox Destekli
   ============================================ */

/* ========== Gallery Page Base ========== */
.gallery-page {
    background-color: var(--color-light);
    padding: var(--space-xl) 0 var(--space-2xl);
}

@media (min-width: 768px) {
    .gallery-page {
        padding: var(--space-2xl) 0 var(--space-3xl);
    }
}

/* ========== Gallery Grid ========== */
.gallery-page__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

/* ========== Gallery Item ========== */
.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    display: block;
    text-decoration: none;
    /* Safari render fix */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* Touch feedback */
    -webkit-tap-highlight-color: transparent;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
    /* Safari için */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Masaüstü hover */
@media (hover: hover) {
    .gallery-item:hover img,
    .gallery-item:focus img {
        transform: scale(1.1);
    }
}

/* Touch cihazlarda scale efektini kaldır */
@media (hover: none) {
    .gallery-item:active {
        opacity: 0.9;
    }
}

/* ========== Gallery Overlay ========== */
.gallery-item__overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%) scale(0.8);
    transform: translate(-50%, -50%) scale(0.8);
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-dark);
    font-size: 1.25rem;
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 2;
    pointer-events: none;
}

/* Masaüstü hover */
@media (hover: hover) {
    .gallery-item:hover .gallery-item__overlay,
    .gallery-item:focus .gallery-item__overlay {
        opacity: 1;
        -webkit-transform: translate(-50%, -50%) scale(1);
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Mobilde overlay'ı her zaman göster ama küçük */
@media (hover: none) {
    .gallery-item__overlay {
        opacity: 0.7;
        -webkit-transform: translate(-50%, -50%) scale(0.7);
        transform: translate(-50%, -50%) scale(0.7);
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ========== Instagram CTA ========== */
.gallery-instagram {
    text-align: center;
    margin-top: var(--space-2xl);
    padding: var(--space-xl);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.gallery-instagram p {
    color: var(--color-text-dark);
    margin-bottom: var(--space-lg);
    font-size: 1.0625rem;
}

/* ========================================
   GLightbox Özelleştirmeleri (Altın Tema)
   ======================================== */

/* Overlay arka plan */
.glightbox-container .goverlay {
    background: rgba(0, 0, 0, 0.92) !important;
}

/* Başlık ortalı */
.glightbox-container .gslide-title {
    text-align: center !important;
    width: 100%;
    color: #fff !important;
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

/* Açıklama ortalı */
.glightbox-container .gslide-desc {
    text-align: center !important;
    width: 100%;
    color: rgba(255, 255, 255, 0.88) !important;
    font-family: var(--font-secondary);
    font-size: 0.9375rem;
    line-height: 1.55;
    margin: 0;
}

/* Açıklama (caption) premium koyu tema */
.glightbox-container .gslide-description {
    background: rgba(0, 0, 0, 0.55) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* İç padding */
.glightbox-container .gdesc-inner {
    padding: 14px 16px !important;
}

/* "See more" linkini gizle */
.glightbox-container .gslide-description a {
    display: none !important;
}

/* Görsel üst köşeleri yumuşat */
.glightbox-container .gslide-media {
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

/* ===== Oklar + X (Altın Tema) ===== */
.glightbox-container .gclose,
.glightbox-container .gprev,
.glightbox-container .gnext {
    color: var(--color-primary) !important;
    border: 1px solid rgba(201, 162, 39, 0.75) !important;
    background: rgba(201, 162, 39, 0.12) !important;
    border-radius: 999px !important;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.glightbox-container .gclose:hover,
.glightbox-container .gprev:hover,
.glightbox-container .gnext:hover,
.glightbox-container .gclose:focus,
.glightbox-container .gprev:focus,
.glightbox-container .gnext:focus {
    background: var(--color-primary) !important;
    color: var(--color-dark) !important;
    border-color: var(--color-primary) !important;
    transform: scale(1.03);
    outline: none;
}

/* SVG ikonları */
.glightbox-container .gclose svg,
.glightbox-container .gprev svg,
.glightbox-container .gnext svg {
    fill: currentColor !important;
}

/* Ok boyutları */
.glightbox-container .gprev,
.glightbox-container .gnext {
    width: 54px !important;
    height: 54px !important;
}

/* Kapat (X) boyutu */
.glightbox-container .gclose {
    width: 44px !important;
    height: 44px !important;
    top: 15px !important;
    right: 15px !important;
}

/* ========================================
   Mobil Alt Bar (Önceki / Kapat / Sonraki)
   ======================================== */

/* Varsayılan: masaüstünde alt bar kapalı */
.glightbox-container .gl-bottom-actions {
    display: none;
}

/* Mobil: alt bar aktif + caption'a yer aç */
@media (max-width: 768px) {
    /* Masaüstü oklarını gizle */
    .glightbox-container .gprev,
    .glightbox-container .gnext {
        display: none !important;
    }

    /* Description'a alt bar için yer aç */
    .glightbox-container .gslide-description {
        padding-bottom: 80px !important;
    }

    /* Alt bar görünür */
    .glightbox-container .gl-bottom-actions {
        display: grid;
        position: fixed;
        left: 50%;
        bottom: 10px;
        transform: translateX(-50%);
        z-index: 99999;

        width: min(560px, 94vw);
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        align-items: center;

        pointer-events: none;
    }

    .glightbox-container .gl-bottom-actions .btn-gold {
        pointer-events: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-width: 0;
        padding: 12px 16px;
        font-family: var(--font-secondary);
        font-size: 14px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--color-dark);
        background: var(--color-primary);
        border: none;
        border-radius: var(--radius-md);
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .glightbox-container .gl-bottom-actions .btn-gold:hover,
    .glightbox-container .gl-bottom-actions .btn-gold:focus {
        background: var(--color-primary-dark);
        transform: translateY(-2px);
        box-shadow: var(--shadow-gold);
    }

    .glightbox-container .gl-bottom-actions .btn-gold:active {
        transform: translateY(0);
    }

    /* Kapat butonu farklı stil */
    .glightbox-container .gl-bottom-actions .gl-close {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    .glightbox-container .gl-bottom-actions .gl-close:hover,
    .glightbox-container .gl-bottom-actions .gl-close:focus {
        background: rgba(255, 255, 255, 0.25);
        color: #fff;
        box-shadow: none;
    }

    /* X butonunu mobilde de göster (sağ üst) */
    .glightbox-container .gclose {
        display: flex !important;
        top: 10px !important;
        right: 10px !important;
        width: 40px !important;
        height: 40px !important;
    }

    /* Görsel boyutu */
    .glightbox-container .gslide-image img {
        max-height: 65vh;
    }
}

/* ========================================
   Responsive Grid
   ======================================== */
@media (min-width: 480px) {
    .gallery-page__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-md);
    }
}

@media (min-width: 768px) {
    .gallery-page__grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .gallery-item__overlay {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .gallery-page__grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ========================================
   Animasyonlar
   ======================================== */
.gallery-item {
    opacity: 0;
    transform: translateY(20px);
    animation: galleryFadeIn 0.6s ease forwards;
}

/* Staggered animation */
.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }
.gallery-item:nth-child(10) { animation-delay: 0.5s; }
.gallery-item:nth-child(n+11) { animation-delay: 0.55s; }

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gallery-item {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .gallery-item img {
        transition: none;
    }

    .gallery-item__overlay {
        transition: none;
    }
}