/* Server-rendered contents pages (/years/, /topics/, /recipients/, /about, 404).
   They repeat the archive's header, widths and footer; colours follow the reading theme
   chosen in the archive (/theme.js sets it before paint). */
:root {
  --paper: #f4f0e8;
  --ink: #292c29;
  --muted: #777970;
  --line: #d9d5cb;
  --copper: #934a33;
  --soft: #eae2d6;
  --decoration-ink: #b39c84;
  --serif: Georgia, 'Times New Roman', serif;
  color-scheme: light;
}
:root[data-reading-theme='light'] {
  --paper: #fff;
  --muted: #666b65;
  --line: #dce0da;
  --soft: #f2f4f0;
}
:root[data-reading-theme='dark'] {
  --paper: #222823;
  --ink: #e7e5dc;
  --muted: #b4bbaf;
  --line: #475047;
  --copper: #e0ab8d;
  --soft: #303830;
  --decoration-ink: #b8a48f;
  color-scheme: dark;
}
/* Without scripts the pages still follow the system theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-reading-theme]) {
    --paper: #222823;
    --ink: #e7e5dc;
    --muted: #b4bbaf;
    --line: #475047;
    --copper: #e0ab8d;
    --soft: #303830;
    --decoration-ink: #b8a48f;
    color-scheme: dark;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 'Trebuchet MS', Verdana, sans-serif;
}
a {
  color: var(--copper);
}
.catalog-header,
.catalog,
.catalog-footer {
  max-width: 1456px;
  margin: 0 auto;
  padding-left: 64px;
  padding-right: 64px;
}

/* Header — the same brand, seal and motto as the archive. */
.catalog-header {
  min-height: 102px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  border-bottom: 1px solid var(--line);
}
.catalog-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 2px;
  font-size: 13px;
  font-weight: bold;
}
.catalog-seal {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--copper);
  border-radius: 50%;
  color: var(--copper);
}
.catalog-subtitle {
  display: block;
  margin-top: 6px;
  font-size: 9px;
  font-weight: normal;
  letter-spacing: 3.5px;
  color: var(--muted);
}
.catalog-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--muted);
}
.catalog-header nav,
.catalog-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 12px;
}
.catalog-header nav a,
.catalog-footer nav a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}
.catalog-header nav a:hover,
.catalog-footer nav a:hover {
  color: var(--copper);
  text-decoration-color: currentColor;
}
.catalog-header nav a[aria-current='page'] {
  color: var(--copper);
  text-decoration-color: currentColor;
}

/* Page heading — eyebrow trail and serif title, as "Хронология / На линии времени". */
.catalog {
  padding-top: 56px;
  padding-bottom: 72px;
}
.catalog-trail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 14px;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--copper);
}
.catalog-trail::before {
  content: '';
  width: 30px;
  height: 1px;
  margin-right: 4px;
  background: currentColor;
}
.catalog-trail a {
  text-decoration: none;
}
.catalog-trail a:hover {
  text-decoration: underline;
}
.catalog h1 {
  max-width: 900px;
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: normal;
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: -0.7px;
  line-height: 1.15;
}
.catalog-lead {
  max-width: 680px;
  margin: 0 0 40px;
  font-size: 13px;
  color: var(--muted);
}
.catalog h2 {
  margin: 44px 0 14px;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--copper);
}
.catalog section h2 {
  margin-top: 36px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: normal;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.catalog section {
  max-width: 760px;
}
.catalog section p {
  max-width: 680px;
  font-size: 14px;
  line-height: 1.8;
}
.catalog code {
  overflow-wrap: anywhere;
}

/* «Что нового»: даты — подзаголовки, пункты — обычный список. */
.changes h3 {
  margin: 26px 0 6px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--copper);
}
.changes ul {
  max-width: 680px;
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.8;
}
.changes li + li {
  margin-top: 4px;
}
.changes a {
  color: var(--copper);
}

/* Lists: plain columns for recipients, tiles for years and topics. */
.catalog-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 28px;
  font-size: 14px;
}
.catalog-grid a {
  color: var(--ink);
  text-decoration: none;
}
.catalog-grid a:hover {
  color: var(--copper);
}
.catalog-grid span {
  margin-left: 4px;
  font-size: 11px;
  color: var(--muted);
}
.catalog-tiles {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.catalog-tiles li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  transition: background-color 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.catalog-tiles li:hover {
  background: var(--soft);
}
.catalog-tiles a {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.3;
}
/* The whole tile is the link. */
.catalog-tiles a::after {
  content: '';
  position: absolute;
  inset: 0;
}
.catalog-tiles span {
  margin: 0;
}
.catalog-topics {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.catalog-topics a {
  font-size: 16px;
}
.catalog-initials {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}
.catalog-initials a {
  min-width: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-size: 12px;
}
.catalog-initials a:hover {
  background: var(--soft);
}

/* Letters — as entries in the archive feed. */
.catalog-letters {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 900px;
}
.catalog-letters li {
  display: flex;
  flex-direction: column;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line);
}
.catalog-letters li > a {
  order: 2;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
}
.catalog-letters li > a:hover {
  color: var(--copper);
}
.catalog-meta {
  order: 1;
  margin-bottom: 4px;
  font-size: 10px;
  color: var(--muted);
}
.catalog-teaser {
  order: 3;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.catalog-pager {
  display: flex;
  justify-content: space-between;
  max-width: 900px;
  margin: 32px 0 0;
  font-size: 13px;
}

/* Footer — the same as on the archive page. */
.catalog-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'brand contents'
    'stats stats';
  align-items: center;
  gap: 22px 40px;
  padding-top: 30px;
  padding-bottom: 34px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.catalog-footer-brand {
  grid-area: brand;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  letter-spacing: 0.4px;
}
.catalog-footer-title {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0;
  color: var(--ink);
}
.catalog-footer nav {
  grid-area: contents;
  font-size: 11px;
}
.catalog-stats {
  grid-area: stats;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  font-size: 10px;
}
.catalog-stats li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.catalog-stats li > span:first-of-type {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.catalog-stats svg {
  color: var(--decoration-ink);
}
.catalog-stat-label {
  letter-spacing: 0.8px;
}
.catalog-stats li + li::before {
  content: '·';
  margin: 0 12px;
  color: var(--decoration-ink);
}
.catalog-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .catalog-header,
  .catalog,
  .catalog-footer {
    padding-left: 32px;
    padding-right: 32px;
  }
  .catalog-note {
    display: none;
  }
}
@media (max-width: 760px) {
  .catalog-header,
  .catalog,
  .catalog-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .catalog-header {
    flex-wrap: wrap;
    padding-top: 16px;
    padding-bottom: 14px;
  }
  .catalog-brand {
    font-size: 11px;
    letter-spacing: 1.7px;
  }
  .catalog-seal {
    width: 40px;
    height: 40px;
  }
  .catalog-header nav {
    gap: 6px 18px;
  }
  .catalog {
    padding-top: 32px;
    padding-bottom: 48px;
  }
  .catalog-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .catalog-tiles li {
    padding: 10px 12px;
  }
  .catalog-tiles a {
    font-size: 17px;
  }
  .catalog-topics {
    grid-template-columns: minmax(0, 1fr);
  }
  .catalog-topics li {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
  .catalog-topics a {
    font-size: 15px;
  }
  .catalog-topics span {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .catalog-footer {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'brand'
      'contents'
      'stats';
    justify-items: center;
    gap: 18px;
    padding-top: 28px;
    padding-bottom: 30px;
    text-align: center;
  }
  .catalog-footer-brand {
    align-items: center;
  }
  .catalog-footer nav,
  .catalog-stats {
    justify-content: center;
  }
  .catalog-stats {
    gap: 6px 18px;
    padding-top: 14px;
    width: 100%;
  }
  .catalog-stats li + li::before {
    content: none;
  }
}
