/* ============================================
   POLONIA — Живая История / Żywa Historia
   CSS — Light Parchment Theme
   ============================================ */

:root {
  --red: #D4213D;
  --red-dark: #A50E2D;
  --red-light: #FF4D6D;
  --white: #FFFFFF;
  --cream: #231A0C;
  --parchment: #FCFBF9;
  --parchment-2: #F3F1ED;
  --parchment-3: #E4E0D9;
  --dark: #FAF8F5;
  --dark-2: #F2EFEA;
  --brown: #5C3D1E;
  --gold: #B8821E;
  --gold-light: #C9963A;
  --ink: #1E1B17;

  /* Цвета сезонов — тонкая дуга по краю кругового календаря */
  --season-winter: #7FA8C9;
  --season-spring: #7FBE8B;
  --season-summer: #E6BE55;
  --season-autumn: #CE7B4E;

  /* Чистый шрифт без засечек для интерфейсных элементов (календарь и т.п.) */
  --font-ui: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  --font-display: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-accent: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--parchment);
  color: var(--ink);
  overflow-x: hidden;
}

/* ============ LOADER ============ */
.loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--parchment);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-eagle svg { width: 100px; animation: pulse 1.5s ease infinite; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
.loader-text {
  font-family: var(--font-display);
  font-size: 2.5rem; font-weight: 900;
  letter-spacing: 0.3em;
  color: var(--red);
  animation: fadeInUp 0.8s ease 0.3s both;
}
@keyframes fadeInUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

/* ============ HEADER ============ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0.8rem 2.5rem;
  background: rgba(245, 236, 216, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(184, 130, 30, 0.2);
  transition: var(--transition);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 2rem;
}
.logo { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; }
.logo-eagle { font-size: 1.5rem; color: var(--gold); }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-main {
  font-family: var(--font-display); font-weight: 900;
  font-size: 1.2rem; letter-spacing: 0.2em;
  color: var(--ink);
}
.logo-sub { font-size: 0.7rem; letter-spacing: 0.15em; color: var(--gold); font-style: italic; }

.main-nav { display: flex; gap: 0.2rem; margin-left: auto; }
.nav-link {
  font-family: var(--font-body); font-size: 0.9rem;
  color: rgba(35, 26, 12, 0.65);
  text-decoration: none; padding: 0.4rem 0.8rem;
  border-radius: 2px; letter-spacing: 0.05em;
  transition: var(--transition);
  position: relative;
}
.nav-link::after {
  content: ''; position: absolute; bottom: 0; left: 50%; right: 50%;
  height: 1px; background: var(--gold);
  transition: var(--transition);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { left: 0.8rem; right: 0.8rem; }

.lang-switcher { display: flex; align-items: center; gap: 0.4rem; }
.lang-sep { color: var(--gold); }
.lang-btn {
  background: none; border: 1px solid transparent;
  color: rgba(35, 26, 12, 0.5);
  font-family: var(--font-body); font-size: 0.8rem;
  font-weight: 600; letter-spacing: 0.1em;
  padding: 0.3rem 0.5rem; cursor: pointer;
  border-radius: 2px; transition: var(--transition);
}
.lang-btn:hover { color: var(--ink); border-color: rgba(184, 130, 30, 0.3); }
.lang-btn.active { color: var(--gold); border-color: var(--gold); }

/* ============ HERO ============ */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; }
.hero-stripes {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
}
.stripe.white { flex: 1; background: var(--white); }
.stripe.red { flex: 0 0 42%; background: var(--red); opacity: 0.10; }
.hero-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 45%, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 78%);
}
.hero-pattern {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 60px,
      rgba(201, 150, 58, 0.03) 60px,
      rgba(201, 150, 58, 0.03) 61px
    );
}

.hero-content {
  position: relative; z-index: 2;
  max-width: 800px; padding: 8rem 2rem 4rem;
  text-align: left;
}
.hero-eyebrow {
  font-size: 0.75rem; letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red); margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s ease 0.5s both;
}
.hero-title {
  font-family: var(--font-display);
  line-height: 1.05;
  margin-bottom: 1.5rem;
}
.hero-line-1 {
  display: block;
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 400; font-style: italic;
  color: var(--ink);
  animation: fadeInUp 0.8s ease 0.6s both;
}
.hero-line-2 {
  display: block;
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 900;
  color: var(--red);
  text-shadow: 0 0 60px rgba(220, 20, 60, 0.3);
  animation: fadeInUp 0.8s ease 0.75s both;
}
.hero-desc {
  font-size: 1.2rem; line-height: 1.7;
  color: rgba(30, 27, 23, 0.72);
  max-width: 540px; margin-bottom: 2.5rem;
  animation: fadeInUp 0.8s ease 0.9s both;
}
.hero-actions {
  display: flex; gap: 1rem; flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 1.05s both;
}
.btn-primary {
  background: var(--red); color: var(--white);
  padding: 0.9rem 2rem; text-decoration: none;
  font-family: var(--font-body); font-size: 1rem;
  letter-spacing: 0.1em; font-weight: 600;
  border: 2px solid var(--red);
  transition: var(--transition);
}
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); transform: translateY(-2px); }
.btn-secondary {
  background: transparent; color: var(--ink);
  padding: 0.9rem 2rem; text-decoration: none;
  font-family: var(--font-body); font-size: 1rem;
  letter-spacing: 0.1em;
  border: 2px solid rgba(212, 33, 61, 0.45);
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--red); color: var(--red); transform: translateY(-2px); }

.hero-scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(245, 238, 216, 0.4);
  animation: fadeInUp 0.8s ease 1.3s both;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, rgba(201,150,58,0.6), transparent);
  animation: scrollPulse 2s ease infinite;
}
@keyframes scrollPulse { 0%{transform:scaleY(0);transform-origin:top} 50%{transform:scaleY(1);transform-origin:top} 51%{transform:scaleY(1);transform-origin:bottom} 100%{transform:scaleY(0);transform-origin:bottom} }

/* ============ STATS BAR ============ */
.stats-bar {
  background: var(--red-dark);
  padding: 1.5rem 2rem;
  display: flex; justify-content: center; align-items: center;
  gap: 2rem; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(0,0,0,0.2);
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--font-display); font-size: 2rem; font-weight: 900;
  color: var(--white); line-height: 1;
}
.stat-label { font-size: 0.75rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.6); }
.stat-div { width: 1px; height: 3rem; background: rgba(255,255,255,0.2); }

/* ============ SECTIONS ============ */
.section {
  padding: 5rem 2rem;
  max-width: 1400px; margin: 0 auto;
}

/* Изолируем карту в отдельный stacking context — чтобы event-panel была поверх */
#map {
  position: relative;
  z-index: 0;
}
.section-dark {
  max-width: none;
  background: var(--parchment-2);
  padding: 5rem 2rem;
}
.section-dark > * { max-width: 1400px; margin-left: auto; margin-right: auto; }
.section-dark .section-header,
.section-dark .months-wheel,
.section-dark .culture-grid { max-width: 1400px; margin-left: auto; margin-right: auto; }

.section-header {
  display: flex; gap: 2rem; align-items: flex-start;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(184, 130, 30, 0.25);
}
.section-num {
  font-family: var(--font-display); font-size: 5rem; font-weight: 900;
  color: rgba(184, 130, 30, 0.2); line-height: 1;
  flex-shrink: 0; user-select: none;
}
.section-title-block h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700; color: var(--ink);
  margin-bottom: 0.6rem;
}
.section-title-block p { font-size: 1.05rem; color: rgba(35, 26, 12, 0.6); line-height: 1.6; }

/* ============ MAP ============ */
.map-controls {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.map-filter {
  background: rgba(184, 130, 30, 0.08);
  border: 1px solid rgba(184, 130, 30, 0.25);
  color: rgba(35, 26, 12, 0.65);
  padding: 0.4rem 0.9rem; font-family: var(--font-body);
  font-size: 0.85rem; cursor: pointer; border-radius: 2px;
  transition: var(--transition);
}
.map-filter:hover, .map-filter.active {
  background: var(--red); border-color: var(--red); color: var(--white);
}

.map-wrapper {
  position: relative; border-radius: 4px; overflow: hidden;
  border: 1px solid rgba(184, 130, 30, 0.25);
}
#main-map { height: 550px; background: var(--parchment-2); }
.map-legend {
  position: absolute; bottom: 1rem; right: 1rem; z-index: 500;
  background: rgba(245, 236, 216, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(184, 130, 30, 0.3);
  padding: 0.8rem 1rem; border-radius: 4px;
  min-width: 140px;
}
.legend-title {
  font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.6rem;
}
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; margin-bottom: 0.4rem; color: var(--ink); }
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.legend-dot.battle { background: var(--red); }
.legend-dot.capital { background: var(--gold); }
.legend-dot.culture { background: #4CAF50; }
.legend-dot.tragedy { background: #7B2D8B; }

.event-panel {
  position: fixed; right: -420px; top: 50%; transform: translateY(-50%);
  z-index: 9999; transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 380px;
}
.event-panel.open { right: 1.5rem; }
.event-panel-inner {
  background: var(--parchment);
  border: 1px solid rgba(184, 130, 30, 0.3);
  border-radius: 4px; padding: 2rem;
  position: relative; box-shadow: -8px 0 32px rgba(35,26,12,0.15);
}
.event-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; color: var(--ink);
  font-size: 1rem; cursor: pointer; opacity: 0.4;
  transition: opacity 0.2s;
}
.event-close:hover { opacity: 1; }
.event-year {
  font-family: var(--font-display); font-size: 3rem; font-weight: 900;
  color: rgba(184, 130, 30, 0.25); line-height: 1; margin-bottom: 0.5rem;
}
.event-title {
  font-family: var(--font-display); font-size: 1.4rem;
  color: var(--ink); margin-bottom: 1rem;
}
.event-desc { font-size: 0.95rem; line-height: 1.7; color: rgba(35, 26, 12, 0.75); }
.event-tags { margin-top: 1rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.event-tag {
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.2rem 0.6rem; border-radius: 2px;
  background: rgba(220, 20, 60, 0.08); color: var(--red-dark);
  border: 1px solid rgba(220, 20, 60, 0.2);
}

/* ============ CALENDAR ============ */
/* ── Круговой календарь года ── */
.year-wheel-wrap {
  display: flex; gap: 2.5rem; align-items: center;
  flex-wrap: wrap; justify-content: center;
}
.year-wheel { flex: 0 0 440px; max-width: 100%; }
.wheel-svg {
  width: 100%; height: auto; display: block; overflow: visible;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.06));
}

.wheel-seg {
  fill: #fff; stroke: #eceae6; stroke-width: 1; cursor: pointer;
  transition: fill 0.18s ease;
}
.wheel-seg:hover { fill: #fdeef1; }
.wheel-seg.active { fill: var(--red); stroke: var(--red); }

.wheel-band { stroke: #fff; stroke-width: 0.6; cursor: pointer; }

.wheel-num {
  font-family: var(--font-ui); font-size: 14px; font-weight: 600;
  fill: #6b655e; text-anchor: middle; dominant-baseline: central;
  cursor: pointer; letter-spacing: 0.4px;
}
.wheel-num.active { fill: #fff; font-weight: 700; }

.wheel-center-bg { fill: #fff; stroke: #ededed; stroke-width: 1; }
.wheel-center-num {
  font-family: var(--font-ui); font-size: 46px; font-weight: 800;
  fill: var(--red); text-anchor: middle; dominant-baseline: central;
}
.wheel-center-name {
  font-family: var(--font-ui); font-size: 19px; font-weight: 600;
  fill: var(--ink); text-anchor: middle; dominant-baseline: central;
}
.wheel-center-season {
  font-family: var(--font-ui); font-size: 10.5px; font-weight: 600;
  fill: #a49c92; text-anchor: middle; dominant-baseline: central;
  letter-spacing: 1.6px; text-transform: uppercase;
}

.month-content {
  flex: 1 1 340px; min-width: 300px;
  background: #fff;
  border: 1px solid rgba(184, 130, 30, 0.18);
  border-top: 3px solid var(--red);
  border-radius: 4px; padding: 2rem;
  min-height: 400px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.05);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

.month-display-name {
  font-family: var(--font-display); font-size: 2rem;
  font-weight: 900; color: var(--ink); margin-bottom: 0.3rem;
}
.month-season {
  font-size: 0.8rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.5rem;
}
.holiday-list { display: flex; flex-direction: column; gap: 1rem; }
.holiday-item {
  padding: 1rem; border-radius: 2px;
  border: 1px solid rgba(184, 130, 30, 0.12);
  background: rgba(184, 130, 30, 0.03);
  transition: var(--transition);
}
.holiday-item:hover { border-color: rgba(184, 130, 30, 0.25); background: rgba(184, 130, 30, 0.06); }
.holiday-date { font-size: 0.75rem; color: var(--gold); letter-spacing: 0.1em; margin-bottom: 0.3rem; }
.holiday-name { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); margin-bottom: 0.4rem; }
.holiday-desc { font-size: 0.9rem; color: rgba(35, 26, 12, 0.65); line-height: 1.6; }
.holiday-emoji { font-size: 1.5rem; float: right; margin-left: 1rem; }

/* Кликабельный праздник (со статьёй) */
.holiday-item.clickable { cursor: pointer; }
.holiday-item.clickable:hover {
  border-color: rgba(184, 130, 30, 0.45);
  background: rgba(184, 130, 30, 0.09);
  transform: translateX(3px);
}
.holiday-more {
  margin-top: 0.6rem;
  font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
}

/* ─── Модальное окно со статьёй о празднике ─── */
.holiday-modal-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(20, 14, 4, 0.6); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease;
}
.holiday-modal-overlay.open { opacity: 1; visibility: visible; }

.holiday-modal {
  position: fixed; z-index: 1201;
  top: 50%; left: 50%;
  transform: translate(-50%, -46%);
  width: min(680px, 92vw);
  max-height: 88vh; overflow-y: auto;
  background: var(--white);
  border-top: 4px solid var(--red);
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, transform 0.3s ease;
}
.holiday-modal.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }
.holiday-modal-inner { padding: 2.5rem 2.5rem 2rem; position: relative; }

.holiday-modal-close {
  position: absolute; top: 1rem; right: 1.2rem;
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; color: rgba(35, 26, 12, 0.4); line-height: 1;
  transition: color 0.2s ease;
}
.holiday-modal-close:hover { color: var(--red); }

.holiday-modal-emoji { font-size: 2.6rem; margin-bottom: 0.5rem; }
.holiday-modal-date {
  font-size: 0.8rem; color: var(--gold);
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.4rem;
}
.holiday-modal-title {
  font-family: var(--font-display); font-size: 1.8rem;
  color: var(--ink); line-height: 1.2; margin-bottom: 1.3rem;
}
.holiday-modal-body p {
  font-size: 1rem; line-height: 1.75;
  color: rgba(35, 26, 12, 0.82); margin-bottom: 1rem;
}
.holiday-figure { margin: 0 0 1.3rem; }
.holiday-figure img {
  width: 100%; height: auto; border-radius: 3px; display: block;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.holiday-figure figcaption {
  font-size: 0.78rem; color: rgba(35, 26, 12, 0.5);
  font-style: italic; margin-top: 0.4rem; text-align: center;
}
/* Блокируем прокрутку фона, пока открыта модалка */
body.modal-open { overflow: hidden; }

/* ============ TIMELINE ============ */
.timeline {
  position: relative; padding-left: 3rem;
}
.timeline::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 1px; background: linear-gradient(to bottom, transparent, var(--gold) 10%, var(--gold) 90%, transparent);
}
.timeline-item {
  position: relative; margin-bottom: 2.5rem;
  animation: fadeInUp 0.6s ease both;
}
.timeline-item::before {
  content: ''; position: absolute; left: -3.35rem; top: 0.4rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--parchment); border: 2px solid var(--gold);
  transition: var(--transition);
}
.timeline-item:hover::before { background: var(--gold); transform: scale(1.3); }
.tl-year {
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 700;
  color: var(--gold); letter-spacing: 0.1em; margin-bottom: 0.3rem;
}
.tl-title { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); margin-bottom: 0.5rem; }
.tl-desc { font-size: 0.95rem; line-height: 1.7; color: rgba(35, 26, 12, 0.65); max-width: 600px; }
.tl-tag {
  display: inline-block; margin-top: 0.5rem;
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 2px; border: 1px solid;
}
.tl-tag.piast { color: var(--gold); border-color: rgba(184,130,30,0.4); }
.tl-tag.jagiello { color: #7B4FA8; border-color: rgba(123,79,168,0.4); }
.tl-tag.rzecz { color: #3A7FA8; border-color: rgba(58,127,168,0.4); }
.tl-tag.partitions { color: #A85A3A; border-color: rgba(168,90,58,0.4); }
.tl-tag.modern { color: #3A8A5A; border-color: rgba(58,138,90,0.4); }

/* ============ CULTURE ============ */
.culture-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 1400px; margin: 0 auto;
}
.culture-card {
  background: rgba(245, 236, 216, 0.7);
  border: 1px solid rgba(184, 130, 30, 0.15);
  border-radius: 4px; padding: 1.8rem;
  transition: var(--transition);
  cursor: pointer;
}
.culture-card:hover {
  border-color: rgba(184, 130, 30, 0.4);
  background: rgba(245, 236, 216, 0.9);
  transform: translateY(-3px);
}
.culture-card-wide { grid-column: span 3; }
.culture-icon { font-size: 2rem; margin-bottom: 0.8rem; }
.culture-card h3 {
  font-family: var(--font-display); font-size: 1.25rem;
  color: var(--ink); margin-bottom: 0.6rem;
}
.culture-card p { font-size: 0.9rem; line-height: 1.6; color: rgba(35, 26, 12, 0.65); }

/* ============ ABOUT ============ */
.section-about {
  background: var(--parchment-2);
  padding: 5rem 2rem;
  text-align: center;
  max-width: none;
  border-top: 1px solid rgba(184, 130, 30, 0.15);
}
.about-inner { max-width: 600px; margin: 0 auto; }
.about-eagle { font-size: 4rem; color: var(--gold); opacity: 0.3; margin-bottom: 1.5rem; }
.section-about h2 {
  font-family: var(--font-display); font-size: 2.5rem; font-weight: 700;
  color: var(--ink); margin-bottom: 1.2rem;
}
.section-about p { font-size: 1.05rem; line-height: 1.75; color: rgba(35, 26, 12, 0.7); margin-bottom: 2rem; }
.langs-coming { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.lang-tag {
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.7rem; border-radius: 2px;
  border: 1px solid rgba(184, 130, 30, 0.2);
  color: rgba(35, 26, 12, 0.35);
}
.lang-tag.active { color: var(--gold); border-color: var(--gold); }
.about-small { font-size: 0.8rem !important; color: rgba(35,26,12,0.4) !important; }

/* ============ FOOTER ============ */
.site-footer {
  background: var(--parchment-2);
  border-top: 1px solid rgba(184, 130, 30, 0.1);
  padding: 2rem;
  text-align: center;
}
.footer-inner { max-width: 1400px; margin: 0 auto; }
.footer-logo {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 900;
  letter-spacing: 0.2em; color: var(--gold); margin-bottom: 0.5rem;
}
.footer-inner p { font-size: 0.8rem; letter-spacing: 0.1em; color: rgba(35, 26, 12, 0.35); margin-bottom: 0.3rem; }
.footer-copy { font-size: 0.75rem; color: rgba(35, 26, 12, 0.25); }

/* ============ LEAFLET OVERRIDES ============ */
.leaflet-container { background: var(--parchment-2) !important; position: relative; z-index: 1; }
.leaflet-tile { filter: brightness(0.95); }
.leaflet-popup-content-wrapper {
  background: var(--parchment) !important;
  border: 1px solid rgba(184, 130, 30, 0.3) !important;
  border-radius: 4px !important; color: var(--ink) !important;
  box-shadow: 0 4px 20px rgba(35,26,12,0.15) !important;
}
.leaflet-popup-tip { background: var(--parchment) !important; }
.leaflet-popup-content { font-family: var(--font-body); font-size: 0.9rem; color: var(--ink); }
.leaflet-control-zoom a {
  background: var(--parchment) !important; color: var(--ink) !important;
  border: 1px solid rgba(184,130,30,0.3) !important;
}
.leaflet-control-zoom a:hover { background: var(--parchment-2) !important; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .year-wheel-wrap { gap: 1.5rem; }
  .year-wheel { flex-basis: 320px; }
  .culture-grid { grid-template-columns: 1fr 1fr; }
  .culture-card-wide { grid-column: span 2; }
  .main-nav { display: none; }
  .stats-bar { gap: 1rem; }
  .stat-div { display: none; }
}
@media (max-width: 600px) {
  .culture-grid { grid-template-columns: 1fr; }
  .culture-card-wide { grid-column: span 1; }
  .section-header { flex-direction: column; gap: 0.5rem; }
  .section-num { font-size: 3rem; }
}

/* ============ LANG PANEL ============ */
.lang-panel-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(35,26,12,0.4); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.lang-panel-overlay.open { opacity: 1; visibility: visible; }

.lang-panel {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(0.95);
  z-index: 400; width: min(560px, 94vw);
  background: var(--parchment);
  border: 1px solid rgba(184, 130, 30, 0.3);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(35,26,12,0.2);
  opacity: 0; visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.lang-panel.open { opacity: 1; visibility: visible; transform: translate(-50%,-50%) scale(1); }
.lang-panel-inner { padding: 2rem; position: relative; }
.lang-panel-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; color: rgba(35,26,12,0.4);
  font-size: 1.1rem; cursor: pointer; transition: color 0.2s;
}
.lang-panel-close:hover { color: var(--ink); }
.lang-panel-title {
  font-family: var(--font-body); font-size: 0.8rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.5rem;
}
.lang-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
}
.lang-option {
  display: flex; align-items: center; gap: 0.6rem;
  background: rgba(184,130,30,0.05);
  border: 1px solid rgba(184,130,30,0.15);
  border-radius: 4px; padding: 0.6rem 0.8rem;
  cursor: pointer; text-align: left;
  transition: var(--transition);
}
.lang-option:hover { background: rgba(184,130,30,0.1); border-color: rgba(184,130,30,0.3); }
.lang-option.active { background: rgba(220,20,60,0.08); border-color: var(--red); }
.lo-flag { font-size: 1.3rem; flex-shrink: 0; }
.lo-name { font-family: var(--font-body); font-size: 0.9rem; color: var(--ink); }

/* ── LANG TOGGLE BUTTON ── */
.lang-toggle {
  display: flex; align-items: center; gap: 0.4rem;
  background: rgba(184,130,30,0.08);
  border: 1px solid rgba(184,130,30,0.25);
  color: var(--ink); padding: 0.4rem 0.9rem;
  border-radius: 3px; cursor: pointer; font-family: var(--font-body);
  font-size: 0.85rem; transition: var(--transition);
  white-space: nowrap;
}
.lang-toggle:hover { background: rgba(184,130,30,0.15); border-color: var(--gold); }
.lang-toggle-flag { font-size: 1.1rem; }
.lang-toggle-arrow { color: var(--gold); font-size: 0.7rem; }
.lang-toggle-name { color: rgba(35,26,12,0.8); }

/* ── HEADER SCROLLED STATE ── */
.site-header.scrolled { box-shadow: 0 2px 20px rgba(35,26,12,0.1); }

/* ── LOADER SUB ── */
.loader-emblem { font-size: 3rem; color: var(--gold); animation: pulse 1.5s ease infinite; margin-bottom: 0.5rem; }
.loader-sub { font-family: var(--font-accent); font-size: 1rem; color: rgba(184,130,30,0.7); letter-spacing: 0.2em; margin-top: 0.3rem; }

/* ── HERO RED BLOCK ── */
.hero-red-block {
  position: absolute; right: 0; top: 0; bottom: 0; width: 35%;
  background: linear-gradient(to left, rgba(165,14,45,0.12), transparent);
  pointer-events: none;
}

/* ── DARK WRAP SECTIONS ── */
.section-dark-wrap {
  background: var(--parchment-2);
  border-top: 1px solid rgba(184,130,30,0.12);
  border-bottom: 1px solid rgba(184,130,30,0.12);
}
.section-dark-wrap .section { background: transparent; }

/* ── LANG PILLS (about section) ── */
.langs-all {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  justify-content: center; margin: 1.5rem 0 0.5rem;
}
.lang-pill {
  font-family: var(--font-body); font-size: 0.8rem;
  padding: 0.3rem 0.7rem; border-radius: 3px;
  border: 1px solid rgba(184,130,30,0.2);
  background: none; color: rgba(35,26,12,0.45);
  cursor: pointer; transition: var(--transition);
}
.lang-pill:hover { color: var(--ink); border-color: rgba(184,130,30,0.4); }
.lang-pill.active { color: var(--gold); border-color: var(--gold); background: rgba(184,130,30,0.06); }

/* ── CULTURE MOTTO ── */
.culture-motto {
  margin-top: 0.8rem !important;
  font-family: var(--font-display) !important;
  color: var(--gold) !important; font-size: 1.1rem !important;
}

/* ── ABOUT EMBLEM ── */
.about-emblem { font-size: 4rem; color: var(--gold); opacity: 0.25; margin-bottom: 1.5rem; }

@media (max-width: 500px) {
  .lang-grid { grid-template-columns: repeat(2, 1fr); }
  .lang-toggle-name { display: none; }
}
