@import url("fonts.css");

/* ==========================================================================
   UOKD — Ukrainian Orthodox Koinonia of the Diaspora
   Каркас: не промо-лендинг, а «служебная книга»: титульная плита, колесо года,
   ниши-арки, рубрики киноварью на полях. Палитра — фреска: бумага, чернила,
   киноварь, лазурь. Золото — только волосяные линии.
   ========================================================================== */

:root {
  --paper:        #f7f2e8;
  --paper-warm:   #f1e9da;
  --paper-deep:   #e8ddc8;
  --ink:          #1a1418;
  --ink-soft:     #56484f;
  --ink-faint:    #8a7a80;
  --cinnabar:     #a32b1c;
  --cinnabar-dim: #c25b48;
  --indigo:       #22355f;
  --indigo-deep:  #17233f;
  --gold:         #a8862f;
  --line:         rgba(26, 20, 24, .18);
  --line-soft:    rgba(26, 20, 24, .09);

  --display: "Cormorant Garamond", "Palatino Linotype", Palatino, Georgia, serif;
  --body:    "Literata", Georgia, "Times New Roman", serif;
  --ui:      "Commissioner", "Segoe UI", system-ui, sans-serif;

  --measure: 66ch;
  --shell: 1240px;
  --gutter: clamp(18px, 4.5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.66 var(--body);
  font-feature-settings: "liga" 1, "kern" 1;
  /* лёгкая фактура извести: шум, а не градиент */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}

img, svg { max-width: 100%; }
img { height: auto; }

a { color: var(--indigo); text-underline-offset: .18em; text-decoration-thickness: .06em; }
a:hover { color: var(--cinnabar); }

::selection { background: rgba(163, 43, 28, .16); }

.shell { width: min(100% - var(--gutter) * 2, var(--shell)); margin-inline: auto; }
.measure { max-width: var(--measure); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--ink); color: var(--paper); padding: 10px 16px; font-family: var(--ui);
}
.skip:focus { left: 8px; top: 8px; }

:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 3px; }

/* --------------------------------------------------------------- шапка --- */

.head { border-bottom: 1px solid var(--line); background: rgba(247, 242, 232, .92); }

.head-top {
  display: flex; align-items: center; gap: 20px; justify-content: space-between;
  padding: 14px 0 12px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand .sigil { width: 34px; height: 46px; flex: none; }
.brand b {
  display: block; font: 600 21px/1 var(--display); letter-spacing: .01em;
}
.brand small {
  display: block; margin-top: 3px;
  font: 500 10.5px/1.2 var(--ui); letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint);
}

.langs { display: flex; align-items: center; gap: 2px; font-family: var(--ui); font-size: 12px; }
.langs a {
  display: block; padding: 5px 8px; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-faint); border-radius: 2px;
}
.langs a:hover { color: var(--ink); background: var(--paper-deep); }
.langs a[aria-current="true"] { color: var(--cinnabar); font-weight: 600; }
.langs span { color: var(--line); }

.nav-toggle {
  display: none; font: 500 12px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase;
  background: none; border: 1px solid var(--line); color: var(--ink);
  padding: 10px 14px; border-radius: 2px; cursor: pointer;
}

.nav { border-top: 1px solid var(--line-soft); }
.nav ul {
  display: flex; flex-wrap: wrap; gap: clamp(14px, 2.6vw, 34px);
  margin: 0; padding: 0; list-style: none;
}
.nav a {
  display: block; padding: 11px 0;
  font: 500 12.5px/1 var(--ui); letter-spacing: .13em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-soft); border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--cinnabar); border-bottom-color: var(--cinnabar); }

/* ------------------------------------------------------- титульная плита --- */

.plate {
  display: grid; grid-template-columns: minmax(280px, 360px) 1fr;
  gap: clamp(28px, 5vw, 72px); align-items: start;
  padding: clamp(38px, 6vw, 80px) 0 clamp(30px, 4vw, 54px);
}

.plate-sigil { position: relative; margin: 0; }
.plate-sigil .niche-frame {
  background: var(--paper-warm); border: 1px solid var(--line);
  border-radius: 180px 180px 2px 2px; padding: 34px 26px 26px;
}
.plate-sigil svg { width: 100%; height: auto; display: block; }
.plate-sigil figcaption {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  font: 400 12.5px/1.5 var(--ui); color: var(--ink-faint);
}

.titles { margin: 0; padding: 0; }
.titles li { list-style: none; }
.titles .now {
  font: 600 clamp(30px, 4.6vw, 52px)/1.08 var(--display);
  letter-spacing: -.005em; margin: 0 0 4px;
}
.titles .now-sub {
  font: 400 clamp(17px, 2vw, 21px)/1.35 var(--display); font-style: italic;
  color: var(--ink-soft); margin: 0 0 22px;
}
.titles .other {
  display: flex; flex-wrap: wrap; gap: 7px 20px; margin: 0 0 26px;
  padding-top: 15px; border-top: 1px solid var(--line);
  font: 400 13.5px/1.4 var(--ui); color: var(--ink-faint);
}
.titles .other a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-soft); }
.titles .other a:hover { color: var(--cinnabar); border-bottom-color: currentColor; }

.plate-lead {
  margin: 26px 0 0; max-width: 54ch;
  font: 400 clamp(18px, 1.5vw, 20.5px)/1.55 var(--body); color: var(--ink-soft);
}
.plate-lead b { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------ «сегодня» --- */

.today {
  margin-top: 30px; border: 1px solid var(--line); background: var(--paper-warm);
  display: grid; grid-template-columns: auto 1fr; align-items: stretch;
}
.today-date {
  padding: 18px 22px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  min-width: 118px; background: var(--paper-deep);
}
.today-date .d { font: 600 40px/1 var(--display); color: var(--cinnabar); }
.today-date .m {
  margin-top: 6px; font: 500 11px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-soft); text-align: center;
}
.today-body { padding: 16px 22px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.today-body .rub {
  font: 600 10.5px/1 var(--ui); letter-spacing: .18em; text-transform: uppercase; color: var(--cinnabar);
}
.today-body .feast { font: 400 19px/1.35 var(--display); font-size: 20px; }
.today-body .fast { font: 400 14px/1.4 var(--ui); color: var(--ink-soft); }
.today-body .fast b { font-weight: 600; color: var(--ink); }

/* ------------------------------------------------------------- разделы --- */

.band { padding: clamp(40px, 6vw, 74px) 0; border-top: 1px solid var(--line); }
.band-tight { padding: clamp(30px, 4vw, 48px) 0; }
.band-sand { background: var(--paper-warm); }
.band-ink { background: var(--indigo-deep); color: #e9e3d6; border-top: none; }
.band-ink a { color: #d8cdb4; }
.band-ink a:hover { color: #fff; }

.rubric {
  font: 600 11px/1 var(--ui); letter-spacing: .2em; text-transform: uppercase;
  color: var(--cinnabar); margin: 0 0 16px; display: flex; align-items: center; gap: 12px;
}
.rubric::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.band-ink .rubric { color: #c9a86a; }
.band-ink .rubric::after { background: rgba(233, 227, 214, .22); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.004em; }
h1 { font-size: clamp(32px, 4.4vw, 50px); line-height: 1.06; margin: 0 0 18px; }
h2 { font-size: clamp(25px, 3vw, 34px); line-height: 1.14; margin: 0 0 16px; }
h3 { font-size: clamp(20px, 2vw, 23px); line-height: 1.2; margin: 34px 0 10px; }

p { margin: 0 0 18px; }
.lead { font-size: clamp(18px, 1.4vw, 20.5px); line-height: 1.55; color: var(--ink-soft); }

/* колесо года */
.wheel-wrap {
  display: grid; grid-template-columns: minmax(300px, 520px) 1fr;
  gap: clamp(26px, 4vw, 58px); align-items: center;
}
.wheel { width: 100%; height: auto; display: block; }
.wheel .mo-arc { fill: none; stroke: var(--line); stroke-width: 1; }
.wheel .fast-arc { fill: none; stroke-linecap: butt; opacity: .85; }
.wheel .mo-label { font: 500 9.5px var(--ui); letter-spacing: .14em; fill: var(--ink-faint); text-transform: uppercase; }
.wheel .feast-dot { fill: var(--paper); stroke: var(--indigo); stroke-width: 1.4; cursor: pointer; }
.wheel .feast-dot.great { fill: var(--indigo); }
.wheel .feast-dot.pascha { fill: var(--cinnabar); stroke: var(--cinnabar); }
.wheel .feast-dot:hover, .wheel .feast-dot.on { stroke: var(--cinnabar); stroke-width: 2.4; }
.wheel .hub-year { font: 600 30px var(--display); fill: var(--ink); text-anchor: middle; }
.wheel .hub-cap { font: 500 8.5px var(--ui); letter-spacing: .22em; fill: var(--ink-faint); text-anchor: middle; text-transform: uppercase; }

.wheel-legend { margin: 0; padding: 0; list-style: none; }
.wheel-legend li {
  display: flex; align-items: baseline; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--line-soft); font-size: 15.5px;
}
.wheel-legend .sw { width: 26px; height: 4px; flex: none; align-self: center; }
.wheel-legend .sw-lent { background: #5b3a86; }
.wheel-legend .sw-apostles { background: #2f6f5e; }
.wheel-legend .sw-dormition { background: #22355f; }
.wheel-legend .sw-nativity { background: #a32b1c; }
.wheel-legend .dt { font: 500 13px var(--ui); color: var(--ink-faint); margin-left: auto; white-space: nowrap; }
.wheel-note { margin-top: 18px; font: 400 14px/1.5 var(--ui); color: var(--ink-faint); }
.wheel-readout {
  margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); background: var(--paper);
  min-height: 74px;
}
.wheel-readout .d { font: 500 12px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--cinnabar); }
.wheel-readout .n { font: 400 20px/1.3 var(--display); margin-top: 4px; display: block; }

/* иконостас разделов: ниши-арки */
.niches {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line); border: 1px solid var(--line);
}
.niche {
  background: var(--paper); padding: 30px 24px 26px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 10px; position: relative; min-height: 240px;
  transition: background .22s ease;
}
.niche::before {
  content: ""; display: block; width: 54px; height: 74px; margin-bottom: 6px;
  border: 1px solid var(--indigo); border-bottom: none;
  border-radius: 27px 27px 0 0;
  background:
    linear-gradient(var(--cinnabar), var(--cinnabar)) center 30px / 1.6px 30px no-repeat,
    linear-gradient(var(--cinnabar), var(--cinnabar)) center 38px / 20px 1.6px no-repeat,
    linear-gradient(var(--cinnabar), var(--cinnabar)) center 32px / 12px 1.4px no-repeat;
  opacity: .55; transition: opacity .22s ease;
}
.niche:hover { background: var(--paper-warm); }
.niche:hover::before { opacity: 1; }
.niche .no {
  position: absolute; top: 22px; right: 22px;
  font: 500 11px var(--ui); letter-spacing: .12em; color: var(--ink-faint);
}
.niche h3 { margin: 0; font-size: 24px; }
.niche p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.niche .go {
  margin-top: auto; padding-top: 12px;
  font: 500 11.5px var(--ui); letter-spacing: .13em; text-transform: uppercase; color: var(--cinnabar);
}

/* колонка текста с буквицей */
.incipit h2 + p::first-letter {
  float: left; font-family: var(--display); font-weight: 600; color: var(--cinnabar);
  font-size: 4.15em; line-height: .78; padding: .06em .12em 0 0;
}

/* --------------------------------------------------- внутренние страницы --- */

.page-head { padding: clamp(34px, 5vw, 62px) 0 clamp(22px, 3vw, 34px); }
.page-head .kicker {
  font: 600 11px/1 var(--ui); letter-spacing: .2em; text-transform: uppercase;
  color: var(--cinnabar); margin: 0 0 14px;
}
.page-head .lead { max-width: 60ch; margin-bottom: 0; }

/* внутренняя страница: колонка текста + поле с рубриками справа */
.doc {
  display: grid; grid-template-columns: minmax(0, 70ch) 224px;
  gap: clamp(30px, 4.5vw, 72px); justify-content: start;
  padding-bottom: 20px;
}
.margin { padding-top: 6px; }
.margin .rubric { margin-bottom: 12px; }
.toc { position: sticky; top: 22px; margin: 0; padding: 0; list-style: none; }
.toc li { border-bottom: 1px solid var(--line-soft); }
.toc a {
  display: flex; gap: 10px; padding: 9px 0; text-decoration: none;
  font: 400 14px/1.35 var(--ui); color: var(--ink-soft);
}
.toc a:hover { color: var(--cinnabar); }
.toc .no { color: var(--cinnabar); font-size: 11px; letter-spacing: .1em; padding-top: 2px; }

.prose { max-width: var(--measure); }
.doc .prose { max-width: none; }
.prose h2 { margin-top: 46px; scroll-margin-top: 20px; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 1.3em; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--cinnabar); }

.section-sep {
  border: none; height: 1px; background: var(--line); margin: 46px 0;
  position: relative; overflow: visible;
}
.section-sep::after {
  content: ""; position: absolute; left: 50%; top: -4px; width: 8px; height: 8px;
  transform: translateX(-50%) rotate(45deg); background: var(--paper);
  border: 1px solid var(--cinnabar);
}

.note {
  border-left: 2px solid var(--cinnabar); padding: 4px 0 4px 20px; margin: 0 0 24px;
  font-size: 16px; color: var(--ink-soft);
}
.note b, .note strong { color: var(--ink); }

.callout {
  border: 1px solid var(--line); background: var(--paper-warm); padding: 24px 26px; margin: 0 0 26px;
}
.callout .rubric { margin-bottom: 10px; }
.callout p:last-child { margin-bottom: 0; }

blockquote {
  margin: 0 0 26px; padding: 0 0 0 24px; border-left: 1px solid var(--gold);
  font: 400 20px/1.5 var(--display); font-style: italic; color: var(--ink);
}
blockquote cite {
  display: block; margin-top: 10px; font: 500 11.5px var(--ui); letter-spacing: .14em;
  text-transform: uppercase; font-style: normal; color: var(--ink-faint);
}

/* определения */
.defs { margin: 0 0 26px; }
.defs div { padding: 14px 0; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 8px 26px; }
.defs div:last-child { border-bottom: 1px solid var(--line-soft); }
.defs dt { font: 600 16px var(--display); font-size: 18px; }
.defs dd { margin: 0; color: var(--ink-soft); font-size: 15.5px; line-height: 1.55; }

/* таблицы календаря */
.tbl-wrap { overflow-x: auto; margin: 0 0 26px; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { text-align: left; padding: 11px 14px 11px 0; border-bottom: 1px solid var(--line-soft); vertical-align: baseline; }
th {
  font: 600 10.5px var(--ui); letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint); border-bottom-color: var(--line);
}
td.date { font: 500 15px var(--ui); color: var(--cinnabar); white-space: nowrap; }
tr.is-great td.name { font-weight: 600; }
td.meta { color: var(--ink-faint); font: 400 14px var(--ui); }

/* молитвы */
.prayer { margin: 0 0 40px; padding-top: 26px; border-top: 1px solid var(--line); }
.prayer h2, .prayer h3 { margin: 0 0 4px; font-size: clamp(22px, 2.3vw, 27px); }
.prose .prayer h2 { margin-top: 0; }
.prayer .src { font: 400 13px var(--ui); color: var(--ink-faint); margin: 0 0 18px; }
.prayer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 44px); }
.prayer-cols .col-label {
  font: 600 10.5px var(--ui); letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft);
}
.prayer-text { white-space: pre-line; font-size: 16.5px; line-height: 1.62; margin: 0; }
.prayer-text.uk { font-style: normal; }
.prayer-cols .other .prayer-text { color: var(--ink-soft); }

/* каталог общин */
.dir { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 0 0 30px; }
.dir article { background: var(--paper); padding: 22px 24px; }
.dir h3 { margin: 0 0 6px; font-size: 21px; }
.dir p { margin: 0 0 10px; font-size: 15.5px; color: var(--ink-soft); }
.dir .where {
  font: 500 11px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
  margin: 0 0 8px;
}
.dir a.ext { font: 500 14px var(--ui); text-decoration: none; border-bottom: 1px solid var(--line); }
.dir a.ext:hover { border-bottom-color: var(--cinnabar); }
.dir a.ext::after { content: " ↗"; font-size: .85em; }

/* лента истории */
.years { margin: 0; padding: 0; list-style: none; }
.years li {
  display: grid; grid-template-columns: 108px 1fr; gap: 22px;
  padding: 18px 0; border-top: 1px solid var(--line-soft);
}
.years li:last-child { border-bottom: 1px solid var(--line-soft); }
.years b { font: 600 22px/1.1 var(--display); color: var(--cinnabar); }
.years span { font-size: 16px; line-height: 1.55; }
.years em { display: block; margin-top: 4px; font: 400 13.5px var(--ui); font-style: normal; color: var(--ink-faint); }

/* ------------------------------------------------- корневая страница ------ */

.gate { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.gate-in { text-align: center; max-width: 620px; }
.gate svg { width: 132px; height: auto; margin: 0 auto 26px; display: block; }
.gate h1 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 6px; }
.gate .sub {
  font-family: var(--ui); font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 34px;
}
.gate ul {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 1px;
  background: var(--line); border: 1px solid var(--line); text-align: left;
}
.gate li a {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; background: var(--paper);
  padding: 14px 18px; text-decoration: none; color: var(--ink);
  font-family: var(--ui); font-size: 15px;
}
.gate li a:hover { background: var(--paper-warm); color: var(--cinnabar); }
.gate li span { color: var(--ink-faint); font-size: 13.5px; }

/* --------------------------------------------------------------- подвал --- */

.foot { border-top: 1px solid var(--line); background: var(--paper-warm); padding: 48px 0 30px; margin-top: 0; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 34px; }
.foot h4 {
  margin: 0 0 14px; font: 600 10.5px var(--ui); letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint);
}
.foot ul { margin: 0; padding: 0; list-style: none; }
.foot li { margin-bottom: 9px; }
.foot a { font-size: 15px; text-decoration: none; color: var(--ink-soft); }
.foot a:hover { color: var(--cinnabar); }
.foot .brand { margin-bottom: 14px; }
.foot p { font-size: 14.5px; color: var(--ink-faint); line-height: 1.55; }
.foot-legal {
  margin-top: 38px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between;
  font: 400 13px var(--ui); color: var(--ink-faint);
}

/* ------------------------------------------------------------- телефон --- */

@media (max-width: 1080px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .margin { display: none; }
  .niches { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .plate { grid-template-columns: 1fr; }
  .plate-sigil { max-width: 230px; }
  .wheel-wrap { grid-template-columns: 1fr; }
  .prayer-cols { grid-template-columns: 1fr; gap: 22px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .defs div { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 720px) {
  body { font-size: 16.5px; }
  .niches { grid-template-columns: 1fr; }
  .niche { min-height: 0; }
  .nav-toggle { display: block; }
  .nav { display: none; padding-bottom: 10px; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .nav a[aria-current="page"] { border-bottom-color: var(--cinnabar); }
  .head-top { flex-wrap: wrap; gap: 12px; }
  .brand small { display: none; }
  .brand .sigil { width: 28px; height: 38px; }
  .langs { order: 3; width: 100%; border-top: 1px solid var(--line-soft); padding-top: 8px; }
  .langs a { padding: 6px 10px 6px 0; }
  .today { grid-template-columns: 1fr; }
  .today-date { border-right: none; border-bottom: 1px solid var(--line); flex-direction: row; gap: 12px; padding: 12px; }
  .today-date .m { margin-top: 0; }
  .years li { grid-template-columns: 1fr; gap: 4px; }
  .foot-grid { grid-template-columns: 1fr; }
}

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

@media print {
  .head, .foot, .nav, .langs { display: none; }
  body { background: #fff; }
}
