/* ==========================================================================
   GEFOK — Galeri sayfaları (social-gallery.html, album.html)
   Yalnızca base.css değişkenleri kullanılır; tema/sepya uyumludur.
   ========================================================================== */

/* ---------- Başlık ---------- */
.g-hero { overflow: hidden; }
.g-hero > .container { position: relative; z-index: 1; }
.g-hero__glow {
    position: absolute;
    inset: -30% -10% auto;
    height: 120%;
    background:
        radial-gradient(38% 45% at 82% 28%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%),
        radial-gradient(30% 40% at 8% 80%, color-mix(in srgb, var(--text) 6%, transparent), transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.g-hero__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}
.g-hero__tag { min-width: min(260px, 100%); }
.g-hero__open { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: .68rem; }
.g-hero__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
    animation: pulse 1.6s ease-in-out infinite;
}

.g-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px clamp(24px, 5vw, 64px);
    margin-top: clamp(28px, 4vw, 48px);
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.g-stats > div { display: flex; flex-direction: column-reverse; gap: 4px; }
.g-stats dt {
    font-family: var(--font-mono);
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}
.g-stats dd {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.g-stats > div:first-child dd { color: var(--accent); }

/* ---------- Bölüm başlıkları (satırlar) ---------- */
.g-row-head {
    display: grid;
    gap: 14px;
    margin-bottom: clamp(24px, 3.5vw, 40px);
}
@media (min-width: 900px) {
    .g-row-head {
        grid-template-columns: minmax(160px, 260px) minmax(0, 1fr);
        align-items: end;
        gap: 40px;
    }
}
.g-row-title {
    font-size: clamp(1.7rem, 3.6vw, 3rem);
    font-weight: 800;
    letter-spacing: -.035em;
    background: var(--heading-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-bottom: .06em;
}

/* ---------- Yatay kaydırıcı (seçki + albümler) ---------- */
.g-scroller {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: max(var(--gutter), calc((100vw - var(--container)) / 2));
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
    padding-bottom: 12px;
}
.g-scroller::-webkit-scrollbar { height: 6px; }
.g-scroller::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.g-scroller > ol, .g-scroller > ul {
    display: flex;
    gap: clamp(16px, 2vw, 28px);
    list-style: none;
    width: max-content;
    padding-inline: max(var(--gutter), calc((100vw - var(--container)) / 2));
    padding-block: 18px 6px;
}

/* Bu hafta en çok beğenilenler */
.g-top__item {
    position: relative;
    width: clamp(220px, 26vw, 320px);
    scroll-snap-align: start;
}
.g-top__rank {
    position: absolute;
    top: -14px;
    left: -6px;
    z-index: 3;
    font-size: clamp(2.6rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.06em;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--accent);
    pointer-events: none;
}
.g-top__open { display: block; width: 100%; text-align: left; border-radius: var(--radius); }
.g-top__card, .g-top__card .photo-card__media { display: block; }
.g-top__card .photo-card__media { aspect-ratio: 4 / 5; }
.g-top__card .photo-card__img { display: block; }
.g-top__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
}

/* Albümler */
.g-album { width: clamp(240px, 30vw, 380px); scroll-snap-align: start; }
.g-album__link { display: block; }
.g-album__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    background: var(--bg);
}
.g-album__media img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    transition: transform .9s var(--ease);
}
.g-album__media.frame::after { inset: -8px; opacity: 0; transition: opacity .5s var(--ease), inset .6s var(--ease); }
.g-album__link:hover .g-album__media.frame::after,
.g-album__link:focus-visible .g-album__media.frame::after { opacity: 1; inset: -4px; }
.g-album__link:hover .g-album__media img { transform: translate(-4px, -4px); }
/* Arkadaki "yığın" — albüm hissi */
.g-album__stack {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    transform: translate(8px, 8px);
    transition: transform .9s var(--ease);
}
.g-album__link:hover .g-album__stack { transform: translate(12px, 12px); }
.g-album__placeholder {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}
.g-album__body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 12px;
    padding-top: 22px;
}
.g-album__no { grid-row: span 2; color: var(--accent); padding-top: 4px; }
.g-album__title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.g-album__count { font-size: .66rem; }

/* ---------- Filtre çubuğu ---------- */
.g-filters {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    gap: 14px;
    margin-bottom: clamp(24px, 3vw, 40px);
    padding: 14px 0;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
/* Başlık aşağı kaydırırken gizlenir; görünürken filtre çubuğu altında kalsın */
.site-header:not(.is-hidden) ~ main .g-filters { top: var(--header-h); }
.g-filters__chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
}
.g-filters__chips::-webkit-scrollbar { display: none; }
.g-filters__chips .chip { flex-shrink: 0; }
.g-filters__row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px 20px;
}
.g-select { display: grid; gap: 4px; min-width: 0; flex: 1 1 150px; max-width: 260px; }
.g-select__label { font-size: .62rem; color: var(--muted); }
.g-select select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    min-height: 40px;
    padding: 8px 32px 8px 0;
    border: 0;
    border-bottom: 1px solid var(--line-strong);
    border-radius: 0;
    background:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 8px top 55% / 5px 5px no-repeat,
        linear-gradient(-45deg, transparent 50%, var(--muted) 50%) right 3px top 55% / 5px 5px no-repeat;
    color: var(--text);
    font-size: .92rem;
    cursor: pointer;
    text-overflow: ellipsis;
}
.g-select select:focus-visible { outline: none; border-bottom-color: var(--accent); box-shadow: 0 1px 0 0 var(--accent); }
.g-select option { background: var(--surface); color: var(--text); }
.g-filters__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    min-height: 40px;
}
.g-filters__count { color: var(--muted); font-size: .68rem; white-space: nowrap; }
.g-filters__reset { font-size: .85rem; color: var(--accent); }

@media (max-width: 640px) {
    .g-filters { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; background: transparent; }
    .g-select { max-width: none; flex-basis: calc(50% - 10px); }
    .g-select:last-of-type { flex-basis: 100%; }
    .g-filters__meta { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* ---------- Masonry ızgara ---------- */
/* Sütun sayısı CSS ile; kart yüksekliği gallery-core.js içinde 4px'lik satırlarla hesaplanır (okuma sırası korunur). */
.g-grid {
    --g-gap: clamp(14px, 1.8vw, 26px);
    display: grid;
    grid-template-columns: repeat(var(--g-cols, 2), minmax(0, 1fr));
    grid-auto-rows: 4px;
    column-gap: var(--g-gap);
    align-items: start;
}
@media (min-width: 720px) { .g-grid { --g-cols: 3; } }
@media (min-width: 1200px) { .g-grid { --g-cols: 4; } }
@media (max-width: 380px) { .g-grid { --g-cols: 1; } }

.g-card { position: relative; min-width: 0; }
.g-card__open {
    display: block;
    width: 100%;
    padding: 0;
    text-align: left;
    border-radius: var(--radius);
    perspective: 900px;
}
.g-card__frame { display: block; overflow: visible; background: transparent; }
.g-card__media {
    display: block;
    aspect-ratio: var(--ratio, 4 / 5);
    border-radius: var(--radius);
    background: var(--surface);
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transform-style: preserve-3d;
    transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.g-card__media .photo-card__img {
    display: block;
    transform: scale(1.06) translate3d(var(--px, 0), var(--py, 0), 0);
    transition: transform .9s var(--ease), filter .6s var(--ease);
}
.g-card__open:hover .g-card__media,
.g-card__open:focus-visible .g-card__media {
    box-shadow: 0 24px 50px -24px color-mix(in srgb, #000 80%, transparent), 0 0 0 1px var(--line-strong);
}
.g-card__open:hover .photo-card__img { transform: scale(1.1) translate3d(var(--px, 0), var(--py, 0), 0); }
/* Köşe işaretleri hover'da */
.g-card__open::after {
    --c: var(--accent);
    --s: 16px;
    --w: 2px;
    content: "";
    position: absolute;
    inset: -7px;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    background:
        linear-gradient(var(--c), var(--c)) top left / var(--s) var(--w) no-repeat,
        linear-gradient(var(--c), var(--c)) top left / var(--w) var(--s) no-repeat,
        linear-gradient(var(--c), var(--c)) top right / var(--s) var(--w) no-repeat,
        linear-gradient(var(--c), var(--c)) top right / var(--w) var(--s) no-repeat,
        linear-gradient(var(--c), var(--c)) bottom left / var(--s) var(--w) no-repeat,
        linear-gradient(var(--c), var(--c)) bottom left / var(--w) var(--s) no-repeat,
        linear-gradient(var(--c), var(--c)) bottom right / var(--s) var(--w) no-repeat,
        linear-gradient(var(--c), var(--c)) bottom right / var(--w) var(--s) no-repeat;
    transition: opacity .4s var(--ease), inset .5s var(--ease);
}
.g-card__open { position: relative; }
.g-card__open:hover::after, .g-card__open:focus-visible::after { opacity: 1; inset: -4px; }
.g-card__open:focus-visible { outline: none; }

/* Film şeridi: üst ve alt delik sırası */
.g-band {
    padding: 22px 12px 16px;
    background:
        repeating-linear-gradient(90deg, rgba(242, 241, 237, .55) 0 6px, transparent 6px 14px) left 0 top 8px / 100% 3px no-repeat,
        repeating-linear-gradient(90deg, rgba(242, 241, 237, .55) 0 6px, transparent 6px 14px) left 0 bottom 5px / 100% 3px no-repeat,
        linear-gradient(180deg, transparent, rgba(0, 0, 0, .8) 40%);
}

.g-card__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 2px 0;
}
.g-card__info { display: grid; min-width: 0; }
.g-card__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
    min-width: 0;
}
.g-card__cat { font-size: .6rem; color: var(--muted); }

/* ---------- Beğeni (kalp) ---------- */
.g-like {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    min-width: 44px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: var(--btn-radius);
    color: var(--text-soft);
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
    transition: border-color .3s var(--ease), color .3s var(--ease), background-color .3s var(--ease);
}
.g-like:hover { border-color: var(--accent); color: var(--text); }
.g-like__icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    transition: fill .3s var(--ease), stroke .3s var(--ease), transform .3s var(--ease);
}
.g-like[aria-pressed="true"] { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.g-like[aria-pressed="true"] .g-like__icon { fill: var(--accent); stroke: var(--accent); }
.g-like__burst {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 18px; height: 18px;
    margin-top: -9px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}
.g-like.is-popping .g-like__icon { animation: heart-pop .6s var(--ease); }
.g-like.is-popping .g-like__burst { animation: heart-burst .7s var(--ease) forwards; }
@keyframes heart-pop {
    0% { transform: scale(1); }
    25% { transform: scale(1.45); }
    45% { transform: scale(.88); }
    65% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
@keyframes heart-burst {
    0% { opacity: .9; box-shadow: 0 0 0 0 var(--accent), 0 -6px 0 -4px var(--accent), 6px 0 0 -4px var(--accent), 0 6px 0 -4px var(--accent), -6px 0 0 -4px var(--accent); }
    100% { opacity: 0; box-shadow: 0 0 0 14px transparent, 0 -20px 0 -4px transparent, 20px 0 0 -4px transparent, 0 20px 0 -4px transparent, -20px 0 0 -4px transparent; }
}
.g-like--lg { min-height: 44px; padding: 8px 18px; font-size: .9rem; }

/* ---------- Boş durum, alt kısım ---------- */
.g-empty { display: grid; justify-items: center; gap: 10px; padding-block: 56px; }
.g-empty__mark { color: var(--accent); font-size: .7rem; }
.g-empty__title { color: var(--text); font-weight: 700; font-size: 1.15rem; }
.g-empty p { max-width: 520px; }
.g-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: clamp(32px, 4vw, 56px);
    min-height: 44px;
}
.g-foot .spinner { color: var(--accent); width: 24px; height: 24px; }
.g-sentinel { height: 1px; }
.g-missing__cta { margin-top: 32px; }

/* ---------- Albüm başlığı ---------- */
.g-album-hero__grid {
    display: grid;
    gap: clamp(36px, 5vw, 72px);
    align-items: end;
}
@media (min-width: 900px) {
    .g-album-hero__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
}
.g-album-hero__text { min-width: 0; }
.g-album-hero .page-hero__title { overflow-wrap: anywhere; }
.g-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    color: var(--muted);
    font-size: .68rem;
    transition: color .3s var(--ease);
}
.g-back:hover { color: var(--text); }
.g-back svg { transition: transform .35s var(--ease); }
.g-back:hover svg { transform: translateX(-4px); }
.g-album-hero__cover { margin: 0; }
.g-album-hero__media {
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    background: var(--surface);
}
.g-album-hero__media img { width: 100%; height: 115%; object-fit: cover; margin-top: -7.5%; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 2000; }
.lightbox__backdrop { z-index: 0; }
.lightbox.is-closing { pointer-events: none; }
.lightbox__dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    height: 100%;
}
.lightbox__stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 0;
    padding: clamp(48px, 6vw, 72px) clamp(56px, 7vw, 96px);
    touch-action: none;
}
/* Boyut gallery-core.js'te hesaplanır (width/height); geçişler yalnızca transform/opacity */
.lightbox__figure {
    position: relative;
    margin: 0;
    display: grid;
    place-items: center;
    color: var(--accent);
    transform-origin: 50% 50%;
    backface-visibility: hidden;
}
.lightbox__ph, .lightbox__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}
.lightbox__ph { background: var(--surface); box-shadow: 0 30px 80px -30px #000; }
.lightbox__img { opacity: 0; }
.lightbox__img.is-ready { opacity: 1; transition: opacity .3s var(--ease); }
.lightbox__img:not([src]) { visibility: hidden; }
.lightbox__spinner { position: absolute; z-index: 1; color: var(--text); opacity: 0; transition: opacity .2s; }
.lightbox.is-loading .lightbox__spinner { opacity: 1; transition-delay: .5s; }
.lightbox__corner {
    position: absolute;
    width: clamp(26px, 3vw, 40px);
    height: clamp(26px, 3vw, 40px);
    z-index: 2;
    pointer-events: none;
}
.lightbox__corner svg { width: 100%; height: 100%; }
.lightbox__corner--tl { top: -16px; left: -16px; }
.lightbox__corner--tr { top: -16px; right: -16px; transform: scaleX(-1); }
.lightbox__corner--bl { bottom: -16px; left: -16px; transform: scaleY(-1); }
.lightbox__corner--br { bottom: -16px; right: -16px; transform: scale(-1, -1); }
.lightbox__nav {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 48px; height: 48px;
    margin-top: -24px;
    border: 1px solid color-mix(in srgb, #F2F1ED 25%, transparent);
    border-radius: 50%;
    color: #F2F1ED;
    background: color-mix(in srgb, #000 40%, transparent);
    transition: border-color .3s var(--ease), background-color .3s var(--ease), opacity .3s;
}
.lightbox__nav:hover:not(:disabled) { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.lightbox__nav:disabled { opacity: .25; cursor: default; }
.lightbox__nav--prev { left: clamp(6px, 1.5vw, 24px); }
.lightbox__nav--next { right: clamp(6px, 1.5vw, 24px); }
.lightbox__info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: clamp(64px, 8vw, 96px) clamp(20px, 2.5vw, 32px) 32px;
    background: var(--surface);
    border-left: 1px solid var(--line);
    color: var(--text);
    overflow-y: auto;
}
.lightbox__pos { color: var(--accent); font-size: .68rem; }
.lightbox__title {
    font-size: clamp(1.5rem, 2.4vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.05;
    overflow-wrap: anywhere;
}
.lightbox__by { display: grid; gap: 4px; }
.lightbox__by .mono { font-size: .62rem; }
.lightbox__by b { font-size: 1.05rem; font-weight: 600; overflow-wrap: anywhere; }
.lightbox__meta { display: grid; gap: 12px; padding-block: 16px; border-block: 1px solid var(--line); }
.lightbox__meta > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.lightbox__meta dt { font-size: .6rem; color: var(--muted); }
.lightbox__meta dd { font-size: .92rem; overflow-wrap: anywhere; }
.lightbox__meta a { color: var(--text); }
.lightbox__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    width: 44px; height: 44px;
    background: var(--surface);
}
.lightbox-open .site-header { visibility: hidden; }

@media (max-width: 860px) {
    .lightbox__dialog {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
    }
    .lightbox__stage { padding: 64px 20px 76px; }
    .lightbox__corner { width: 22px; height: 22px; }
    .lightbox__corner--tl, .lightbox__corner--tr { top: -10px; }
    .lightbox__corner--bl, .lightbox__corner--br { bottom: -10px; }
    .lightbox__corner--tl, .lightbox__corner--bl { left: -10px; }
    .lightbox__corner--tr, .lightbox__corner--br { right: -10px; }
    .lightbox__nav { top: auto; bottom: 12px; margin-top: 0; width: 44px; height: 44px; }
    .lightbox__info {
        max-height: 44dvh;
        padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
        border-left: 0;
        border-top: 1px solid var(--line);
        gap: 12px;
    }
    .lightbox__title { font-size: 1.3rem; }
    .lightbox__meta { padding-block: 10px; gap: 8px; }
    .lightbox__actions { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox__img.is-ready { transition: none; }
    .g-card__media, .g-card__media .photo-card__img { transform: none !important; }
    .g-hero__dot { animation: none; }
}
