:root {
  --paper: #efe8d6;
  --paper-2: #e7dec8;
  --ink: #2b3126;
  --sage: #586047;
  --blue: #556c86;
  --gold: #a2823f;
  --gold-text: #77592a;
  --cream: #f4eede;
  /* box/input surfaces — a warmer cream than --cream */
  --surface: #f7f1e2;

  --hero: url('../assets/images/hero-angelus.jpg');
  --join-bg: url('../assets/images/join-bierstadt.jpg');

  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'EB Garamond', 'Georgia', serif;

  --label-tracking: 0.3em;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

/* ---------- Eyebrow / micro-label ---------- */

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--sage);
  border: 1px solid rgba(88, 96, 71, 0.3);
  border-radius: 999px;
  padding: 0.5em 1.3em;
  margin-bottom: 1.75rem;
}

.statement {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 1.75rem;
  max-width: 20ch;
  /* even line lengths instead of a stranded last word */
  text-wrap: balance;
}

.body-text {
  max-width: 56ch;
  color: var(--ink);
  font-size: 1.08rem;
  /* avoid a single-word last line */
  text-wrap: pretty;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: var(--hero) center 55% / cover no-repeat;
  color: var(--cream);
  padding: 2.5rem 1.5rem;
  overflow: hidden;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(20, 22, 14, 0.62) 0%,
      rgba(20, 22, 14, 0.15) 28%,
      rgba(20, 22, 14, 0.25) 60%,
      rgba(20, 22, 14, 0.72) 100%);
  z-index: 1;
}

.hero__nav {
  position: relative;
  z-index: 2;
  display: flex;
  gap: clamp(1.25rem, 4vw, 3rem);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ---------- Sticky nav (appears after scrolling past hero) ---------- */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  padding: 1.1rem 1.5rem;
  background: rgba(239, 232, 214, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(43, 49, 38, 0.1);
  box-shadow: 0 4px 20px rgba(43, 49, 38, 0.06);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.site-nav.is-visible {
  transform: translateY(0);
}

.site-nav a {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.site-nav a:hover {
  opacity: 1;
}

.hero__nav a {
  text-decoration: none;
  color: var(--cream);
  opacity: 0.92;
  text-shadow: 0 1px 6px rgba(10, 12, 6, 0.65), 0 1px 2px rgba(10, 12, 6, 0.5);
  transition: opacity 0.25s ease;
}

.hero__nav a:hover {
  opacity: 1;
}

.hero__content {
  position: absolute;
  top: 54%;
  left: 1.5rem;
  right: 1.5rem;
  transform: translateY(-50%);
  z-index: 2;
  text-align: center;
}

.hero__wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 7vw, 5rem);
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-shadow: 0 2px 20px rgba(10, 12, 6, 0.55), 0 1px 3px rgba(10, 12, 6, 0.4);
}

.hero__subtitle {
  margin: 1.5rem auto 0;
  max-width: 36ch;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  line-height: 1.4;
  color: #c9a15a;
  opacity: 0.92;
  /* tight dark halo lifts local contrast where the painting behind is lightest */
  text-shadow:
    0 1px 2px rgba(10, 12, 6, 0.85),
    0 2px 10px rgba(10, 12, 6, 0.7),
    0 0 22px rgba(10, 12, 6, 0.55);
}

.hero__cta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
}

.hero__cta-btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  border: 1px solid rgba(244, 238, 222, 0.55);
  border-radius: 999px;
  padding: 0.9em 1.8em;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.hero__cta-btn:hover {
  border-color: var(--cream);
  background: rgba(244, 238, 222, 0.1);
}

.hero__cta-btn--filled {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--surface);
}

.hero__cta-btn--filled:hover {
  background: transparent;
  color: var(--cream);
}

/* ---------- Mission (consolidated) ---------- */

.mission-consolidated {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 6rem) 1.5rem clamp(2rem, 4vw, 3rem);
}

.mission-consolidated__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.mission-consolidated__text .statement {
  max-width: none;
}

.mission-consolidated__media {
  position: relative;
  height: 620px;
}

.mission-consolidated__media-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 12px;
}

.body-text + .body-text {
  margin-top: 1.5rem;
}

.mission__hope {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--sage);
  /* short emphasis line: balance reads better than a stranded last word */
  text-wrap: balance;
}

/* ---------- Split (Prayers intro) ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  background: var(--paper-2);
}

.split__media {
  position: relative;
  height: 580px;
  overflow: hidden;
}

.split__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 40%;
}

.split__media--contain {
  height: 720px;
  background: var(--paper-2);
  padding: 0.5rem;
}

.split__media--contain img {
  object-fit: contain;
  object-position: center;
}

.split__text {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(3rem, 6vw, 6rem);
}

@media (min-width: 861px) {
  /* text on the left, image on the right — ease off the inner (right) edge */
  .split__text:first-child {
    padding-right: clamp(1.5rem, 3vw, 2.5rem);
  }

  /* text on the right, image on the left — ease off the inner (left) edge */
  .split__text:last-child {
    padding-left: clamp(1.5rem, 3vw, 2.5rem);
  }
}

.split__text .eyebrow,
.split__text .statement,
.split__text .body-text {
  position: relative;
  z-index: 1;
}

.split__text .statement {
  max-width: 16ch;
  text-align: center;
}

/* ---------- Join ---------- */

.join {
  position: relative;
  margin-top: 1.5rem;
  padding: clamp(6rem, 14vw, 10rem) 1.5rem;
  background: var(--join-bg) center 50% / cover no-repeat;
  color: var(--cream);
}

.join::before {
  content: "";
  position: absolute;
  inset: 0;
  /* 0.65 keeps cream text >=4.5:1 over the brightest part of the painting */
  background: rgba(20, 22, 14, 0.65);
}

.join__inner {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.join__inner .eyebrow {
  color: var(--cream);
  border-color: rgba(244, 238, 222, 0.5);
}

.join__inner .statement {
  color: var(--cream);
}

.join .body-text {
  color: var(--cream);
  margin: 0 auto 4rem;
}

/* ---------- Action cards (Join) ---------- */

.action-card {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid rgba(43, 49, 38, 0.14);
  border-radius: 10px;
  padding: 1.5rem 2rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(43, 49, 38, 0.14);
  border-color: var(--gold);
}

.action-card__tag {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--sage);
  opacity: 0.85;
}

.action-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.3;
}

.action-card__desc {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--sage);
  line-height: 1.5;
  /* short blurb: keep the two lines even rather than stranding a word */
  text-wrap: balance;
}

.action-card__check {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--sage);
  cursor: pointer;
}

/* selected state */
.action-card:has(.action-card__check:checked) {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.action-card:has(.action-card__check:focus-visible) {
  outline: 2px solid var(--gold-text);
  outline-offset: 3px;
}

/* ---------- Signup form ---------- */

.signup {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.signup__groups {
  width: 100%;
  border: 0;
  padding: 0;
  /* grid keeps the columns even; a lone card never stretches full width */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.signup__legend {
  width: 100%;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--cream);
  text-align: center;
}

.signup__fields {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.signup__field {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}

.signup__label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
}

.signup__field input {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid rgba(43, 49, 38, 0.18);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}

.signup__field input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.signup__btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--surface);
  border-radius: 999px;
  padding: 0.95em 2.4em;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.signup__btn:hover {
  background: transparent;
  color: var(--cream);
}

.signup__btn[disabled] {
  opacity: 0.6;
  cursor: default;
}

.signup__status {
  min-height: 1.2em;
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--cream);
}

.signup__status.is-error {
  color: #f0c9a0;
}

.signup__note {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--cream);
}

/* ---------- Prayers ---------- */

.prayers {
  /* wide enough that no verse line has to wrap on desktop */
  max-width: 1000px;
  /* breathing room above (off the Join image) and below (before the footer) */
  margin: clamp(3rem, 7vw, 5rem) auto;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border-radius: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--paper-2);
}

.prayers .body-text {
  margin: 0 auto;
}

.prayers__intro {
  width: 100%;
  margin-bottom: 1rem;
  border-radius: 18px;
  overflow: hidden;
}

.prayers__intro .split__media--contain {
  height: auto;
  aspect-ratio: 1200 / 1498;
  padding: 0;
  background: none;
  align-self: center;
}

@media (min-width: 861px) {
  .prayers__intro .split__text {
    text-align: left;
  }

  .prayers__intro .body-text {
    margin: 0;
  }
}

.prayer-tabs {
  display: grid;
  grid-template-columns: 260px 1fr;
  width: 100%;
  margin-top: 0;
  background: var(--surface);
  border: 1px solid rgba(43, 49, 38, 0.14);
  border-radius: 18px;
  overflow: hidden;
  text-align: left;
}

.prayer-tabs__nav {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border-right: 1px solid rgba(43, 49, 38, 0.14);
  background: rgba(43, 49, 38, 0.03);
}

.prayer-tab {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  text-align: left;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0.9rem 1rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--sage);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.prayer-tab:hover {
  background: rgba(162, 130, 63, 0.1);
}

.prayer-tab.is-active {
  background: rgba(162, 130, 63, 0.14);
  color: var(--ink);
  font-weight: 600;
}

.prayer-tab__num {
  font-weight: 600;
  color: var(--gold-text);
  flex-shrink: 0;
}

.prayer-tabs__panels {
  padding: clamp(2rem, 4vw, 3rem) clamp(2rem, 4vw, 2.5rem) clamp(1rem, 2vw, 1.5rem);
}

.prayer-panel {
  display: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink);
  animation: prayer-panel-fade 0.35s ease;
}

/* instructions / rubrics: quieter than the prayer itself */
.prayer-panel .rubric {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--sage);
}

.prayer-panel.is-active {
  display: block;
}

@keyframes prayer-panel-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.prayer-panel p {
  margin-bottom: 1.25rem;
}

/* verse lines: each is its own block so a wrapped line hangs an indent
   instead of reading as a new line of the prayer */
.prayer-panel .verse > span {
  display: block;
  padding-left: 1.4em;
  text-indent: -1.4em;
  /* even out a wrapped verse line instead of stranding one word */
  text-wrap: balance;
}

/* multi-line list entries (the Rosary mysteries) need air between them */
.prayer-panel .verse--spaced > span + span {
  margin-top: 0.85rem;
}

/* too long to balance; just avoid a single-word last line */
.prayer-panel .verse--spaced > span {
  text-wrap: pretty;
}

.prayer-panel p:last-of-type {
  margin-bottom: 0;
}

.prayer-panel strong {
  font-weight: 600;
  font-style: normal;
}

.petition {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--sage);
}

.prayer-panel__source {
  display: block;
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--sage);
  opacity: 0.75;
}

/* ---------- About page ---------- */

#about-intro {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 6rem) 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-nav {
  display: flex;
  justify-content: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  padding: 1.5rem;
  background: var(--paper);
  border-bottom: 1px solid rgba(43, 49, 38, 0.1);
}

.page-nav a {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.page-nav a:hover {
  opacity: 1;
}

.team {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem clamp(3rem, 6vw, 4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.team-card {
  width: 100%;
  max-width: 340px;
  background: var(--paper-2);
  border-radius: 18px;
  padding: clamp(2rem, 5vw, 3rem) 1.75rem;
  text-align: center;
}

.team-card__photo {
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
}

.team-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: 1.6rem;
  color: var(--ink);
}

.team-card__bio {
  margin-top: 1.25rem;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
  color: var(--ink);
  font-size: 1.05rem;
}

.about-contact {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem clamp(3rem, 6vw, 4rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.about-contact__btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.9em 1.8em;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.about-contact__btn:hover {
  background: transparent;
  color: var(--ink);
}

@media (max-width: 860px) {
  .page-nav {
    gap: 0.9rem 1.25rem;
    flex-wrap: wrap;
  }
}

/* keep all four nav items on one row on the narrowest phones */
@media (max-width: 380px) {
  .page-nav {
    gap: 0.9rem 1rem;
    padding: 1.5rem 1rem;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--paper-2);
  color: var(--sage);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-top: 1px solid rgba(43, 49, 38, 0.1);
}

.site-footer p + p {
  margin-top: 0.6rem;
  opacity: 0.7;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
  }

  .mission-consolidated {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .mission-consolidated__media {
    order: -1;
    height: 340px;
  }

  .mission-consolidated__media-main {
    width: 100%;
    height: 100%;
  }

  .mission-consolidated__text {
    text-align: center;
    align-items: center;
  }

  /* Prayers intro: grid + aspect-ratio was overlapping image and text on
     mobile — force a plain, predictable stacked layout instead */
  .prayers__intro {
    display: flex;
    flex-direction: column;
  }

  .prayers__intro .split__media--contain {
    width: 100%;
  }

  .split__media {
    height: 340px;
  }

  .split__media--contain {
    height: 420px;
    padding: 0.5rem;
  }

  .split__text {
    align-items: center;
    text-align: center;
    padding: 3.5rem 1.75rem;
  }

  .split__text .statement {
    max-width: 22ch;
  }

  .hero__nav {
    gap: 0.9rem 1.25rem;
    font-size: 0.68rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .site-nav {
    gap: 0.9rem 1.25rem;
    flex-wrap: wrap;
    padding: 0.9rem 1.25rem;
  }

  .prayer-tabs {
    grid-template-columns: 1fr;
  }

  .prayer-tabs__nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, auto);
    grid-auto-flow: column;
    column-gap: 1rem;
    border-right: none;
    border-bottom: 1px solid rgba(43, 49, 38, 0.14);
  }

  .prayer-tab {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
  }

  /* reclaim width so fewer verse lines have to wrap */
  .prayer-tabs__panels {
    padding: 1.75rem 1.25rem 1rem;
  }

  .prayer-panel {
    font-size: 1rem;
    line-height: 1.5;
  }

  /* every verse line starts flush left; a wrapped line is instead grouped
     with its own line by tighter leading + a gap between verse lines */
  .prayer-panel .verse > span {
    padding-left: 0;
    text-indent: 0;
  }

  .prayer-panel .verse > span + span {
    margin-top: 0.55rem;
  }

  .prayer-panel .verse--spaced > span + span {
    margin-top: 1rem;
  }
}

/* ---------- Focus states (accessibility) ---------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold-text);
  outline-offset: 3px;
  border-radius: 2px;
}

