/* Referanslar: detay galerisi, tam sayfa gezinti ve liste pop-up'ı.
   Tailwind derlemesine (public/css/app.css) yeni sınıf eklememek için ayrı dosya. */

:root {
    --ref-ink: rgb(7 7 7);
    --ref-coal: rgb(13 13 15);
    --ref-gold: #c9a96a;
    --ref-silver: rgb(215 216 220);
    --ref-line: rgba(255, 255, 255, 0.1);
}

/* ── Detay (tam sayfa + pop-up ortak) ─────────────────────────── */
.ref-container { max-width: 64rem; }

.ref-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}
.ref-gallery__item {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 0.9rem;
    background: var(--ref-coal);
    border: 0;
    padding: 0;
    cursor: zoom-in;
}
.ref-gallery.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ref-gallery__item.is-hero {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
    border-radius: 1.1rem;
}
.ref-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(.22, 1, .36, 1);
}
.ref-gallery__item:hover img { transform: scale(1.04); }
.ref-gallery__item:focus-visible { outline: 2px solid var(--ref-gold); outline-offset: 2px; }

.ref-gallery + .ref-content { margin-top: 2.5rem; }
.ref-content > :first-child { margin-top: 0; }

@media (max-width: 639px) {
    .ref-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
}

/* Tam sayfada önceki / sonraki referans */
.ref-pager {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ref-line);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.ref-pager a { color: var(--ref-gold); transition: opacity 0.2s; }
.ref-pager a:hover { opacity: 0.75; }
.ref-pager__link.is-next { text-align: end; }
.ref-pager__all { color: rgba(215, 216, 220, 0.6) !important; }
@media (max-width: 639px) {
    .ref-pager { grid-template-columns: 1fr 1fr; }
    .ref-pager__all { grid-column: 1 / -1; grid-row: 2; text-align: center; }
}

/* ── Pop-up ───────────────────────────────────────────────────── */
/* Navbar (z 65) üstünde, lightbox (z 90) altında: pop-up'taki galeri lightbox'ta açılabilsin. */
.ref-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: rgba(7, 7, 7, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.ref-modal[hidden] { display: none; }
.ref-modal.is-open { opacity: 1; }

.ref-modal__panel {
    position: relative;
    width: 100%;
    max-width: 72rem;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--ref-coal);
    border: 1px solid var(--ref-line);
    border-radius: 1.1rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    transform: translateY(14px) scale(0.985);
    transition: transform 0.3s cubic-bezier(.22, 1, .36, 1);
    outline: none;
}
.ref-modal.is-open .ref-modal__panel { transform: none; }

/* Başlık çubuğu pop-up kaydırılırken üstte kalır */
.ref-modal__bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem 0.85rem 1.4rem;
    background: rgba(13, 13, 15, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ref-line);
}
.ref-modal__heading { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.ref-modal__icon { width: 1.15rem; height: 1.15rem; flex-shrink: 0; color: var(--ref-gold); }
.ref-modal__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ref-silver);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ref-modal__actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.ref-modal__pager { display: flex; align-items: center; gap: 0.5rem; }
.ref-modal__pager[hidden] { display: none; }
.ref-modal__counter {
    min-width: 3.5rem;
    text-align: center;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: rgba(215, 216, 220, 0.7);
}

.ref-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 2.25rem;
    padding: 0 0.85rem;
    border-radius: 0.6rem;
    border: 1px solid var(--ref-line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ref-silver);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s, opacity 0.2s;
}
.ref-btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.ref-btn:hover:not(:disabled) { border-color: rgba(201, 169, 106, 0.5); color: var(--ref-gold); }
.ref-btn:focus-visible { outline: 2px solid var(--ref-gold); outline-offset: 2px; }
.ref-btn:disabled { opacity: 0.35; cursor: default; }
.ref-btn--icon { width: 2.25rem; padding: 0; justify-content: center; }

.ref-modal__body { padding: 1.75rem 2rem 2.5rem; }
.ref-modal__body.is-loading { min-height: 50vh; display: flex; align-items: center; justify-content: center; }
.ref-modal__spinner {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid rgba(201, 169, 106, 0.2);
    border-top-color: var(--ref-gold);
    animation: ref-spin 0.8s linear infinite;
}
@keyframes ref-spin { to { transform: rotate(360deg); } }

/* Mobil: tam ekran, butonlarda yalnızca ikon */
@media (max-width: 639px) {
    .ref-modal { padding: 0; }
    .ref-modal__panel {
        max-width: none;
        height: 100%;
        max-height: none;
        border: 0;
        border-radius: 0;
        transform: translateY(24px);
    }
    .ref-modal__bar { padding: 0.65rem 0.75rem 0.65rem 1rem; gap: 0.5rem; }
    .ref-modal__actions, .ref-modal__pager { gap: 0.35rem; }
    .ref-btn__label { display: none; }
    .ref-btn { width: 2.25rem; padding: 0; justify-content: center; font-size: 1rem; }
    .ref-modal__counter { min-width: 2.75rem; font-size: 0.75rem; }
    .ref-modal__body { padding: 1rem 1rem 2rem; }
}

@media (prefers-reduced-motion: reduce) {
    .ref-modal, .ref-modal__panel, .ref-gallery__item img { transition: none; }
}
