/* ═══════════════════════════════════════════════
   ZYPERN ARCHÄOLOGISCHER READER — Design System
   ═══════════════════════════════════════════════ */

:root {
  /* Color palette */
  --bg-primary: #0c0f14;
  --bg-secondary: #141820;
  --bg-card: #1a1f2e;
  --bg-elevated: #222840;
  --text-primary: #e8e6e1;
  --text-secondary: #9b978f;
  --text-muted: #6b6760;
  --accent: #c8a45c;
  --accent-glow: #c8a45c33;
  --accent-hover: #dbb96e;
  --border: #2a2f3e;
  --border-light: #353b4e;
  
  /* Epoch colors */
  --epoch-neolithic: #7fb069;
  --epoch-bronze: #cd8a3e;
  --epoch-iron: #b85c5c;
  --epoch-classical: #5c8db8;
  --epoch-roman: #9b5cb8;
  --epoch-byzantine: #b8965c;
  --epoch-medieval: #5cb89b;
  
  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Spacing */
  --nav-height: 60px;
  --section-pad: clamp(2rem, 5vw, 5rem);
  --radius: 10px;
  --radius-lg: 16px;
  
  /* Transitions */
  --ease: cubic-bezier(.4,0,.2,1);
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #f5f2ec;
  --bg-secondary: #ebe7df;
  --bg-card: #ffffff;
  --bg-elevated: #f9f7f3;
  --text-primary: #1a1612;
  --text-secondary: #5a5650;
  --text-muted: #8a8680;
  --accent: #9a7b3a;
  --accent-glow: #9a7b3a22;
  --accent-hover: #b8943e;
  --border: #d5d0c8;
  --border-light: #e2ded6;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #0c0f14 0%, #1a1f2e 50%, #222840 100%);
  overflow: hidden;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, var(--accent-glow) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, #5c8db822 0%, transparent 50%);
  animation: heroPulse 8s ease-in-out infinite alternate;
}
@keyframes heroPulse {
  0% { opacity: .6; } 100% { opacity: 1; }
}
.hero-content { position: relative; z-index: 2; max-width: 720px; padding: 2rem; }
.hero-subtitle {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.8;
}
.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  font-size: .9rem;
  color: var(--text-muted);
}
.hero-stat strong { color: var(--accent); }
.hero-divider { color: var(--border-light); }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .9rem 2.2rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  transition: all .3s var(--ease);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 0 30px var(--accent-glow);
}

/* ── Navigation ── */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  padding: 0 1.5rem;
  background: color-mix(in srgb, var(--bg-primary) 85%, transparent);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  transition: background .3s var(--ease);
}
.nav-brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: 1rem; }
.nav-icon { font-size: 1.3rem; }
.nav-links { display: flex; gap: .2rem; }
.nav-link {
  padding: .45rem 1rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .25s var(--ease);
}
.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
}
.btn-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all .25s var(--ease);
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); }

/* ── Sections ── */
.section { padding: var(--section-pad) 1.5rem; max-width: 1400px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: .75rem;
}
.section-subtitle { color: var(--text-secondary); font-size: 1rem; max-width: 640px; margin: 0 auto; }

/* ── Map ── */
.map-container {
  position: relative;
  display: flex;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  height: 600px;
}
.map { flex: 1; min-height: 100%; z-index: 1; }
.itinere-frame {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  z-index: 5;
  border: none;
  border-radius: var(--radius-lg);
}
.itinere-frame.hidden { display: none; }
.btn-itinere {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 15;
  padding: .45rem .85rem;
  border-radius: 8px;
  border: 1px solid rgba(70,130,180,.35);
  background: rgba(15,20,30,.85);
  backdrop-filter: blur(8px);
  color: #7ab4d6;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  letter-spacing: .3px;
}
.btn-itinere:hover {
  background: rgba(70,130,180,.25);
  color: #a4d0ea;
  transform: translateY(-1px);
}
.btn-itinere.active {
  background: rgba(70,130,180,.3);
  color: #fff;
  border-color: rgba(70,130,180,.6);
}

/* Pleiades inline symbol */
.pleiades-inline {
  display: inline;
  font-size: .65rem;
  color: rgba(196,149,106,.6);
  text-decoration: none;
  margin-left: 1px;
  vertical-align: super;
  transition: color .2s;
  line-height: 1;
}
.pleiades-inline:hover {
  color: #e0b88a;
}
.map-sidebar {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 380px;
  background: color-mix(in srgb, var(--bg-card) 95%, transparent);
  backdrop-filter: blur(15px);
  border-left: 1px solid var(--border);
  z-index: 10;
  overflow-y: auto;
  padding: 1.5rem;
  transform: translateX(0);
  transition: transform .4s var(--ease);
}
.map-sidebar.collapsed { transform: translateX(100%); }
.sidebar-close {
  position: absolute; top: .75rem; right: .75rem;
  width: 32px; height: 32px;
  border: none; background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-close:hover { color: var(--accent); }
.sidebar-site-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: .5rem;
  padding-right: 2rem;
}
.sidebar-epoch-badge {
  display: inline-block;
  padding: .2rem .7rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}
.sidebar-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: 1rem;
}
.sidebar-photo-wrap {
  position: relative;
}
.sidebar-photo {
  border-radius: 8px;
  cursor: pointer;
  aspect-ratio: 4/3;
  object-fit: cover;
  border: 1px solid var(--border);
  transition: transform .2s var(--ease), border-color .2s;
}
.sidebar-photo:hover { transform: scale(1.03); border-color: var(--accent); }
.sidebar-desc { font-size: .9rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 1rem; }
.sidebar-refs { font-size: .8rem; color: var(--text-muted); }
.sidebar-refs strong { color: var(--text-secondary); }
.sidebar-btn {
  display: block;
  width: 100%;
  padding: .65rem;
  margin-top: 1rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: .85rem;
  font-weight: 500;
  transition: all .25s var(--ease);
}
.sidebar-btn:hover { background: var(--accent); color: var(--bg-primary); }

/* Epoch filter bar */
.epoch-filter {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.filter-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-right: .5rem; }
.epoch-btn {
  padding: .35rem .9rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all .25s var(--ease);
}
.epoch-btn:hover { border-color: var(--accent); color: var(--accent); }
.epoch-btn.active { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); }

/* ── Timeline ── */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding-left: 3rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}
.timeline-item {
  position: relative;
  padding: 1.5rem 0 2.5rem 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all .5s var(--ease);
}
.timeline-item.visible { opacity: 1; transform: none; }
.timeline-dot {
  position: absolute;
  left: -2.45rem;
  top: 1.7rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  z-index: 2;
}
.timeline-date {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .4rem;
}
.timeline-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.timeline-body {
  font-size: .92rem;
  color: var(--text-secondary);
  line-height: 1.8;
}
.timeline-sites {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}
.timeline-site-tag {
  padding: .2rem .6rem;
  border-radius: 15px;
  font-size: .72rem;
  font-weight: 500;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.timeline-site-tag:hover { border-color: var(--accent); color: var(--accent); }

/* ── Sites Grid ── */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.site-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all .35s var(--ease);
}
.site-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.site-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.site-card:hover .site-card-img { transform: scale(1.05); }
.site-card-overlay {
  position: absolute; top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to top, var(--bg-card) 0%, transparent 60%);
  pointer-events: none;
}
.site-card-body { padding: 1.2rem; }
.site-card-epoch {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 12px;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: .5rem;
}
.site-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: .4rem;
}
.site-card-desc {
  font-size: .85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.site-card-meta {
  display: flex;
  gap: .75rem;
  margin-top: .75rem;
  font-size: .78rem;
  color: var(--text-muted);
}

/* ── Site Detail Panel ── */
.site-detail {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  transition: opacity .3s var(--ease);
}
.site-detail.hidden { opacity: 0; pointer-events: none; }
.detail-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}
.detail-panel {
  position: relative;
  width: min(800px, 90vw);
  background: var(--bg-secondary);
  overflow-y: auto;
  padding: 2.5rem;
  z-index: 2;
  transform: translateX(0);
  transition: transform .4s var(--ease);
}
.site-detail.hidden .detail-panel { transform: translateX(100%); }
.detail-close {
  position: fixed;
  top: 1rem; right: min(810px, calc(90vw + 10px));
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
}
.detail-close:hover { color: var(--accent); }
.detail-header-img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}
.detail-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.detail-meta {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
  font-size: .85rem;
  color: var(--text-muted);
}
.detail-meta span { display: flex; align-items: center; gap: .3rem; }
.detail-body { font-size: .95rem; line-height: 1.9; color: var(--text-secondary); }
.detail-body h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2rem 0 .75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.detail-body p { margin-bottom: 1rem; }
.detail-epoch-badges { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.detail-body .cite {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent);
  cursor: help;
}
/* Cross-links */
.site-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color .2s;
}
.site-link:hover { color: var(--accent-hover); text-decoration-style: solid; }
/* Epoch-specific sections */
.epoch-detail-section {
  margin: 1.2rem 0;
  padding: 1rem 1.2rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}
.epoch-detail-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .6rem;
}
.epoch-detail-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.epoch-detail-badge {
  padding: .15rem .5rem;
  border-radius: 12px;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.epoch-detail-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.epoch-detail-body {
  font-size: .9rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* External links (Pleiades, itiner-e) */
.detail-ext-links {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin: .75rem 1.5rem 0;
}
.ext-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s ease;
  letter-spacing: .3px;
}
.pleiades-link {
  background: rgba(139,90,43,.12);
  color: #c4956a;
  border: 1px solid rgba(139,90,43,.25);
}
.pleiades-link:hover {
  background: rgba(139,90,43,.25);
  color: #e0b88a;
  transform: translateY(-1px);
}
.itinere-link {
  background: rgba(70,130,180,.12);
  color: #7ab4d6;
  border: 1px solid rgba(70,130,180,.25);
}
.itinere-link:hover {
  background: rgba(70,130,180,.25);
  color: #a4d0ea;
  transform: translateY(-1px);
}

/* Quickfacts box */
.quickfacts-box {
  background: linear-gradient(135deg, rgba(212,175,55,.08), rgba(212,175,55,.03));
  border: 1px solid rgba(212,175,55,.2);
  border-left: 3px solid rgba(212,175,55,.5);
  border-radius: 8px;
  padding: .9rem 1.1rem;
  margin-bottom: 1.2rem;
}
.quickfacts-header {
  font-family: var(--font-serif);
  font-size: .9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: .5rem;
  letter-spacing: .3px;
}
.quickfacts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.quickfacts-list li {
  font-size: .82rem;
  line-height: 1.5;
  color: var(--text-secondary);
  padding-left: 1.1rem;
  position: relative;
}
.quickfacts-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: .7rem;
  top: .15rem;
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
  margin: 1.5rem 0;
}
.gallery-item {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.detail-gallery img {
  border-radius: 8px;
  aspect-ratio: 4/3;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: border-color .2s, transform .25s var(--ease), box-shadow .25s;
  width: 100%;
}
.detail-gallery img:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.gallery-caption {
  font-size: .72rem;
  line-height: 1.4;
  color: var(--text-muted);
  padding: .2rem .3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: help;
  transition: all .25s ease;
  border-radius: 4px;
}
.gallery-item:hover .gallery-caption {
  -webkit-line-clamp: unset;
  display: block;
  background: var(--bg-card);
  color: var(--text-secondary);
}
/* Sidebar photo hover */
.sidebar-photo {
  position: relative;
  z-index: 1;
}
.sidebar-photo:hover {
  transform: scale(2) !important;
  z-index: 100;
  box-shadow: 0 8px 40px rgba(0,0,0,.6), 0 0 0 2px var(--accent);
}
/* Floating image preview */
.img-preview {
  position: fixed;
  z-index: 2500;
  max-width: 420px;
  max-height: 70vh;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(200,164,92,.2);
  padding: 4px;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  opacity: 1;
  transform: scale(1);
}
.img-preview.hidden {
  opacity: 0;
  transform: scale(.9);
  pointer-events: none;
}
.img-preview img {
  width: 100%;
  max-height: calc(70vh - 8px);
  object-fit: contain;
  border-radius: calc(var(--radius-lg) - 2px);
}
/* Ancient source links */
.source-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  padding-bottom: 1px;
  transition: color .2s, border-color .2s;
  font-family: var(--font-mono);
  font-size: .85em;
}
.source-link:hover {
  color: var(--accent-hover);
  border-bottom-style: solid;
}
.detail-refs {
  margin-top: 2rem;
  padding: 1.2rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.detail-refs h4 {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: .75rem;
}
.detail-ref-item {
  font-size: .85rem;
  color: var(--text-secondary);
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
}
.detail-ref-item:last-child { border-bottom: none; }

/* ── Reconstruction attribution ── */
.reconstruction-container {
  position: relative;
  margin: 1rem 0 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.reconstruction-img {
  border-radius: 0 !important;
  margin-bottom: 0 !important;
}
.reconstruction-label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: .8rem 1rem;
  background: linear-gradient(135deg, #2a2210 0%, #1a1f2e 100%);
  border-top: 1px solid var(--accent);
}
[data-theme="light"] .reconstruction-label {
  background: linear-gradient(135deg, #f5ebd5 0%, #faf8f3 100%);
}
.reconstruction-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  background: var(--accent);
  color: var(--bg-primary);
  width: fit-content;
}
.reconstruction-caption {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-style: italic;
}

/* ── Bibliography ── */
.bib-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.bib-search {
  flex: 1;
  min-width: 200px;
  padding: .7rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: .9rem;
}
.bib-search:focus { outline: none; border-color: var(--accent); }
.bib-sort { display: flex; gap: .3rem; }
.bib-sort-btn {
  padding: .4rem .8rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: .8rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all .2s var(--ease);
}
.bib-sort-btn.active { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); }
.bibliography { max-width: 900px; margin: 0 auto; }
.bib-entry {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  transition: color .2s;
}
.bib-entry:hover { color: var(--text-primary); }
.bib-author { font-weight: 600; color: var(--text-primary); }
.bib-year { color: var(--accent); }
.bib-title-text { font-style: italic; }
.bib-tags { display: flex; gap: .3rem; margin-top: .4rem; flex-wrap: wrap; }
.bib-tag {
  font-size: .68rem;
  padding: .1rem .5rem;
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.bib-link {
  display: inline-block;
  font-size: .72rem;
  text-decoration: none;
  margin-left: .3rem;
  opacity: .4;
  transition: opacity .2s;
}
.bib-link:hover { opacity: 1; }

/* ── Lightbox ── */
.lightbox {
  position: fixed; inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .3s var(--ease);
}
.lightbox.hidden { opacity: 0; pointer-events: none; }
.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.9);
}
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}
.lightbox-close {
  position: absolute;
  top: -40px; right: 0;
  width: 36px; height: 36px;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}
.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px; height: 50px;
  border: none;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 2rem;
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: background .2s;
}
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,.25); }
.lightbox-prev { left: -70px; }
.lightbox-next { right: -70px; }
.lightbox-caption {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .85rem;
  color: #ccc;
  text-align: center;
  max-width: 70vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
}
.lb-caption-text {
  font-size: .85rem;
  color: #eee;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
  transition: all .2s ease;
  max-width: 60vw;
  line-height: 1.45;
}
.lb-caption-text.expanded {
  -webkit-line-clamp: unset;
  display: block;
}
.lb-caption-counter {
  font-size: .75rem;
  color: #888;
  font-family: var(--font-mono);
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 3rem 1.5rem;
  font-size: .85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.footer-note { margin-top: .3rem; font-size: .75rem; }
.footer-ki-info {
  margin-top: 1.2rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.footer-ki-info summary {
  cursor: pointer;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: .4rem .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  transition: all .25s var(--ease);
  text-align: center;
  margin: 0 auto;
}
.footer-ki-info summary:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.footer-ki-info[open] summary {
  border-radius: 8px 8px 0 0;
  border-bottom: none;
}
.ki-info-content {
  padding: 1rem 1.2rem;
  font-size: .78rem;
  line-height: 1.7;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  background: var(--bg-card);
  text-align: left;
}
.ki-info-content p { margin-bottom: .6rem; }
.ki-info-content p:last-child { margin-bottom: 0; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .map-container { height: 450px; }
  .map-sidebar { width: 100%; }
  .sites-grid { grid-template-columns: 1fr; }
  .detail-panel { width: 100vw; padding: 1.5rem; }
  .detail-close { right: auto; left: 1rem; }
  .lightbox-prev { left: 5px; }
  .lightbox-next { right: 5px; }
  .epoch-filter { overflow-x: auto; flex-wrap: nowrap; }
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}
.animate-in {
  animation: fadeInUp .6s var(--ease) both;
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Leaflet marker custom styles */
.custom-marker {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  cursor: pointer;
  transition: transform .2s var(--ease);
}
.custom-marker:hover { transform: scale(1.3); }
.custom-marker.pulse { animation: markerPulse 2s ease-in-out infinite; }
@keyframes markerPulse {
  0%,100% { box-shadow: 0 2px 8px rgba(0,0,0,.4); }
  50% { box-shadow: 0 2px 16px rgba(200,164,92,.6); }
}
