/* ИПК РФЦСЭ — архив материалов. Палитра по логотипу */
:root {
  --blue: #4070B0;
  --blue-deep: #2C5A9A;
  --green: #509020;
  --green-2: #4A9A28;
  --charcoal: #303030;
  --light: #F0F0F0;
  --paper: #F7F8FA;
  --card: #FFFFFF;
  --ink: #303030;
  --ink-soft: #4A4F57;
  --muted: #6B7078;
  --line: #E1E4E9;
  --blue-tint: #EAF0F8;
  --green-tint: #EEF5E7;
  --shadow: 0 1px 2px rgba(48,48,48,.05), 0 8px 24px rgba(44,90,154,.07);
  --radius: 14px;
  --measure: 44rem;
  --header-h: 68px;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper);
  line-height: 1.65; min-height: 100vh; display: flex; flex-direction: column;
}
img { max-width: 100%; height: auto; }
a { color: var(--blue-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue); }
.wrap { width: min(1140px, calc(100% - 2rem)); margin-inline: auto; }
.muted { color: var(--muted); }
.cnt { font-size: .8em; opacity: .7; font-weight: 400; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -3px 0 0 transparent;
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, var(--blue) 0 25%, var(--green) 25% 50%, var(--charcoal) 50% 75%, var(--light) 75% 100%);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: relative; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--charcoal); }
.brand-logo { width: 42px; height: 42px; object-fit: contain; }
.brand-text { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; line-height: 1.1; display: flex; flex-direction: column; }
.brand-text small { font-family: var(--sans); font-weight: 400; font-size: .74rem; color: var(--muted); letter-spacing: .02em; }
.brand:hover .brand-text { color: var(--blue-deep); }
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--blue-deep); border-bottom-color: var(--green); }
.nav a.is-active { color: var(--blue-deep); border-bottom-color: var(--blue); font-weight: 600; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; font-size: 1.2rem; padding: .25rem .6rem; cursor: pointer; color: var(--charcoal); }

main { flex: 1; padding: 2rem 0 3.5rem; }

/* Author hero */
.author {
  display: grid; grid-template-columns: 240px 1fr 220px; gap: 2rem; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px);
  padding: 1.75rem; box-shadow: var(--shadow); margin-bottom: 2rem; position: relative; overflow: hidden;
}
.author::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(var(--blue) 0 50%, var(--green) 50% 100%); }
.author-photo img { display: block; width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: 50% 30%; border-radius: 12px; border: 1px solid var(--line); }
.eyebrow { margin: 0 0 .25rem; text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; color: var(--green); font-weight: 700; }
.author h1 { font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.2; margin: 0 0 .9rem; color: var(--charcoal); }
.regalia { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .35rem; }
.regalia li { padding-left: 1.3rem; position: relative; color: var(--ink); }
.regalia li::before { content: ""; position: absolute; left: 0; top: .6em; width: .55rem; height: .55rem; border-radius: 2px; background: var(--blue); box-shadow: .25rem .25rem 0 -.05rem var(--green); }
.author-lead { margin: 0 0 1.1rem; color: var(--ink-soft); max-width: 44rem; }
.author-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.1rem; }
.btn { display: inline-block; padding: .55rem 1.05rem; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .93rem; border: 1px solid transparent; transition: .15s ease; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); color: #fff; }
.btn-ghost { border-color: var(--blue); color: var(--blue-deep); background: #fff; }
.btn-ghost:hover { background: var(--blue-tint); color: var(--blue-deep); }
.contacts { margin: 0; display: grid; gap: .3rem; font-size: .93rem; }
.contacts div { display: grid; grid-template-columns: 5.5rem 1fr; gap: .5rem; }
.contacts dt { color: var(--muted); }
.contacts dd { margin: 0; }
.award { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: .75rem; font-size: .85rem; color: var(--ink-soft); }
.award img { display: block; width: 100%; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.award p { margin: .6rem 0 0; line-height: 1.45; }
.award strong { color: var(--charcoal); }

.archive-intro { margin: 0 0 .75rem; }
.archive-intro h2 { font-family: var(--serif); font-size: 1.6rem; margin: 0; color: var(--charcoal); }
.archive-intro h2::after { content: ""; display: block; width: 3.5rem; height: 3px; margin-top: .35rem; background: var(--green); border-radius: 2px; }
.archive-intro p { margin: .5rem 0 0; }

/* Toolbar */
.toolbar {
  display: grid; gap: .8rem; margin-bottom: 1.75rem; position: sticky; top: var(--header-h); z-index: 30;
  background: rgba(247,248,250,.95); backdrop-filter: blur(8px); padding: .85rem 0 .9rem; border-bottom: 1px solid var(--line);
}
.search-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.search-input {
  flex: 1 1 280px; appearance: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: .7rem 1.1rem; font: inherit; color: var(--ink); box-shadow: var(--shadow);
}
.search-input:focus { outline: 2px solid rgba(64,112,176,.25); border-color: var(--blue); }
.result-count { font-size: .9rem; color: var(--muted); }
.tag-filters { display: flex; flex-wrap: wrap; gap: .45rem; }
.tag-pill {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); border-radius: 999px;
  padding: .32rem .8rem; font: inherit; font-size: .85rem; cursor: pointer; transition: .15s ease;
}
.tag-pill:hover { border-color: var(--green); color: var(--green); }
.tag-pill.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.month-nav { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .84rem; }
.month-nav a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid transparent; }
.month-nav a:hover { color: var(--blue-deep); border-bottom-color: var(--green); }

/* Feed */
.feed { display: grid; gap: 1.75rem; }
.month-block { display: grid; gap: 1rem; }
.month-heading {
  font-family: var(--serif); font-size: 1.35rem; margin: 0; padding: .3rem 0 .45rem; color: var(--charcoal);
  border-bottom: 1px solid var(--line); position: relative;
}
.month-heading::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 3rem; height: 2px; background: var(--green); }
.cards { display: grid; gap: 1rem; }
.card {
  display: grid; grid-template-columns: 5.2rem 1fr; gap: 1rem 1.15rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease;
}
.card.has-thumb { grid-template-columns: 5.2rem 1fr 150px; }
.card:hover { border-color: rgba(64,112,176,.45); transform: translateY(-1px); }
.card.is-hidden { display: none; }
.date-rail { display: flex; flex-direction: column; gap: .15rem; padding-top: .15rem; border-right: 2px solid rgba(80,144,32,.35); padding-right: .85rem; }
.date-day { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; line-height: 1; color: var(--blue-deep); }
.date-mon { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card-body { min-width: 0; }
.card-title { font-family: var(--serif); font-size: 1.16rem; line-height: 1.35; margin: 0 0 .5rem; font-weight: 700; }
.card-title a { color: var(--charcoal); text-decoration: none; }
.card-title a:hover { color: var(--blue-deep); }
.card-excerpt { margin: 0 0 .7rem; color: var(--ink-soft); font-size: .97rem; }
.card-tags, .article-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.chip {
  display: inline-block; font-size: .78rem; padding: .16rem .6rem; border-radius: 999px;
  background: var(--green-tint); color: #3C6E18; border: 1px solid rgba(80,144,32,.28);
}
.card-actions { display: flex; flex-wrap: wrap; gap: .75rem 1.1rem; align-items: center; font-size: .92rem; }
.btn-text { color: var(--blue); font-weight: 600; text-decoration: none; }
.btn-text:hover { color: var(--blue-deep); text-decoration: underline; text-decoration-color: var(--green); }
.link-tg { color: var(--blue-deep); text-decoration: none; }
.link-tg:hover { text-decoration: underline; }
.card-thumb { position: relative; display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); align-self: start; background: var(--light); }
.card-thumb img { display: block; width: 100%; height: 120px; object-fit: cover; }
.thumb-count { position: absolute; right: .35rem; bottom: .35rem; background: rgba(48,48,48,.8); color: #fff; font-size: .72rem; padding: .05rem .45rem; border-radius: 999px; }
.empty-state { display: none; padding: 2rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: #fff; }
.empty-state.is-visible { display: block; }

/* Article */
.article-wrap { width: min(var(--measure), calc(100% - 2rem)); margin-inline: auto; }
.article-head { margin-bottom: 1.5rem; }
.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: .85rem; }
.breadcrumb a { color: var(--blue-deep); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.article-head h1 { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.05rem); line-height: 1.3; margin: 0 0 .85rem; color: var(--charcoal); }
.article-meta { display: flex; flex-wrap: wrap; gap: .4rem .8rem; color: var(--muted); font-size: .92rem; margin-bottom: 1rem; }
.article-body { font-size: 1.06rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.6rem; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.article-body p { margin: 0 0 1.05rem; }
.article-body p:last-child { margin-bottom: 0; }
.article-gallery { margin: 0 0 1.25rem; display: grid; gap: .5rem; }
.article-gallery.is-multi { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.article-gallery > a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--light); }
.article-gallery img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: contain; margin: 0 auto; }
.article-gallery.is-multi img { height: 220px; object-fit: cover; }
.article-gallery figcaption { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); border-left: 3px solid var(--green); padding-left: .6rem; }
.article-footer { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; justify-content: space-between; align-items: center; }
.back-link { color: var(--blue); text-decoration: none; font-weight: 600; }
.back-link:hover { color: var(--blue-deep); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.post-nav a { display: block; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-decoration: none; color: var(--charcoal); font-size: .92rem; line-height: 1.4; }
.post-nav a span { display: block; font-size: .78rem; color: var(--green); font-weight: 700; margin-bottom: .2rem; }
.post-nav a:hover { border-color: var(--blue); }
.post-nav .next { text-align: right; }

/* Footer */
.site-footer { margin-top: auto; background: var(--charcoal); color: #DADDE2; padding: 2.25rem 0 1.25rem; border-top: 4px solid var(--blue); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.footer-title { font-family: var(--serif); font-size: 1.05rem; margin-bottom: .65rem; color: #fff; }
.footer-title::after { content: ""; display: block; width: 2rem; height: 2px; background: var(--green-2); margin-top: .3rem; }
.site-footer a { color: #A9C3E8; }
.site-footer a:hover { color: #fff; }
.site-footer p { margin: 0 0 .4rem; font-size: .94rem; }
.site-footer .muted { color: #A3A8B0; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .84rem; color: #A3A8B0; }

@media (max-width: 980px) {
  .author { grid-template-columns: 200px 1fr; }
  .award { grid-column: 1 / -1; display: grid; grid-template-columns: 120px 1fr; gap: 1rem; align-items: center; }
  .award p { margin: 0; }
}
@media (max-width: 760px) {
  :root { --header-h: 60px; }
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 100%; right: 0; left: 0; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; gap: 0; padding: .5rem 1rem; box-shadow: var(--shadow); }
  .nav.is-open { display: flex; }
  .nav a { padding: .6rem 0; border-bottom: 1px solid var(--line); }
  .brand-text small { display: none; }
  .author { grid-template-columns: 1fr; padding: 1.25rem; }
  .author-photo img { max-width: 220px; }
  .toolbar { position: static; }
  .card, .card.has-thumb { grid-template-columns: 1fr; }
  .card-thumb img { height: 180px; }
  .date-rail { flex-direction: row; align-items: baseline; gap: .5rem; border-right: 0; border-bottom: 2px solid rgba(80,144,32,.35); padding-right: 0; padding-bottom: .45rem; }
  .date-day { font-size: 1.25rem; }
  .article-body { padding: 1.1rem; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .contacts div { grid-template-columns: 1fr; gap: 0; }
}

.sort-label{display:flex;align-items:center;gap:.4rem;font-size:.9rem;color:#303030;white-space:nowrap}
.sort-select{border:1px solid #c5cdd8;border-radius:8px;padding:.35rem .55rem;background:#fff;font:inherit;color:#303030}
.tag-summary{margin-top:.35rem;font-size:.92rem;line-height:1.45}
@media (max-width:720px){
  .search-row{flex-wrap:wrap}
  .sort-label{width:100%}
  .sort-select{flex:1}
}
