/* Case for Catholics — self-hosted only. No web fonts, no CDN, no analytics. */

:root {
  --ink: #1f1c18;
  --paper: #fbfaf6;
  --rule: #ddd6c8;
  --quiet: #5f594f;
  --accent: #7a4a2f;
  --panel: #f3efe6;

  /* One radius scale, applied to everything that draws a box. */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.06rem/1.7 Georgia, "Iowan Old Style", "Times New Roman", serif;
  -webkit-text-size-adjust: 100%;
}

header, main, footer {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

header { border-bottom: 1px solid var(--rule); padding-bottom: 1rem; }

.wordmark {
  font-variant: small-caps;
  letter-spacing: .06em;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--ink);
}

h1 { font-size: 1.9rem; line-height: 1.2; font-weight: 600; margin: .6em 0 .3em; }
h2 { font-size: 1.25rem; line-height: 1.3; font-weight: 600; }

a { color: var(--accent); text-underline-offset: 2px; }

.lede { color: var(--quiet); font-size: 1.1rem; }
.topic { font-variant: small-caps; letter-spacing: .05em; margin-bottom: 0; }

.summary { margin: 2rem 0; }
.summary h2 { margin-bottom: .2em; }
.summary p { margin-top: 0; color: var(--quiet); }

blockquote {
  margin: 1.5rem 0;
  padding: .6rem 1rem;
  border-left: 3px solid var(--rule);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--quiet);
  font-style: italic;
}

.objection, .sources, .collaboration { margin-top: 2.5rem; }

.objection {
  background: var(--panel);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.objection h2 { margin-top: 0; }

.sources, .collaboration {
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  font-size: .95rem;
  color: var(--quiet);
}

.search { display: flex; gap: .5rem; margin: 1.5rem 0; }
.search input { flex: 1; padding: .55rem .9rem; border: 1px solid var(--rule);
                border-radius: var(--radius-pill);
                background: var(--paper); color: var(--ink); font: inherit; }
.search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.search button { padding: .55rem 1.2rem; border: 1px solid var(--rule);
                 border-radius: var(--radius-pill);
                 background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
.search button:hover { background: var(--rule); }
.count { color: var(--quiet); font-size: .95rem; }

/* Pill controls: the article's way into the graph, and the contact actions.
   Same shape as .search button so the site keeps one vocabulary for "this is
   a thing you can press". */
.graph-open, .contact-action {
  display: inline-block;
  padding: .5rem 1.15rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--accent);
  font-size: .95rem;
  text-decoration: none;
}
.graph-open:hover, .contact-action:hover { background: var(--rule); }
.graph-open:focus-visible, .contact-action:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

/* Sits between the lede and the body, so it needs air on both sides. */
.graph-open { margin: .35rem 0 .5rem; }

.contact-address { font-size: 1.15rem; margin: 1.25rem 0; }

.topics { padding-left: 1.1rem; }
.topics li { margin: .35rem 0; }

footer {
  border-top: 1px solid var(--rule);
  color: var(--quiet);
  font-size: .9rem;
  margin-top: 3rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9e4da;
    --paper: #171613;
    --rule: #3b372f;
    --quiet: #a49d90;
    --accent: #d2a081;
    --panel: #211f1a;
  }
}

/* --- corpus + graph --- */
#graph { width: 100%; height: 60vh; min-height: 380px; display: block;
         border: 1px solid var(--rule); background: var(--panel);
         border-radius: var(--radius); }
.graph-controls { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
                  margin: 1rem 0 .6rem; font-size: .9rem; }
.hint { color: var(--quiet); font-size: .88rem; }
.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .9rem;
          font-size: .85rem; color: var(--quiet); }
.dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%;
       vertical-align: baseline; margin-right: .25rem; }
.dot.ref { background: #999; border: 1px dashed #666; }
.backlinks { padding-left: 1.1rem; }
.backlinks li { margin: .3rem 0; }
.count { color: var(--quiet); font-size: .85rem; font-variant-numeric: tabular-nums; }
mark { background: #f0e2b8; color: inherit; border-radius: 3px; padding: 0 .15em; }
@media (prefers-color-scheme: dark) { mark { background: #4a4025; } }

/* --- graph + reading pane split --- */
.split { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.split-panel {
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel);
  padding: 1rem 1.15rem; max-height: 60vh; overflow-y: auto;
}
.split-panel h2 { margin-top: 0; font-size: 1.15rem; }
.split-panel h3 { font-size: 1rem; }
.split-panel .body { font-size: .97rem; }
.panel-doc .sources { margin-top: 1.5rem; }
@media (min-width: 60rem) {
  /* The reading pane only earns its place when there is width for both.
     Order is set here rather than in the DOM: stacked on a narrow screen the graph
     must come first, because a pane saying "click a node" above a graph you have
     not seen yet reads backwards. */
  main:has(.split) { max-width: 92rem; }
  .split { grid-template-columns: 15rem minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
  .split-tree { order: 0; display: block; max-height: 62vh; }
  .split-panel { order: 1; max-height: 62vh; }
  .split-graph { order: 2; }
  #graph { height: 62vh; }
}

/* --- Library tree sidebar (graph page) --- */
.split-tree {
  display: none;              /* narrow screens: the Browse pages are the tree */
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel);
  padding: .75rem .6rem; overflow-y: auto; font-size: .88rem; line-height: 1.45;
}
.split-tree ul { list-style: none; margin: 0; padding-left: .9rem; }
.split-tree > ul { padding-left: 0; }
.split-tree li { margin: .1rem 0; }
.split-tree .t-folder {
  background: none; border: 0; padding: 0; font: inherit; color: var(--ink);
  cursor: pointer; display: inline;
}
.split-tree .t-folder::before { content: "▸ "; color: var(--quiet); }
.split-tree li.open > .t-folder::before { content: "▾ "; }
.split-tree a { text-decoration: none; color: var(--accent); }
.split-tree a.t-ref { color: var(--quiet); }
.split-tree a.t-current { font-weight: bold; text-decoration: underline; }
@media (min-width: 60rem) { .split-tree { display: block; } }

/* Everything that draws a box gets the same radius -- no square corners left. */
pre, code { border-radius: var(--radius-sm); }
pre { padding: .8rem 1rem; background: var(--panel); overflow-x: auto; }
code { padding: .1em .35em; background: var(--panel); }
pre code { padding: 0; background: none; }
table { border-collapse: separate; border-spacing: 0; overflow: hidden;
        border-radius: var(--radius-sm); border: 1px solid var(--rule); width: 100%; }
th, td { padding: .45rem .7rem; border-bottom: 1px solid var(--rule); text-align: left; }
tr:last-child td { border-bottom: 0; }
img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.summary { border-radius: var(--radius); }

/* Brand mark in the header. */
.wordmark .mark {
  height: 1.5em;
  width: auto;
  vertical-align: -0.42em;
  margin-right: .35rem;
}

/* Library browse breadcrumbs. */
.crumbs {
  font-size: .9rem;
  color: var(--quiet);
  margin-bottom: 1rem;
}
.crumbs a { color: var(--accent); }

/* Article images. */
.body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.body figure { margin: 1.5rem 0; }
.body figcaption {
  font-size: .85rem;
  color: var(--quiet);
  margin-top: .4rem;
  text-align: center;
}

/* Artwork figures outside article bodies (homepage, category pages). */
.art { margin: 2rem 0; }
.art img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.art figcaption {
  font-size: .85rem;
  color: var(--quiet);
  margin-top: .4rem;
  text-align: center;
}

/* --- Topics rail (Arguments side) --- */
/* Narrow screens: a wrapped pill row above the content. */
.topics-side h2 { display: none; }
.topics-side ul {
  list-style: none; margin: 0 0 1.25rem; padding: 0;
  display: flex; flex-wrap: wrap; gap: .45rem;
}
.topics-side li {
  border: 1px solid var(--rule); border-radius: var(--radius-pill);
  padding: .15rem .7rem; background: var(--panel); font-size: .85rem;
}
.topics-side li.t-here { border-color: var(--accent); }
.topics-side li.t-here a { color: var(--accent); font-weight: bold; }
.topics-side a { text-decoration: none; color: var(--ink); }
.topics-side .count { color: var(--quiet); font-size: .8em; margin-left: .3rem; }

@media (min-width: 60rem) {
  /* Wide screens: a left column, mirroring the Library's tree. */
  main:has(.with-topics) { max-width: 58rem; }
  .with-topics {
    display: grid; grid-template-columns: 13rem minmax(0, 40rem);
    gap: 2rem; align-items: start;
  }
  .topics-side { position: sticky; top: 1rem; }
  .topics-side h2 {
    display: block; font-size: .8rem; text-transform: uppercase;
    letter-spacing: .08em; color: var(--quiet); margin: 0 0 .6rem;
  }
  .topics-side ul { display: block; margin: 0; }
  .topics-side li {
    border: 0; border-radius: 0; padding: .2rem 0; background: none;
    font-size: .92rem; border-left: 2px solid transparent; padding-left: .6rem;
  }
  .topics-side li.t-here { border-left-color: var(--accent); }
}

/* Topics as a pill row (article pages, all widths). */
.topics-row .topics-side { position: static; }
.topics-row .topics-side h2 { display: none; }
.topics-row .topics-side ul {
  display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1rem; padding: 0;
}
.topics-row .topics-side li {
  border: 1px solid var(--rule); border-radius: var(--radius-pill);
  padding: .15rem .7rem; background: var(--panel); font-size: .85rem;
}
.topics-row .topics-side li.t-here { border-color: var(--accent); }

/* This site's articles in the Library tree: gold, like their graph nodes. */
.split-tree a.t-art { color: #b8860b; }
.split-tree a.t-art.t-current { color: #b8860b; }

/* Pinned marker on the home list. */
.pin {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); border: 1px solid var(--accent);
  border-radius: var(--radius-pill); padding: .05rem .5rem;
  vertical-align: middle; margin-left: .4rem;
}
