:root {
  --ink: #25211d;
  --red: #b63d32;
  --sepia: #8a6a45;
  --parchment: #f3e7d0;
  --paper: #fffdf8;
  --line: #d8c7aa;
  --charcoal: #171513;
  --muted: #6f6558;
  --white: #ffffff;
  --rail: 280px;
}

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 18px;
  line-height: 1.75;
}

a {
  color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover,
a:focus {
  color: #7d241d;
}

.skip-link {
  position: absolute;
  z-index: 2000;
  left: 1rem;
  top: 1rem;
  background: var(--paper);
  color: var(--ink);
  padding: 0.5rem 0.75rem;
}

.mobile-archive-nav {
  --bs-primary-rgb: 37, 33, 29;
}

.site-rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  padding: 2rem 1.2rem;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  background: #fff6e9;
  border-right: 1px solid var(--line);
  z-index: 1030;
}

.rail-brand {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0.75rem;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.rail-mark {
  display: grid;
  place-items: center;
  height: 42px;
  width: 42px;
  background: var(--ink);
  color: var(--paper);
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
}

.rail-title,
.footer-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  line-height: 1.15;
}

.rail-nav {
  display: grid;
  gap: 0.18rem;
}

.rail-link,
.rail-child {
  display: block;
  color: var(--muted);
  font-family: Inter, Arial, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.42rem 0.55rem;
  border-left: 3px solid transparent;
}

.rail-child {
  margin-left: 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.rail-link:hover,
.rail-child:hover,
.rail-link.is-active,
.rail-child.is-active {
  color: var(--ink);
  background: rgba(216, 199, 170, 0.4);
  border-left-color: var(--red);
}

.rail-search {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  font-family: Inter, Arial, sans-serif;
  font-size: 0.82rem;
}

.site-main,
.site-footer {
  margin-left: var(--rail);
}

.archive-hero {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(37, 33, 29, 0.22), rgba(243, 231, 208, 0.88)),
    url("/assets/images/manuscript-background.jpg") center 27% / cover no-repeat;
}

.archive-hero-home {
  min-height: 470px;
}

.archive-hero-compact {
  min-height: 280px;
}

.archive-hero-inner {
  width: min(880px, calc(100% - 2rem));
  padding: 3rem 1rem;
}

.archive-kicker {
  margin: 0 0 0.7rem;
  color: var(--sepia);
  font-family: Inter, Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.archive-hero h1 {
  margin: 0;
  color: var(--red);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.4rem, 7vw, 5.7rem);
  font-style: italic;
  font-weight: 700;
  line-height: 1.05;
  text-wrap: balance;
}

.archive-page {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.archive-paper {
  background: var(--paper);
  border: 1px solid rgba(216, 199, 170, 0.85);
  box-shadow: 0 18px 50px rgba(37, 33, 29, 0.08);
  padding: clamp(1.25rem, 3vw, 3rem);
}

.archive-prose {
  max-width: 820px;
}

.archive-prose h1,
.archive-prose h2,
.archive-prose h3,
.archive-prose h4,
.archive-prose h5,
.archive-prose h6 {
  color: var(--ink);
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  line-height: 1.22;
  margin: 1.6em 0 0.65em;
}

.archive-prose h1:first-child,
.archive-prose h2:first-child {
  margin-top: 0;
}

.archive-prose p,
.archive-prose li {
  color: var(--ink);
}

.archive-prose p {
  margin-bottom: 1.15rem;
}

.archive-prose blockquote {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--red);
  background: #fbf1df;
  color: var(--muted);
}

.archive-figure {
  margin: 2rem auto;
  text-align: center;
}

.archive-figure img,
.archive-gallery img,
.content-main-image {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 0.35rem;
}

.archive-figure figcaption,
.archive-gallery figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-family: Inter, Arial, sans-serif;
  font-size: 0.85rem;
}

.archive-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.archive-list {
  padding-left: 1.4rem;
}

.archive-table {
  margin: 2rem 0;
  font-size: 0.95rem;
}

.archive-breadcrumbs {
  font-family: Inter, Arial, sans-serif;
  font-size: 0.84rem;
  margin-bottom: 1rem;
}

.archive-sidebar .list-group-item {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.content-toc {
  max-width: 820px;
  margin: 0 auto 1rem;
  padding: 0.8rem 1rem;
  background: #fff6e9;
  border: 1px solid var(--line);
  font-family: Inter, Arial, sans-serif;
  font-size: 0.9rem;
}

.content-toc ul {
  margin: 0;
  padding-left: 1rem;
}

.content-dates {
  color: var(--muted);
  font-family: Inter, Arial, sans-serif;
  font-size: 0.86rem;
  margin-bottom: 1rem;
}

.content-main-image {
  width: min(320px, 100%);
}

.archive-content-card,
.archive-content-card-minimal {
  border: 1px solid var(--line);
  background: var(--paper);
}

.archive-content-card .card-title a,
.archive-content-card-minimal a {
  color: var(--ink);
}

.archive-content-card-minimal {
  padding: 1rem;
  height: 100%;
}

.archive-read-more {
  font-family: Inter, Arial, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
}

.site-footer {
  background: var(--charcoal) !important;
  color: var(--paper) !important;
  font-family: Inter, Arial, sans-serif;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--paper);
  text-decoration: none;
}

.site-footer a:hover {
  color: #f3b7ad;
}

.footer-heading {
  color: var(--paper);
  font-family: Inter, Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.footer-note {
  color: #d8c7aa;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

@media (max-width: 991.98px) {
  .site-main,
  .site-footer {
    margin-left: 0;
  }

  .archive-hero,
  .archive-hero-home,
  .archive-hero-compact {
    min-height: 260px;
  }

  .archive-page {
    width: min(100% - 1rem, 900px);
    padding-top: 1rem;
  }

  .archive-paper {
    padding: 1rem;
  }
}

@media print {
  .site-rail,
  .mobile-archive-nav,
  .site-footer,
  .archive-hero {
    display: none !important;
  }

  .site-main {
    margin-left: 0;
  }

  .archive-paper {
    border: 0;
    box-shadow: none;
  }
}
