/* Orthodox Hierarchs (hierarchs.zosha.net): the type and colours of zosha.net */

@font-face { font-family: 'Alegreya Variable'; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(/fonts/alegreya-latin-wght.woff2) format('woff2-variations');
  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: 'Alegreya Variable'; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(/fonts/alegreya-latin-ext-wght.woff2) format('woff2-variations');
  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: 'Alegreya Variable'; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(/fonts/alegreya-cyrillic-wght.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Alegreya Variable'; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(/fonts/alegreya-cyrillic-ext-wght.woff2) format('woff2-variations');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Alegreya Variable'; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(/fonts/alegreya-greek-wght.woff2) format('woff2-variations');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'Alegreya Variable'; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(/fonts/alegreya-greek-ext-wght.woff2) format('woff2-variations');
  unicode-range: U+1F00-1FFF; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-display: swap; font-weight: 400;
  src: url(/fonts/alegreya-sans-latin-400.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: 'Alegreya Sans'; font-style: normal; font-display: swap; font-weight: 500;
  src: url(/fonts/alegreya-sans-latin-500.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: 'Alegreya Sans'; font-style: normal; font-display: swap; font-weight: 400;
  src: url(/fonts/alegreya-sans-latin-ext-400.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: 'Alegreya Sans'; font-style: normal; font-display: swap; font-weight: 500;
  src: url(/fonts/alegreya-sans-latin-ext-500.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: 'Alegreya Sans'; font-style: normal; font-display: swap; font-weight: 400;
  src: url(/fonts/alegreya-sans-cyrillic-400.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-display: swap; font-weight: 500;
  src: url(/fonts/alegreya-sans-cyrillic-500.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-display: swap; font-weight: 400;
  src: url(/fonts/alegreya-sans-cyrillic-ext-400.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-display: swap; font-weight: 500;
  src: url(/fonts/alegreya-sans-cyrillic-ext-500.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-display: swap; font-weight: 400;
  src: url(/fonts/alegreya-sans-greek-400.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-display: swap; font-weight: 500;
  src: url(/fonts/alegreya-sans-greek-500.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-display: swap; font-weight: 400;
  src: url(/fonts/alegreya-sans-greek-ext-400.woff2) format('woff2');
  unicode-range: U+1F00-1FFF; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-display: swap; font-weight: 500;
  src: url(/fonts/alegreya-sans-greek-ext-500.woff2) format('woff2');
  unicode-range: U+1F00-1FFF; }

:root {
  --font-serif: 'Alegreya Variable', Alegreya, Georgia, 'Times New Roman', serif;
  --font-sans: 'Alegreya Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --bg: #e4e6e0;
  --surface: #eef0ea;
  --ink: #18213f;
  --ink-muted: #4a5272;
  --line: rgba(24, 33, 63, 0.18);
  --link: #1f3f8f;
  --accent: #9a6d17;
  --focus: #1f3f8f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121a30;
    --surface: #1a2340;
    --ink: #f2ebd8;
    --ink-muted: #b4b9cc;
    --line: rgba(242, 235, 216, 0.16);
    --link: #e3c27a;
    --accent: #d0a64a;
    --focus: #e3c27a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
svg { display: block; max-width: 100%; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--ink-muted); }
.small { font-size: 0.95rem; }
.count {
  display: inline-block;
  min-width: 1.8em;
  padding: 0 0.45em;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  vertical-align: 0.2em;
  color: var(--ink-muted);
}

/* ---------------------------------------------------------------- masthead and footer */

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px clamp(16px, 4vw, 48px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
}
.brand svg { width: 16px; height: 22px; color: var(--accent); }
.topnav { display: flex; gap: 20px; font-family: var(--font-sans); font-weight: 500; }
.topnav a { color: var(--ink-muted); text-decoration: none; }
.topnav a:hover, .topnav a[aria-current] { color: var(--ink); text-decoration: underline; }
.topsearch { margin-left: auto; flex: 0 1 260px; }
.topsearch input { width: 100%; }

input[type=search], select {
  font: inherit;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
}
input[type=search]:focus-visible { outline-offset: 0; }
button, .button {
  display: inline-block;
  font: inherit;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1rem;
  color: var(--bg);
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  padding: 8px 18px;
  cursor: pointer;
  text-decoration: none;
}
.button:hover, button:hover { opacity: 0.88; text-decoration: none; }

.footer {
  padding: 28px 24px 34px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--line);
}
.footer a { color: inherit; }

/* ---------------------------------------------------------------- page */

.page {
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 48px) 48px;
}
.page > section, .hierarch > section { margin-top: 44px; }
h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); line-height: 1.1; font-weight: 700; }
h2 {
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 700;
  padding-bottom: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
h3 { font-size: 1.2rem; font-weight: 700; margin: 26px 0 10px; }
section p + p, section p + ul, section ul + p { margin-top: 12px; }

.hero .eyebrow { font-family: var(--font-sans); font-weight: 500; font-size: 0.95rem; letter-spacing: 0.02em; margin-bottom: 6px; }
.hero .eyebrow a { color: var(--accent); text-decoration: none; }
.hero .eyebrow a:hover { text-decoration: underline; }
.hero .original { font-size: 1.45rem; color: var(--ink-muted); margin-top: 4px; }
.hero .subtitle { font-size: 1.25rem; margin-top: 8px; }
.hero .aka { margin-top: 6px; color: var(--ink-muted); }
.saint {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  vertical-align: 0.5em;
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 10px;
}

.on-page {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 22px;
  font-family: var(--font-sans);
  font-weight: 500;
}

/* life events: a two-column list */
.events { display: grid; gap: 4px; }
.events > div { display: grid; grid-template-columns: 15em 1fr; gap: 16px; padding: 4px 0; border-bottom: 1px dotted var(--line); }
.events dt { color: var(--ink-muted); }

/* see tenures and successions: date column, then who/what */
.tenures li, .succession li {
  display: grid;
  grid-template-columns: 15em 1fr;
  column-gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dotted var(--line);
}
.tenure-dates { grid-row: span 2; color: var(--ink-muted); font-family: var(--font-sans); font-size: 1rem; padding-top: 2px; }
.tenure-what { font-weight: 500; }
.tenure-more { font-size: 1rem; }

/* lists of people */
.people li { padding: 5px 0; border-bottom: 1px dotted var(--line); }
.people.dated li { display: grid; grid-template-columns: 11em 1fr; gap: 16px; }
.people .when { color: var(--ink-muted); font-family: var(--font-sans); font-size: 1rem; padding-top: 2px; }

/* the line of succession: a chain running upward from him */
.lineage { position: relative; margin-left: 10px; }
.lineage li { position: relative; padding: 6px 0 12px 26px; }
.lineage li::before {
  content: '';
  position: absolute;
  left: 0; top: 14px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
  transform: translateX(-50%);
  z-index: 1;
}
.lineage li.self::before { background: var(--accent); }
.lineage li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 0; top: 20px; bottom: -20px;
  border-left: 2px solid var(--line);
  transform: translateX(-50%);
}
.lineage-date { display: block; color: var(--ink-muted); font-family: var(--font-sans); font-size: 0.95rem; }

.sources li { padding: 3px 0; overflow-wrap: anywhere; }
.sources li::before { content: '— '; color: var(--ink-muted); }
.note { padding: 12px 16px; background: var(--surface); border-left: 3px solid var(--accent); }
.record-id { margin-top: 40px; font-family: var(--font-sans); font-size: 0.85rem; }

/* jurisdiction pages */
.chips { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--font-sans); }
.chips a {
  padding: 3px 4px 3px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
}
.chips a:hover { border-color: var(--ink-muted); }
.columns { columns: 3 15em; column-gap: 32px; }
.columns li { break-inside: avoid; padding: 2px 0; }
.columns .muted { font-family: var(--font-sans); font-size: 0.9rem; }

.table { width: 100%; border-collapse: collapse; margin-top: 24px; }
.table th, .table td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px dotted var(--line); }
.table th { font-family: var(--font-sans); font-weight: 500; color: var(--ink-muted); border-bottom: 1px solid var(--line); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-sans); }

/* home */
.intro { max-width: 720px; }
.lede { font-size: 1.3rem; margin-top: 14px; }
.bigsearch { display: flex; gap: 10px; margin-top: 24px; max-width: 720px; }
.bigsearch input { flex: 1; font-size: 1.15rem; padding: 11px 16px; }
.figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 40px; }
.figures > div { padding: 14px 0; border-top: 2px solid var(--accent); }
.figures dt { font-family: var(--font-sans); color: var(--ink-muted); font-size: 0.95rem; }
.figures dd { font-size: 2rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tiles a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
}
.tiles a:hover { border-color: var(--accent); }
.tile-name { font-weight: 700; line-height: 1.25; }
.tile-count { margin-top: auto; padding-top: 6px; font-family: var(--font-sans); font-size: 0.9rem; color: var(--ink-muted); }

.prose { max-width: 70ch; }
.prose h2 { margin-top: 36px; }
.prose p { margin-top: 12px; }

/* search results */
#search-status { margin-top: 18px; font-family: var(--font-sans); }
.results h2 { margin-top: 28px; }
.results li { padding: 8px 0; border-bottom: 1px dotted var(--line); }
.results .orig { color: var(--ink-muted); }
.results .meta { display: block; font-family: var(--font-sans); font-size: 0.95rem; color: var(--ink-muted); }
.results mark { background: none; color: inherit; font-weight: 700; }

/* the consecration network */
.graph-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 18px; font-family: var(--font-sans); }
.graph-controls label { display: flex; align-items: center; gap: 8px; }
.graph { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-height: 200px; }
.graph svg { max-width: none; }
.graph .edge { fill: none; stroke: var(--ink-muted); stroke-opacity: 0.45; stroke-width: 1.2; }
.graph .node rect { fill: var(--bg); stroke: var(--line); stroke-width: 1; }
.graph .node.center rect { stroke: var(--accent); stroke-width: 2.5; }
.graph .node a { cursor: pointer; }
.graph .node a:hover rect, .graph .node a:focus rect { stroke: var(--link); stroke-width: 2; }
.graph .node a:focus { outline: none; }
.graph .name { fill: var(--ink); font-family: var(--font-serif); font-size: 14px; font-weight: 700; }
.graph .meta { fill: var(--ink-muted); font-family: var(--font-sans); font-size: 12px; }
.graph .more { fill: var(--ink-muted); font-family: var(--font-sans); font-size: 12px; }
.graph .band { fill: var(--ink-muted); font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }

@media (max-width: 700px) {
  .events > div, .tenures li, .succession li, .people.dated li { grid-template-columns: 1fr; gap: 0; }
  .tenure-dates { grid-row: auto; }
  .figures { grid-template-columns: repeat(2, 1fr); }
  .topsearch { flex-basis: 100%; margin-left: 0; }
  .bigsearch { flex-direction: column; }
}

@media print {
  .masthead, .footer, .on-page, .button { display: none; }
  body { background: #fff; color: #000; }
}

/* tenures: the lines of one entry sit together; secondary links stay quiet */
.tenures p + p, .succession p + p { margin-top: 0; }
.tenure-more a { color: inherit; }
.graph-link { margin-top: 32px; }
/* the network may use the window's width, not just the text column's */
.graph { position: relative; left: 50%; width: min(calc(100vw - 32px), 1400px); transform: translateX(-50%); }
