/* ==========================================================================
   GEFOK — Fotoğraf Haritası (harita.html)
   Küre sahnesi her temada koyu kalır (uzay); liste ve panel base.css değişkenlerini kullanır.
   ========================================================================== */

.map-hero { padding-bottom: clamp(20px, 3vw, 36px); }

.map-wrap {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 0 var(--gutter);
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin: 0 auto;
    gap: 16px;
}

/* ---------- Sahne ---------- */
.map-stage {
    position: relative;
    height: min(78vh, 760px);
    min-height: 420px;
    border-radius: 12px;
    overflow: hidden;
    background:
        radial-gradient(60% 60% at 50% 50%, #1a1a1e 0%, #0b0b0d 60%, #050506 100%);
    border: 1px solid color-mix(in srgb, #fff 8%, transparent);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    outline: none;
    color: #f2f1ed;
}
.map-stage.is-dragging { cursor: grabbing; }
.map-stage:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.map-canvas, .map-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-canvas canvas { opacity: 0; transition: opacity .8s var(--ease); }
.map-stage.is-ready .map-canvas canvas { opacity: 1; }

.map-markers { position: absolute; inset: 0; pointer-events: none; }
.map-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 54px;
    height: 54px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 7px;
    background: #222;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .55);
    cursor: pointer;
    pointer-events: auto;
    will-change: transform;
    transition: border-color .2s, box-shadow .2s, opacity .25s;
}
.map-marker img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; display: block; pointer-events: none; }
/* Birden fazla kare: arkada ikinci bir kart görünür */
.map-marker.is-stack::before {
    content: "";
    position: absolute;
    inset: -2px;
    border: 2px solid rgba(255, 255, 255, .8);
    border-radius: 7px;
    background: #3a3a3f;
    transform: translate(5px, -5px) rotate(5deg);
    z-index: -1;
}
.map-marker__badge {
    position: absolute;
    top: -9px;
    right: -11px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font: 700 .72rem/22px var(--font-sans);
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.map-marker:hover, .map-marker:focus-visible, .map-marker.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent), 0 8px 22px rgba(0, 0, 0, .6); outline: none; }
.map-marker.is-hidden { opacity: 0; pointer-events: none; visibility: hidden; }

.map-status, .map-hint {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #b8b8be;
    pointer-events: none;
    text-align: center;
    max-width: calc(100% - 32px);
}
.map-status { top: 50%; translate: 0 -50%; font-size: .85rem; text-transform: none; letter-spacing: 0; }
.map-hint { bottom: 16px; opacity: .7; }
.map-stage.has-panel .map-hint { opacity: 0; }

.map-tools {
    position: absolute;
    right: 14px;
    top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2000;
}
.map-tool {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, #fff 22%, transparent);
    background: rgba(12, 12, 14, .72);
    color: #f2f1ed;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: border-color .2s, background .2s;
}
.map-tool:hover, .map-tool:focus-visible { border-color: var(--accent); outline: none; }
.map-tool .i-play { display: none; }
.map-tool.is-paused .i-play { display: block; }
.map-tool.is-paused .i-pause { display: none; }

/* WebGL yok: sahne yerine yalnızca bilgi notu */
.map-stage.map--nogl { height: auto; min-height: 0; padding: 28px 16px; cursor: default; }
.map-stage.map--nogl .map-canvas, .map-stage.map--nogl .map-markers, .map-stage.map--nogl .map-hint, .map-stage.map--nogl .map-tools { display: none; }
.map-stage.map--nogl .map-status { position: static; transform: none; translate: none; max-width: none; }

/* ---------- Bölge paneli ---------- */
.map-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.map-panel[hidden] { display: none; }
.map-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.map-panel__head .map-tool { flex: none; background: transparent; color: var(--text); border-color: var(--line-strong); }
.map-panel__title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; outline: none; }
.map-panel__meta { margin-top: 4px; color: var(--muted); font-size: .72rem; }
.map-panel__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.map-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
    cursor: zoom-in;
}
.map-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.map-thumb:hover img, .map-thumb:focus-visible img { transform: scale(1.05); }
.map-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.map-thumb__by {
    position: absolute;
    inset: auto 0 0;
    padding: 14px 6px 5px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .75));
    color: #fff;
    font-size: .66rem;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 901px) {
    /* Masaüstü: panel sahnenin sağında, sahnenin üstünde süzülür */
    .map-panel {
        position: absolute;
        top: 16px;
        right: calc(var(--gutter) + 70px);
        bottom: 16px;
        width: min(380px, 38%);
        z-index: 2100;
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        backdrop-filter: blur(10px);
        box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
    }
}
@media (max-width: 900px) {
    .map-stage { height: 62svh; min-height: 340px; }
    .map-marker { width: 44px; height: 44px; }
    .map-panel__grid { max-height: none; }
}

/* ---------- Erişilebilir liste ---------- */
.map-list__title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.03em; }
.map-list__lead { margin-top: 6px; }
.map-list {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}
.map-list__item {
    width: 100%;
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    padding: 8px 12px 8px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color .2s;
}
.map-list__item:hover, .map-list__item:focus-visible { border-color: var(--accent); outline: none; }
.map-list__item img { grid-row: 1 / 3; width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.map-list__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-list__count { color: var(--muted); font-size: .72rem; }
.map-note { margin-top: 18px; font-size: .8rem; }
.map-note + .map-note { margin-top: 6px; font-size: .7rem; }

@media (prefers-reduced-motion: reduce) {
    .map-canvas canvas, .map-thumb img, .map-marker { transition: none; }
}
