/* ============================================================
   Толкиновское Общество СПб — Static stylesheet
   WordPress-transferable. No build step required.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,500;1,8..60,300;1,8..60,400&display=swap');

/* ─── Design tokens ───────────────────────────────────────── */
:root {
  --bg:              #f4f1ed;   /* oklch(0.960 0.008 80)  */
  --card:            #f9f7f5;   /* oklch(0.975 0.006 85)  */
  --fg:              #2a2520;   /* oklch(0.22  0.018 60)  */
  --muted:           #7a7570;   /* oklch(0.48  0.016 55)  */
  --border:          #ccc7be;   /* oklch(0.875 0.012 75)  */
  --border-subtle:   #dedad4;   /* oklch(0.920 0.008 80)  */
  --secondary:       #ede9e3;   /* oklch(0.945 0.010 75)  */
  --sidebar-bg:      #f0ede8;   /* oklch(0.955 0.009 78)  */
  --sidebar-border:  #cac5bc;   /* oklch(0.875 0.010 78)  */
  --accent:          #6b2d3e;   /* oklch(0.36  0.055 340) */
  --accent-hover:    #5a2434;   /* oklch(0.38  0.058 340) */
  --card-hover-bg:   #f5eff0;   /* oklch(0.962 0.018 345) */
  --top-rule:        #7a3040;   /* oklch(0.36  0.060 340) */
  --colophon-bg:     #f0eee9;   /* oklch(0.965 0.007 82)  */
  --colophon-border: #c8c3bb;   /* oklch(0.87  0.010 78)  */
  --colophon-bar:    #ece9e3;   /* oklch(0.950 0.008 80)  */

  --radius: 0.125rem;
  --font: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

/* ─── Reset / base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--bg);
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "liga" 1, "kern" 1;
  min-height: 100vh;
}

a { color: inherit; transition: color .2s; }
a:hover { color: var(--accent-hover); }

::selection { background: rgba(107, 45, 62, .14); }

img { display: block; max-width: 100%; }

ul { list-style: none; }

/* ─── Paper texture wrapper ───────────────────────────────── */
.site-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(244,241,237,.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(240,237,232,.2) 0%, transparent 50%);
}

/* Thin burgundy top accent rule */
.site-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right,
    rgba(122,48,64,.65) 0%,
    rgba(107,45,62,.85) 20%,
    rgba(107,45,62,.85) 80%,
    rgba(122,48,64,.65) 100%);
  z-index: 10;
  pointer-events: none;
}

/* ─── Header ──────────────────────────────────────────────── */
.site-header {
  background: var(--card);
  border-bottom: 1px solid #c8c3bb;
}

/* Utility bar */
.util-bar {
  border-bottom: 1px solid var(--border-subtle);
  padding: .4rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .6875rem;
  color: var(--muted);
}

.util-bar__domain { letter-spacing: .05em; }

.util-bar__right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.util-bar__icons {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-right: .75rem;
  margin-right: .25rem;
  border-right: 1px solid var(--border-subtle);
}

.util-bar__icons a,
.util-bar__right a {
  color: rgba(122,117,112,.6);
  display: flex;
  align-items: center;
}

.util-bar__icons a:hover,
.util-bar__right a:hover { color: var(--accent-hover); }

.util-bar__sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--border);
  display: inline-block;
}

/* Masthead */
.masthead {
  padding: 1.75rem 1.25rem 0;
}

.masthead__inner {
  max-width: 52rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.masthead__portrait {
  flex-shrink: 0;
  position: relative;
  padding: 3px;
  background: #f9f8f6;
  box-shadow:
    inset 0 0 0 1px rgba(240,236,230,.95),
    0 1px 2px rgba(48,40,32,.07);
}

.masthead__portrait::after {
  content: '';
  position: absolute;
  inset: 5px;
  pointer-events: none;
}

.masthead__portrait img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  opacity: .95;
}

.masthead__title {
  text-align: center;
  flex: 1;
}

.masthead__rule-top {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  gap: .25rem;
}

.masthead__rule-top span { height: 1px; background: var(--border); display: block; }
.masthead__rule-top .r1 { width: 1.5rem; }
.masthead__rule-top .r2 { width: .75rem; }

.masthead__h1 {
  font-family: var(--font);
  font-weight: 400;
  color: var(--fg);
  letter-spacing: .04em;
}

.masthead__h1 .line1 {
  display: block;
  font-size: 1.5rem;
  line-height: 1.2;
}

.masthead__h1 .line2 {
  display: block;
  font-size: 1rem;
  color: var(--muted);
  letter-spacing: .15em;
  font-weight: 300;
  margin-top: .2rem;
}

.masthead__h1 a { text-decoration: none; }

.masthead__sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: .75rem;
  font-size: .625rem;
  color: var(--muted);
  letter-spacing: .15em;
  text-transform: uppercase;
}

.masthead__sub hr {
  width: 2rem; height: 1px;
  border: none;
  background: var(--border);
  flex-shrink: 0;
}

.masthead__spacer { width: 90px; flex-shrink: 0; }

/* Ornament bar below masthead */
.header-ornament {
  margin-top: 1.25rem;
  border-top: 1px solid #d0ccc4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .4rem 0;
  background: rgba(240,238,233,.4);
  gap: .75rem;
}

.header-ornament hr {
  width: 5rem; height: 1px;
  border: none;
  background: linear-gradient(to right, transparent, #c8c3bb);
  flex-shrink: 0;
}

.header-ornament hr.rev {
  background: linear-gradient(to left, transparent, #c8c3bb);
}

/* ─── Body layout ─────────────────────────────────────────── */
.site-body {
  flex: 1;
  display: flex;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: 20rem;
  flex-shrink: 0;
  background: linear-gradient(to right, #f0ede8, #f3f1ed);
  border-right: 1px solid #cac5bc;
}

.sidebar__inner {
  position: sticky;
  top: 0;
  padding: 1.25rem 0.875rem;  /* было: 1.25rem 0 */
}

.sidebar__label {
  padding: 0 .875rem 0 .875rem;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .5625rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(122,117,112,.6);
}

.sidebar__nav { padding: 0 .5rem; }

.sidebar__nav li + li { margin-top: 1px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .45rem .875rem;
  font-size: .8125rem;
  line-height: 1.4;
  color: var(--muted);
  border-left: 2px solid transparent;
  margin-left: -2px;
  text-decoration: none;
  transition: color .2s, background-color .2s, border-color .2s;
}

.nav-item:hover {
  color: var(--fg);
  background-color: rgba(236,230,222,.5);
  border-left-color: rgba(96,64,88,.35);
}

.nav-item.active {
  color: var(--fg);
  font-weight: 500;
  background-color: rgba(230,224,215,.6);
  border-left-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(200,192,182,.3);
}

.nav-item svg {
  flex-shrink: 0;
  width: .875rem;
  height: .875rem;
  opacity: .4;
  transition: opacity .2s;
}

.nav-item:hover svg { opacity: .65; }
.nav-item.active svg { opacity: 1; color: var(--accent); }

.sidebar__foot {
  margin-top: 1.5rem;
  padding: 0 .875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.sidebar__foot hr {
  flex: 1; height: 1px;
  border: none;
  background: rgba(200,194,186,.5);
}

/* ─── Main content ────────────────────────────────────────── */
.site-main {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem;
  background: rgba(249,247,245,.2);
}

/* ─── Page title / intro ──────────────────────────────────── */
.page-intro {
  text-align: center;
  margin-bottom: 2rem;
}

.page-intro p {
  font-size: .9375rem;
  color: var(--muted);
  line-height: 1.65;
  max-width: 38rem;
  margin: 0 auto;
}

.page-intro__rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin-top: 1.25rem;
}

.page-intro__rule hr {
  width: 3rem; height: 1px;
  border: none;
  background: linear-gradient(to right, transparent, var(--border));
  flex-shrink: 0;
}

.page-intro__rule hr.rev {
  background: linear-gradient(to left, transparent, var(--border));
}

/* Page title for inner pages */
.page-title {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.page-title__label {
  font-size: .625rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .25rem;
}

.page-title h1 {
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
}

.page-title__desc {
  font-size: .875rem;
  color: var(--muted);
  margin-top: .4rem;
  line-height: 1.5;
}

/* ─── Section cards / blocks ──────────────────────────────── */
.cards-grid {
  display: grid;
  gap: 1.125rem;
}

.cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.125rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1.25rem 1.375rem;
  text-decoration: none;
  display: block;
  transition: background-color .2s, border-color .2s, box-shadow .2s;
}

.card:hover {
  background-color: var(--card-hover-bg);
  border-color: rgba(82,64,88,.45);
  box-shadow: 0 2px 10px rgba(53,32,48,.06);
}

.card:hover .card__title { color: var(--accent-hover); }

.card__label {
  font-size: .625rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(122,117,112,.7);
  margin-bottom: .25rem;
  display: block;
}

.card__title {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--fg);
  transition: color .2s;
}

.card--featured .card__title {
  font-size: 1.1875rem;
}

.card__meta {
  font-size: .625rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(122,117,112,.6);
  white-space: nowrap;
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .5rem;
}

.card__desc {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.6;
}

.card__items {
  margin-top: .875rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(200,194,186,.5);
}

.card__item {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .875rem;
  padding: .2rem 0;
  color: rgba(42,37,32,.75);
}

.card__item-dot {
  width: .25rem; height: .25rem;
  border-radius: 50%;
  background: rgba(107,45,62,.4);
  flex-shrink: 0;
  margin-top: .45rem;
}

.card__item-date {
  margin-left: auto;
  font-size: .75rem;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: rgba(76,70,65,.6);
}

.badge-new {
  display: inline-block;
  padding: .1rem .4rem;
  font-size: .5625rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  background: rgba(107,45,62,.08);
  margin-left: .5rem;
  vertical-align: middle;
}

/* ─── Ornamental divider ─────────────────────────────────── */
.ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin: .75rem 0;
}

.ornament-divider hr {
  width: 3rem; height: 1px;
  border: none;
  background: #c8c3bb;
}

/* ─── News list ─────────────────────────────────────────── */
.news-list { }

.news-item {
  display: flex;
  gap: 1rem;
  padding: .75rem .5rem;
  border-bottom: 1px solid rgba(200,194,186,.5);
  transition: background-color .15s;
}

.news-item:last-child { border-bottom: none; }

.news-item:hover { background-color: rgba(236,230,222,.3); }

.news-item__date {
  flex-shrink: 0;
  width: 4.75rem;
  padding-top: .1rem;
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
  color: rgba(76,70,65,.65);
}

.news-item__body { flex: 1; min-width: 0; }

.news-item__text {
  font-size: .9375rem;
  line-height: 1.55;
  color: var(--fg);
}

.news-item__links {
  margin-top: .35rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.news-item__link {
  font-size: .75rem;
  color: var(--accent);
  border-bottom: 1px solid rgba(107,45,62,.3);
  text-decoration: none;
  transition: border-color .2s;
}

.news-item__link:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ─── Chips ─────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: .1rem .45rem;
  font-size: .6875rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--muted);
  transition: border-color .15s, background-color .15s;
}

.chip:hover {
  border-color: #ccc8c0;
  background: #eae7e0;
}

.chip--accent {
  border-color: var(--accent);
  background: rgba(107,45,62,.08);
  color: var(--accent);
}

/* ─── Content page footer note ───────────────────────────── */
.content-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(200,194,186,.4);
  text-align: center;
}

.content-footer p {
  font-size: .75rem;
  color: rgba(122,117,112,.7);
  letter-spacing: .02em;
}

.content-footer .ornament-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 1rem;
}

.content-footer .ornament-row hr {
  width: 2rem; height: 1px;
  border: none;
  background: var(--border);
}

/* ─── Footer / Colophon ─────────────────────────────────── */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--colophon-border);
  background: linear-gradient(to bottom, #f4f1eb, #ece9e3);
}

.colophon__main {
  padding: 2rem 1.5rem;
}

.colophon__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-bottom: 2rem;
  padding: .75rem 0;
}

.colophon__divider hr {
  flex: 1;
  max-width: 5rem;
  height: 1px;
  border: none;
}

.colophon__divider .left { background: linear-gradient(to right, transparent, #c8c3bb); }
.colophon__divider .right { background: linear-gradient(to left, transparent, #c8c3bb); }

.colophon__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 48rem;
  margin: 0 auto;
  font-size: .75rem;
}

.colophon__col h4 {
  display: flex;
  align-items: center;
  gap: .375rem;
  font-size: .5625rem;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(122,117,112,.6);
  margin-bottom: .625rem;
}

.colophon__col ul { }
.colophon__col li + li { margin-top: .375rem; }

.footer-link {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}

.footer-link:hover { color: var(--accent-hover); }

.colophon__social {
  display: flex;
  align-items: center;
  gap: .625rem;
  margin-top: .75rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(200,185,168,.5);
}

.colophon__social a {
  color: rgba(122,117,112,.5);
  display: flex;
  align-items: center;
}

.colophon__social a:hover { color: var(--accent-hover); }

/* Bottom bar */
.colophon__bar {
  border-top: 1px solid #ccc8c1;
  background: rgba(236,233,227,.5);
  padding: 1rem 1.5rem;
  text-align: center;
}

.colophon__bar-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-size: .6875rem;
  color: rgba(122,117,112,.6);
}

.colophon__bar-text strong { font-weight: 400; font-family: var(--font); letter-spacing: .04em; }

.colophon__bar-sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(200,194,186,.8);
  display: inline-block;
}

.colophon__bar-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  margin-top: 1rem;
}

.colophon__bar-foot hr {
  width: 1.5rem; height: 1px;
  border: none;
  background: rgba(200,194,186,.4);
}

/* ─── SVG ornaments ─────────────────────────────────────── */
.ornament-fleuron { display: inline-block; }

/* ─── Archive year navigation ────────────────────────────── */
.archive-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.archive-nav__item {
  padding: .2rem .6rem;
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--secondary);
  text-decoration: none;
  transition: color .2s, border-color .15s, background-color .15s;
}

.archive-nav__item:hover {
  color: var(--fg);
  border-color: #bbb6ae;
  background: #e8e4de;
}

.archive-nav__item.active {
  color: var(--fg);
  border-color: var(--accent);
  background: rgba(107,45,62,.07);
  font-weight: 500;
}

/* ─── News archive list ──────────────────────────────────── */
.archive-group { margin-bottom: 2rem; }

.archive-group__heading {
  font-size: .625rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(122,117,112,.65);
  padding-bottom: .5rem;
  margin-bottom: .25rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* ─── Palantir issue grid ────────────────────────────────── */
.issue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 1rem;
  margin-top: .5rem;
}

.issue-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: .875rem .75rem .75rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: background-color .2s, border-color .2s;
}

.issue-card:hover {
  background-color: var(--card-hover-bg);
  border-color: rgba(82,64,88,.45);
}

.issue-card:hover .issue-card__num { color: var(--accent-hover); }

.issue-card__num {
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg);
  transition: color .2s;
}

.issue-card__year {
  font-size: .6875rem;
  color: var(--muted);
  margin-top: .2rem;
  font-variant-numeric: tabular-nums;
}

.issue-card__note {
  font-size: .75rem;
  color: var(--muted);
  margin-top: .5rem;
  line-height: 1.4;
  flex: 1;
}

.issue-card__badge { margin-top: .5rem; align-self: flex-start; }

/* Issue card with featured image */
.issue-card--has-thumb { padding-top: 0; }

.issue-card__thumb {
  width: calc(100% + 0px); /* flush to card edges */
  margin-bottom: .6rem;
  line-height: 0;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--secondary);
}

.issue-card__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  transition: opacity .2s;
}

.issue-card--has-thumb:hover .issue-card__thumb img { opacity: .9; }

/* Issue list variant (for older issues) */
.issue-list { margin-top: .5rem; }

.issue-row {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid rgba(200,194,186,.4);
  font-size: .875rem;
  text-decoration: none;
  color: var(--fg);
  transition: background-color .15s;
}

.issue-row:hover {
  background-color: rgba(236,230,222,.3);
  padding-left: .4rem;
  padding-right: .4rem;
}

.issue-row:hover .issue-row__title { color: var(--accent-hover); }

.issue-row__num {
  flex-shrink: 0;
  width: 3rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: .8125rem;
}

.issue-row__title { flex: 1; transition: color .2s; }

.issue-row__year {
  flex-shrink: 0;
  font-size: .75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ─── Single post featured image ────────────────────────── */
.single-thumbnail {
  margin: 0 0 1.75rem;
  border: 1px solid var(--border);
  background: var(--secondary);
  line-height: 0;
}

.single-thumbnail__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
}

.single-thumbnail__caption {
  padding: .45rem .75rem;
  font-size: .75rem;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px solid var(--border-subtle);
  background: var(--secondary);
  line-height: 1;
}

/* ─── Article / single page ──────────────────────────────── */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: .8125rem;
  color: var(--muted);
}

.article-meta__sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--border);
  display: inline-block;
}

.article-meta__label {
  font-size: .625rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(122,117,112,.65);
}

.article-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--fg);
  max-width: 42rem;
}

.article-body p + p { margin-top: 1.1em; }

.article-body h2 {
  font-size: 1.125rem;
  font-weight: 500;
  margin-top: 2em;
  margin-bottom: .6em;
  letter-spacing: .01em;
}

.article-body h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-top: 1.5em;
  margin-bottom: .5em;
  color: rgba(42,37,32,.85);
}

.article-body blockquote {
  margin: 1.5em 0;
  padding: .75em 1.25em;
  border-left: 2px solid var(--accent);
  background: rgba(107,45,62,.04);
  font-style: italic;
  color: rgba(42,37,32,.8);
}

.article-body a {
  color: var(--accent);
  border-bottom: 1px solid rgba(107,45,62,.3);
  text-decoration: none;
}

.article-body a:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.article-body hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2em 0;
}

.article-source {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--secondary);
  border: 1px solid var(--border-subtle);
  font-size: .8125rem;
  color: var(--muted);
  line-height: 1.55;
}

.article-source__label {
  font-size: .5625rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(122,117,112,.6);
  margin-bottom: .35rem;
}

/* ─── Generic / info page ────────────────────────────────── */
.info-body {
  max-width: 42rem;
}

.info-body p {
  font-size: .9375rem;
  line-height: 1.75;
  color: var(--fg);
  margin-top: 1em;
}

.info-body p:first-child { margin-top: 0; }

.info-body h2 {
  font-size: 1.125rem;
  font-weight: 500;
  margin-top: 2em;
  margin-bottom: .6em;
}

.info-body h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-top: 1.5em;
  margin-bottom: .4em;
}

.info-body ul {
  list-style: none;
  margin-top: .75em;
}

.info-body ul li {
  display: flex;
  gap: .6rem;
  font-size: .9375rem;
  color: var(--fg);
  line-height: 1.6;
  padding: .2rem 0;
}

.info-body ul li::before {
  content: '';
  display: inline-block;
  width: .25rem;
  height: .25rem;
  border-radius: 50%;
  background: rgba(107,45,62,.45);
  flex-shrink: 0;
  margin-top: .55rem;
}

.info-aside {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--secondary);
  border-left: 2px solid var(--accent);
  font-size: .875rem;
  line-height: 1.6;
  color: var(--muted);
}

.info-aside__label {
  font-size: .5625rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(122,117,112,.6);
  margin-bottom: .4rem;
}

/* ─── Library / archive listing ──────────────────────────── */
.lib-section { margin-bottom: 2.5rem; }

.lib-section__heading {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

.lib-section__heading h2 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .01em;
}

.lib-section__heading hr {
  flex: 1;
  height: 1px;
  border: none;
  background: var(--border-subtle);
}

.lib-entry {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: .75rem 1rem;
  padding: .875rem 0;
  border-bottom: 1px solid rgba(200,194,186,.4);
}

.lib-entry:last-child { border-bottom: none; }

.lib-entry__cover {
  width: 4.5rem;
  aspect-ratio: 2/3;
  background: var(--secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .5rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: .25rem;
}

.lib-entry__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lib-entry__body { min-width: 0; }

.lib-entry__title {
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--fg);
}

.lib-entry__author {
  font-size: .8125rem;
  color: var(--muted);
  font-style: italic;
  margin-top: .15rem;
}

.lib-entry__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .5rem;
}

.lib-entry__desc {
  font-size: .8125rem;
  color: var(--muted);
  line-height: 1.55;
  margin-top: .5rem;
}

.lib-entry__link {
  display: inline-block;
  margin-top: .6rem;
  font-size: .75rem;
  color: var(--accent);
  border-bottom: 1px solid rgba(107,45,62,.3);
  text-decoration: none;
  transition: color .2s, border-color .2s;
}

.lib-entry__link:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ─── Responsive additions ───────────────────────────────── */
@media (max-width: 768px) {
  .issue-grid { grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); }
  .lib-entry { grid-template-columns: 3.5rem 1fr; }
  .lib-entry__cover { width: 3.5rem; }
  .article-body, .info-body { max-width: 100%; }
}

/* ─── Mobile nav toggle ─────────────────────────────────── */
.mobile-nav-toggle {
  display: none;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  font-size: .8125rem;
  color: var(--muted);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  cursor: pointer;
  width: 100%;
  text-align: left;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font);
}

.mobile-nav-toggle:hover { color: var(--fg); }

.mobile-nav-panel {
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  padding: .5rem;
}

.mobile-nav-panel .nav-item { font-size: .875rem; }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-nav-toggle { display: flex; }
  .masthead__portrait { display: none; }
  .masthead__spacer { display: none; }
  .masthead__inner { gap: 0; }
  .site-main { padding: 1.25rem 1rem; }
  .cards-row { grid-template-columns: 1fr; }
  .colophon__cols { grid-template-columns: 1fr 1fr; }
  .util-bar__icons { display: none; }
  .util-bar__domain { display: none; }
}

@media (max-width: 480px) {
  .colophon__cols { grid-template-columns: 1fr; }
  .masthead__h1 .line1 { font-size: 1.2rem; }
}

/* ─── WordPress-specific overrides ──────────────────────── */

/* Remove Google Fonts import — enqueued via wp_enqueue_style() */

/* Custom logo alignment in portrait frame */
.masthead__portrait .custom-logo-link { display: block; line-height: 0; }
.masthead__portrait .custom-logo { width: 90px; height: 90px; object-fit: contain; opacity: .95; }

/* WordPress body classes */
.home .nav-item[href="/"],
.home .nav-item[href="<?php echo home_url('/'); ?>"] { color: var(--fg); font-weight: 500; }

/* Entry content — typography resets for WP editor output */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 1.75em;
  margin-bottom: .5em;
  font-weight: 500;
  line-height: 1.3;
}
.entry-content h1 { font-size: 1.375rem; }
.entry-content h2 { font-size: 1.125rem; }
.entry-content h3 { font-size: 1rem; }
.entry-content h4 { font-size: .9375rem; }
.entry-content p  { margin-top: 1em; line-height: 1.75; }
.entry-content p:first-child { margin-top: 0; }
.entry-content a  { color: var(--accent); border-bottom: 1px solid rgba(107,45,62,.3); text-decoration: none; }
.entry-content a:hover { color: var(--accent-hover); border-color: var(--accent-hover); }
.entry-content ul,
.entry-content ol { margin-top: .75em; margin-left: 1.5em; }
.entry-content li { padding: .2em 0; line-height: 1.6; }
.entry-content blockquote {
  margin: 1.5em 0;
  padding: .75em 1.25em;
  border-left: 2px solid var(--accent);
  background: rgba(107,45,62,.04);
  font-style: italic;
  color: rgba(42,37,32,.8);
}
.entry-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2em 0;
}
.entry-content img {
  max-width: 100%;
  height: auto;
}
.entry-content figure { margin: 1.5em 0; }
.entry-content figcaption {
  font-size: .8125rem;
  color: var(--muted);
  margin-top: .4rem;
  text-align: center;
}
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  margin: 1.5em 0;
}
.entry-content th,
.entry-content td {
  padding: .45rem .75rem;
  border: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}
.entry-content th {
  background: var(--secondary);
  font-weight: 500;
}

/* Lists — unordered get a small dot, ordered stay numeric */
.entry-content ul { list-style: none; }
.entry-content ul > li { position: relative; padding-left: 1.1em; }
.entry-content ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .68em;
  width: .28em;
  height: .28em;
  border-radius: 50%;
  background: rgba(107,45,62,.5);
}
.entry-content ol { list-style: decimal; }
.entry-content ol > li { padding-left: .3em; }

/* Inline emphasis */
.entry-content strong { font-weight: 600; color: inherit; }
.entry-content em     { font-style: italic; }

/* Images — always block, responsive, no overflow */
.entry-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-subtle);
}

/* Figure with caption */
.entry-content figure {
  margin: 1.75em 0;
  max-width: 100%;
}
.entry-content figure img { margin: 0 auto; }
.entry-content figcaption {
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: .4rem;
  padding: .3rem .5rem;
  background: var(--secondary);
  border-top: 1px solid var(--border-subtle);
  text-align: left;
}

/* WP alignment classes inside content */
.entry-content .alignleft {
  float: left;
  margin: .25em 1.5em 1em 0;
  max-width: 48%;
}
.entry-content .alignright {
  float: right;
  margin: .25em 0 1em 1.5em;
  max-width: 48%;
}
.entry-content .aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.entry-content .alignfull {
  width: 100%;
  max-width: 100%;
}
.entry-content .alignwide { width: 100%; }

/* WP caption (classic editor) */
.entry-content .wp-caption {
  max-width: 100%;
  background: var(--secondary);
  border: 1px solid var(--border-subtle);
  padding: 4px;
}
.entry-content .wp-caption img { border: none; display: block; }
.entry-content .wp-caption-text {
  font-size: .8125rem;
  color: var(--muted);
  padding: .3rem .5rem;
  margin: 0;
  text-align: left;
}

/* Clearfix after floated images */
.entry-content::after {
  content: '';
  display: table;
  clear: both;
}

/* Portrait / custom-logo in masthead — no broken img when none set */
.masthead__portrait:empty { display: none; }
.masthead__portrait .custom-logo-link img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  opacity: .95;
}

/* Search form */
.search-form {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
}
.search-form__input {
  flex: 1;
  padding: .4rem .75rem;
  font-family: var(--font);
  font-size: .9375rem;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 0;
  outline: none;
}
.search-form__input:focus { border-color: rgba(107,45,62,.5); }
.search-form__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .4rem .75rem;
  background: var(--secondary);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: color .2s, background-color .15s;
}
.search-form__submit:hover { color: var(--fg); background: var(--card); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: .375rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: .8125rem;
}
.pagination .page-numbers {
  padding: .2rem .55rem;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, background-color .15s;
}
.pagination .page-numbers:hover { color: var(--fg); background: var(--card); }
.pagination .page-numbers.current {
  border-color: var(--accent);
  background: rgba(107,45,62,.08);
  color: var(--fg);
  font-weight: 500;
}
.pagination .page-numbers.dots { border: none; background: none; padding: 0 .25rem; }

/* Screen reader text */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* Alignment helpers (WordPress block editor) */
.alignleft  { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: .8125rem; color: var(--muted); margin-top: .35rem; }

/* Sticky post indicator */
.sticky .card__label::after {
  content: ' ·  Закреплено';
  opacity: .6;
}

/* Post nav */
.post-nav a { text-decoration: none; }

/* ─── Category card grid (category.php) ─────────────────── */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.cat-card {
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: background-color .2s, border-color .2s;
}

.cat-card:hover {
  background-color: var(--card-hover-bg);
  border-color: rgba(82,64,88,.42);
}

/* Image area */
.cat-card__image-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--secondary);
  flex-shrink: 0;
}

.cat-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .2s;
}

.cat-card:hover .cat-card__img { opacity: .92; }

.cat-card__img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary);
  color: var(--muted);
}

/* Card body */
.cat-card__body {
  padding: .875rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cat-card__date {
  font-size: .6875rem;
  letter-spacing: .05em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  margin-bottom: .45rem;
}

.cat-card__title {
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: .5rem;
}

.cat-card__title a {
  color: var(--fg);
  text-decoration: none;
  transition: color .2s;
}

.cat-card:hover .cat-card__title a { color: var(--accent-hover); }

.cat-card__excerpt {
  font-size: .8125rem;
  line-height: 1.6;
  color: var(--muted);
  flex: 1;
  margin-bottom: .75rem;
}

.cat-card__more {
  display: inline-block;
  font-size: .75rem;
  letter-spacing: .03em;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(107,45,62,.25);
  align-self: flex-start;
  transition: color .2s, border-color .2s;
}

.cat-card__more:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Responsive grid breakpoints */
@media (max-width: 960px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .cat-grid { grid-template-columns: 1fr; }
}

/* ─── Sidebar widgets (general) ─────────────────────────── */

/* Zone container — sits below the sidebar foot ornament */
.sidebar__widgets {
  margin-top: .75rem;
  padding-top: .75rem;
}

/* Individual widget — tight editorial spacing */
.sidebar-widget {
  padding-bottom: .875rem;
  margin-bottom: .875rem;
  border-bottom: 1px solid rgba(200,194,186,.4);
  font-size: .75rem;           /* smaller than sidebar nav */
  line-height: 1.5;
  color: var(--fg);
}

.sidebar-widget:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Widget title — matches .sidebar__label tone exactly */
.sidebar-widget .widget-title,
.sidebar__widgets .widget-title {
  margin: 0 0 .5rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: .5625rem;
  font-weight: 400;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(122,117,112,.6);
  line-height: 1.2;
}

/* Lists: recent posts, recent comments, archives, categories, pages */
.sidebar-widget ul,
.sidebar-widget ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-widget ul li,
.sidebar-widget ol li {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  padding: .2rem 0;
  border-bottom: 1px solid rgba(200,194,186,.28);
  line-height: 1.35;
  font-size: .75rem;
}

.sidebar-widget ul li:last-child,
.sidebar-widget ol li:last-child { border-bottom: none; }

/* Tiny dot bullet */
.sidebar-widget ul li::before {
  content: '';
  display: inline-block;
  flex-shrink: 0;
  width: .2rem;
  height: .2rem;
  border-radius: 50%;
  background: rgba(107,45,62,.35);
  margin-top: .45rem;
}

/* Links */
.sidebar-widget a {
  color: var(--fg);
  text-decoration: none;
  transition: color .18s;
}

.sidebar-widget a:hover { color: var(--accent-hover); }

/* Post / archive counts */
.sidebar-widget ul li .post-count,
.sidebar-widget ul li > span[aria-label],
.sidebar-widget ul li > span:last-child:not(:only-child) {
  margin-left: auto;
  flex-shrink: 0;
  font-size: .6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  opacity: .8;
}

/* Text / HTML widget */
.sidebar-widget .textwidget {
  font-size: .75rem;
  line-height: 1.6;
  color: var(--fg);
}

.sidebar-widget .textwidget p { margin-top: .6em; }
.sidebar-widget .textwidget p:first-child { margin-top: 0; }

.sidebar-widget .textwidget a {
  color: var(--accent);
  border-bottom: 1px solid rgba(107,45,62,.22);
}

.sidebar-widget .textwidget a:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Search widget */
.sidebar-widget .search-form,
.sidebar-widget form[role="search"] {
  display: flex;
  gap: .3rem;
}

.sidebar-widget .search-field,
.sidebar-widget input[type="search"],
.sidebar-widget input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: .28rem .5rem;
  font-family: var(--font);
  font-size: .75rem;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  outline: none;
  border-radius: 0;
}

.sidebar-widget .search-field:focus,
.sidebar-widget input[type="search"]:focus {
  border-color: rgba(107,45,62,.38);
}

.sidebar-widget .search-submit,
.sidebar-widget button[type="submit"],
.sidebar-widget input[type="submit"] {
  padding: .28rem .55rem;
  background: var(--secondary);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font);
  font-size: .6875rem;
  letter-spacing: .04em;
  cursor: pointer;
  border-radius: 0;
  transition: color .18s, background-color .15s;
}

.sidebar-widget .search-submit:hover,
.sidebar-widget button[type="submit"]:hover,
.sidebar-widget input[type="submit"]:hover {
  color: var(--fg);
  background: var(--card);
}

/* Recent comments: author name */
.sidebar-widget .recentcomments .comment-author-link {
  color: var(--accent);
  font-size: .6875rem;
}

/* Calendar widget */
.sidebar-widget .calendar_wrap {
  font-size: .6875rem;
}

.sidebar-widget .calendar_wrap table {
  width: 100%;
  border-collapse: collapse;
}

.sidebar-widget .calendar_wrap th,
.sidebar-widget .calendar_wrap td {
  text-align: center;
  padding: .15rem .1rem;
  border: 1px solid rgba(200,194,186,.35);
}

.sidebar-widget .calendar_wrap caption {
  font-size: .5625rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .3rem;
  text-align: center;
}

.sidebar-widget .calendar_wrap td#today {
  background: rgba(107,45,62,.07);
  font-weight: 600;
}

.sidebar-widget .calendar_wrap td a { color: var(--accent); }

/* Tag cloud */
.sidebar-widget .tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin: 0;
  padding: 0;
}

.sidebar-widget .tagcloud a {
  font-size: .6875rem !important; /* WP inlines font-size per tag */
  padding: .15rem .45rem;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--muted);
  text-decoration: none;
  transition: color .18s, border-color .15s, background-color .15s;
}

.sidebar-widget .tagcloud a:hover {
  color: var(--fg);
  border-color: rgba(107,45,62,.3);
  background: var(--card);
}

/* ─── 404 page ───────────────────────────────────────────── */

.error-nav {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  border-top: 1px solid var(--border-subtle);
}

.error-nav li {
  padding: .45rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: .9375rem;
}

.error-nav li::before { display: none; }

.error-nav a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color .2s, border-color .2s;
}

.error-nav a:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.error-search {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.error-search__label {
  font-size: .625rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(122,117,112,.6);
  margin-bottom: .6rem;
}

/* ─── Safe fallback states ───────────────────────────────── */

/* No menu assigned — sidebar notice */
.sidebar__no-menu {
  padding: .75rem 1rem;
  font-size: .8125rem;
  line-height: 1.55;
  color: var(--muted);
  border: 1px dashed var(--border);
  background: var(--secondary);
}

/* Homepage card with no real page target — not clickable */
.card--no-link {
  cursor: default;
  opacity: .7;
}

.card--no-link:hover {
  background-color: var(--card);
  border-color: var(--border);
  box-shadow: none;
}