/* =============================================================
   Скобелев · Историография 1881–2026
   Design tokens + base + components
   ============================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Palette — тёплый пергамент, глубокий бордовый, ночной чёрный */
  --parchment:      #F4EFE6;
  --parchment-2:    #EDE6D8;
  --parchment-3:    #FAF7F1;
  --ink:            #1A1614;
  --ink-2:          #3E3730;
  --muted:          #6E645A;
  --hairline:       #C9BFB1;
  --hairline-soft:  #E0D7C6;
  --burgundy:       #7A2E2E;
  --burgundy-dark:  #4E1B1B;
  --gold:           #B08838;

  /* Type scale — clamp() responsive */
  --text-xs:   clamp(0.75rem,  0.72rem + 0.15vw, 0.83rem);
  --text-sm:   clamp(0.875rem, 0.84rem + 0.15vw, 0.95rem);
  --text-base: clamp(1rem,     0.96rem + 0.2vw,  1.1rem);
  --text-lg:   clamp(1.125rem, 1.06rem + 0.3vw,  1.25rem);
  --text-xl:   clamp(1.5rem,   1.3rem  + 0.9vw,  2rem);
  --text-2xl:  clamp(2rem,     1.6rem  + 1.8vw,  3rem);
  --text-3xl:  clamp(2.5rem,   1.8rem  + 3vw,    4.5rem);
  --text-hero: clamp(3rem,     2rem    + 4.5vw,  6rem);

  /* Spacing */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;  --sp-3: 0.75rem;
  --sp-4: 1rem;     --sp-5: 1.5rem;  --sp-6: 2rem;
  --sp-8: 3rem;     --sp-10: 4rem;   --sp-12: 5rem;
  --sp-16: 7rem;    --sp-20: 9rem;

  /* Layout */
  --container: 1240px;
  --container-narrow: 780px;
  --container-wide: 1440px;
  --radius: 4px;
  --radius-lg: 10px;
  --header-h: 72px;

  /* Fonts (загружаются через <link> в HTML) */
  --font-display: 'Playfair Display', 'EB Garamond', 'Georgia', serif;
  --font-body: 'Source Sans 3', 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html:focus-within { scroll-behavior: smooth; }
img, picture, svg { max-width: 100%; display: block; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: var(--burgundy); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--burgundy-dark); text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--burgundy); color: var(--parchment); }

/* ---------- Base ---------- */
html { font-size: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--parchment);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { max-width: 68ch; }
.wide p { max-width: none; }
p + p { margin-top: 1em; }

.overline {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 500;
}

.dropcap::first-letter {
  font-family: var(--font-display);
  font-size: 4.2em;
  float: left;
  line-height: 0.85;
  padding: 0.08em 0.12em 0 0;
  color: var(--burgundy);
  font-weight: 700;
}

/* ---------- Container ---------- */
.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}
.container-narrow { width: min(100% - 2rem, var(--container-narrow)); margin-inline: auto; }
.container-wide { width: min(100% - 2rem, var(--container-wide)); margin-inline: auto; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 239, 230, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline-soft);
}
.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand__mark {
  width: 34px; height: 34px;
  flex-shrink: 0;
}
.brand__text small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.65rem;
}
.nav a {
  font-size: 0.9rem;
  color: var(--ink-2);
  font-weight: 500;
  position: relative;
  padding: 6px 0;
}
.nav a:hover { color: var(--burgundy); text-decoration: none; }
.nav a.is-active { color: var(--burgundy); }
.nav a.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--burgundy);
}

.nav-toggle {
  display: none;
  width: 32px; height: 32px;
  color: var(--ink);
  padding: 0;
}
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--parchment);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1rem 1.25rem;
    border-bottom: 1px solid var(--hairline);
    transform: translateY(-110%);
    transition: transform .25s ease;
  }
  .nav.is-open { transform: translateY(0); }
  .nav a {
    width: 100%;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--hairline-soft);
    font-size: 1rem;
  }
  .nav a:last-child { border-bottom: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(4rem, 8vw, 8rem) 0 clamp(3rem, 6vw, 6rem);
  position: relative;
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero__eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-bottom: 1.25rem;
}
.hero__title {
  font-size: var(--text-hero);
  line-height: 1.02;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: manual;
}
@media (max-width: 720px) {
  .hero__title { font-size: clamp(2.2rem, 8vw, 3rem); overflow-wrap: break-word; }
}
.hero__title em { font-style: italic; color: var(--burgundy); font-weight: 400; }
.hero__lede {
  font-size: var(--text-lg);
  color: var(--ink-2);
  max-width: 55ch;
  line-height: 1.55;
}
.hero__meta {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.hero__meta-item .num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--burgundy);
  line-height: 1;
  font-weight: 700;
  display: block;
}
.hero__meta-item .lbl {
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 0.35rem;
  display: block;
}
.hero__portrait {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--parchment-2);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,.25);
}
.hero__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.05) contrast(1.02);
}
.hero__portrait::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(26,22,20,.4) 100%);
  pointer-events: none;
}
.hero__caption {
  position: absolute;
  left: 1.2rem; right: 1.2rem; bottom: 1rem;
  color: var(--parchment);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

@media (max-width: 800px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__portrait { max-width: 460px; margin: 0 auto; }
}

/* ---------- Page header (interior pages) ---------- */
.page-header {
  padding: clamp(3rem, 5vw, 5rem) 0 clamp(1.5rem, 3vw, 3rem);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: clamp(2rem, 4vw, 4rem);
}
.page-header__eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--burgundy);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 1rem;
}
.page-header h1 {
  font-size: var(--text-3xl);
  max-width: 20ch;
  line-height: 1.06;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: manual;
}
@media (max-width: 720px) {
  .page-header h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); }
}
.page-header__lede {
  margin-top: 1.5rem;
  font-size: var(--text-lg);
  color: var(--ink-2);
  max-width: 68ch;
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(3rem, 6vw, 6rem);
}
.section--tight { padding-block: clamp(2rem, 4vw, 4rem); }
.section--muted { background: var(--parchment-2); }
.section__title {
  font-size: var(--text-2xl);
  margin-bottom: 0.6rem;
  max-width: 24ch;
}
.section__intro {
  color: var(--ink-2);
  max-width: 68ch;
  margin-bottom: clamp(1.5rem, 3vw, 3rem);
}

/* ---------- Card grids ---------- */
.grid {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

.card {
  background: var(--parchment-3);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color .2s ease, transform .2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card:hover { border-color: var(--hairline); }
.card--interactive:hover { transform: translateY(-2px); }
.card__eyebrow {
  font-size: var(--text-xs);
  color: var(--burgundy);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.6rem;
  font-weight: 600;
}
.card h3 { font-size: var(--text-lg); margin-bottom: 0.5rem; }
.card p { font-size: 0.95rem; color: var(--ink-2); line-height: 1.55; }
.card__meta {
  margin-top: auto;
  padding-top: 1rem;
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Feature card with image */
.feature-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--parchment-3);
  border: 1px solid var(--hairline-soft);
}
.feature-card__img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.feature-card__img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.feature-card:hover .feature-card__img img { transform: scale(1.03); }
.feature-card__body { padding: 1.5rem 1.75rem 1.75rem; }

/* Directory card (link to page) */
.directory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.dir-card {
  display: block;
  padding: 1.5rem;
  background: var(--parchment-3);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-lg);
  color: var(--ink);
  transition: all .2s ease;
  position: relative;
}
.dir-card:hover {
  color: var(--ink);
  text-decoration: none;
  border-color: var(--burgundy);
  transform: translateY(-2px);
}
.dir-card__num {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--burgundy);
  letter-spacing: 0.14em;
  margin-bottom: 0.75rem;
}
.dir-card h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.dir-card p { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
.dir-card__arrow {
  position: absolute;
  right: 1.25rem; bottom: 1.25rem;
  color: var(--burgundy);
  transition: transform .2s ease;
}
.dir-card:hover .dir-card__arrow { transform: translateX(4px); }

/* ---------- Buttons / Tags ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all .2s ease;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.btn--primary {
  background: var(--burgundy);
  color: var(--parchment);
}
.btn--primary:hover {
  background: var(--burgundy-dark);
  color: var(--parchment);
  text-decoration: none;
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline);
}
.btn--ghost:hover {
  border-color: var(--burgundy);
  color: var(--burgundy);
  text-decoration: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 999px;
  background: var(--parchment-2);
  color: var(--ink-2);
  border: 1px solid var(--hairline-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tag--burgundy { background: var(--burgundy); color: var(--parchment); border-color: var(--burgundy); }
.tag--gold { background: var(--gold); color: var(--ink); border-color: var(--gold); }

/* ---------- Tabs (used on historiography page) ---------- */
.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 2.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs__list::-webkit-scrollbar { display: none; }
.tabs__btn {
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all .15s ease;
}
.tabs__btn:hover { color: var(--ink); }
.tabs__btn.is-active {
  color: var(--burgundy);
  border-bottom-color: var(--burgundy);
  font-weight: 600;
}
.tabs__panel { display: none; }
.tabs__panel.is-active { display: block; animation: fadeIn .3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Timeline (life page/campaigns) ---------- */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--hairline);
  margin-top: 2rem;
}
.timeline__item { position: relative; padding-bottom: 2.5rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: '';
  position: absolute;
  left: -2.55rem;
  top: 0.5rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--burgundy);
  box-shadow: 0 0 0 3px var(--parchment);
}
.timeline__date {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--burgundy);
  margin-bottom: 0.25rem;
  font-weight: 700;
}
.timeline__title { font-size: 1rem; font-weight: 600; margin-bottom: 0.3rem; }
.timeline__text { font-size: 0.95rem; color: var(--ink-2); line-height: 1.55; }

/* ---------- Work list (historiography) ---------- */
.work {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 2rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.work:last-child { border-bottom: none; }
@media (min-width: 780px) {
  .work { grid-template-columns: 240px 1fr; }
}
.work__meta { display: flex; flex-direction: column; gap: 0.35rem; }
.work__year {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--burgundy);
  line-height: 1;
  font-weight: 700;
}
.work__author {
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 600;
  margin-top: 0.35rem;
}
.work__pub {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}
.work h3 {
  font-size: 1.15rem;
  line-height: 1.35;
  margin-bottom: 0.6rem;
  font-family: var(--font-display);
}
.work__desc {
  font-size: 0.95rem;
  color: var(--ink-2);
  line-height: 1.6;
}
.work__link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.85rem;
}
.work__tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 2rem 0; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table th, .table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--hairline-soft);
  vertical-align: top;
}
.table th {
  background: var(--parchment-2);
  font-weight: 600;
  color: var(--ink);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid var(--hairline);
}
.table tr:hover td { background: var(--parchment-3); }

/* ---------- Version comparison (death page) ---------- */
.version-card {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--hairline-soft);
  background: var(--parchment-3);
  border-left: 4px solid var(--burgundy);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.version-card__id {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--burgundy);
  line-height: 0.85;
  margin-bottom: 0.8rem;
  font-weight: 700;
}
.version-card h3 { font-size: 1.15rem; margin-bottom: 0.75rem; line-height: 1.3; }
.version-card p { font-size: 0.92rem; line-height: 1.55; color: var(--ink-2); }
.version-card__cred {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.version-card__cred strong { color: var(--ink); font-weight: 600; }
.version-card--low { border-left-color: var(--muted); }
.version-card--low .version-card__id { color: var(--muted); }

/* ---------- Map containers ---------- */
.map-container {
  height: 620px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--parchment-2);
  margin: 2rem 0;
}
@media (max-width: 700px) { .map-container { height: 500px; } }

/* Leaflet overrides — match design system */
.leaflet-popup-content-wrapper {
  background: var(--parchment-3);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.2);
}
.leaflet-popup-content { margin: 1rem 1.25rem; font-family: var(--font-body); font-size: 0.9rem; line-height: 1.5; }
.leaflet-popup-content h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--burgundy);
  margin-bottom: 0.4rem;
}
.leaflet-popup-content .popup-date {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
}
.leaflet-popup-tip { background: var(--parchment-3); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.gallery__item {
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--parchment-2);
  border: 1px solid var(--hairline-soft);
  aspect-ratio: 4 / 3;
  position: relative;
  transition: transform .2s ease;
}
.gallery__item:hover { transform: translateY(-2px); }
.gallery__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.gallery__item:hover img { transform: scale(1.04); }
.gallery__item--wide { grid-column: span 2; aspect-ratio: 16/9; }
@media (max-width: 700px) { .gallery__item--wide { grid-column: span 1; aspect-ratio: 4/3; } }
.gallery__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(0deg, rgba(26,22,20,.85), rgba(26,22,20,0));
  color: var(--parchment);
  font-size: 0.85rem;
  transform: translateY(60%);
  transition: transform .3s ease;
}
.gallery__item:hover .gallery__caption { transform: translateY(0); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15,12,10,0.92);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: pointer;
}
.lightbox.is-open { display: flex; animation: fadeIn .2s ease; }
.lightbox__img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6);
}
.lightbox__caption {
  color: var(--parchment);
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  max-width: 60ch;
  line-height: 1.5;
}
.lightbox__caption small { color: var(--hairline); display: block; margin-top: 0.5rem; font-size: 0.75rem; }
.lightbox__close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  color: var(--parchment);
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--parchment);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

/* ---------- Bibliography filter ---------- */
.filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--parchment-3);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-lg);
}
.filter-group { display: flex; flex-direction: column; gap: 0.35rem; min-width: 150px; }
.filter-group label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
}
.filter-group select, .filter-group input {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--parchment);
  font-size: 0.9rem;
  color: var(--ink);
}
.filter-group select:focus, .filter-group input:focus {
  outline: 2px solid var(--burgundy);
  outline-offset: -1px;
  border-color: var(--burgundy);
}
.filter-group input { min-width: 220px; }
.filter-stats {
  margin-left: auto;
  align-self: end;
  font-size: 0.85rem;
  color: var(--muted);
}

.bib-list { display: flex; flex-direction: column; gap: 0; }
.bib-item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 1rem 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--hairline-soft);
  align-items: baseline;
  cursor: pointer;
}
.bib-item:hover { background: var(--parchment-3); }
.bib-item__num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--burgundy);
  font-weight: 700;
  padding-left: 0.5rem;
}
.bib-item__title {
  font-size: 0.95rem;
  line-height: 1.45;
}
.bib-item__title strong { font-weight: 600; }
.bib-item__title em { font-style: italic; color: var(--ink-2); }
.bib-item__meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.bib-item__desc {
  grid-column: 2 / -1;
  padding-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-2);
  display: none;
}
.bib-item.is-open .bib-item__desc { display: block; }

@media (max-width: 700px) {
  .bib-item { grid-template-columns: 40px 1fr; }
  .bib-item__meta { grid-column: 1 / -1; padding-left: 0; }
  .bib-item__desc { grid-column: 1 / -1; }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(4rem, 8vw, 8rem);
  padding: clamp(3rem, 5vw, 5rem) 0 2rem;
  background: var(--ink);
  color: var(--parchment);
}
.site-footer a { color: var(--parchment); }
.site-footer a:hover { color: var(--gold); text-decoration: none; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 2.5rem;
}
.footer-title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--hairline);
  margin-bottom: 1rem;
  font-weight: 600;
}
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-grid li { font-size: 0.9rem; }
.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--hairline);
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--parchment);
  margin-bottom: 0.75rem;
}

/* ---------- Utilities ---------- */
.divider {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 3rem 0;
}
.divider--ornament {
  height: 2rem;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--burgundy);
  font-size: 1.2rem;
  letter-spacing: 1rem;
  margin: 2.5rem 0;
}
.divider--ornament::before { content: '❦'; }

.text-center { text-align: center; }
.mt-4 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }
.mb-4 { margin-bottom: 2rem; }
.badge-lang {
  display: inline-flex;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: var(--parchment-2);
  color: var(--ink-2);
  border: 1px solid var(--hairline-soft);
  border-radius: 3px;
  letter-spacing: 0.05em;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
