/* ==========================================================================
   SELİM İLHAN — 570 YILLIK ÇORUM SOY AĞACI & OSMANLI ARŞİVİ
   Editorial Ottoman-Archival Tasarım Sistemi (Açık Parşömen + Gece Arşivi)
   ========================================================================== */

:root {
  --bg: #f6f1e7;
  --bg-subtle: #eee6d6;
  --surface: #fffdf8;
  --surface-elev: #ffffff;
  --ink: #1b222a;
  --ink-muted: #525d68;
  --ink-soft: #75808b;
  --border: rgba(27, 34, 42, 0.11);
  --border-strong: rgba(27, 34, 42, 0.22);

  --crimson: #8c2d19;
  --crimson-soft: rgba(140, 45, 25, 0.11);
  --gold: #b58938;
  --gold-soft: rgba(181, 137, 56, 0.15);
  --teal: #1e4d45;
  --teal-soft: rgba(30, 77, 69, 0.12);
  --slate: #2f506e;
  --slate-soft: rgba(47, 80, 110, 0.12);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 10px rgba(27, 34, 42, 0.05);
  --shadow-md: 0 10px 30px rgba(27, 34, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 20, 26, 0.18);

  --font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --header-h: 68px;
  --transition: 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0f1318;
  --bg-subtle: #161c24;
  --surface: #181f28;
  --surface-elev: #1f2732;
  --ink: #f0ebe1;
  --ink-muted: #aeb7c2;
  --ink-soft: #7f8a97;
  --border: rgba(240, 235, 225, 0.1);
  --border-strong: rgba(240, 235, 225, 0.22);

  --crimson: #e06d53;
  --crimson-soft: rgba(224, 109, 83, 0.16);
  --gold: #d9ae5b;
  --gold-soft: rgba(217, 174, 91, 0.17);
  --teal: #4ca899;
  --teal-soft: rgba(76, 168, 153, 0.15);
  --slate: #76a5d1;
  --slate-soft: rgba(118, 165, 209, 0.15);

  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.65);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 80% 50% at 10% 0%, var(--gold-soft), transparent 60%),
    radial-gradient(ellipse 60% 45% at 95% 10%, var(--crimson-soft), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ==================== TOP NAVIGATION ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(12px, 2vw, 24px);
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-crest {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--crimson), #5c190d);
  color: #f9ebd2;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(140, 45, 25, 0.28);
  border: 1px solid rgba(217, 174, 91, 0.45);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-family: var(--font-display); font-weight: 700; font-size: 1.22rem; letter-spacing: 0.01em; }
.brand-sub { font-size: 0.72rem; color: var(--ink-muted); letter-spacing: 0.06em; text-transform: uppercase; }

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px;
  background: var(--bg-subtle);
  border-radius: 999px;
  border: 1px solid var(--border);
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-tab:hover { color: var(--ink); }
.nav-tab.active {
  background: var(--surface-elev);
  color: var(--crimson);
  box-shadow: var(--shadow-sm);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}
.icon-btn:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.kbd {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--ink-muted);
  border: 1px solid var(--border);
}

/* ==================== MAIN CONTAINER & VIEWS ==================== */
.main-wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px clamp(14px, 3vw, 34px) 72px;
}

.view-panel { display: none; animation: fadeUp 0.32s ease; }
.view-panel.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== HERO & OVERVIEW ==================== */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1d2630 0%, #2b1a17 55%, #19302c 100%);
  color: #f9f3e7;
  padding: clamp(28px, 5vw, 56px);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(217, 174, 91, 0.32);
  margin-bottom: 28px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 82% 24%, rgba(217, 174, 91, 0.2), transparent 42%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 18px);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; max-width: 920px; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(217, 174, 91, 0.16);
  border: 1px solid rgba(217, 174, 91, 0.42);
  color: #f3d28f;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.hero h1 span { color: #e8c47a; font-style: italic; }

.hero-desc {
  font-size: clamp(0.95rem, 1.3vw, 1.08rem);
  color: rgba(249, 243, 231, 0.84);
  margin: 0 0 24px;
  max-width: 780px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.btn-primary, .btn-ghost {
  border-radius: 999px;
  padding: 11px 20px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, #c99a44, #a87725);
  color: #16110a;
  border: none;
  box-shadow: 0 6px 20px rgba(201, 154, 68, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.07); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.09);
  color: #f9f3e7;
  border: 1px solid rgba(255, 255, 255, 0.24);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.17); transform: translateY(-1px); }

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  backdrop-filter: blur(8px);
}
.stat-val {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: #f0ce84;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 0.82rem; font-weight: 600; margin-top: 5px; color: #fff; }
.stat-sub { font-size: 0.72rem; color: rgba(249, 243, 231, 0.65); margin-top: 2px; }

/* ==================== SECTION HEADERS & CARDS ==================== */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
}
.section-head p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
  max-width: 720px;
}

.branches-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}
@media (max-width: 760px) {
  .branches-grid { grid-template-columns: 1fr; }
}

.branch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent, var(--crimson));
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.branch-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.branch-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge-mono { font-family: var(--font-mono); font-size: 0.72rem; }

.branch-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.2;
}
.branch-meta {
  font-size: 0.83rem;
  color: var(--ink-muted);
  display: grid;
  gap: 5px;
}
.branch-meta strong { color: var(--ink); }
.branch-card p { margin: 4px 0 0; font-size: 0.87rem; color: var(--ink-muted); }

/* Callout / Methodological Banner */
.notice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}
.notice-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.notice-box.teal { border-left-color: var(--teal); }
.notice-box h4 {
  margin: 0 0 6px;
  font-size: 0.96rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notice-box p { margin: 0; font-size: 0.86rem; color: var(--ink-muted); }

/* ==================== INTERACTIVE TREE WORKSPACE ==================== */
.tree-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 0.79rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
}
.pill:hover { color: var(--ink); border-color: var(--border-strong); }
.pill.active {
  background: var(--crimson);
  color: #fff;
  border-color: var(--crimson);
}

.tree-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.tree-stage-wrap {
  position: relative;
  width: 100%;
  height: clamp(540px, 72vh, 780px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background-image:
    radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0);
  background-size: 24px 24px;
}

#treeSvg {
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
#treeSvg:active { cursor: grabbing; }

.tree-node { cursor: pointer; transition: opacity 0.25s ease; }
.tree-node.dimmed { opacity: 0.18; }
.tree-node rect.node-bg {
  fill: var(--surface-elev);
  stroke-width: 1.8;
  rx: 12;
  transition: filter 0.2s ease, stroke-width 0.2s ease;
}
.tree-node:hover rect.node-bg { filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.16)); stroke-width: 2.6; }
.tree-node.selected rect.node-bg { stroke-width: 3.2; filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }

.tree-edge { fill: none; stroke-width: 2; opacity: 0.55; transition: opacity 0.25s ease; }
.tree-edge.dimmed { opacity: 0.08; }
.tree-edge.cousin-arc { stroke: var(--gold); stroke-width: 2.4; stroke-dasharray: 6 4; opacity: 0.9; }

.tree-legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  pointer-events: none;
}
.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.tree-hint {
  position: absolute;
  right: 14px;
  bottom: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.74rem;
  color: var(--ink-muted);
  pointer-events: none;
}

/* Directory Card Grid (Toggleable inside Soy Ağacı) */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--crimson);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition);
}
.person-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.person-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.person-card h4 { margin: 0 0 4px; font-size: 1rem; }
.person-card .p-sub { font-size: 0.8rem; color: var(--ink-muted); }

/* ==================== VILLAGES & INTERACTIVE MAP ==================== */
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.map-panel, .village-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.map-svg-wrap {
  width: 100%;
  aspect-ratio: 640 / 470;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-subtle) 70%, transparent), var(--bg));
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.map-marker { cursor: pointer; transition: transform 0.2s ease; transform-box: fill-box; transform-origin: center; }
.map-marker:hover { transform: scale(1.14); }
.map-marker.active circle.ring { stroke-width: 3.5; }

.village-detail h3 {
  margin: 4px 0 6px;
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1.15;
}
.v-ottoman {
  font-size: 0.84rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 14px;
}
.v-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.v-kpi {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}
.v-kpi .val { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; color: var(--crimson); }
.v-kpi .lbl { font-size: 0.72rem; color: var(--ink-muted); }

.v-list { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: 0.87rem; color: var(--ink-muted); }
.v-list li strong { color: var(--ink); }

/* Population Chart Card */
.chart-card {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.pop-bars { display: grid; gap: 16px; margin-top: 14px; }
.pop-row { display: grid; grid-template-columns: 155px 1fr; gap: 14px; align-items: center; }
.pop-row-name { font-weight: 700; font-size: 0.88rem; }
.pop-tracks { display: grid; gap: 5px; }
.pop-track { display: grid; grid-template-columns: 44px 1fr 48px; align-items: center; gap: 8px; font-size: 0.74rem; color: var(--ink-muted); }
.pop-bar-bg { height: 9px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden; }
.pop-bar-fill { height: 100%; border-radius: 999px; transition: width 0.55s ease; }

/* ==================== TIMELINE & VAKIF CHAINS ==================== */
.vakif-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.vakif-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.vakif-card h4 { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.25rem; }
.vakif-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0;
}
.year-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
}
.vakif-card p { margin: 0; font-size: 0.82rem; color: var(--ink-muted); }

.timeline-list {
  position: relative;
  padding-left: 28px;
  display: grid;
  gap: 16px;
}
.timeline-list::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold), var(--crimson), var(--teal));
  border-radius: 2px;
}
.tl-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.tl-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--crimson);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--gold);
}
.tl-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.tl-year { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--crimson); }
.tl-date { font-size: 0.8rem; color: var(--ink-soft); }
.tl-item h4 { margin: 0 0 6px; font-size: 1.02rem; }
.tl-item p { margin: 0; font-size: 0.87rem; color: var(--ink-muted); }

/* ==================== ARCHIVAL DOCUMENT GALLERY ==================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.exhibit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.exhibit-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.exhibit-thumb {
  position: relative;
  height: 215px;
  background: #14171c;
  overflow: hidden;
}
.exhibit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.45s ease;
}
.exhibit-card:hover .exhibit-thumb img { transform: scale(1.05); }
.exhibit-year-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(18, 22, 27, 0.84);
  color: #f2cf84;
  border: 1px solid rgba(217, 174, 91, 0.45);
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
}
.exhibit-village-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(30, 77, 69, 0.88);
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.exhibit-body { padding: 15px 17px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.exhibit-code { font-family: var(--font-mono); font-size: 0.73rem; color: var(--gold); font-weight: 600; }
.exhibit-body h4 { margin: 0; font-size: 0.98rem; line-height: 1.3; }
.exhibit-body p { margin: 0; font-size: 0.82rem; color: var(--ink-muted); }

/* ==================== LAKAPS & ARCHIVES TABLE ==================== */
.lakap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}
.lakap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.lakap-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lakap-card h4 { margin: 0; font-family: var(--font-display); font-size: 1.3rem; color: var(--crimson); }
.lakap-ott { font-size: 1.05rem; color: var(--gold); direction: rtl; font-weight: 600; }
.lakap-meta { font-size: 0.76rem; color: var(--teal); font-weight: 600; margin: 4px 0 8px; }
.lakap-card p { margin: 0; font-size: 0.84rem; color: var(--ink-muted); }

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}
.search-input {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  min-width: 240px;
  outline: none;
}
.search-input:focus { border-color: var(--crimson); }

.table-scroll { overflow-x: auto; }
table.arch-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.arch-table th, .arch-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.arch-table th {
  background: var(--bg-subtle);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}
.arch-table tr:hover td { background: color-mix(in srgb, var(--gold-soft) 35%, transparent); }
.status-ok { color: var(--teal); font-weight: 700; }
.status-ctrl { color: var(--ink-soft); font-weight: 600; }

/* ==================== PERSON INSPECTOR DRAWER ==================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 16, 22, 0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.inspector-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(460px, 94vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 210;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}
.inspector-drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.drawer-header h3 { margin: 6px 0 0; font-family: var(--font-display); font-size: 1.65rem; line-height: 1.15; }
.close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}
.close-btn:hover { background: var(--crimson); color: #fff; border-color: var(--crimson); }

.drawer-body {
  padding: 18px 22px 28px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  align-content: start;
}
.info-block {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.info-block .lbl {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.info-block .val { font-size: 0.88rem; color: var(--ink); }
.rel-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rel-chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.rel-chip:hover { border-color: var(--crimson); color: var(--crimson); }

/* ==================== LIGHTBOX MODAL ==================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 13, 18, 0.9);
  backdrop-filter: blur(8px);
  display: none;
  grid-template-columns: 1fr 370px;
  gap: 0;
}
.lightbox.open { display: grid; }

.lb-stage {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 24px;
  cursor: grab;
}
.lb-stage:active { cursor: grabbing; }
.lb-stage img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  transition: transform 0.18s ease-out;
  user-select: none;
  pointer-events: none;
}
.lb-controls {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: rgba(20, 25, 32, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 12px;
  border-radius: 999px;
}
.lb-controls button {
  background: transparent;
  color: #f8f2e6;
  border: none;
  padding: 5px 10px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.lb-controls button:hover { background: rgba(255, 255, 255, 0.15); }

.lb-side {
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lb-side h3 { margin: 0; font-family: var(--font-display); font-size: 1.55rem; line-height: 1.2; }

/* ==================== GLOBAL SEARCH MODAL ==================== */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 280;
  background: rgba(12, 16, 22, 0.65);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.search-modal.open { display: flex; }
.search-box {
  width: min(640px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-box-head {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.search-box-head input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
}
.search-results { max-height: 58vh; overflow-y: auto; padding: 8px; }
.sr-item {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.sr-item:hover { background: var(--bg-subtle); }
.sr-item strong { font-size: 0.9rem; display: block; }
.sr-item span { font-size: 0.77rem; color: var(--ink-muted); }

/* ==================== FOOTER ==================== */
.site-footer {
  margin-top: 56px;
  padding: 26px clamp(14px, 3vw, 34px);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 960px) {
  .map-layout { grid-template-columns: 1fr; }
  .lightbox.open { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lb-side { max-height: 40vh; border-left: none; border-top: 1px solid var(--border); }
  .brand-sub, .kbd { display: none; }
}
@media (max-width: 680px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; }
  .nav-tabs { order: 3; width: 100%; }
  .pop-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ==================== PRINT / PDF KİTAPÇIK MODU ==================== */
@media print {
  .topbar, .hero-cta-row, .tree-toolbar, .tree-hint, .topbar-actions, .lightbox, .drawer-backdrop, .inspector-drawer, .search-modal { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
  .view-panel { display: block !important; page-break-after: always; }
  .hero { background: #1d2630 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
