/* ============================================================
   СПАДОК — читальна зала та архівні матеріали
   ============================================================ */

.archive-page { padding-bottom: clamp(70px, 9vw, 120px); }
.archive-hero { --page-hero-image: url("../assets/images/congress-vienna.jpg"); }
.archive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px 0;
  border-bottom: 1px solid var(--line-light);
}
.archive-search {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: min(420px, 100%);
  border: 1px solid var(--line-light);
  padding: 0 16px;
  background: var(--ink-2);
}
.archive-search svg { width: 16px; height: 16px; color: var(--gold-2); flex: 0 0 auto; }
.archive-search input {
  width: 100%;
  min-height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--paper);
}
.archive-search input::placeholder { color: var(--muted); }
.archive-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  padding: 8px 12px;
  border: 1px solid var(--line-light);
  background: transparent;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.filter-chip:hover { border-color: var(--line-gold); color: var(--paper); }
.filter-chip.is-active { border-color: var(--gold); background: rgba(176, 138, 79, 0.12); color: var(--gold-2); }
.archive-count {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.archive-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1px;
  background: var(--line-light);
  border: 1px solid var(--line-light);
  margin-top: 34px;
}
.archive-feature-image {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: var(--ink-2);
}
.archive-feature-image img { width: 100%; height: 100%; object-fit: cover; filter: sepia(0.15) contrast(0.95) brightness(0.8); }
.archive-feature-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(23, 20, 15, 0.48), transparent 50%); }
.archive-feature-copy {
  padding: clamp(30px, 4.5vw, 58px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--paper);
  color: var(--ink);
}
.archive-feature-copy h2 { font-size: clamp(2.5rem, 4.4vw, 4.4rem); font-weight: 500; line-height: 0.92; margin: 18px 0 22px; }
.archive-feature-copy p { color: rgba(23, 20, 15, 0.68); font-size: 15px; }
.archive-feature-copy .link-underline { align-self: flex-start; margin-top: 28px; color: var(--ink); }
.archive-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.archive-meta .dot { width: 3px; height: 3px; background: var(--gold); transform: rotate(45deg); }

.article-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1px;
  background: var(--line-light);
  border: 1px solid var(--line-light);
  margin-top: 34px;
}
.article-card {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  min-height: 390px;
  background: var(--ink);
  padding: 0;
  text-align: left;
  border: 0;
  transition: background 0.3s ease;
}
.article-card:hover { background: var(--ink-2); }
.article-card.is-wide { grid-column: span 8; }
.article-card.is-tall { min-height: 520px; }
.article-card-image {
  position: relative;
  height: 210px;
  overflow: hidden;
  background: var(--ink-3);
}
.article-card.is-tall .article-card-image { height: 300px; }
.article-card-image img { width: 100%; height: 100%; object-fit: cover; filter: sepia(0.3) contrast(0.9) brightness(0.76); transition: transform 0.6s var(--ease); }
.article-card:hover .article-card-image img { transform: scale(1.03); }
.article-card-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(23, 20, 15, 0.4), transparent 60%); }
.article-card-copy { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.article-card-copy h3 { font-size: clamp(1.6rem, 2.4vw, 2.4rem); font-weight: 500; line-height: 1; margin: 14px 0 10px; }
.article-card-copy p { font-size: 12px; line-height: 1.6; color: var(--muted); }
.article-card-copy .article-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: auto;
  padding-top: 18px;
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.article-card-copy .article-card-foot span:last-child { color: var(--gold-2); }
.article-card--text { background: var(--paper); color: var(--ink); }
.article-card--text:hover { background: var(--paper-3); }
.article-card--text .article-card-copy p { color: rgba(23, 20, 15, 0.64); }
.article-card--text .article-card-copy .article-card-foot { color: var(--muted-dark); }
.article-card--text .article-card-copy .article-card-foot span:last-child { color: var(--gold-3); }

/* ── Article detail ─────────────────────────────────────── */
.article-page { padding-bottom: clamp(70px, 9vw, 120px); }
.article-head { padding: 140px 0 40px; }
.article-head-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: clamp(30px, 6vw, 90px);
  align-items: end;
}
.article-head h1 { font-size: clamp(3rem, 6.4vw, 6.6rem); line-height: 0.88; letter-spacing: -0.04em; font-weight: 500; margin: 18px 0 22px; }
.article-head .lead { max-width: 760px; }
.article-head-aside {
  border-left: 1px solid var(--line-gold);
  padding-left: 22px;
}
.article-head-aside dl { margin: 0; }
.article-head-aside div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-light); font-size: 11px; }
.article-head-aside dt { color: var(--muted); }
.article-head-aside dd { margin: 0; text-align: right; }
.article-hero-image {
  position: relative;
  margin: 20px 0 0;
  min-height: 540px;
  overflow: hidden;
  background: var(--ink-2);
  border: 1px solid var(--line-light);
}
.article-hero-image img { width: 100%; height: 100%; object-fit: cover; filter: sepia(0.12) contrast(0.94) brightness(0.8); }
.article-hero-image figcaption {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 16px;
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(233, 223, 203, 0.72);
}
.article-body-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: clamp(34px, 6vw, 90px);
  align-items: start;
  padding-top: 48px;
}
.article-body { max-width: 760px; }
.article-body section { margin-bottom: 42px; }
.article-body h2 { font-size: clamp(1.9rem, 3vw, 2.8rem); font-weight: 500; margin-bottom: 18px; }
.article-body p { margin-bottom: 17px; font-size: 16px; line-height: 1.85; color: rgba(233, 223, 203, 0.82); }
.article-body > section:first-child > p:first-child::first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 72px;
  line-height: 0.72;
  padding: 9px 12px 0 0;
  color: var(--gold-2);
}
.article-aside { position: sticky; top: 108px; }
.article-aside-block { border: 1px solid var(--line-light); padding: 22px; margin-bottom: 16px; }
.article-aside-block h3 { font-family: var(--sans); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 14px; }
.article-aside-block p { font-size: 12px; line-height: 1.65; color: var(--muted); }
.article-timeline { border-left: 1px solid var(--line-gold); padding-left: 16px; }
.article-timeline-item { position: relative; padding-bottom: 16px; }
.article-timeline-item:last-child { padding-bottom: 0; }
.article-timeline-item::before { content: ""; position: absolute; left: -20px; top: 7px; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }
.article-timeline-item strong { display: block; font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--gold-2); line-height: 1; }
.article-timeline-item span { display: block; margin-top: 4px; font-size: 11px; line-height: 1.55; color: var(--muted); }
.article-sources { margin-top: 42px; padding-top: 24px; border-top: 1px solid var(--line-light); }
.article-sources h2 { font-size: 30px; margin-bottom: 14px; }
.article-sources ul { list-style: none; }
.article-sources li { padding: 10px 0; border-bottom: 1px solid var(--line-light); }
.article-sources a { display: flex; justify-content: space-between; gap: 20px; font-size: 12px; color: var(--paper); }
.article-sources a:hover { color: var(--gold-2); }
.article-sources span { font-family: var(--sans); font-size: 8px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.article-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.wiki-results { margin-top: 14px; }
.wiki-result {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-light);
  font-size: 12px;
  line-height: 1.5;
}
.wiki-result:hover { color: var(--gold-2); }
.wiki-result small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.wiki-note { font-size: 10px; color: var(--muted); line-height: 1.6; margin-top: 10px; }
.article-related {
  margin-top: 48px;
  border-top: 1px solid var(--line-light);
  padding-top: 28px;
}
.article-related h2 { font-size: 32px; margin-bottom: 18px; }
.related-links { display: flex; flex-wrap: wrap; gap: 10px; }
.related-links a {
  padding: 9px 12px;
  border: 1px solid var(--line-gold);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.related-links a:hover { background: rgba(176, 138, 79, 0.12); }

@media (max-width: 1000px) {
  .archive-feature { grid-template-columns: 1fr; }
  .archive-feature-image { min-height: 360px; }
  .article-card { grid-column: span 6; }
  .article-card.is-wide { grid-column: span 6; }
  .article-card.is-tall { min-height: 420px; }
  .article-head-grid { grid-template-columns: 1fr; }
  .article-head-aside { justify-self: start; }
  .article-body-layout { grid-template-columns: 1fr; }
  .article-aside { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .article-aside-block { margin-bottom: 0; }
}

@media (max-width: 680px) {
  .archive-toolbar { align-items: stretch; }
  .archive-search { min-width: 100%; }
  .article-grid { grid-template-columns: 1fr; }
  .article-card, .article-card.is-wide { grid-column: auto; }
  .article-card.is-tall { min-height: 390px; }
  .article-card.is-tall .article-card-image { height: 210px; }
  .article-head { padding-top: 120px; }
  .article-hero-image { min-height: 320px; }
  .article-aside { grid-template-columns: 1fr; }
  .article-body p { font-size: 15px; }
}

/* -- Розширені контролі архіву ---------------------------- */
.archive-toolbar-secondary {
  padding-top: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-light);
}
.archive-selects { display: flex; gap: 14px; flex-wrap: wrap; }
.archive-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.archive-select select {
  appearance: none;
  background: var(--ink-2);
  border: 1px solid var(--line-light);
  color: var(--paper);
  padding: 10px 34px 10px 12px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.02em;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold-2) 50%), linear-gradient(135deg, var(--gold-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.archive-select select:hover { border-color: var(--line-gold); }

/* -- Картка: обране й статус ------------------------------ */
.article-card { position: relative; cursor: pointer; }
.article-card-link { position: absolute; inset: 0; z-index: 2; }
.card-fav {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-gold);
  border-radius: 50%;
  background: rgba(23, 20, 15, 0.72);
  color: var(--gold-2);
  font-size: 17px;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.card-fav:hover { background: rgba(176, 138, 79, 0.24); transform: scale(1.06); }
.card-fav.is-active { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.read-badge {
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-2);
  border: 1px solid var(--line-gold);
  padding: 2px 6px;
}

/* -- Досьє матеріалу -------------------------------------- */
.article-dossier {
  display: grid;
  gap: 26px;
  margin-bottom: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line-light);
}
.dossier-block h2 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); font-weight: 500; margin-bottom: 14px; }
.dossier-list { list-style: none; display: grid; gap: 10px; }
.dossier-list li {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(233, 223, 203, 0.82);
}
.dossier-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
}
.dossier-events { border-left: 1px solid var(--line-gold); padding-left: 18px; display: grid; gap: 14px; }
.dossier-event strong { display: block; font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--gold-2); line-height: 1; }
.dossier-event span { display: block; margin-top: 4px; font-size: 13px; line-height: 1.6; color: rgba(233, 223, 203, 0.78); }
.dossier-block.is-significance {
  border: 1px solid var(--line-gold);
  padding: 20px 22px;
  background: rgba(176, 138, 79, 0.06);
}
.dossier-block.is-significance h2 { color: var(--gold-2); }
.dossier-block.is-significance p { margin: 0; font-size: 14px; line-height: 1.75; color: var(--paper); }
.article-fav { margin-top: 16px; }
.article-fav.is-active { border-color: var(--gold); color: var(--gold-2); background: rgba(176, 138, 79, 0.12); }

/* -- Перехід між матеріалами ------------------------------ */
.article-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line-light);
}
.article-pager-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line-light);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.article-pager-link:hover { border-color: var(--line-gold); background: rgba(176, 138, 79, 0.06); }
.article-pager-link span { font-family: var(--sans); font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-2); }
.article-pager-link strong { font-family: var(--serif); font-size: 18px; font-weight: 500; line-height: 1.15; }
.article-pager-next { text-align: right; }

/* -- Профіль: читальна зала ------------------------------- */
.profile-library { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.profile-library h3 {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.profile-library h3 span { color: var(--gold-2); }
.profile-article-list { list-style: none; }
.profile-article-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-light);
  font-size: 13px;
}
.profile-article-list a { color: var(--paper); }
.profile-article-list a:hover { color: var(--gold-2); }
.profile-article-list span { color: var(--muted); font-size: 11px; white-space: nowrap; }

@media (max-width: 680px) {
  .archive-toolbar-secondary { flex-direction: column; align-items: stretch; }
  .archive-selects { flex-direction: column; }
  .archive-select select { width: 100%; }
  .article-pager { grid-template-columns: 1fr; }
  .article-pager-next { text-align: left; }
  .profile-library { grid-template-columns: 1fr; }
}
