/* deronje.rs. Quiet, print-like layout: serif headings (Literata), sans body (Roboto Flex), thin rules
   instead of cards. Colors use Material 3 role names so both themes come from one set of variables;
   [data-theme="dark"] on <html> (set by theme-init.js) switches to dark. */

@font-face {
  font-family: "Literata";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("/assets/fonts/literata-latin.woff2") format("woff2");
  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: "Literata";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("/assets/fonts/literata-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("/assets/fonts/literata-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Roboto Flex";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("/assets/fonts/roboto-flex-latin.woff2") format("woff2");
  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: "Roboto Flex";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("/assets/fonts/roboto-flex-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto Flex";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("/assets/fonts/roboto-flex-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  color-scheme: light;
  --surface: #f6f3ea;
  --surface-container: #ece7da;
  --on-surface: #24231e;
  --on-surface-variant: #5d5a50;
  --outline: #cfc8b6;
  --primary: #3f5d2c;
  --on-primary: #ffffff;
  --primary-container: #c9dcb4;
  --tertiary: #9a6b1f;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Roboto Flex", system-ui, -apple-system, "Segoe UI", sans-serif;
}
[data-theme="dark"] {
  color-scheme: dark;
  --surface: #171612;
  --surface-container: #22211b;
  --on-surface: #e7e3d6;
  --on-surface-variant: #aaa596;
  --outline: #3a382f;
  --primary: #a7c98c;
  --on-primary: #1a2a10;
  --primary-container: #33472a;
  --tertiary: #d9aa5c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--on-surface);
  background: var(--surface);
}
a {
  color: var(--primary);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
p {
  margin: 0 0 1em;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  padding: 8px 14px;
  background: var(--primary);
  color: var(--on-primary);
  z-index: 10;
}
.skip-link:focus {
  top: 8px;
}
.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--outline);
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--on-surface);
  text-decoration: none;
}
.topnav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  font-size: 0.9375rem;
}
.topnav a {
  color: var(--on-surface-variant);
  text-decoration: none;
}
.topnav a:hover {
  color: var(--on-surface);
  text-decoration: underline;
}
.topbar__tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.script-switch {
  display: inline-flex;
  font-size: 0.875rem;
  border: 1px solid var(--outline);
  border-radius: 6px;
  overflow: hidden;
}
.script-switch a {
  padding: 4px 10px;
  color: var(--on-surface-variant);
  text-decoration: none;
}
.script-switch a + a {
  border-left: 1px solid var(--outline);
}
[data-script="lat"] [data-lat],
[data-script="cyr"] [data-cyr] {
  background: var(--primary-container);
  color: var(--on-surface);
  font-weight: 600;
}
.theme-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--on-surface-variant);
  cursor: pointer;
}
.theme-btn:hover {
  background: var(--surface-container);
}
.icon--sun,
[data-theme="dark"] .icon--moon {
  display: none;
}
[data-theme="dark"] .icon--sun {
  display: block;
}

/* ---------- intro ---------- */
.intro {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 56px;
  padding: 56px 0 24px;
  align-items: start;
}
.intro h1 {
  font-size: clamp(3rem, 7vw, 4.75rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}
.intro__lead {
  font-family: var(--serif);
  font-size: 1.375rem;
  line-height: 1.45;
}
.facts {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 14px 32px;
  justify-content: start;
  margin: 32px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--outline);
}
.facts dt {
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
}
.facts dd {
  margin: 0;
  font-weight: 500;
}
.intro__photo {
  margin: 0;
}
.intro__photo img {
  border-radius: 3px;
}
figcaption {
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
}

/* ---------- sections ---------- */
.block {
  padding: 48px 0 8px;
  border-top: 1px solid var(--outline);
  margin-top: 40px;
}
.block h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}
.block__note {
  max-width: 40em;
  color: var(--on-surface-variant);
}

/* history: year in the margin, text beside it */
.years {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  max-width: 760px;
}
.years li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 12px 0;
}
.years li + li {
  border-top: 1px dashed var(--outline);
}
.years__y {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.4;
}
.years p {
  margin: 0;
}

/* churches */
.churches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 8px;
}
.churches img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 3px;
  margin-bottom: 16px;
}
.churches article:first-child {
  padding-top: 4px;
}
.churches h3 {
  font-size: 1.375rem;
  margin-bottom: 8px;
}

/* census table */
.census {
  border-collapse: collapse;
  margin-top: 16px;
  width: 100%;
  max-width: 620px;
  font-variant-numeric: tabular-nums;
}
.census caption {
  text-align: left;
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
  padding-bottom: 8px;
}
.census th,
.census td {
  padding: 5px 0;
  border-bottom: 1px solid var(--outline);
  text-align: left;
  font-weight: 400;
}
.census th {
  width: 80px;
  color: var(--on-surface-variant);
}
.census td:nth-child(2) {
  width: 80px;
  text-align: right;
  padding-right: 20px;
}
.census__bar {
  display: block;
  height: 8px;
  border-radius: 1px;
  background: var(--primary);
  opacity: 0.55;
}
.census__max .census__bar {
  background: var(--tertiary);
  opacity: 1;
}
.census__max td {
  font-weight: 600;
}
.w63 { width: 63%; }
.w67 { width: 67%; }
.w70 { width: 70%; }
.w75 { width: 75%; }
.w80 { width: 80%; }
.w85 { width: 85%; }
.w87 { width: 87%; }
.w94 { width: 94%; }
.w95 { width: 95%; }
.w100 { width: 100%; }

/* map */
.map {
  border: 1px solid var(--outline);
  border-radius: 3px;
  overflow: hidden;
}
.map iframe {
  display: block;
  width: 100%;
  height: 380px;
  border: 0;
}
[data-theme="dark"] .map iframe {
  filter: invert(0.9) hue-rotate(180deg) saturate(0.6);
}
.map__links {
  margin-top: 10px;
  font-size: 0.9375rem;
  color: var(--on-surface-variant);
}

/* footer */
.footer {
  margin-top: 64px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--outline);
  background: var(--surface-container);
  color: var(--on-surface-variant);
}
.footer__small {
  font-size: 0.8125rem;
  margin: 0;
}

/* 404 */
.not-found {
  min-height: 60vh;
  display: grid;
  place-content: center;
  text-align: center;
}
.not-found .big {
  font-family: var(--serif);
  font-size: 5rem;
  margin: 0;
  color: var(--primary);
}

@media (max-width: 860px) {
  .topnav {
    display: none;
  }
  .topbar__tools {
    margin-left: auto;
  }
  .intro {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 32px;
  }
  .intro__photo {
    max-width: 420px;
  }
  .facts {
    grid-template-columns: repeat(2, auto);
  }
  .churches {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .years li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .map iframe {
    height: 300px;
  }
}
