/* Catholic Apologetics Project.
   The page takes the form of a scholastic article: an objection, then "On the
   contrary" and the witnesses. Red is used the way a rubric is: only for the
   words that say what part of the article you are reading. */
:root {
  --stone: #ecede8;
  --stone-deep: #dcdfd8;
  --ink: #10162f;
  --lapis: #1b2a6b;
  --rubric: #b3261e;
  --muted: #4c5370;
  --serif: "Brygada 1918", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --gutter: clamp(16px, 5vw, 64px);
  --margin-col: 8.5rem;
  --measure: 38rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-feature-settings: "onum" 1;
}
a { color: var(--lapis); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--rubric); outline-offset: 3px; }
h1, h2, p, ol, ul, blockquote { margin: 0; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--stone); padding: 0.5rem 1rem; }
.skip:focus { left: 0; z-index: 10; }

/* Top bar */
.top {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--stone-deep);
}
.name { font-weight: 700; font-size: 1.0625rem; letter-spacing: 0.01em; color: var(--ink); text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: 1rem; }
.top nav a { color: var(--ink); text-decoration: none; padding: 0.25rem 0; }
.top nav a:hover { text-decoration: underline; }
.top nav a.cta { color: var(--rubric); font-weight: 600; }

/* The article: objection and witnesses */
.article {
  padding: clamp(2.5rem, 8vw, 6rem) var(--gutter) clamp(3rem, 7vw, 5rem);
  max-width: 76rem;
}
.rubric {
  color: var(--rubric);
  font-style: italic;
  font-weight: 500;
  font-size: 1.375rem;
}
.article h1 {
  font-weight: 600;
  font-size: clamp(2.75rem, 9.5vw, 7.25rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0.35rem 0 0 -0.05em;
  max-width: 11ch;
  text-wrap: balance;
  hanging-punctuation: first;
}
.rubric.contra { margin-top: clamp(2.5rem, 6vw, 4.5rem); padding-left: calc(var(--margin-col) + 1.5rem); }

.witnesses { list-style: none; padding: 0; margin-top: 1rem; }
.witnesses li {
  display: grid;
  grid-template-columns: var(--margin-col) minmax(0, var(--measure));
  column-gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--stone-deep);
}
.witnesses li:last-child { border-bottom: 1px solid var(--stone-deep); }
.date {
  grid-row: span 2;
  text-align: right;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--lapis);
  font-feature-settings: "lnum" 1, "tnum" 1;
}
.witnesses blockquote { font-size: 1.5rem; line-height: 1.35; text-wrap: pretty; }
.who { grid-column: 2; margin-top: 0.5rem; font-size: 1rem; color: var(--muted); }
.more { margin-top: 2rem; padding-left: calc(var(--margin-col) + 1.5rem); }

/* One moment of motion: the witnesses arrive in the order they spoke. */
@media (prefers-reduced-motion: no-preference) {
  .witnesses li { opacity: 0; animation: arrive 0.6s ease-out forwards; }
  .witnesses li:nth-child(1) { animation-delay: 0.3s; }
  .witnesses li:nth-child(2) { animation-delay: 0.75s; }
  .witnesses li:nth-child(3) { animation-delay: 1.2s; }
  .witnesses li:nth-child(4) { animation-delay: 1.65s; }
  @keyframes arrive { from { opacity: 0; } to { opacity: 1; } }
}

.button {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  background: var(--lapis);
  color: var(--stone);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  border-radius: 2px;
}
.button:hover { background: var(--ink); }
.button.light { background: var(--stone); color: var(--lapis); }
.button.light:hover { background: #fff; }

/* The Project and its work: heading in the margin column, text beside it */
.project, .work {
  display: grid;
  grid-template-columns: var(--margin-col) minmax(0, var(--measure));
  column-gap: 1.5rem;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter);
}
.project { border-top: 3px solid var(--ink); margin-top: 0; }
.project h2, .work h2 {
  font-size: 1.1875rem; font-weight: 700; line-height: 1.6; text-align: right;
}
.prose > * + * { margin-top: 1.1em; }
.sections {
  list-style: none; padding: 0;
  columns: 2; column-gap: 2rem;
  font-size: 1.25rem;
}
.sections li { padding: 0.2rem 0; break-inside: avoid; }

/* Leave an objection */
.ask { background: var(--lapis); color: var(--stone); margin-top: clamp(1rem, 4vw, 3rem); }
.ask-in { padding: clamp(3rem, 8vw, 5.5rem) var(--gutter); max-width: 76rem; }
.ask h2 {
  font-weight: 600;
  font-size: clamp(2rem, 5.2vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 20ch;
  text-wrap: balance;
}
.ask p { max-width: var(--measure); margin-top: 1.5rem; }
.ask :focus-visible { outline-color: var(--stone); }

.foot { padding: 2.5rem var(--gutter) 3.5rem; font-size: 1rem; color: var(--muted); }
.foot .name { display: block; margin-bottom: 0.5rem; }
.foot p { max-width: var(--measure); }

@media (max-width: 720px) {
  body { font-size: 1.125rem; }
  .witnesses li, .project, .work { grid-template-columns: 1fr; }
  .date { grid-row: auto; text-align: left; font-size: 1.125rem; margin-bottom: 0.25rem; }
  .who { grid-column: 1; }
  .witnesses blockquote { font-size: 1.3125rem; }
  .rubric.contra, .more { padding-left: 0; }
  .project h2, .work h2 { text-align: left; margin-bottom: 0.75rem; font-size: 1.375rem; }
  .sections { columns: 1; }
}
