/* ==========================================================================
   Fonts (self-hosted, variable)
   ========================================================================== */

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/lora.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/lora-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter.woff2") format("woff2");
}

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  --paper: #faf6ef;
  --paper-raised: #f3ecdf;
  --ink: #2a2420;
  --ink-soft: #5e5349;
  --accent: #7a2e2a;
  --accent-ink: #fffaf3;
  --rule: #e2d7c5;
  --focus: #1f5f8b;

  --serif: "Lora", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --reading: 42.5rem; /* 680px */
  --wide: 70rem;
  --gutter: 1.25rem;
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1714;
    --paper-raised: #25201b;
    --ink: #ece4d8;
    --ink-soft: #b8ac9d;
    --accent: #e3ab93;
    --accent-ink: #1b1714;
    --rule: #3a322b;
    --focus: #8cc4ea;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding-block: 2.5rem 4rem;
}

main:focus {
  outline: none;
}

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

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 1.5rem + 2.4vw, 3rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.4rem, 1.25rem + 0.8vw, 1.75rem);
}

h3 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 1.25em;
}

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

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.95rem;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--reading {
  max-width: calc(var(--reading) + var(--gutter) * 2);
}

.section {
  margin-top: 4rem;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
  margin-bottom: 2rem;
}

.section__head h2 {
  margin: 0;
}

.section__head a {
  font-family: var(--sans);
  font-size: 0.9rem;
  white-space: nowrap;
}

.ornament {
  text-align: center;
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1;
  margin: 2.5rem 0;
}

.kicker,
.meta {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.kicker a {
  display: inline-block;
  padding-block: 0.35rem;
  color: var(--accent);
  text-decoration: none;
}

.kicker a:hover {
  text-decoration: underline;
}

.meta {
  font-size: 0.875rem;
  margin-bottom: 0;
}

.badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 99px;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
}

.lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  font-style: italic;
}

.empty {
  text-align: center;
  color: var(--ink-soft);
  padding-block: 2rem;
}

.button {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.button:hover {
  background: transparent;
  color: var(--accent);
}

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* ==========================================================================
   Header and footer
   ========================================================================== */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1.5rem;
  padding-block: 0.75rem;
}

.site-brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  text-decoration: none;
  padding-block: 0.4rem;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0 0 0 -0.75rem;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 0.65rem 0.75rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.4em;
}

.site-nav .site-nav__cta {
  margin-left: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
}

.site-nav .site-nav__cta:hover,
.site-nav .site-nav__cta[aria-current] {
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 1rem 3rem;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.site-footer__name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.site-footer__tagline {
  margin-bottom: 1.5rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.5rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.site-footer__links a {
  display: inline-block;
  padding: 0.5rem;
  color: var(--ink);
}

.site-footer__legal {
  margin: 1.5rem 0 0;
  font-size: 0.8125rem;
}

/* ==========================================================================
   Home
   ========================================================================== */

.hero__inner {
  padding-block: 1.5rem 1rem;
  max-width: 48rem;
  margin-inline: auto;
  text-align: center;
}

.hero__title {
  font-size: clamp(2.25rem, 1.5rem + 3.6vw, 3.75rem);
  letter-spacing: -0.015em;
  margin-bottom: 1.25rem;
}

.hero__title a {
  color: var(--ink);
  text-decoration: none;
}

.hero__title a:hover {
  color: var(--accent);
}

.hero__excerpt {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 38rem;
  margin-inline: auto;
}

.hero .meta {
  margin-bottom: 1.75rem;
}

.hero__image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

@media (min-width: 56rem) {
  .hero__inner--image {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
    align-items: center;
    max-width: none;
    text-align: left;
  }

  .hero__inner--image .hero__excerpt {
    margin-inline: 0;
  }
}

.intro {
  text-align: center;
}

.intro__text {
  font-size: 1.15rem;
}

.intro__sign {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   Story cards and grids
   ========================================================================== */

.grid {
  display: grid;
  gap: 2.5rem 2.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  padding-top: 1.25rem;
  border-top: 2px solid var(--ink);
}

.card__image {
  display: block;
  margin-bottom: 1.25rem;
}

.card__image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
}

.card__title {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
}

.card__title a {
  color: var(--ink);
  text-decoration: none;
}

.card__title a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.card__excerpt {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.card .meta {
  margin-top: auto;
}

/* Theme filter */

.filter {
  margin-bottom: 3rem;
}

.filter ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.filter a {
  display: block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 99px;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.filter a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter a[aria-current] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.9375rem;
}

.pagination a {
  padding-block: 0.5rem;
}

.pagination > :last-child {
  text-align: right;
}

.pagination__count {
  color: var(--ink-soft);
}

.theme-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.theme-list li {
  padding-block: 1.5rem;
  border-top: 1px solid var(--rule);
}

.theme-list h2 {
  margin-bottom: 0.25rem;
}

.theme-list h2 a {
  color: var(--ink);
  text-decoration: none;
}

.theme-list h2 a:hover {
  color: var(--accent);
}

.theme-list p {
  margin-bottom: 0.25rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   Pages
   ========================================================================== */

.page__header {
  margin-bottom: 2.5rem;
}

.page__header--center {
  text-align: center;
  max-width: 44rem;
  margin-inline: auto;
  padding-top: 1rem;
}

.author-note {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--paper-raised);
  border-radius: var(--radius);
  font-size: 1rem;
}

.author-note img {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.author-note p {
  margin: 0;
}

.author-note__name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem !important;
}

/* ==========================================================================
   Story
   ========================================================================== */

.story__header {
  text-align: center;
  padding-top: 1.5rem;
  margin-bottom: 2.5rem;
}

.story__title {
  font-size: clamp(2.25rem, 1.6rem + 3.2vw, 3.5rem);
  margin-bottom: 1rem;
}

.story__cover {
  margin-block: 0 2.5rem;
  max-width: 56rem;
}

.story__cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
}

.scripture {
  margin: 0 0 2.75rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border-block: 1px solid var(--rule);
  text-align: center;
}

.scripture blockquote {
  margin: 0;
}

.scripture blockquote p {
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.scripture__ref {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.prose {
  font-size: 1.1875rem; /* 19px on phones */
  line-height: 1.75;
  overflow-wrap: break-word;
  hanging-punctuation: first;
}

@media (min-width: 40rem) {
  .prose {
    font-size: 1.3125rem; /* 21px */
    line-height: 1.8;
  }
}

.prose--small,
.prose.prose--small {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.prose > * + * {
  margin-top: 1.25em;
}

.prose p {
  margin-bottom: 0;
}

.prose h2 {
  margin-top: 2.25em;
  font-size: 1.5rem;
}

.prose h3 {
  margin-top: 2em;
}

.prose blockquote {
  margin-inline: 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
  color: var(--ink-soft);
}

.prose hr {
  border: 0;
  text-align: center;
  margin-block: 2.5rem;
}

.prose hr::before {
  content: "\2766";
  color: var(--accent);
  font-size: 1.25rem;
}

.prose img {
  border-radius: var(--radius);
  margin-inline: auto;
}

.prose li + li {
  margin-top: 0.5em;
}

/* Drop cap on the first paragraph of a story. */
.story__body > p:first-of-type::first-letter {
  float: left;
  font-size: 3.6em;
  line-height: 0.82;
  font-weight: 600;
  padding: 0.08em 0.1em 0 0;
  color: var(--accent);
}

.reflection,
.questions {
  margin-top: 2.5rem;
  padding: 1.75rem 1.5rem;
  background: var(--paper-raised);
  border-radius: var(--radius);
}

.reflection h2,
.questions h2,
.share__title {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.questions ol {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 1.0625rem;
}

.questions li + li {
  margin-top: 0.75rem;
}

.questions li::marker {
  color: var(--accent);
  font-family: var(--sans);
  font-weight: 600;
}

.share {
  margin-top: 3rem;
  text-align: center;
}

.share__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.share__list a,
.share__copy {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 99px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.share__list a:hover,
.share__copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.share__list li:has([hidden]) {
  display: none;
}

.story-nav {
  display: grid;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

@media (min-width: 36rem) {
  .story-nav {
    grid-template-columns: 1fr 1fr;
  }

  .story-nav__link--next {
    grid-column: 2;
    text-align: right;
  }
}

.story-nav__link {
  display: block;
  padding: 0.5rem 0;
  text-decoration: none;
}

.story-nav__label {
  display: block;
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.story-nav__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.story-nav__link:hover .story-nav__title {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* ==========================================================================
   Signup
   ========================================================================== */

.signup {
  margin-top: 4rem;
  padding: 2.25rem 1.5rem;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--paper-raised);
  text-align: center;
}

.signup__title {
  margin-bottom: 0.5rem;
}

.signup__text {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  max-width: 32rem;
  margin-inline: auto;
}

.signup__row {
  display: grid;
  gap: 0.75rem;
  max-width: 32rem;
  margin-inline: auto;
  text-align: left;
}

.signup__label {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
}

.signup__input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--ink-soft);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.2;
}

.signup__input::placeholder {
  color: var(--ink-soft);
  opacity: 0.8;
}

@media (min-width: 36rem) {
  .signup {
    padding: 2.75rem 2.5rem;
  }

  .signup__row {
    grid-template-columns: 1fr auto;
  }

  .signup__label {
    grid-column: 1 / -1;
  }
}

.signup__status {
  margin: 1.25rem auto 0;
  max-width: 32rem;
  font-size: 1.0625rem;
}

.signup__status[data-state="success"] {
  font-style: italic;
}

.signup__status[data-state="error"] {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--accent);
}

/* Subscribe page */

.ebook {
  display: grid;
  gap: 2rem;
  align-items: center;
  justify-items: center;
}

.ebook__text {
  font-size: 1.0625rem;
}

.ebook__text ul {
  padding-left: 1.25rem;
  margin: 0;
}

.ebook__text li + li {
  margin-top: 0.5rem;
}

.ebook__cover {
  width: 11rem;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 2px 6px 6px 2px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), 0 12px 28px -10px rgb(0 0 0 / 0.35);
}

.ebook__cover--placeholder {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1rem;
  background: #6d2925;
  color: #fbf3e6;
  border-left: 6px solid #4f1d1a;
  text-align: center;
}

.ebook__cover-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.ebook__cover-ornament {
  font-size: 1.5rem;
  opacity: 0.85;
}

.ebook__cover-author {
  font-family: var(--sans);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (min-width: 36rem) {
  .ebook {
    grid-template-columns: auto 1fr;
    justify-items: start;
  }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .site-header,
  .site-footer,
  .signup,
  .share,
  .story-nav,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }
}
