:root {
  --navy: #16263b;
  --navy-deep: #0f1b2b;
  --navy-soft: #253d5b;
  --gold: #b0883e;
  --gold-light: #e5d3a8;
  --crimson: #8b2635;
  --teal: #1b5e54;
  --parchment: #faf6ee;
  --paper: #fffdf9;
  --ink: #24211d;
  --muted: #625a4f;
  --border: #dfd4be;
  --shadow: 0 6px 24px rgba(22, 38, 59, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--parchment);
  color: var(--ink);
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: 16.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-soft); }
a:hover { color: var(--gold); }

/* Navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(18, 32, 51, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--gold);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-light);
  text-decoration: none;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.nav-links a {
  color: #f2ece0;
  text-decoration: none;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13.5px;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}
.viewer-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(229, 211, 168, 0.35);
  border-radius: 4px;
  padding: 4px 10px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12.5px;
  color: var(--gold-light);
}
.viewer-picker select {
  background: #16263b;
  color: #fffdf8;
  border: 1px solid rgba(229, 211, 168, 0.45);
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 12.5px;
  cursor: pointer;
}
.btn-outline-gold {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid var(--gold);
  border-radius: 3px;
  padding: 5px 12px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: none;
}
.btn-outline-gold:hover {
  background: var(--gold);
  color: #fff;
}
.btn-primary {
  display: inline-block;
  background: var(--navy);
  color: #faf6ee;
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 11px 22px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--navy-soft); color: var(--gold-light); }
.btn-gold {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 11px 22px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-gold:hover { background: #96722f; color: #fff; }

/* Hero Banners */
.hero-dark {
  background: linear-gradient(180deg, #101d2e 0%, #192e49 70%, #213958 100%);
  color: #faf6ee;
  text-align: center;
  padding: 46px 24px 36px;
  border-bottom: 4px solid var(--gold);
}
.hero-dark.gawron-theme {
  background: linear-gradient(180deg, #27151a 0%, #3d1e26 65%, #1c2c42 100%);
}
.hero-dark h1 {
  font-size: clamp(28px, 4.4vw, 46px);
  font-weight: 400;
  margin-bottom: 10px;
  color: #fffdf8;
}
.hero-dark .subtitle {
  max-width: 740px;
  margin: 0 auto;
  font-size: 17.5px;
  font-style: italic;
  color: var(--gold-light);
}
.hero-svg-arms {
  max-width: 540px;
  width: 100%;
  margin: 0 auto 14px;
  display: block;
}
.kicker {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 2.3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

/* Containers & Cards */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 38px 42px;
  margin-bottom: 34px;
  border-radius: 4px;
}
.panel h2 {
  font-size: 28px;
  font-weight: 400;
  color: var(--navy);
  border-bottom: 2px solid var(--gold-light);
  padding-bottom: 10px;
  margin-bottom: 18px;
}
.panel h3 {
  font-size: 20px;
  color: var(--navy-soft);
  margin: 24px 0 10px;
}
.panel p { margin-bottom: 15px; }

/* Interactive Map Shell */
.map-shell {
  background: var(--paper);
  border: 2px solid var(--navy);
  outline: 1px solid var(--gold);
  outline-offset: -5px;
  box-shadow: 0 10px 30px rgba(22, 38, 59, 0.14);
  margin-bottom: 36px;
  border-radius: 3px;
  overflow: hidden;
}
.map-toolbar {
  background: #f4eee1;
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.map-filter-btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--navy);
  padding: 5px 12px;
  border-radius: 20px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.map-filter-btn:hover { border-color: var(--gold); }
.map-filter-btn.active {
  background: var(--navy);
  color: var(--gold-light);
  border-color: var(--navy);
}
.interactive-map {
  width: 100%;
  height: 540px;
  z-index: 1;
}
.map-caption-bar {
  background: #f8f4eb;
  border-top: 1px solid var(--border);
  padding: 10px 18px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Hoverable Person & Place Links (Mini-Bio Trigger) */
.bio-ref, .place-ref {
  text-decoration: none;
  border-bottom: 1.5px dotted var(--gold);
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0 2px;
  border-radius: 2px;
}
.bio-ref:hover {
  background: rgba(176, 136, 62, 0.18);
  color: var(--navy-deep);
}
.place-ref {
  border-bottom-color: var(--teal);
  color: var(--teal);
}
.place-ref:hover {
  background: rgba(27, 94, 84, 0.12);
}

/* Floating Mini-Bio Tooltip Card */
.mini-bio-popover {
  position: fixed;
  z-index: 2000;
  width: 330px;
  max-width: calc(100vw - 24px);
  background: #fffdf9;
  border: 2px solid var(--navy);
  outline: 1px solid var(--gold);
  outline-offset: -4px;
  box-shadow: 0 12px 32px rgba(15, 27, 43, 0.28);
  padding: 14px 16px;
  border-radius: 4px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  display: none;
}
.mini-bio-popover.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.mini-bio-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.mini-bio-thumb {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
  background: #16263b;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 16px;
}
.mini-bio-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}
.mini-bio-dates {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 11.5px;
  color: var(--muted);
}
.mini-bio-rel {
  display: inline-block;
  margin-top: 3px;
  background: var(--gold-light);
  color: var(--navy);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}
.mini-bio-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: #332e27;
  margin-bottom: 8px;
}
.mini-bio-link {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
}
.mini-bio-link:hover { color: var(--gold); }

/* Grids & Galleries */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin: 22px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 22px 0; }
.photo-card {
  background: #f6f1e6;
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 3px;
}
.photo-card img { width: 100%; height: auto; display: block; border: 1px solid #d4c8b0; }
.photo-card figcaption {
  margin-top: 8px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.info-card {
  background: #f8f4eb;
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  padding: 18px 20px;
  border-radius: 3px;
}
.info-card.war { border-top-color: var(--crimson); }
.info-card.gold { border-top-color: var(--gold); }
.info-card.teal { border-top-color: var(--teal); }
.info-card h4 { font-size: 17px; color: var(--navy); margin-bottom: 6px; }
.info-card p { font-size: 14.5px; margin-bottom: 0; }

/* Quotes */
blockquote {
  margin: 22px 0;
  padding: 16px 24px;
  background: #f5efe3;
  border-left: 4px solid var(--gold);
  font-style: italic;
  font-size: 17.5px;
}
blockquote cite {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 5px;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c9bea8;
  border-radius: 4px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14.5px;
  background: #fff;
}
.form-group input:focus, .form-group textarea:focus {
  outline: 2px solid var(--gold);
  border-color: var(--gold);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 28px 24px 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
}

/* Confidence Level Gauge & Sources */
.conf-box {
  background: #f8f4eb;
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: 4px;
  padding: 14px 18px;
  margin: 16px 0 22px;
  font-family: "Segoe UI", Arial, sans-serif;
}
.conf-box.probable { border-left-color: #c28a1e; }
.conf-box.lead { border-left-color: #8b2635; }
.conf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.conf-label {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--navy);
}
.conf-meter {
  height: 8px;
  background: #e4dac6;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.conf-meter-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s ease;
}
.conf-meter-fill.confirmed { width: 95%; background: linear-gradient(90deg, #1b5e54, #2b8a78); }
.conf-meter-fill.probable { width: 68%; background: linear-gradient(90deg, #b0883e, #d4a442); }
.conf-meter-fill.lead { width: 32%; background: linear-gradient(90deg, #8b2635, #b84a5a); }
.conf-note {
  font-size: 13px;
  color: #443e35;
  line-height: 1.45;
}
.conf-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
}
.conf-pill.confirmed { background: #e3f3ef; color: #145047; border: 1px solid #9fd0c4; }
.conf-pill.probable { background: #fbf2de; color: #7d570e; border: 1px solid #dfc17b; }
.conf-pill.lead { background: #fbeaea; color: #7a1c27; border: 1px solid #e0a7ae; }
.conf-dots { letter-spacing: 1px; font-size: 10px; }

.sources-panel {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 2px solid var(--gold-light);
}
.sources-panel h3 {
  font-size: 18px;
  color: var(--navy);
  margin: 0 0 12px;
}
.sources-list {
  list-style: none;
  display: grid;
  gap: 9px;
}
.sources-list li {
  background: #f8f4eb;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 9px 13px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.sources-list a {
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}
.sources-list a:hover { color: var(--gold); text-decoration: underline; }
.source-ref {
  font-size: 11.5px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .panel { padding: 24px 18px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .interactive-map { height: 420px; }
}
