/* ============================================
   MARKT VOOR JODEN — Design System
   Monument + Archief stijl
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
    color-scheme: dark;
    --bg-dark: #0a0a0a;
    --bg-panel: #111111;
    --bg-card: #1a1a1a;
    --bg-hover: #222222;
    --border: rgba(201,168,76,0.3);
    --border-light: rgba(255,255,255,0.08);
    --gold: #c9a84c;
    --gold-dim: #8e712b;
    --gold-bright: #e4c066;
    --brass-gradient: linear-gradient(135deg, #8E712B 0%, #C9A84C 50%, #E4C066 100%);
    --text: #d4c5a9;
    --text-dim: #7a6f5a;
    --text-bright: #e8d9b8;
    --markt: #e8a030;
    --overheid: #4a90d9;
    --synagoge: #9b59b6;
    --deportatie: #e74c3c;
    --dwangmarkt: #666666;
    --woonadres: #f1c40f;
    --shadow: 0 4px 24px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
    --radius: 8px;
    --transition: 0.25s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--gold);
    font-weight: 400;
    line-height: 1.3;
}

h1 { font-size: 2em; letter-spacing: 3px; }
h2 { font-size: 1.5em; letter-spacing: 2px; }
h3 { font-size: 1.2em; letter-spacing: 1px; }

a {
    color: var(--gold);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--gold-bright); }

/* ===== LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== HEADER (HOMEPAGE) ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.7) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(42,34,24,0.5);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    transition: background var(--transition);
}

.site-header .logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.1em;
    color: var(--gold);
    letter-spacing: 3px;
    text-transform: uppercase;
    white-space: nowrap;
}
.site-header .logo span {
    color: var(--text-dim);
    font-size: 0.7em;
    letter-spacing: 1px;
    margin-left: 12px;
}

/* ===== SEARCH BAR (HEADER) ===== */
.search-container {
    position: relative;
    flex: 0 1 360px;
}
.search-input {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 12px 25px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    width: 100%;
}
.search-input::placeholder {
    color: var(--text-dim);
}
.search-input:focus {
    border-color: var(--gold-bright);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 15px rgba(201,168,76,0.2);
}
.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 0.85em;
}

/* ===== NAV ===== */
.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}
.nav-links a {
    font-size: 0.75em;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all var(--transition);
}
.nav-links a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}
.nav-links a.active {
    color: var(--gold);
}

/* ===== FUNDA SPLIT-SCREEN LAYOUT ===== */
.funda-layout {
    position: fixed;
    top: 56px;
    bottom: 60px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    background: #000;
}

.map-wrapper {
    position: relative;
    flex: 1;
    min-width: 0; /* Prevents flex blowout */
}
#map {
    width: 100%;
    height: 100%;
}

/* === DOCUMENT CARD (UNIFIED) === */
.doc-card {
    background: #141414;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--gold-dim);
    border-radius: 4px 12px 12px 4px;
    padding: 20px;
    margin-bottom: 20px;
    text-decoration: none;
    display: block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.doc-card:hover {
    border-color: var(--gold);
    border-left-color: var(--gold-bright);
    background: #1a1a1a;
    transform: translateX(6px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.doc-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.3;
}
.doc-card p {
    font-size: 0.85em;
    color: var(--text-dim);
    line-height: 1.5;
}
.doc-card .similarity-score {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--gold-dim);
    color: #000;
    font-size: 9px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 0 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.doc-card .doc-type {
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold-dim);
    margin-bottom: 6px;
}
.doc-card .doc-meta {
    font-size: 0.7em;
    color: var(--text-dim);
    margin-top: 10px;
    display: flex;
    gap: 16px;
}
/* Search result archive reference bar */
.search-ref-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--gold);
    background: rgba(201,168,76,0.08);
    padding: 6px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}
.search-ref-bar .ref-sep {
    color: var(--border);
    font-weight: 300;
}
.doc-card .metadata {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.indicateur-item:hover {
    background: rgba(201,168,76,0.1) !important;
    border-left: 2px solid var(--gold);
    padding-left: 12px !important;
}
.indicateur-item.active {
    background: rgba(201,168,76,0.2) !important;
    border-left: 3px solid var(--gold-bright);
    color: #fff;
}

/* ===== CONTROLS BAR ===== */
.controls-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 60px;
}

/* Pin search filter */
.filter-search-section {
    flex: 0 1 260px;
    min-width: 160px;
}
.pin-search-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 18px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    outline: none;
    transition: all 0.3s;
}
.pin-search-input::placeholder { color: var(--text-dim); }
.pin-search-input:focus {
    border-color: var(--gold);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 0 12px rgba(201,168,76,0.2);
}

/* Divider */
.divider {
    width: 1px;
    height: 40px;
    background: var(--border);
    flex-shrink: 0;
}

/* Filter buttons */
.filter-section {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}
.filter-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
    font-size: 0.65em;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    letter-spacing: 0.5px;
}
.filter-btn .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all var(--transition);
}
.filter-btn.active {
    color: var(--text);
    background: rgba(255,255,255,0.04);
}
.filter-btn.active .dot {
    box-shadow: 0 0 6px currentColor;
}
.filter-btn:hover {
    border-color: var(--border-light);
    background: rgba(255,255,255,0.03);
}

/* Smart filter buttons */
.smart-filter-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid var(--gold-dim);
    border-radius: 20px;
    background: transparent;
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
    font-size: 0.65em;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    letter-spacing: 0.5px;
}
.smart-filter-btn .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.smart-filter-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(201,168,76,0.08);
}
.smart-filter-btn.active {
    background: rgba(201,168,76,0.2);
    border-color: var(--gold);
    color: var(--gold);
}
.smart-filter-btn.active .dot {
    box-shadow: 0 0 6px currentColor;
}

/* Stats badge */
.stats-badge {
    font-size: 0.65em;
    color: var(--text-dim);
    text-align: right;
    min-width: 80px;
    line-height: 1.6;
}
.stats-badge .count {
    font-family: 'Playfair Display', serif;
    font-size: 1.6em;
    color: var(--gold);
    display: block;
}

/* ===== CONTEXT BAR (floating) ===== */
.context-bar {
    position: fixed;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    background: rgba(10,10,10,0.88);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 20px;
    font-size: 0.72em;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    text-align: center;
    max-width: 600px;
    transition: opacity 0.5s;
    pointer-events: none;
}
.context-bar .event-year {
    color: var(--gold);
    font-weight: 600;
}

/* ===== LEAFLET OVERRIDES (MONUMENT POPUPS) ===== */
.leaflet-popup {
    animation: popupFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes popupFadeIn {
    0% { opacity: 0; transform: translateY(15px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.leaflet-popup-content-wrapper {
    background: rgba(15, 15, 15, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    color: var(--text) !important;
    border: 1px solid rgba(201, 168, 76, 0.3) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8) !important;
    padding: 0 !important;
}

.leaflet-popup-tip {
    background: rgba(15, 15, 15, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    border-right: 1px solid rgba(201, 168, 76, 0.3) !important;
    border-bottom: 1px solid rgba(201, 168, 76, 0.3) !important;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5) !important;
}

.leaflet-popup-content {
    font-family: 'Inter', sans-serif !important;
    margin: 18px 20px !important;
    min-width: 220px;
}

/* Close button override */
.leaflet-popup-close-button {
    color: var(--text-dim) !important;
    top: 10px !important;
    right: 10px !important;
    font-size: 16px !important;
    transition: color 0.2s !important;
}
.leaflet-popup-close-button:hover {
    color: var(--gold) !important;
    background: transparent !important;
}

/* Popup Inner Elements */
.popup-type {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
    font-weight: 600;
}
.popup-name {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: var(--gold);
    margin-bottom: 8px;
    line-height: 1.25;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}
.popup-desc {
    font-size: 12.5px;
    color: #e0e0e0;
    line-height: 1.5;
    margin-bottom: 12px;
}
.popup-years {
    font-size: 11px;
    color: var(--text-dim);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 8px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
}
.popup-link {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gold);
    background: rgba(201,168,76,0.1);
    border: 1px solid rgba(201,168,76,0.4);
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: all var(--transition);
}
.popup-link:hover {
    background: rgba(201,168,76,0.25);
    border-color: var(--gold);
    color: #fff;
    transform: translateY(-1px);
}

.leaflet-control-zoom a {
    background: var(--bg-card) !important;
    color: var(--gold) !important;
    border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover {
    background: var(--bg-panel) !important;
}
.leaflet-control-attribution {
    background: rgba(10,10,10,0.7) !important;
    color: var(--text-dim) !important;
    font-size: 10px !important;
}
.leaflet-control-attribution a {
    color: var(--gold-dim) !important;
}

/* Cluster styling */
.marker-cluster {
    background: rgba(201,168,76,0.2) !important;
    border: 2px solid rgba(201,168,76,0.5) !important;
}
.marker-cluster div {
    background: rgba(201,168,76,0.6) !important;
    color: #fff !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
}

/* Marker hover - Fixed! Removed transform:scale which causes Leaflet AutoPan bugs in Chrome */
.leaflet-marker-icon {
    transition: opacity 0.4s ease, filter 0.4s ease;
}
.leaflet-marker-icon:hover {
    z-index: 10000 !important;
}
.leaflet-marker-icon svg, .marker-cluster div {
    transition: filter 0.25s ease;
}
.leaflet-marker-icon:hover svg, .marker-cluster:hover div {
    filter: drop-shadow(0 0 10px rgba(201,168,76,0.8)) brightness(1.2);
}

/* ===== PERSOON PAGE ===== */
.page-wrapper {
    padding-top: 72px;
    min-height: 100vh;
}

/* Hero: pasfoto + kerngegevens */
.persoon-hero {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--border);
}
.persoon-foto-frame {
    flex-shrink: 0;
    width: 160px;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--gold-dim);
    box-shadow: 0 8px 30px rgba(0,0,0,0.6), 0 0 0 1px rgba(201,168,76,0.2);
    background: var(--bg-card);
}
.persoon-foto-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(15%) contrast(1.05);
    transition: filter 0.4s;
}
.persoon-foto-frame:hover img {
    filter: sepia(0%) contrast(1);
}
.persoon-hero-info {
    flex: 1;
    min-width: 0;
}
.persoon-hero-info h1 {
    font-size: 2.2em;
    margin-bottom: 8px;
}
.persoon-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.persoon-meta .tag {
    font-size: 0.72em;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
}
.persoon-meta .tag-memorial {
    color: #e74c3c;
    border-color: rgba(231,76,60,0.4);
}
.jm-badge {
    display: inline-block;
    margin-top: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gold);
    background: rgba(201,168,76,0.1);
    border: 1px solid rgba(201,168,76,0.3);
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    transition: all var(--transition);
}
.jm-badge:hover {
    background: rgba(201,168,76,0.25);
    color: #fff;
}

/* Levensverhaal */
.verhaal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--gold-dim);
    border-radius: 4px 12px 12px 4px;
    padding: 24px;
    margin-bottom: 24px;
}
.verhaal-card h2 {
    font-size: 1.1em;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.verhaal-tekst {
    font-family: Georgia, serif;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
    white-space: pre-wrap;
}

/* Foto Galerij */
.foto-galerij {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.foto-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.3s;
    aspect-ratio: 3/4;
    background: var(--bg-card);
}
.foto-item:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(10%);
    transition: filter 0.3s;
}
.foto-item:hover img {
    filter: sepia(0%);
}
.foto-pdf-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dim);
    background: var(--bg-card);
}
.foto-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    cursor: zoom-out;
}
.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}
.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

/* Familie */
.familie-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85em;
}
.familie-item:last-child { border-bottom: none; }
.familie-relatie {
    color: var(--gold-dim);
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 70px;
}
.familie-naam {
    color: var(--text);
}

/* Externe Bronnen */
.externe-bronnen-card { padding: 16px; }
.ext-bron-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s;
}
.ext-bron-link:hover {
    background: rgba(201,168,76,0.08);
    border-color: var(--gold);
    transform: translateX(3px);
}
.ext-bron-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(201,168,76,0.1);
    border-radius: 8px;
    color: var(--gold);
}
.ext-bron-info {
    flex: 1;
    min-width: 0;
}
.ext-bron-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}
.ext-bron-desc {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ext-bron-link .arrow {
    color: var(--text-dim);
    font-size: 16px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.ext-bron-link:hover .arrow { color: var(--gold); }

.ext-zoek-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 12px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
}
.ext-zoek-divider::before,
.ext-zoek-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}
.ext-bron-search {
    border-style: dashed;
    opacity: 0.8;
}
.ext-bron-search:hover {
    opacity: 1;
    border-style: solid;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    padding: 32px 0;
}

/* Document cards on persoon page — minor overrides */

/* Sidebar */
.sidebar {
    position: sticky;
    top: 72px;
}
.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}
.sidebar-card h3 {
    font-size: 0.9em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* External links */
.ext-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.8em;
    transition: all var(--transition);
}
.ext-link:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}
.ext-link .arrow {
    margin-left: auto;
    color: var(--text-dim);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 24px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-bottom: 20px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid var(--bg-dark);
}
.timeline-item .year {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 0.9em;
}
.timeline-item .event {
    font-size: 0.8em;
    color: var(--text-dim);
    margin-top: 2px;
}

/* ===== SEARCH PAGE ===== */
.search-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: calc(100vh - 56px);
}
.search-results {
    overflow-y: auto;
    padding: 24px;
    border-right: 1px solid var(--border);
}
.search-map {
    position: relative;
}

.result-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--transition);
}
.result-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

/* ===== MARKT & MARKTEN PAGINA ===== */
.breadcrumb {
    padding-top: 16px;
    margin-bottom: 8px;
}
.breadcrumb a {
    font-size: 12px;
    color: var(--text-dim);
    text-decoration: none;
}
.breadcrumb a:hover { color: var(--gold); }

.markt-hero, .markten-hero {
    padding: 40px 0 24px;
    text-align: center;
    margin-bottom: 32px;
}
.markt-hero h1, .markten-hero h1 {
    font-size: 2.8em;
    letter-spacing: 4px;
}
.markt-hero-line {
    width: 60px;
    height: 2px;
    background: var(--brass-gradient);
    margin: 16px auto;
}
.markt-subtitle {
    font-size: 14px;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.markt-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.stat-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 28px;
    text-align: center;
    min-width: 100px;
}
.stat-value {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 2.2em;
    color: var(--gold);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
}
.stat-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
}
.stat-memorial .stat-value { color: #e74c3c; }
.stat-memorial-val { color: #e74c3c !important; }

/* Markten Overzicht Cards */
.markten-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding-bottom: 60px;
}
.markten-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.markten-card:hover {
    border-color: var(--gold);
    background: #1e1e1e;
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(201,168,76,0.2);
}
.markten-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.markten-card-top h2 {
    font-size: 1.15em;
    color: #fff;
    line-height: 1.2;
}
.markten-count {
    font-family: 'Playfair Display', serif;
    font-size: 1.8em;
    color: var(--gold);
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    margin-left: 16px;
}
.markten-bar {
    height: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    margin-bottom: 12px;
    overflow: hidden;
}
.markten-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--deportatie), #c0392b);
    border-radius: 2px;
    transition: width 0.6s ease;
}
.markten-card-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dim);
}
.markten-omgekomen { color: rgba(231,76,60,0.7); }

/* ===== MONUMENT GRID (Herdenkingsmuur) ===== */
.monument-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding-bottom: 60px;
}
.monument-cell {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.monument-cell:hover {
    border-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
.monument-cell.cell-deceased {
    border-bottom: 2px solid rgba(231,76,60,0.4);
}

/* Uniforme Pasfoto Container */
.monument-photo {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #151515;
    position: relative;
}
.monument-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    filter: grayscale(30%) contrast(1.05) brightness(0.95);
    transition: filter 0.4s;
}
.monument-cell:hover .monument-photo img {
    filter: grayscale(0%) contrast(1) brightness(1);
}
.monument-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #121212 0%, #1a1a1a 100%);
    color: var(--text-dim);
}

.monument-label {
    padding: 10px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.monument-name {
    font-family: 'Playfair Display', serif;
    font-size: 13px;
    color: #fff;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.monument-detail {
    font-size: 10px;
    color: var(--gold-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.monument-dates {
    font-size: 10px;
    color: var(--text-dim);
}
.monument-lot {
    font-size: 9px;
    color: rgba(231,76,60,0.8);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ===== ARCHIEF REFERENTIE BANNER ===== */
.archief-ref-banner {
    display: flex;
    align-items: center;
    gap: 0;
    background: linear-gradient(135deg, rgba(142,113,43,0.15) 0%, rgba(201,168,76,0.08) 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 0;
    margin-bottom: 20px;
}
.ref-block {
    flex: 1;
    text-align: center;
    padding: 0 16px;
}
.ref-label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.ref-value {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.4em;
    color: var(--gold);
    font-weight: 700;
}
.ref-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
    flex-shrink: 0;
}

/* ===== DOCUMENT PAGE ===== */
.doc-viewer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: calc(100vh - 56px);
}
.doc-scan {
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
    overflow: auto;
}
.doc-scan img {
    max-width: 100%;
    height: auto;
}
.doc-text {
    overflow-y: auto;
    padding: 32px;
}
.doc-text .transcriptie {
    font-family: 'Georgia', serif;
    font-size: 0.95em;
    line-height: 1.8;
    color: var(--text);
    white-space: pre-wrap;
}

/* ===== STORIES OVERLAY (NETFLIX STYLE) ===== */
.btn-discover {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 12px 24px;
    border-radius: 30px;
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), 0 0 20px rgba(201,168,76,0.2) inset;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}
.btn-discover:hover {
    background: var(--gold);
    color: #111;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201,168,76,0.4);
}

.btn-list-view {
    position: absolute;
    top: 80px;
    right: 24px;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-light);
    color: #ddd;
    padding: 10px 20px;
    border-radius: 30px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}
.btn-list-view:hover {
    background: rgba(201,168,76,0.2);
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
}

.stories-overlay {
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    height: calc(100vh - 56px - 80px);
    background: rgba(8, 8, 8, 0.95);
    backdrop-filter: blur(20px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    overflow-y: auto;
}
.stories-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.btn-close-overlay {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 40px;
    cursor: pointer;
    transition: color 0.3s;
}
.btn-close-overlay:hover { color: var(--gold); }

.overlay-header {
    text-align: center;
    margin-bottom: 50px;
    max-width: 600px;
}
.overlay-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    color: var(--gold);
    margin-bottom: 16px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.8);
}
.overlay-header p {
    font-size: 18px;
    color: var(--text-dim);
    line-height: 1.6;
}

.story-cards {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.story-card {
    position: relative;
    width: 320px;
    height: 460px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s;
}
.story-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 0 1px var(--gold);
}
.sc-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0.6;
    transition: opacity 0.4s;
    background-size: cover;
    background-position: center;
    filter: grayscale(80%) contrast(1.2);
}
.story-card:hover .sc-bg {
    opacity: 0.9;
    filter: grayscale(30%) contrast(1.1);
}
.sc-content {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 30px 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 60%, transparent 100%);
    z-index: 2;
}
.sc-tag {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 12px;
}
.sc-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    margin-bottom: 12px;
    color: #fff;
    line-height: 1.1;
}
.sc-content p {
    font-size: 13px;
    color: #ccc;
}

/* ===== PERMANENT INFO SIDEBAR (FUNDA STYLE) ===== */
.side-panel {
    position: relative;
    width: 450px;
    height: 100%;
    background: #0f0f0f;
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    z-index: 500;
    display: flex;
    flex-direction: column;
}
.btn-close-panel {
    position: absolute;
    top: 16px;
    left: -40px;
    width: 40px;
    height: 40px;
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid var(--border);
    border-right: none;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-close-panel:hover {
    color: var(--gold);
}
.side-content {
    padding: 30px 25px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    /* CSS Top Skill: Native Smooth scrolling and blocking body scroll leak */
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}
.side-content.marker-mode {
    padding: 25px 25px;
}
.side-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: var(--gold);
    margin-bottom: 16px;
    line-height: 1.2;
    border-bottom: 1px solid rgba(201,168,76,0.2);
    padding-bottom: 15px;
}
.marker-type-badge {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid currentColor;
}
.marker-info-block {
    font-family: 'Inter', sans-serif;
    color: #e0e0e0;
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 14px;
}
/* Sidebar pin detail */
.sidebar-foto-frame {
    width: 100%;
    max-height: 200px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}
.sidebar-foto-frame img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    filter: sepia(10%);
}
.sidebar-leven {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}
.sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}
.sidebar-tag {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.markt-tag {
    color: var(--markt);
    border: 1px solid rgba(232,160,48,0.4);
    background: rgba(232,160,48,0.1);
}
.artikel-tag {
    color: var(--gold);
    border: 1px solid var(--border);
    background: rgba(201,168,76,0.08);
}

.marker-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gold);
    background: rgba(201,168,76,0.1);
    border: 1px solid rgba(201,168,76,0.4);
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    transition: all var(--transition);
}
.marker-action-btn:hover {
    background: rgba(201,168,76,0.25);
    border-color: var(--gold);
    color: #fff;
    transform: translateY(-2px);
}
.editorial-intro {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 20px;
}
.story-chunk {
    margin-bottom: 30px;
    background: transparent;
    padding: 0;
    border: none;
}
.editorial-quote {
    font-family: 'Georgia', serif;
    font-size: 19px;
    line-height: 1.8;
    color: #e0e0e0;
    font-style: italic;
    position: relative;
}
.dropcap {
    float: left;
    font-size: 64px;
    line-height: 50px;
    padding-top: 8px;
    padding-right: 12px;
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-style: normal;
}
.story-chunk .doc-link {
    display: inline-block;
    margin-top: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: var(--gold);
    text-decoration: none;
    border-bottom: 1px solid var(--gold);
}
.story-chunk .doc-link:hover {
    color: #fff;
}

/* LIST CARDS (MASTER LIST VIEW) */
.list-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.list-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(201,168,76,0.4);
    transform: translateX(4px);
}
.list-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: #fff;
    margin-bottom: 8px;
}
.list-card .address { 
    font-family: 'Inter', sans-serif;
    font-size: 13px; 
    color: #aaa; 
    margin-top: 6px;
}

/* ===== RESPONSIVE ===== */
/* ===== TABLET (<=1024px) ===== */
@media (max-width: 1024px) {
    /* Zoekpagina: verberg context panel, maak ledger smaller */
    .context-panel { display: none; }
    .ledger-explorer { width: 260px !important; }
    .search-hero-compact > div { flex-wrap: wrap; gap: 15px !important; }
    .expert-filters-mini { width: 100%; }
}

/* ===== MOBILE (<=768px) ===== */
@media (max-width: 768px) {
    /* Header */
    .site-header { padding: 0 12px; height: 48px; }
    .site-header .logo { font-size: 0.85em; letter-spacing: 1.5px; }
    .site-header .logo span { display: none; }
    .search-container { flex: 0 1 160px; }
    .search-input { padding: 8px 16px; font-size: 13px; }
    .nav-links a { padding: 6px 8px; font-size: 0.65em; }

    /* Kaartpagina: stack verticaal */
    .funda-layout {
        flex-direction: column;
        top: 48px;
        bottom: 0;
    }
    .map-wrapper {
        flex: 1 1 55vh;
    }
    .side-panel {
        width: 100%;
        flex: 1 1 45vh;
        border-left: none;
        border-top: 2px solid var(--gold);
    }

    /* Controls bar */
    .controls-bar {
        position: relative;
        flex-wrap: wrap;
        height: auto;
        padding: 10px 12px;
        gap: 8px;
    }
    .filter-search-section { flex: 1 1 100%; }
    .filter-section { min-width: 100%; justify-content: center; }
    .divider { display: none; }
    .stats-badge { width: 100%; text-align: center; }

    /* Kaart knoppen */
    .btn-discover { top: 12px; right: 12px; padding: 8px 16px; font-size: 13px; }
    .btn-list-view { top: 56px; right: 12px; padding: 8px 14px; font-size: 12px; }

    /* Stories overlay */
    .stories-overlay { padding: 30px 15px; }
    .overlay-header h2 { font-size: 28px; }
    .overlay-header p { font-size: 14px; }
    .story-cards { flex-direction: column; align-items: center; gap: 20px; }
    .story-card { width: 100%; max-width: 360px; height: 320px; }

    /* Zoekpagina: volledig gestapeld */
    .search-page-overhaul { padding-top: 48px !important; }
    .master-ledger-panes { flex-direction: column !important; }
    .ledger-explorer {
        width: 100% !important;
        max-height: 200px;
        border-right: none !important;
        border-bottom: 1px solid var(--border-light);
    }
    .discovery-grid { padding: 20px !important; }
    .context-panel {
        width: 100% !important;
        border-left: none !important;
        border-top: 1px solid var(--border-light);
        max-height: 300px;
    }
    .search-hero-compact { padding: 12px 16px !important; }
    .search-hero-compact h1 { font-size: 20px !important; }
    .search-hero-compact > div { flex-direction: column; gap: 10px !important; }
    .expert-filters-mini { gap: 8px !important; }
    .expert-filters-mini select,
    .expert-filters-mini input { height: 36px; font-size: 13px; }

    /* Persoon pagina */
    .persoon-hero { flex-direction: column; align-items: center; text-align: center; gap: 20px; padding: 32px 0 24px; }
    .persoon-foto-frame { width: 120px; height: 150px; }
    .persoon-hero-info h1 { font-size: 1.5em; }
    .persoon-meta { justify-content: center; }
    .foto-galerij { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .monument-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
    .monument-label { padding: 8px 8px 10px; }
    .monument-name { font-size: 11px; }
    .markt-hero h1, .markten-hero h1 { font-size: 1.8em; }
    .markten-grid { grid-template-columns: 1fr; }
    .markt-stats { gap: 8px; }
    .stat-block { padding: 12px 16px; min-width: 70px; }
    .stat-value { font-size: 1.6em; }
    .content-grid { grid-template-columns: 1fr; }

    /* Document pagina */
    .doc-viewer { grid-template-columns: 1fr; }
    .search-page { grid-template-columns: 1fr; }
    .search-results-grid { grid-template-columns: 1fr; gap: 20px; }

    /* Context bar */
    .context-bar { max-width: 90%; font-size: 0.65em; padding: 6px 14px; top: 58px; }
}
/* ===== SEARCH DASHBOARD ===== */
.search-page {
    background: radial-gradient(circle at top right, #1a1a1a 0%, #0a0a0a 100%);
    min-height: calc(100vh - 56px - 80px);
    padding: 60px 20px;
}
.search-hero {
    max-width: 900px;
    margin: 0 auto 60px auto;
    text-align: center;
}
.search-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    color: var(--gold);
    margin-bottom: 20px;
}
.search-hero p {
    font-size: 18px;
    color: var(--text-dim);
    margin-bottom: 40px;
}

/* Topic Chips / Inspiration */
.topic-section {
    max-width: 1000px;
    margin: 0 auto 40px auto;
}
.topic-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    margin-bottom: 20px;
    text-align: center;
    opacity: 0.8;
}
.topic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.topic-chip {
    padding: 8px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}
.topic-chip:hover {
    background: rgba(201,168,76,0.1);
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-1px);
}

/* Results Grid */
.search-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}
.results-column h2 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* Search page doc-card styles covered by unified .doc-card above */
