:root {
  color-scheme: light;
  --linen: #f3eee7;
  --mast: #faf7f2;
  --notice: #ece5db;
  --ink: #22201e;
  --teal: #3f6f68;
  --mist: #e2e8e3;
  --deep: #26332f;
  --rule: #cdc4b8;
  --display: "Newsreader", Georgia, serif;
  --body: "Figtree", Arial, sans-serif;
  --gutter: clamp(1.25rem, 5.7vw, 5.25rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.08;
}

h1 {
  font-size: clamp(2.75rem, 6.8vw, 5rem);
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  text-wrap: balance;
}

h3 {
  font-size: clamp(1.5rem, 2.35vw, 2.125rem);
}

p {
  margin: 0;
}

p + p {
  margin-top: 1em;
}

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

figure {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.serm-frame {
  width: min(100% - 2 * var(--gutter), 80rem);
  margin-inline: auto;
}

.serm-skip {
  position: absolute;
  z-index: 2;
  top: 0.5rem;
  left: var(--gutter);
  padding: 0.65rem 1rem;
  background: var(--mast);
  transform: translateY(calc(-100% - 1rem));
}

.serm-skip:focus {
  transform: translateY(0);
}

.serm-notice {
  display: grid;
  place-items: center;
  padding-inline: var(--gutter);
  background: var(--notice);
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}

.serm-notice a {
  display: grid;
  place-items: center;
  min-block-size: 2.5rem;
  color: var(--ink);
}

.serm-mast {
  background: var(--mast);
  border-bottom: 1px solid var(--rule);
}

.serm-mast-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2.5rem;
  padding-block: 1.25rem 1.1rem;
}

.serm-name {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(2rem, 3vw, 2.65rem);
  line-height: 1;
  text-decoration: none;
}

.serm-line {
  margin-top: 0.15rem;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
  text-wrap: pretty;
}

.serm-mast nav ul,
.serm-foot nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
}

.serm-mast nav a,
.serm-foot nav a {
  display: inline-flex;
  min-block-size: 2.75rem;
  align-items: center;
}

.serm-mast nav a {
  color: var(--ink);
  text-decoration-color: transparent;
}

.serm-mast nav a:hover,
.serm-mast nav a[aria-current="page"] {
  text-decoration-color: currentColor;
}

.serm-mast nav a[aria-current="page"] {
  color: var(--teal);
  font-weight: 500;
}

.serm-opening {
  position: relative;
}

.serm-hero-frame img {
  width: 100%;
  height: clamp(25rem, 47vw, 48rem);
  object-fit: cover;
  object-position: center 56%;
}

.serm-headline {
  width: min(100% - 2 * var(--gutter), 80rem);
  margin-inline: auto;
  padding-block: clamp(2rem, 5.5vw, 4rem) 0;
}

.serm-headline h1 {
  max-inline-size: 15ch;
  font-size: clamp(2.75rem, 6vw, 5.25rem);
  line-height: 0.99;
  text-wrap: wrap;
}

.serm-headline em {
  font-weight: 400;
}

@media (min-width: 62rem) {
  .serm-opening[data-photo-ready="true"] .serm-headline {
    position: absolute;
    inset-inline: 0;
    bottom: clamp(2.75rem, 5.85vw, 5.25rem);
    padding: 0;
    color: var(--mast);
  }

  .serm-opening[data-photo-ready="true"] .serm-headline h1 {
    max-inline-size: min(13.6ch, 47vw);
  }
}

.serm-home-lede {
  max-inline-size: 61ch;
  margin-block: clamp(1.9rem, 5vw, 3.75rem) 0;
  font-size: clamp(1.125rem, 1.65vw, 1.375rem);
  line-height: 1.55;
}

.serm-topics {
  margin-block: clamp(4.25rem, 8.8vw, 7.75rem);
}

.serm-topics > h2,
.serm-topics > p {
  text-align: center;
}

.serm-topics > p {
  max-inline-size: 64ch;
  margin: 0.85rem auto 0;
}

.serm-subjects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1.5rem);
  margin: clamp(1.6rem, 4vw, 2.85rem) 0 0;
  padding: 0;
  list-style: none;
}

.serm-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(1.15rem, 3vw, 2.2rem);
  border-radius: 1rem;
  background: var(--mist);
}

.serm-tile p {
  margin: 0.75rem 0 1.15rem;
}

.serm-tile a {
  margin-top: auto;
  padding-block: 0.4rem;
  font-weight: 500;
}

.serm-division {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(1.5rem, 5.5vw, 5rem);
  padding-block: clamp(2.75rem, 7.5vw, 6.5rem);
  border-top: 1px solid var(--rule);
}

.serm-division:has(> [hidden]) {
  grid-template-columns: minmax(0, 66ch);
}

.serm-division h2 {
  margin-bottom: 1rem;
  text-wrap: wrap;
}

.serm-division img {
  width: 100%;
  border-radius: 1rem;
}

.serm-editorial {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 1.25rem clamp(1.5rem, 5vw, 5.5rem);
  align-items: start;
  margin: 0 0 clamp(3rem, 6.8vw, 6rem);
  padding: clamp(1.5rem, 5vw, 4rem);
  border-radius: 1rem;
  background: var(--deep);
  color: var(--linen);
}

.serm-editorial h2 {
  text-wrap: wrap;
}

.serm-editorial a {
  color: var(--linen);
  font-weight: 500;
}

.serm-entrance {
  width: min(100% - 2 * var(--gutter), 59rem);
  margin: 0 auto;
  padding-block: clamp(3.15rem, 8vw, 7rem) clamp(2.8rem, 6.7vw, 5.8rem);
  text-align: center;
}

.serm-entrance p {
  max-inline-size: 61ch;
  margin: clamp(1rem, 2vw, 1.45rem) auto 0;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
}

.serm-sheet {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3.5rem, 8.5vw, 7.5rem);
  border-top: 1px solid var(--rule);
  border-radius: clamp(1.25rem, 3.2vw, 2.75rem) clamp(1.25rem, 3.2vw, 2.75rem) 0 0;
}

.serm-reading {
  width: min(100% - 2 * var(--gutter), 67ch);
  margin-inline: auto;
}

.serm-reading section + section {
  margin-top: clamp(2.85rem, 6vw, 5rem);
  padding-top: clamp(1.85rem, 4vw, 3.4rem);
  border-top: 1px solid var(--rule);
}

.serm-reading h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.95rem, 4vw, 3rem);
  text-wrap: wrap;
}

.serm-reading h3 {
  margin-block: 1.65rem 0.55rem;
}

.serm-reading .serm-study-photo {
  margin-block: 1.85rem 0;
}

.serm-study-photo img {
  width: 100%;
  border-radius: 0.875rem;
}

/* Frame the hands and hem below both heads. */
.serm-study-photo img[src="/images/trouser-hem.webp"] {
  aspect-ratio: 19 / 10;
  object-fit: cover;
  object-position: center bottom;
}

.serm-comparison {
  margin-top: 1.85rem;
  padding: clamp(1rem, 4vw, 2rem);
  border-radius: 0.875rem;
  background: var(--mist);
}

.serm-reading .serm-comparison h3 {
  margin-top: 0;
  margin-bottom: 0.85rem;
}

.serm-comparison table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: left;
  font-size: 1rem;
  line-height: 1.45;
}

.serm-comparison th,
.serm-comparison td {
  vertical-align: top;
  padding: 0.7rem 0.75rem 0.7rem 0;
  border-top: 1px solid #b1bdb5;
}

.serm-comparison th {
  width: 44%;
  font-weight: 500;
}

.serm-comparison th + th,
.serm-comparison td {
  width: 56%;
  padding-right: 0;
}

.serm-comparison figcaption {
  padding-top: 0.9rem;
  border-top: 1px solid #b1bdb5;
  font-size: 1rem;
  line-height: 1.55;
}

.serm-foot {
  border-top: 1px solid var(--rule);
}

.serm-foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 2rem;
  padding-block: 1.8rem 2.3rem;
  font-size: 1rem;
}

@media (max-width: 47rem) {
  .serm-mast-inner {
    display: block;
    padding-block: 1rem 0.35rem;
  }

  .serm-mast nav {
    margin-top: 0.35rem;
  }

  .serm-mast nav ul {
    column-gap: clamp(0.5rem, 2.5vw, 1.35rem);
  }

  .serm-hero-frame img {
    height: auto;
    aspect-ratio: 4 / 3;
    object-position: 69% 54%;
  }

  .serm-headline h1 {
    max-inline-size: 16ch;
    font-size: clamp(2.6rem, 10.7vw, 3.95rem);
    text-wrap: balance;
  }

  .serm-home-lede {
    margin-top: 1.4rem;
  }

  .serm-division,
  .serm-editorial {
    grid-template-columns: minmax(0, 1fr);
  }

  .serm-division img {
    aspect-ratio: 5 / 4;
    object-fit: cover;
    object-position: center 60%;
  }
}

@media (max-width: 42rem) {
  .serm-subjects {
    grid-template-columns: minmax(0, 1fr);
  }

  .serm-topics > h2,
  .serm-topics > p {
    text-align: left;
  }
}
