/* ======================================================================
   SECTION — GALLERY PREVIEW
   Prefix: .gp-
   4 fotoğraf grid + vanilla JS lightbox
   ====================================================================== */

.gp {
    padding: var(--sp-10) 0 var(--sp-12) 0;
    background: var(--bg-page);
}

.gp-inner {
    max-width: var(--container);
    margin-inline: auto;
    padding: 0 var(--sp-4);
}

@media (min-width: 768px) {
    .gp-inner { padding: 0 var(--sp-6); }
}

.gp-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
}

.gp-title {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gp-title-emoji {
    font-size: 1.2em;
}

.gp-subtitle {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin: 4px 0 0 0;
}

.gp-view-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    transition: gap var(--t-fast);
}
.gp-view-all:hover {
    gap: 8px;
    color: var(--primary-dk);
}
.gp-view-all svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ─────────── Grid (4 fotoğraf) ─────────── */

.gp-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
}

@media (min-width: 768px) {
    .gp-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--sp-4);
    }
}

.gp-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
    cursor: pointer;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.gp-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.gp-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gp-item:hover .gp-item-img {
    transform: scale(1.08);
}

.gp-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        rgba(0,0,0,0.55) 0%,
        rgba(0,0,0,0.1) 40%,
        transparent 100%);
    opacity: 0;
    transition: opacity var(--t-fast);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: var(--sp-3);
    color: #fff;
}
.gp-item:hover .gp-item-overlay {
    opacity: 1;
}

.gp-item-title {
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-snug);
    margin: 0;
    flex: 1;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.gp-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    color: var(--primary-dk);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gp-item-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Focus ring (klavye erişilebilirliği) */
.gp-item:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

/* ──────────────────────────────────────────────────────────────────
   LIGHTBOX — Tam ekran fotoğraf görüntüleyici
   ────────────────────────────────────────────────────────────────── */

.gp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: var(--sp-4);
}
.gp-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.gp-lightbox-stage {
    position: relative;
    max-width: min(1200px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
}

.gp-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    user-select: none;
    -webkit-user-drag: none;
    /* Touch swipe için transform tabanı */
    transform: translateX(0);
    transition: transform 0.25s ease;
    will-change: transform;
    touch-action: pan-y pinch-zoom; /* dikey scroll + zoom mümkün, yatay swipe JS'te */
}

.gp-lightbox-caption {
    color: #fff;
    text-align: center;
    font-size: var(--fs-sm);
    font-family: var(--font-display);
    padding: var(--sp-2) var(--sp-4);
    background: rgba(0,0,0,0.6);
    border-radius: var(--radius-full);
    backdrop-filter: blur(8px);
    max-width: 80vw;
    line-height: var(--lh-snug);
}
.gp-lightbox-caption:empty { display: none; }

.gp-lightbox-counter {
    position: absolute;
    top: -36px;
    inset-inline-start: 0;
    color: rgba(255,255,255,0.6);
    font-size: var(--fs-xs);
    font-family: var(--font-display);
    font-weight: var(--fw-medium);
    letter-spacing: 0.1em;
}

/* Kapat butonu */
.gp-lightbox-close {
    position: absolute;
    top: -36px;
    inset-inline-end: 0;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--t-fast), transform var(--t-fast);
}
.gp-lightbox-close:hover {
    color: #fff;
    transform: rotate(90deg);
}
.gp-lightbox-close svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Nav butonları (sol/sağ ok) */
.gp-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast);
    backdrop-filter: blur(4px);
}
.gp-lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%) scale(1.1);
}
.gp-lightbox-nav[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}
.gp-lightbox-nav svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gp-lightbox-prev { inset-inline-start: var(--sp-4); }
.gp-lightbox-next { inset-inline-end:   var(--sp-4); }

@media (max-width: 640px) {
    .gp-lightbox-nav {
        width: 36px;
        height: 36px;
    }
    .gp-lightbox-prev { inset-inline-start: var(--sp-2); }
    .gp-lightbox-next { inset-inline-end:   var(--sp-2); }
}
