/* Sermon Planet, set like a bilingual missal: black for what is said, red
   rubrics for everything around it, centred title pages, and the German and
   Polish texts side by side. At night the page turns dark, as by candlelight;
   site.js sets data-theme from the reader's choice or the device. */

@font-face {
  font-family: "Vollkorn";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/vollkorn-latin-wght-normal.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: "Vollkorn";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/vollkorn-latin-ext-wght-normal.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: "Vollkorn";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/vollkorn-latin-wght-italic.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: "Vollkorn";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/vollkorn-latin-ext-wght-italic.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;
}

:root {
  color-scheme: light dark;
  /* light-dark(day, night) */
  --paper: light-dark(#fbfaf7, #1a1613);   /* the page */
  --ink: light-dark(#221e1b, #ebe4d8);     /* iron-gall ink: the text */
  --faded: light-dark(#6b635b, #a89e91);   /* notes and the second language */
  --rubric: light-dark(#a51d1d, #e26d5f);  /* the red of rubrics */
  --hair: light-dark(#e3c9c4, #5a3530);    /* rubric red, thinned: rules */
  --violet: light-dark(#4f2b68, #9f86c4);  /* Advent */
  --rose: light-dark(#c07a92, #d896ae);    /* Gaudete */
  --flame: light-dark(#c98d24, #e5b04a);  /* candle flame and gold leaf */
  --vellum: light-dark(#f5eddc, #2a221b);  /* a warmer leaf, for the invitation */
  --measure: 36rem;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.65 "Vollkorn", Georgia, serif;
  font-kerning: normal;
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem) 3rem;
}

a {
  color: inherit;
  text-decoration-color: var(--rubric);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--rubric); }
:focus-visible { outline: 2px solid var(--rubric); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-weight: 600; line-height: 1.1; }
button { font: inherit; }
p { margin: 0; }

/* A rule as in old liturgical books: two red lines, short and centred. */
hr {
  width: 7rem;
  height: 0;
  margin: 1.75rem auto;
  border: 0;
  border-top: 3px double var(--rubric);
}

/* Top bar */
.bar {
  display: flex;
  min-height: 2rem;
  gap: clamp(0.75rem, 3vw, 1.5rem);
  align-items: center;
  font-size: 1rem;
}
.bar a { white-space: nowrap; }
.bar .home { font-weight: 700; text-decoration: none; }

/* The light and dark switch, at the right of the top bar. Like the download
   icons, it has a target of 44 pixels or more for fingers; negative margins
   keep the icon in its place. */
.theme {
  margin: -0.3875rem -0.3875rem -0.3875rem auto;
  padding: 0.6875rem;
  border: 0;
  background: none;
  color: var(--faded);
  cursor: pointer;
}
.theme:hover { color: var(--rubric); }
.theme svg {
  display: block;
  width: 1.375rem;
  height: 1.375rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme .sun, [data-theme="dark"] .theme .moon { display: none; }
[data-theme="dark"] .theme .sun { display: block; }
.theme[hidden] { display: none; }

/* Title pages: centred, as in a missal */
.title { text-align: center; }
body > header.title { margin: clamp(2.5rem, 8vw, 5rem) auto 0; max-width: 46rem; }
.title h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6.5vw, 4rem);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.feast { margin-bottom: 0.5rem; font-style: italic; font-size: 1.375rem; color: var(--faded); }
.cycle { margin-top: 1rem; font-size: 1rem; color: var(--faded); }
.cycle mark { background: none; color: var(--rubric); font-weight: 700; }
.preacher { font-size: 1.25rem; font-weight: 600; }
/* A preacher's photo stands free, with softened corners: a frame round
   a face reads as a death notice. */
.preacher .face {
  display: block;
  width: 5rem;
  height: auto;
  margin: 0 auto 0.75rem;
  border-radius: 6px;
}
.occasion, .readings { margin-top: 0.35rem; color: var(--faded); }
.readings { font-style: italic; }

/* A preacher's page */
.portrait {
  display: block;
  width: min(12rem, 60vw);
  height: auto;
  margin: 0 auto 2rem;
  border-radius: 6px;
}
.person .bio { max-width: var(--measure); margin: 0 auto; text-align: left; hyphens: auto; }
.person .links { margin-top: 1.25rem; font-style: italic; color: var(--faded); }
.list { max-width: var(--measure); margin: 0 auto; padding: 0; list-style: none; text-align: center; }
.list li + li { margin-top: 1.25rem; }
.list a { font-size: 1.375rem; font-weight: 600; text-wrap: balance; }
.list .when { display: block; font-style: italic; color: var(--faded); }

/* The Advent candles, in the order they are lit */
.candles { display: block; width: 3rem; height: auto; margin: 0 auto 1.5rem; }
.candles rect { fill: var(--violet); }
.candles .rose { fill: var(--rose); }
.candles line { stroke: var(--ink); stroke-width: 1.5; }
.candles .flame { fill: var(--flame); }

/* Front page */
.masthead .cross { display: block; width: 1.75rem; height: 1.75rem; margin: 0 auto 1.25rem; fill: var(--rubric); }
.masthead h1 { font-size: clamp(3rem, 9vw, 5.25rem); }
.masthead .lead { margin-top: 0.75rem; font-style: italic; font-size: 1.375rem; line-height: 1.4; }
.masthead .intro { max-width: var(--measure); margin: 0 auto; color: var(--faded); }

.sermons { margin-top: clamp(3rem, 8vw, 5rem); }
.sermon { padding-top: clamp(2.5rem, 6vw, 4rem); border-top: 3px double var(--rubric); }
.sermon + .sermon { margin-top: clamp(3rem, 8vw, 5rem); }
.sermon .title { margin-bottom: 2.5rem; }
.sermon .when { margin-bottom: 0.4rem; font-style: italic; color: var(--faded); }
.sermon h2 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); text-wrap: balance; }
.sermon h2 a { text-decoration: none; }
.sermon .preacher { margin-top: 1rem; }
.sermon audio { max-width: 32rem; margin: 0 auto; }
.sermon .readings { margin-top: 1rem; text-align: center; }
.more { margin-top: 2.25rem; text-align: center; }

/* The one action of a page, in red, as a rubric tells what to do */
.button {
  display: inline-block;
  padding: 0.6rem 1.5rem 0.65rem;
  border: 0;
  cursor: pointer;
  border-radius: 2px;
  background: var(--rubric);
  color: var(--paper);
  font-weight: 600;
  font-size: 1.125rem;
  text-decoration: none;
}
.button:hover { background: var(--ink); color: var(--paper); }

/* Sections of the sermon page, headed by a rubric between two hairlines */
main > section { margin-top: clamp(3.5rem, 9vw, 5.5rem); }
section > h2 {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin: 0 0 2.25rem;
  font-weight: 500;
  font-style: italic;
  font-size: 1.625rem;
  color: var(--rubric);
}
section > h2::before, section > h2::after { content: ""; flex: 1; border-top: 1px solid var(--hair); }
section > h2 a { text-decoration: none; }
section > h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
section[id] { scroll-margin-top: 1.5rem; }

/* Audio: German on the left, Polish on the right, as in the text. Each
   player spans three rows (label, player, note) of the shared grid, so the
   players of a row line up even when one label wraps. */
.players {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-auto-flow: row dense;
  column-gap: 3rem;
  text-align: left;
}
.player {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  row-gap: 0;
  align-content: start;
  margin-bottom: 2rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hair);
}
.player.german { grid-column: 1; }
.player.polish { grid-column: 2; }
.player .label { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start;
  margin-bottom: 0.6rem; font-weight: 600; }
.download { flex: none; margin: -0.4875rem -0.6875rem -0.6875rem; padding: 0.6875rem; color: var(--rubric); }
.download:hover { color: var(--ink); }
.download svg {
  display: block;
  width: 1.375rem;
  height: 1.375rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.player .note { margin-top: 0.5rem; font-style: italic; font-size: 0.9375rem; color: var(--faded); }
audio { display: block; width: 100%; }
/* The browser's own players are near-black in the dark, so they stay light
   and take the colour of the dark mode's text, like lit paper. */
audio { color-scheme: light; }
:root[data-theme="dark"] audio::-webkit-media-controls-panel { background-color: #e4dccd; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) audio::-webkit-media-controls-panel { background-color: #e4dccd; }
}

/* A word to the reader above the text */
.hint { max-width: var(--measure); margin: -0.75rem auto 2.5rem; text-align: center; font-style: italic; color: var(--faded); }

/* Parallel text, as in a bilingual missal: number, German, Polish */
.parallel {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 1fr);
}
.parallel.single { grid-template-columns: 3rem minmax(0, var(--measure)); }
.parallel > * { padding-right: clamp(1rem, 2.5vw, 2.25rem); }
.parallel > [lang="pl"] { padding-left: clamp(1rem, 2.5vw, 2.25rem); border-left: 1px solid var(--hair); }
.parallel .head:first-child { grid-column: 2; }
.parallel .head { padding-bottom: 1.75rem; }
.parallel .head h3 { margin: 0; font-size: 1.25rem; color: var(--rubric); }
.parallel .head p { font-style: italic; color: var(--faded); }
.parallel > p { padding-bottom: 1.1em; hyphens: auto; }
.parallel > p[lang="pl"] { color: var(--faded); }

/* A red initial opens the sermon in each language */
.parallel > .n:first-of-type + p::first-letter,
.parallel > .n:first-of-type + p + p[lang]::first-letter {
  float: left;
  margin: 0.08em 0.1em 0 0;
  font-size: 3.4em;
  line-height: 0.8;
  font-weight: 600;
  color: var(--rubric);
}

.n {
  grid-column: 1;
  padding: 0.25em 0.9rem 0 0;
  text-align: right;
  font-size: 0.875rem;
  color: var(--rubric);
}
/* Where the section starts in the German recording, under its number:
   a link that plays it from there */
.n .at {
  display: block;
  padding: 0.2rem 0 0.4rem;
  font-size: 0.75rem;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--faded);
}
.n .at:hover, .n .at.playing { color: var(--rubric); }
.n .at.playing { font-weight: 700; }

/* Translator's notes: a red number in the text, and the note under its
   paragraph, across both languages, like a footnote under a page */
sup { line-height: 0; }
.mark a, .notes a[href^="#"] {
  color: var(--rubric);
  font-weight: 600;
  font-variant-numeric: lining-nums;  /* an old-style 1 reads as an I */
  text-decoration: none;
}
.mark a { padding: 0 0.1em; }
.parallel > .notes { grid-column: 2 / -1; margin-bottom: 1.6em; font-size: 0.9375rem; color: var(--faded); }
.notes::before { content: ""; display: block; width: 4rem; margin-bottom: 0.5rem; border-top: 1px solid var(--rubric); }
.notes p { hyphens: auto; }
.notes a[href^="#"] { margin-right: 0.2em; }
.notes [id], .mark [id] { scroll-margin-top: 30vh; }

details { margin-top: 3rem; }
summary { cursor: pointer; margin-bottom: 1.5rem; font-style: italic; font-size: 1.25rem; color: var(--rubric); }

/* Feedback, one paragraph at the foot of every page */
.feedback { max-width: var(--measure); margin: clamp(4rem, 10vw, 6rem) auto 0; text-align: center; }
.feedback .ask { font-weight: 600; font-style: italic; color: var(--rubric); }
.feedback .write {
  padding: 0;
  border: 0;
  background: none;
  color: var(--rubric);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.feedback .write:hover { color: var(--ink); }
.feedback .address { margin-top: 0.75rem; font-style: italic; color: var(--faded); }
.feedback [hidden] { display: none; }

/* The newsletter, the page's one invitation: a warmer leaf with a gilt
   edge, headed by a star, St Dominic's sign and Advent's, in a vine */
.newsletter {
  max-width: 36rem;
  margin: 3.5rem auto 0;
  padding: 1.75rem clamp(1.25rem, 5vw, 3rem) 2.25rem;
  border-radius: 6px;
  background: var(--vellum);
  outline: 1px solid color-mix(in srgb, var(--flame) 55%, transparent);
  outline-offset: -0.5rem;
  text-align: center;
}
.newsletter .ornament { display: block; width: min(20rem, 100%); height: auto; margin: 0 auto 1rem; color: var(--rubric); }
.newsletter h2 { display: block; margin: 0 0 0.75rem; font-size: 1.875rem; font-style: normal; font-weight: 600; color: var(--ink); }
.newsletter h2::before, .newsletter h2::after { content: none; }
.newsletter .subscribe { margin-top: 1.5rem; }
.newsletter .button { padding: 0.75rem 1.5rem 0.8rem; font-size: clamp(1.0625rem, 4.5vw, 1.25rem); white-space: nowrap; }
.newsletter .promise { margin-top: 1rem; font-style: italic; font-size: 0.9375rem; color: var(--faded); }
.newsletter .address { margin-top: 1rem; font-style: italic; color: var(--faded); }
.newsletter [hidden] { display: none; }

footer {
  margin: clamp(4rem, 10vw, 6rem) auto 0;
  padding-top: 1.75rem;
  max-width: 46rem;
  border-top: 3px double var(--rubric);
  text-align: center;
  font-size: 0.9375rem;
  color: var(--faded);
}
footer p + p { margin-top: 0.35rem; }
/* The colophon, as at the end of a book: how the site is made, and by whom */
footer .colophon { max-width: var(--measure); margin-inline: auto; font-size: 0.8125rem; text-wrap: balance; }
footer p + .colophon { margin-top: 1.5rem; }

/* On the narrowest phones the site's name alone leads home: it goes where
   "Alle Predigten" goes, and both do not fit next to the switch. */
@media (max-width: 22rem) {
  .bar .home + a { display: none; }
}

@media (max-width: 52rem) {
  .players { grid-template-columns: minmax(0, 1fr); }
  .player.german, .player.polish { grid-column: auto; }
}

@media (max-width: 46rem) {
  .parallel, .parallel.single { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .parallel .head, .parallel .head:first-child, .parallel > p, .parallel > .notes { grid-column: 2; }
  .parallel > [lang="pl"] { padding-left: 0; border-left: 0; }
  .parallel > p[lang="pl"] { padding-bottom: 2em; }
  .n { padding-right: 0.6rem; }
}
