/* ==========================================================================
   Klawiter Bibliography — Custom CSS
   Visual language derived from Stefan Zweig Digital
   ========================================================================== */

/* --- Custom Properties --- */
:root {
  --sz-burgundy: #631a34;
  --sz-burgundy-dark: #4A1228;
  --sz-burgundy-light: #7A2D45;
  --sz-gold: #C2A360;
  --sz-gold-light: #D4B87A;
  --sz-cream: #FAF8F3;
  --sz-white: #FFFFFF;
  --sz-text: #2D2D2D;
  --sz-text-light: #6B6B6B;
  --sz-border: #E0D8CC;
  --sz-border-light: #EDE8DF;

  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --max-width: 1200px;
  --sidebar-width: 240px;
  --header-height: 56px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--sz-text);
  background: var(--sz-cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--sz-burgundy);
  text-decoration: none;
}
a:hover {
  color: var(--sz-burgundy-dark);
  text-decoration: underline;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--sz-gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* --- Header --- */
.site-header {
  background: var(--sz-burgundy);
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 28px;
  height: 28px;
  color: var(--sz-gold);
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--sz-cream);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  margin-left: 1rem;
}

.site-nav a {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(250, 248, 243, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--sz-cream);
  border-bottom-color: var(--sz-gold);
  text-decoration: none;
}

.header-search {
  margin-left: auto;
  position: relative;
  width: 280px;
  flex-shrink: 0;
}

.header-search input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  border: 1px solid rgba(250, 248, 243, 0.3);
  border-radius: 4px;
  background: rgba(250, 248, 243, 0.1);
  color: var(--sz-cream);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.header-search input::placeholder {
  color: rgba(250, 248, 243, 0.5);
}
.header-search input:focus {
  border-color: var(--sz-gold);
  background: rgba(250, 248, 243, 0.15);
}

.header-search-icon {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--sz-gold);
  pointer-events: none;
}

/* --- Filter Chips --- */
.filter-chips {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.filter-chips:empty {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  background: rgba(184, 150, 62, 0.15);
  color: var(--sz-burgundy);
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
}
.chip button {
  background: none;
  border: none;
  font-size: 0.875rem;
  line-height: 1;
  color: var(--sz-burgundy);
  opacity: 0.6;
  cursor: pointer;
  padding: 0;
}
.chip button:hover {
  opacity: 1;
}

/* --- Main Layout --- */
.main-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  gap: 2rem;
  flex: 1;
  width: 100%;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* --- Sidebar / Facets --- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

.facet-group {
  margin-bottom: 1.5rem;
}

.facet-heading {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--sz-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.facet-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
  padding-left: 0.5rem;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 0.875rem;
  color: var(--sz-text);
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.facet-item:hover {
  color: var(--sz-burgundy);
}
.facet-item.active {
  color: var(--sz-burgundy);
  font-weight: 600;
  border-left-color: var(--sz-burgundy);
}

.facet-count {
  margin-left: auto;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--sz-text-light);
}

/* --- Home / Startseite --- */
.home-intro {
  max-width: 720px;
  margin-bottom: 2rem;
}

.home-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--sz-burgundy);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.home-subtitle {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--sz-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.home-text {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--sz-text);
  margin-bottom: 1.5rem;
}

.home-search {
  position: relative;
  max-width: 560px;
  margin-bottom: 2.5rem;
}

.home-search input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 1px solid var(--sz-gold);
  border-radius: 4px;
  background: var(--sz-white);
  color: var(--sz-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-search input:focus {
  border-color: var(--sz-burgundy);
  box-shadow: 0 0 0 2px rgba(122, 27, 45, 0.1);
}
.home-search input::placeholder {
  color: var(--sz-text-light);
}

.home-search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--sz-gold);
  pointer-events: none;
}

/* Category list (expandable rows) */
.category-section {
  margin-bottom: 2rem;
}

.category-list {
  display: flex;
  flex-direction: column;
}

.category-row {
  border-bottom: 1px solid var(--sz-border-light);
}
.category-row:last-child {
  border-bottom: none;
}

.category-row-header {
  display: flex;
  align-items: center;
  padding: 0.625rem 0;
  gap: 0.5rem;
}

.category-row-name {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  color: var(--sz-text);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.category-row-name:hover {
  color: var(--sz-burgundy);
  border-bottom-color: var(--sz-burgundy);
}
.category-row-name:focus-visible {
  color: var(--sz-burgundy);
  outline: 2px solid var(--sz-gold);
  outline-offset: 2px;
  border-radius: 2px;
}

.category-row-count {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--sz-burgundy);
  margin-left: auto;
}

.category-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--sz-text-light);
  transition: color 0.15s;
  display: flex;
  align-items: center;
}
.category-expand-btn:hover {
  color: var(--sz-burgundy);
}
.expand-chevron {
  transition: transform 0.2s ease;
}
.category-row.expanded .expand-chevron {
  transform: rotate(180deg);
}

/* Subcategory expand area */
.category-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 1rem;
}
.category-row.expanded .category-expand {
  max-height: 500px;
}

.subcategory-group {
  margin-bottom: 0.5rem;
}

.subcategory-format {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--sz-gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.25rem;
}

.subcategory-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.375rem;
}

.subcategory-item {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--sz-text);
  background: var(--sz-white);
  border: 1px solid var(--sz-border);
  border-radius: 3px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.subcategory-item:hover {
  border-color: var(--sz-burgundy);
  color: var(--sz-burgundy);
}

.subcategory-count {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: var(--sz-text-light);
}

.subcategory-more {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--sz-text-light);
  padding: 0.2rem 0.5rem;
}

/* Browse & Explore buttons */
.home-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.browse-btn {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sz-cream);
  background: var(--sz-burgundy);
  border: none;
  border-radius: 4px;
  padding: 0.625rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s;
}
.browse-btn:hover {
  background: var(--sz-burgundy-dark);
}

.explore-link {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--sz-burgundy);
  text-decoration: none;
}
.explore-link:hover {
  text-decoration: underline;
}

/* Keep tile grid for backward compat (used by "other" section) */
.tile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.category-tile {
  background: var(--sz-white);
  border: 1px solid var(--sz-border);
  border-radius: 4px;
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 140px;
}
.category-tile:hover {
  border-left-color: var(--sz-gold);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.tile-name {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  color: var(--sz-text);
  margin-bottom: 0.125rem;
}

.tile-count {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--sz-burgundy);
}

/* Kurzstatistik */
.home-stats-line {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sz-border);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--sz-text-light);
}
.home-stats-line a {
  color: var(--sz-burgundy);
  font-weight: 500;
}

/* --- Results --- */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.results-count {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--sz-text-light);
}

.results-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-select {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--sz-border);
  border-radius: 4px;
  background: var(--sz-white);
  color: var(--sz-text);
  cursor: pointer;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Entry cards — expandable */
.entry-card {
  background: var(--sz-white);
  border: 1px solid var(--sz-border);
  border-radius: 4px;
  border-left: 3px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card-header {
  padding: 1rem 1.25rem;
  cursor: pointer;
}
.entry-card:hover {
  border-left-color: var(--sz-gold);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.entry-card.card-expanded {
  border-left-color: var(--sz-burgundy);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-detail {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--sz-border-light);
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.card-meta-text {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--sz-text-light);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--sz-text);
  line-height: 1.4;
  margin-bottom: 0.125rem;
}

.card-secondary {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--sz-text-light);
  margin-bottom: 0.25rem;
}

.card-snippet {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--sz-text-light);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 3em; /* fallback for browsers without -webkit-line-clamp */
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--sz-text-light);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
}
.empty-state p:first-child {
  font-size: 1.0625rem;
  color: var(--sz-text);
  margin-bottom: 0.5rem;
}

/* Load more */
.load-more {
  text-align: center;
  padding: 1rem 0;
}
.load-more button {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--sz-burgundy);
  background: none;
  border: 1px solid var(--sz-border);
  border-radius: 4px;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.load-more button:hover {
  border-color: var(--sz-burgundy);
}

/* --- Entry Type Badges --- */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.badge-fiction { background: #EDE4D4; color: #7A1B2D; }
.badge-essay { background: #F5EDD8; color: #8B6914; }
.badge-poetry { background: #E8E0EF; color: #5B3A7A; }
.badge-drama { background: #F0DDE4; color: #7A1B2D; }
.badge-correspondence { background: #DDE8E0; color: #2D5B3A; }
.badge-film { background: #EDDDDD; color: #7A2D1B; }
.badge-historical-study { background: #E0E0ED; color: #3A3A7A; }
.badge-secondary-literature { background: #EDE8E0; color: #5B5040; }
.badge-collected-works { background: #F0EBD8; color: #6B5A14; }
.badge-foreword { background: #DDE8E4; color: #2D5B4A; }
.badge-translation { background: #E0EDDD; color: #3A5B2D; }
.badge-symposium { background: #F0E4DD; color: #7A4A1B; }
.badge-dramatic-reading { background: #EDDDEE; color: #6B1B6E; }
.badge-newspaper { background: #E8E4E0; color: #5B504A; }
.badge-other { background: #E8E4E0; color: #6B6B6B; }

/* --- Detail View --- */
.detail-back {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--sz-burgundy);
  margin-bottom: 1rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.detail-back:hover {
  text-decoration: underline;
}

.detail-type {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  color: var(--sz-gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.detail-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--sz-text);
  line-height: 1.3;
  margin-bottom: 1.5rem;
}

/* Metadata table */
.meta-table {
  width: 100%;
  background: var(--sz-white);
  border: 1px solid var(--sz-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.meta-row {
  display: flex;
  border-bottom: 1px solid var(--sz-border-light);
  padding: 0.625rem 1rem;
}
.meta-row:last-child {
  border-bottom: none;
}

.meta-label {
  width: 160px;
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-size: 0.875rem;
  color: var(--sz-burgundy);
}

.meta-value {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--sz-text);
}

/* Detail sections */
.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section-heading {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--sz-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.detail-bibentry {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.8;
  background: var(--sz-white);
  border: 1px solid var(--sz-border);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--sz-text);
}

.detail-list {
  list-style: disc;
  padding-left: 1.25rem;
}
.detail-list li {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--sz-text);
  margin-bottom: 0.25rem;
}

.detail-list-numbered {
  list-style: decimal;
  padding-left: 1.25rem;
}
.detail-list-numbered li {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--sz-text);
  margin-bottom: 0.25rem;
}

/* Action bar */
.action-bar {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--sz-border);
}

.action-btn {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--sz-burgundy);
  background: none;
  border: 1px solid var(--sz-border);
  border-radius: 4px;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: border-color 0.15s, background 0.15s;
}
.action-btn:hover {
  border-color: var(--sz-burgundy);
  background: rgba(122, 27, 45, 0.04);
}

.action-btn svg {
  width: 14px;
  height: 14px;
}

.detail-provenance {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  color: var(--sz-text-light);
  margin-top: 1rem;
}

/* --- Statistics --- */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--sz-white);
  border: 1px solid var(--sz-border);
  border-radius: 4px;
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sz-burgundy);
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--sz-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* --- Explore Interface --- */
.explore-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.explore-mode-tabs {
  display: flex;
  gap: 0.25rem;
}

.mode-tab {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--sz-text-light);
  background: transparent;
  border: 1px solid var(--sz-border);
  border-radius: 4px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.mode-tab:hover {
  color: var(--sz-burgundy);
  border-color: var(--sz-burgundy);
}
.mode-tab.active {
  color: var(--sz-white);
  background: var(--sz-burgundy);
  border-color: var(--sz-burgundy);
}

.explore-body {
  display: flex;
  gap: 1.5rem;
  min-height: 450px;
  margin-bottom: 1.5rem;
}

.explore-viz {
  flex: 1;
  min-width: 0;
  background: var(--sz-white);
  border: 1px solid var(--sz-border);
  border-radius: 4px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.explore-panel { width: 100%; }

.explore-detail {
  width: 300px;
  flex-shrink: 0;
  background: var(--sz-white);
  border: 1px solid var(--sz-border);
  border-radius: 4px;
  padding: 1.25rem;
  overflow-y: auto;
  max-height: 550px;
}

.explore-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.explore-tooltip {
  position: absolute;
  display: none;
  background: rgba(45, 41, 38, 0.92);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  pointer-events: none;
  z-index: 1000;
  max-width: 250px;
}

/* Detail panel */
.detail-summary-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--sz-burgundy);
  margin-bottom: 0.5rem;
}
.detail-summary-text {
  font-size: 0.8125rem;
  color: var(--sz-text);
  margin-bottom: 0.5rem;
}
.detail-summary-hint {
  font-size: 0.75rem;
  color: var(--sz-text-light);
  font-style: italic;
  margin-bottom: 1rem;
}
.detail-summary-stats {
  font-size: 0.8125rem;
  color: var(--sz-text-light);
  line-height: 1.8;
}
.detail-summary-stats strong {
  color: var(--sz-burgundy);
  font-weight: 600;
}

.detail-group-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--sz-burgundy);
  margin-bottom: 0.25rem;
}
.detail-group-meta {
  font-size: 0.75rem;
  color: var(--sz-text-light);
  margin-bottom: 1rem;
}
.detail-group-section { margin-bottom: 1rem; }
.detail-group-section h4 {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--sz-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}

.mini-bar-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  padding: 0.15rem 0;
}
.mini-bar-label { color: var(--sz-text); }
.mini-bar-count { color: var(--sz-text-light); font-weight: 600; }

.detail-entry-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.detail-entry-item {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--sz-border);
}
.detail-entry-link {
  font-size: 0.8125rem;
  color: var(--sz-text);
  text-decoration: none;
  display: block;
}
.detail-entry-link:hover { color: var(--sz-burgundy); }
.detail-entry-link .badge { font-size: 0.6rem; vertical-align: middle; margin-right: 0.25rem; }
.detail-entry-year { color: var(--sz-text-light); font-size: 0.75rem; float: right; }

.detail-more {
  font-size: 0.75rem;
  color: var(--sz-text-light);
  font-style: italic;
  margin-top: 0.5rem;
}

.explore-view-btn {
  width: 100%;
  margin-top: 1rem;
}

/* Overview grid */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.overview-cell { min-height: 170px; }

.ov-title {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--sz-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.ov-empty {
  font-size: 0.8125rem;
  color: var(--sz-text-light);
  font-style: italic;
}

.overview-chips {
  margin-bottom: 0.75rem;
  min-height: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}
.chip-clear {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--sz-text-light);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

/* Network */
.network-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.network-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--sz-text-light);
}
.network-legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.network-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* --- Footer --- */
.site-footer {
  background: var(--sz-white);
  border-top: 1px solid var(--sz-border);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-heading {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--sz-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.footer-text {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--sz-text-light);
  line-height: 1.6;
}
.footer-text a {
  color: var(--sz-burgundy);
}

/* Stats export */
.stats-export {
  margin-top: 1.5rem;
  text-align: center;
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--sz-burgundy);
  color: var(--sz-cream);
  padding: 0.5rem 1rem;
  border-radius: 0 0 4px 4px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  z-index: 100;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 0;
  color: var(--sz-cream);
  text-decoration: none;
}

/* --- Focus Visible --- */
.action-btn:focus-visible,
.category-tile:focus-visible,
.facet-item:focus-visible,
.card-header:focus-visible,
.sort-select:focus-visible,
.load-more button:focus-visible,
.chip button:focus-visible,
.detail-back:focus-visible,
.site-nav a:focus-visible {
  outline: 2px solid var(--sz-burgundy);
  outline-offset: 2px;
}

/* --- Loading Indicator --- */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  color: var(--sz-text-light);
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--sz-border);
  border-top-color: var(--sz-burgundy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Nav Dropdown --- */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(250, 248, 243, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.25rem 0;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
  color: var(--sz-cream);
  border-bottom-color: var(--sz-gold);
}
.nav-dropdown-toggle svg {
  transition: transform 0.2s;
}
.nav-dropdown.open .nav-dropdown-toggle svg {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--sz-burgundy-dark);
  border-radius: 0 0 4px 4px;
  padding: 0.375rem 0;
  min-width: 170px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 31;
}
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(250, 248, 243, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-dropdown-menu a:hover {
  color: var(--sz-cream);
  background: rgba(250, 248, 243, 0.08);
  text-decoration: none;
}

/* --- Static Page Content --- */
.page-content {
  max-width: 720px;
  padding-bottom: 2rem;
}

.page-content h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--sz-burgundy);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--sz-border);
}

.page-content h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--sz-gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 2.5rem 0 0.75rem;
}
.page-content h2:first-of-type {
  margin-top: 1.5rem;
}

.page-content h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--sz-burgundy);
  margin: 1.75rem 0 0.5rem;
}

.page-content p {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  line-height: 1.75;
  margin-bottom: 1rem;
  color: var(--sz-text);
}

.page-content ul,
.page-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.page-content li {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  line-height: 1.75;
  margin-bottom: 0.375rem;
  color: var(--sz-text);
}

.page-content code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.8125rem;
  background: rgba(184, 150, 62, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  color: var(--sz-burgundy);
}

.page-content blockquote {
  border-left: 3px solid var(--sz-gold);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  background: rgba(184, 150, 62, 0.05);
  border-radius: 0 4px 4px 0;
}
.page-content blockquote p {
  margin-bottom: 0;
  font-style: italic;
  color: var(--sz-text);
}

.page-content a {
  color: var(--sz-burgundy);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.page-content a:hover {
  color: var(--sz-burgundy-dark);
}

.page-content strong {
  font-weight: 600;
}

/* Page tables (methodology, data) */
.page-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
}
.page-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: var(--sz-burgundy);
  color: var(--sz-cream);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}
.page-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--sz-border-light);
  vertical-align: top;
}
.page-table tr:last-child td {
  border-bottom: none;
}
.page-table tbody tr:hover {
  background: rgba(184, 150, 62, 0.05);
}

/* Action buttons on pages (download, etc.) */
.page-actions {
  margin: 1rem 0 1.5rem;
}
.page-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--sz-burgundy);
  color: var(--sz-cream);
  border: none;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.page-download-btn:hover {
  background: var(--sz-burgundy-dark);
}

/* --- Utility --- */
.hidden { display: none !important; }

mark {
  background: rgba(184, 150, 62, 0.25);
  padding: 0 0.125rem;
  border-radius: 0.125rem;
}

/* Mobile filter button */
.mobile-filter-btn {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--sz-burgundy);
  color: var(--sz-white);
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 20;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 50;
}
.mobile-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 300px;
  background: var(--sz-white);
  padding: 1.25rem;
  overflow-y: auto;
}
.mobile-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.mobile-panel-header h2 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
}
.mobile-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--sz-text-light);
  cursor: pointer;
}

/* --- Provenance Badges --- */
.prov-badge {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 50%;
  font-family: var(--font-sans);
  font-size: 0.55rem;
  font-weight: 700;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.prov-regex { background: #d4edda; color: #155724; }
.prov-llm { background: #fff3cd; color: #856404; }
.prov-missing { background: #f0f0f0; color: #999; }
.prov-expert { background: #cce5ff; color: #004085; }

/* --- Edit Mode --- */
.edit-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(250, 248, 243, 0.7);
  background: none;
  border: 1px solid rgba(250, 248, 243, 0.3);
  border-radius: 3px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.15s;
}
.edit-toggle-btn:hover { border-color: rgba(250, 248, 243, 0.6); color: var(--sz-cream); }
.edit-toggle-btn.active {
  background: var(--sz-gold);
  border-color: var(--sz-gold);
  color: var(--sz-burgundy);
}

.edit-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sz-burgundy);
  background: var(--sz-gold);
  border: none;
  border-radius: 3px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: background 0.15s;
}
.edit-save-btn:hover { background: var(--sz-gold-light); }

.edit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--sz-burgundy);
  color: var(--sz-cream);
  border-radius: 8px;
  font-size: 0.6rem;
  font-weight: 700;
}

/* Editable fields in edit mode */
.editable-field {
  outline: none;
  border-bottom: 1px dashed var(--sz-gold);
  padding: 0.1rem 0.2rem;
  min-width: 60px;
  display: inline-block;
  transition: border-color 0.15s, background 0.15s;
}
.editable-field:focus {
  border-bottom-color: var(--sz-burgundy);
  background: rgba(194, 163, 96, 0.08);
}

.missing-value {
  color: var(--sz-text-light);
  font-style: italic;
  font-size: 0.8rem;
}

/* Edit mode body class — highlight editable areas */
body.edit-mode .meta-table {
  border-color: var(--sz-gold);
}

/* --- Verbund Bar --- */
.verbund-bar {
  background: #f2f2f2;
  border-bottom: 1px solid var(--sz-border);
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 28px;
  padding: 0 1rem;
}
.verbund-mark {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sz-burgundy);
  line-height: 1;
}
.verbund-bar a {
  color: var(--sz-text-light);
  text-decoration: none;
  transition: color 0.15s;
}
.verbund-bar a:hover {
  color: var(--sz-burgundy);
  text-decoration: none;
}
.verbund-bar .verbund-active {
  color: var(--sz-burgundy);
  font-weight: 600;
}
.verbund-sep {
  color: var(--sz-border);
}

/* --- Responsive (basic) --- */
@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }
  .mobile-filter-btn {
    display: flex;
  }
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .explore-body {
    flex-direction: column;
  }
  .explore-detail {
    width: 100%;
    max-height: 300px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* --- Print --- */
@media print {
  .site-header, .site-footer, .sidebar, .mobile-filter-btn,
  .mobile-overlay, .filter-chips, .action-bar, .load-more,
  .home-search, .results-header, .detail-back, .detail-provenance,
  .stats-export, .page-actions { display: none !important; }
  body { background: white; font-size: 11pt; }
  .main-layout { max-width: 100%; padding: 0; }
  .main-content { width: 100%; }
  .entry-card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .card-detail { animation: none; }
  .meta-table { border: 1px solid #ccc; }
  .chart-card { break-inside: avoid; }
}

@media (max-width: 640px) {
  .site-nav,
  .nav-dropdown {
    display: none;
  }
  .header-search {
    width: 180px;
  }
  .home-title {
    font-size: 1.375rem;
  }
  .stats-cards {
    grid-template-columns: 1fr 1fr;
  }
  .tile-grid {
    gap: 0.5rem;
  }
  .category-tile {
    min-width: 100px;
    padding: 0.625rem 0.875rem;
  }
}
