:root {
  color-scheme: light;
  --ink: #1b2a35;
  --muted: #60717e;
  --line: #d9e0e3;
  --paper: #fffdf8;
  --canvas: #f1f4f3;
  --brand: #315f7d;
  --brand-dark: #244a63;
  --accent: #b58b3a;
  --shadow: 0 18px 55px rgba(27, 42, 53, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(181, 139, 58, 0.09), transparent 28rem),
    var(--canvas);
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: var(--brand);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--brand-dark);
}

.document-header {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem) clamp(2.5rem, 5vw, 4.5rem);
  text-align: center;
}

.document-header::after {
  display: block;
  width: 3rem;
  height: 2px;
  margin: 2rem auto 0;
  background: var(--accent);
  content: "";
}

.document-header > p:first-of-type {
  margin: 0 0 0.65rem;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.document-header h1 {
  max-width: 18ch;
  margin: 0 auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 6vw, 4.75rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.document-lead {
  max-width: 52ch;
  margin: 1.25rem auto 0;
  color: var(--muted);
}

.document-back {
  position: absolute;
  top: 1.25rem;
  left: clamp(1rem, 4vw, 3rem);
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 7px 24px rgba(27, 42, 53, 0.06);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.document-main {
  width: min(100% - 2rem, 1180px);
  margin: 0 auto clamp(4rem, 8vw, 8rem);
}

.missal-title-page,
.missal-spread {
  margin: 0 0 1.25rem;
  border: 1px solid rgba(49, 95, 125, 0.14);
  border-radius: 1rem;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.missal-title-page {
  display: grid;
  min-height: min(70vh, 680px);
  place-items: center;
  padding: clamp(2rem, 8vw, 7rem);
  text-align: center;
}

.missal-title {
  max-width: 48rem;
}

.missal-spread {
  overflow: clip;
  padding: clamp(1.25rem, 4vw, 3rem);
}

.missal-spread__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 4rem);
}

.missal-column + .missal-column {
  padding-left: clamp(1.5rem, 4vw, 4rem);
  border-left: 1px solid var(--line);
}

.missal-spread__notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.missal-note {
  padding: 1rem 1.15rem;
  border-left: 3px solid rgba(181, 139, 58, 0.7);
  border-radius: 0 0.65rem 0.65rem 0;
  background: #f7f2e8;
  color: #53616b;
  font-size: 0.86rem;
}

.missal-heading {
  margin: 1.6rem 0 0.75rem;
  color: var(--brand-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.12rem, 2vw, 1.4rem);
  font-weight: 600;
  line-height: 1.25;
}

.missal-heading:first-child,
.missal-paragraph:first-child {
  margin-top: 0;
}

.missal-paragraph {
  margin: 0.7rem 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.62;
}

.missal-rubric {
  color: #795345;
  font-size: 0.94rem;
  font-style: italic;
}

.missal-response {
  font-weight: 650;
}

.document-footer {
  padding: 2rem 1rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.document-footer a {
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .document-main {
    width: min(100% - 1rem, 1180px);
  }

  .missal-spread__columns,
  .missal-spread__notes {
    grid-template-columns: 1fr;
  }

  .missal-column + .missal-column {
    padding-top: 1.5rem;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media print {
  body {
    background: white;
  }

  .document-back,
  .document-footer {
    display: none;
  }

  .document-header {
    padding-block: 2rem;
  }

  .missal-title-page,
  .missal-spread {
    break-after: page;
    border: 0;
    box-shadow: none;
  }
}
