/* Боянска църква — бележки на любител */
:root {
  --lapis: #1d3550;
  --lapis-deep: #13243a;
  --ochre: #d7a64a;
  --ochre-soft: #f0d9a0;
  --brick: #a8452c;
  --brick-deep: #7a2e1b;
  --moss: #4f6f45;
  --stone: #f6f2ea;
  --stone-2: #ebe3d3;
  --ink: #2a2420;
  --ink-soft: #564c42;
  --line: #d6c9b0;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brick-deep); text-underline-offset: 3px; }
a:hover { color: var(--brick); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--lapis-deep); font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin: 0 0 .6em; }
h3 { font-size: 1.25rem; margin: 0 0 .4em; }
p { margin: 0 0 1em; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

/* ---------- header ---------- */
.site-head {
  background: linear-gradient(180deg, var(--lapis-deep), var(--lapis));
  color: #f3e6c8;
  border-bottom: 4px solid var(--ochre);
  position: relative;
}
.site-head::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -10px; height: 6px;
  background: repeating-linear-gradient(90deg, var(--brick) 0 18px, transparent 18px 24px);
  opacity: .55;
}
.head-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 14px 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff6e0; text-decoration: none; }
.brand img { width: 52px; height: 52px; }
.brand-name { font-family: var(--serif); font-size: 1.35rem; line-height: 1.1; display: block; }
.brand-sub { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ochre-soft); }
.brand:hover { color: #fff; }

.menu { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.menu a {
  display: block; padding: 8px 16px 7px;
  color: #f3e6c8; text-decoration: none; font-size: .95rem;
  border: 1px solid rgba(240, 217, 160, .35);
  border-radius: 999px 999px 6px 6px;
  transition: background .2s, color .2s;
}
.menu a:hover { background: rgba(240, 217, 160, .15); color: #fff; }
.menu a[aria-current="page"] { background: var(--ochre); color: var(--lapis-deep); border-color: var(--ochre); font-weight: 600; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 40px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 260px;
  background: linear-gradient(180deg, var(--stone-2), transparent);
  z-index: -1;
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center;
}
.kicker {
  display: inline-block; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--brick-deep); border-bottom: 2px solid var(--ochre); padding-bottom: 2px; margin-bottom: 18px;
}
.lead { font-size: 1.18rem; color: var(--ink-soft); }
.lead::first-letter {
  font-family: var(--serif); float: left; font-size: 3.6em; line-height: .85;
  padding: 6px 10px 0 0; color: var(--brick);
}
.arch {
  border-radius: 999px 999px var(--radius) var(--radius);
  overflow: hidden; border: 6px solid #fff; box-shadow: 0 0 0 2px var(--ochre), 0 22px 40px -18px rgba(19, 36, 58, .5);
  background: #fff;
}
.hero-figure { position: relative; margin: 0; }
.hero-figure .stamp {
  position: absolute; left: -22px; bottom: 34px;
  background: var(--brick); color: #fff3dc; font-family: var(--serif);
  padding: 10px 16px; border-radius: 6px; font-size: .95rem; transform: rotate(-3deg);
  box-shadow: 0 8px 18px -8px rgba(0,0,0,.4);
}
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; padding: 0; list-style: none; }
.hero-facts li { font-size: .92rem; color: var(--ink-soft); padding-left: 18px; position: relative; }
.hero-facts li::before { content: ""; position: absolute; left: 0; top: .55em; width: 9px; height: 9px; background: var(--ochre); transform: rotate(45deg); }
.hero-facts b { color: var(--lapis-deep); font-family: var(--serif); font-size: 1.1rem; }

/* ---------- section helpers ---------- */
.section { padding: 56px 0; }
.section-alt { background: #fff; border-block: 1px solid var(--line); }
.section-title { display: flex; align-items: baseline; gap: 14px; margin-bottom: 26px; }
.section-title .num { font-family: var(--serif); color: var(--ochre); font-size: 2.6rem; line-height: 1; }
.section-title h2 { margin: 0; }

/* niches: cards with arched tops */
.niches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.niche {
  background: #fff; border: 1px solid var(--line);
  border-radius: 140px 140px var(--radius) var(--radius);
  padding: 46px 24px 24px; position: relative;
}
.section-alt .niche { background: var(--stone); }
.niche::before {
  content: ""; position: absolute; top: 12px; left: 50%; width: 46px; height: 4px; margin-left: -23px;
  background: var(--ochre); border-radius: 2px;
}
.niche h3 { text-align: center; }
.niche .more { font-weight: 600; text-decoration: none; }
.niche .more::after { content: " →"; }
.niche:nth-child(2) { transform: translateY(26px); }

/* chronicle — vertical timeline */
.chronicle-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: start; }
.chronicle { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 3px solid var(--line); }
.chronicle li { position: relative; padding: 0 0 26px 18px; }
.chronicle li::before {
  content: ""; position: absolute; left: -38px; top: 4px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--stone); border: 3px solid var(--brick);
}
.chronicle .year { font-family: var(--serif); font-size: 1.3rem; color: var(--brick-deep); display: block; }

/* marginal note */
.note {
  background: var(--lapis); color: #eadfc6; border-radius: var(--radius);
  padding: 24px 26px; position: relative;
}
.note h3 { color: var(--ochre-soft); }
.note a { color: var(--ochre-soft); }
.note::after {
  content: ""; position: absolute; right: 18px; top: -12px; width: 26px; height: 26px;
  background: var(--ochre); transform: rotate(45deg); border-radius: 3px;
}

/* quote band */
.band {
  background: radial-gradient(circle at 15% 30%, #8f3a24, var(--brick-deep) 60%);
  color: #fbe9cc; padding: 64px 0; position: relative;
}
.band::before, .band::after {
  content: ""; position: absolute; left: 0; right: 0; height: 10px;
  background: repeating-linear-gradient(90deg, var(--ochre) 0 10px, transparent 10px 20px);
  opacity: .5;
}
.band::before { top: 10px; } .band::after { bottom: 10px; }
.band blockquote { margin: 0 auto; max-width: 780px; font-family: var(--serif); font-size: clamp(1.25rem, 2.6vw, 1.7rem); line-height: 1.45; text-align: center; }
.band cite { display: block; margin-top: 16px; font-size: .95rem; font-style: normal; color: var(--ochre-soft); font-family: var(--sans); }

/* split with figure */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.split.reverse > :first-child { order: 2; }
figure { margin: 0; }
figcaption { font-size: .88rem; color: var(--ink-soft); margin-top: 10px; font-style: italic; }
.framed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: 0 18px 34px -22px rgba(19, 36, 58, .55); background: #fff; }

/* three parts — horizontal steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; counter-reset: s; margin-top: 30px; }
.step { padding: 26px 24px; border-top: 6px solid var(--brick); background: #fff; border-right: 1px solid var(--line); }
.step:nth-child(2) { border-top-color: var(--ochre); }
.step:nth-child(3) { border-top-color: #98a6b3; border-right: 0; }
.step .tag { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); }

/* gallery of saints */
.saints { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.saint { text-align: center; padding: 18px 14px 20px; background: var(--lapis); color: #eadfc6; border-radius: 90px 90px 10px 10px; }
.saint .halo { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f8de92, #b9862a); box-shadow: 0 0 0 3px rgba(255,255,255,.15); display: grid; place-items: center; font-family: var(--serif); color: var(--lapis-deep); font-size: 1.5rem; }
.saint h3 { color: #fff3dc; font-size: 1.05rem; }
.saint p { font-size: .92rem; margin: 0; }

/* glossary */
.glossary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 40px; margin: 0; }
.glossary div { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.glossary dt { font-family: var(--serif); font-weight: 600; color: var(--brick-deep); font-size: 1.1rem; }
.glossary dd { margin: 4px 0 0; color: var(--ink-soft); }

/* checklist */
.checklist { list-style: none; padding: 0; margin: 0; counter-reset: c; }
.checklist li { counter-increment: c; position: relative; padding: 0 0 18px 56px; }
.checklist li::before {
  content: counter(c); position: absolute; left: 0; top: -2px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--moss); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 1.1rem;
}

/* questions */
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 20px; margin-bottom: 12px; }
.faq summary { cursor: pointer; padding: 16px 0; font-family: var(--serif); font-size: 1.1rem; color: var(--lapis-deep); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; display: inline-block; width: 1.4em; color: var(--brick); font-weight: 700; }
.faq details[open] summary::before { content: "−"; }
.faq details p { padding-bottom: 14px; margin: 0; }

/* pebbles — small fact chips */
.pebbles { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; padding: 0; list-style: none; }
.pebbles li { background: var(--stone-2); border-radius: 30px 30px 30px 6px; padding: 10px 16px; font-size: .93rem; }

.page-intro { padding: 48px 0 24px; }
.page-intro .lead { max-width: 760px; }
.crumbs { font-size: .88rem; color: var(--ink-soft); margin-bottom: 10px; }
.crumbs a { color: var(--ink-soft); }

/* ---------- footer ---------- */
.site-foot { background: var(--lapis-deep); color: #cfc3a8; padding: 48px 0 28px; margin-top: 0; font-size: .95rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.site-foot h3 { color: var(--ochre-soft); font-size: 1.05rem; }
.site-foot a { color: #f3e6c8; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin-bottom: 6px; }
.foot-brand { display: flex; gap: 12px; align-items: flex-start; }
.foot-brand img { width: 44px; height: 44px; flex: none; }
.foot-bottom { margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(240, 217, 160, .2); font-size: .85rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .chronicle-grid, .split { grid-template-columns: 1fr; gap: 32px; }
  .split.reverse > :first-child { order: 0; }
  .niches { grid-template-columns: 1fr 1fr; }
  .niche:nth-child(2) { transform: none; }
  .saints { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--line); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
  .hero-figure .stamp { left: 10px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .head-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .menu a { padding: 7px 12px 6px; font-size: .9rem; }
  .hero { padding-top: 36px; }
  .section { padding: 42px 0; }
  .niches, .saints, .glossary, .foot-grid { grid-template-columns: 1fr; }
  .niche { border-radius: 90px 90px var(--radius) var(--radius); }
  .chronicle { padding-left: 20px; }
  .chronicle li::before { left: -30px; }
}
