@font-face {
  font-family: "Golos Text";
  src: url("assets/golos-text-cyrillic.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Golos Text";
  src: url("assets/golos-text-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "PT Serif";
  src: url("assets/pt-serif-cyrillic.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "PT Serif";
  src: url("assets/pt-serif-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --page: #f5f8f6;
  --paper: #fff;
  --ink: #122e2d;
  --muted: #4d625e;
  --line: #dce6e1;
  --teal: #126e70;
  --deep: #083f3e;
  --lime: #d9eb81;
  --mint: #e6f4ef;
  --lilac: #f1eaf4;
  --purple: #64366c;
  --font: "Century Gothic", "Golos Text", system-ui, sans-serif;
  --display: "PT Serif", Georgia, serif;
  --gutter: clamp(20px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font: 400 1rem/1.55 var(--font);
}

.public-page { min-height: 100vh; display: flex; flex-direction: column; }
.public-page > main { flex: 1; }

a, button, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 4px;
}
p, h1, h2, h3 { margin: 0; }

.container {
  width: min(100% - var(--gutter) * 2, 1240px);
  margin-inline: auto;
}

.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: absolute;
  z-index: 3;
  top: 16px;
  left: var(--gutter);
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--paper);
  transform: translateY(calc(-100% - 25px));
}
.skip-link:focus { transform: none; }

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner, .identity {
  display: flex;
  align-items: center;
}

.header-inner {
  min-height: 80px;
  justify-content: space-between;
  gap: 20px;
}

.identity { gap: 20px; }

.brand {
  display: block;
  flex: 0 1 auto;
}

.brand img {
  display: block;
  width: clamp(145px, 17vw, 220px);
  height: auto;
}

.identity-label {
  border-left: 1px solid var(--line);
  padding-left: 20px;
  color: var(--muted);
  font-size: .91rem;
  font-weight: 600;
  line-height: 1.3;
}

.source-link, .footer-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--teal);
  font-size: .91rem;
  font-weight: 650;
  text-decoration: none;
}

.source-link {
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: background-color .18s ease, border-color .18s ease;
}
.source-link:hover { background: var(--mint); border-color: #b7d3cc; }

.hero {
  display: flex;
  position: relative;
  isolation: isolate;
  align-items: center;
  min-height: 310px;
  overflow: hidden;
  margin-top: 28px;
  border-radius: 24px;
  background: var(--deep);
  color: #fff;
}

.hero-art {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: -1;
  width: 53%;
  pointer-events: none;
}

.hero-art::before {
  content: "";
  position: absolute;
  inset: 13px -35px -24px -23px;
  border: 1px solid #90c4b4;
  border-top-left-radius: 60% 96%;
  opacity: .35;
}

.hero-arch {
  position: absolute;
  inset: 30px 0 0;
  overflow: hidden;
  border-top-left-radius: 60% 96%;
  background: #3b8986;
}

.hero-arch::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #083f3e6b, transparent 45%),
    linear-gradient(0deg, #083f3e8c, transparent 46%);
}

.hero-arch img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 80%;
  mix-blend-mode: luminosity;
  opacity: .85;
}

.hero-content {
  width: min(58%, 660px);
  padding: 32px clamp(28px, 5vw, 68px) 34px;
}

.hero h1 {
  font: 400 clamp(2.75rem, 5.4vw, 4.5rem)/.99 var(--display);
  letter-spacing: -.052em;
}

.hero p {
  max-width: 420px;
  margin-top: 17px;
  color: #dcebe7;
  font-size: clamp(.95rem, 1.4vw, 1.07rem);
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 45px;
  margin-top: 22px;
  padding: 9px 15px;
  border-radius: 9px;
  background: var(--lime);
  color: #153938;
  font-size: .91rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .18s ease;
}

.hero-link:focus-visible { outline-color: var(--lime); }
.hero-link:hover { background: #e8f5ae; }

.documents {
  margin-block: clamp(32px, 4vw, 52px) 58px;
  scroll-margin-top: 22px;
}

.catalog-heading {
  font: 400 clamp(2rem, 3.7vw, 3.35rem)/1.08 var(--display);
  letter-spacing: -.041em;
  overflow-wrap: anywhere;
}

.catalog-heading, #local-heading { scroll-margin-top: 16px; }
.catalog-heading:focus { outline: none; }
#home-view > .catalog-heading { font-size: clamp(1.82rem, 2.8vw, 2.48rem); }

.section-grid, .topic-list {
  display: grid;
  gap: 14px;
  margin: 19px 0 0;
  padding: 0;
}

.section-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.topic-list { grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; }

@media (min-width: 1050px) {
  .topic-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.section-tile, .topic-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 1.7vw, 18px);
  min-height: 76px;
  padding: clamp(13px, 1.7vw, 20px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--deep);
  font-size: clamp(.95rem, 1.55vw, 1.14rem);
  font-weight: 670;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease;
}

.section-tile:hover, .topic-link:hover {
  border-color: #a8c8ba;
  background: #f9fcfa;
}

.section-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--mint);
  color: var(--teal);
}

.section-tile-common .section-icon {
  background: var(--lilac);
  color: var(--purple);
}

.tile-arrow { color: var(--teal); }
.topic-link { height: 100%; }

.topic-text {
  display: grid;
  gap: 5px;
}

.topic-title { overflow-wrap: anywhere; }

.topic-count {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 400;
}

.breadcrumbs {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: .88rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.breadcrumbs li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--muted);
}

.breadcrumbs a { color: var(--teal); text-underline-offset: 3px; }
.breadcrumbs a:hover { color: var(--deep); }

.branch-tools, .folder-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.branch-tools { margin-top: 12px; }
.folder-content { margin-top: 12px; }

.folder-tools {
  margin: 0 0 12px;
  font-size: .88rem;
}

.section-matches { margin-top: 14px; }
.match-count { margin-bottom: 10px; color: var(--muted); font-size: .88rem; }

.search-box {
  position: relative;
  width: min(100%, 300px);
  color: var(--teal);
}

.search-box > .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  min-height: 45px;
  padding: 8px 12px 8px 39px;
  border: 1px solid #cbdad4;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.35 var(--font);
}

.search-box input::placeholder { color: var(--muted); }
.search-box input:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.text-action {
  min-height: 44px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font: 650 .88rem/1.3 var(--font);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-action:hover { color: var(--deep); }

.catalog-status {
  margin-top: 18px;
  padding: 20px 24px;
  border: 1px dashed #bfd4ca;
  border-radius: 14px;
  background: #f9fbfa;
  color: var(--muted);
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
}

#local-access h2 {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 1.12rem;
}

#local-access h2:focus { outline: none; }

.catalog-results {
  display: grid;
  gap: 13px;
}

.category-group {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.group-header {
  padding: 12px clamp(12px, 2vw, 22px);
  border-bottom: 1px solid var(--line);
  background: #edf5f0;
  font-size: .94rem;
  font-weight: 650;
  line-height: 1.28;
}

.group-header a {
  color: var(--teal);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.group-header a:hover { color: var(--deep); }

.announcements { margin-top: clamp(28px, 5vw, 52px); }
.announcements .catalog-heading { font-size: clamp(1.55rem, 2.3vw, 1.95rem); }

.announcement-list {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.announcement {
  padding: clamp(14px, 2.1vw, 22px);
  overflow-wrap: anywhere;
}

.announcement + .announcement { border-top: 1px solid var(--line); }
.announcement h3 { font-size: 1.08rem; }
.announcement p { margin-top: 5px; white-space: pre-wrap; }

.file-list { margin: 0; padding: 0; list-style: none; }
.file-list li + li { border-top: 1px solid var(--line); }

.file-row {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 69px;
  padding: 11px clamp(12px, 2vw, 22px);
  text-decoration: none;
  transition: background-color .18s ease;
}

.file-row:hover { background: #f6fbf9; }

.file-open {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 13px;
  min-width: 0;
  min-height: 44px;
  text-decoration: none;
}

.file-open .file-title { color: var(--teal); }
.file-open:hover .file-title { text-decoration: underline; text-underline-offset: 3px; }

.file-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  border-radius: 9px;
  background: var(--mint);
  color: var(--teal);
}

.file-text {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 4px;
}

.file-title {
  font-size: .96rem;
  font-weight: 620;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.file-description, .file-meta {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.file-description { font-size: .85rem; line-height: 1.45; }
.file-details {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 9px;
  font-size: .76rem;
  line-height: 1.35;
}

.file-preview-label {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.file-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal);
  font-size: .8rem;
  font-weight: 650;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease;
}

.file-download .icon { width: 17px; height: 17px; }
.file-download:hover { background: var(--mint); border-color: #b3d5ce; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px 24px;
  padding-block: 25px 31px;
}
.footer-name { font-size: .9rem; font-weight: 650; }
.photo-credit { margin-top: 6px; color: var(--muted); font-size: .72rem; }
.photo-credit a { text-underline-offset: 2px; }
.footer-contact { flex-shrink: 0; }
.footer-contact:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 890px) {
  .hero-content { width: 61%; }
  .hero-art { width: 45%; }
}

@media (max-width: 650px) {
  .header-inner { min-height: 68px; gap: 9px; }
  .identity { gap: 6px; flex-direction: column; align-items: start; }
  .identity-label { border: 0; padding-left: 0; font-size: .72rem; }
  .brand img { width: clamp(125px, 36vw, 137px); }
  .source-link { padding: 6px 8px; font-size: .75rem; gap: 5px; }
  .source-link .icon { width: 16px; height: 16px; }
  .admin-entry { flex-shrink: 1; line-height: 1.2; }

  .hero {
    display: block;
    min-height: 0;
    margin-top: 18px;
    border-radius: 17px;
    padding-bottom: 91px;
  }

  .hero-content { width: 100%; padding: 22px 20px 7px; }
  .hero h1 { font-size: clamp(2.35rem, 9vw, 3.5rem); line-height: 1.02; }
  .hero p { margin-top: 11px; }
  .hero-link { min-height: 44px; margin-top: 13px; }
  .hero-art { inset: auto 0 0 auto; width: 81%; height: 93px; }
  .hero-art::before { inset: 0 -16px -20px -15px; }
  .hero-arch { inset: 8px 0 0; }
  .hero-arch img { object-position: 68% 75%; }

  .documents { margin-bottom: 38px; }
  .section-grid, .topic-list { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 14px; }
  .section-tile, .topic-link { min-height: 62px; padding: 10px 13px; gap: 12px; }
  .section-icon { width: 35px; height: 35px; border-radius: 8px; }
  .file-row { gap: 9px; }
  .file-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .footer-inner { flex-direction: column-reverse; padding-block: 19px 22px; }
}

@media (max-width: 510px) {
  .branch-tools { align-items: stretch; flex-direction: column; }
  .branch-tools .search-box { width: 100%; }
  .file-row { display: grid; grid-template-columns: minmax(0, 1fr); }
  .file-download { justify-self: start; min-height: 44px; margin-left: 44px; }
}

@media (max-width: 390px) {
  .folder-tools { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .file-title { font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.preview-main { padding-block: 28px; }

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.preview-heading { min-width: 0; }

.preview-heading h1 {
  font: 400 clamp(1.5rem, 3vw, 2.5rem)/1.15 var(--display);
  overflow-wrap: anywhere;
}

.preview-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: .82rem;
  overflow-wrap: anywhere;
}

.preview-actions {
  display: flex;
  flex: 0 0 auto;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-download {
  border-color: var(--deep);
  background: var(--deep);
  color: #fff;
}

.preview-download:hover { border-color: var(--teal); background: var(--teal); }

.preview-frame {
  display: block;
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e8efec;
}

.preview-controls {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px;
  border-bottom: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  background: #f5f8f6;
  color: var(--ink);
  font-size: .9rem;
}

.preview-controls button {
  min-width: 44px;
  cursor: pointer;
  background: #fff;
}
.preview-controls button:disabled { opacity: .5; cursor: default; }
.preview-controls input {
  width: 4rem;
  min-height: 44px;
  margin-left: 3px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: inherit;
  font: inherit;
}

.preview-status { padding: 22px; text-align: center; }
.preview-sheet { position: relative; padding: 14px; }
.preview-sheet canvas {
  display: block;
  width: min(100%, 850px);
  height: auto;
  margin-inline: auto;
  background: #fff;
  box-shadow: 0 2px 14px #122e2d26;
}

.preview-screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.preview-error { padding-block: clamp(32px, 7vw, 84px); }
.preview-error h1 { font: 400 clamp(1.8rem, 4vw, 3rem)/1.12 var(--display); }
.preview-error p { margin-block: 12px 20px; color: var(--muted); }

@media (max-width: 760px) {
  .preview-main { padding-block: 18px; }
  .preview-toolbar { flex-direction: column; align-items: start; gap: 11px; }
  .preview-actions .source-link { font-size: .8rem; }
  .preview-sheet { padding: 8px; }
}

@media (max-width: 390px) {
  .preview-controls { flex-wrap: wrap; gap: 6px; padding-inline: 6px; font-size: .78rem; }
}
