.home-page {
  --home-section-gap: 44px;
  --home-tint: light-dark(#e5f6ed, #17372a);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--home-section-gap);
  padding-block: 18px 54px;
  font-family: var(--shell-font);
  overflow-wrap: anywhere;
}

/* Center the divider in the section gap so it adds no extra height. */
.home-page--configured > :not(.home-visually-hidden) ~ * {
  position: relative;
}

.home-page--configured > :not(.home-visually-hidden) ~ *::after {
  content: '';
  position: absolute;
  inset-block-start: calc(var(--home-section-gap) / -2);
  inset-inline: 0;
  border-block-start: 1px solid color-mix(in srgb, var(--color-border) 28%, transparent);
  pointer-events: none;
}

.home-page :is(h1, h2, h3, p, dl, dd, ul) { margin: 0; }
.home-page :is(h1, h2, h3) { font-weight: 700; }
.home-page h1 { font-size: 40px; line-height: 51px; }
.home-page h2 { font-size: 28px; line-height: 36px; }
.home-page a { color: inherit; text-decoration: none; }
.home-page a:not(.article-card):not(.home-download__store):not(.home-services a):hover { text-decoration: underline; }
.home-page :focus-visible, .home-header-ad :focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }

.home-page :is(.home-feed, .home-download, .home-services) ul {
  padding: 0;
  list-style: none;
}

.home-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.home-lead { display: grid; min-width: 0; gap: 28px; }
.home-lead--split { grid-template-columns: minmax(0, 1fr) minmax(260px, 336px); align-items: start; }
.home-feature, .home-feature > a { display: grid; gap: 10px; min-width: 0; }
.home-feature__excerpt { font-family: var(--editorial-font); color: var(--color-muted); font-size: 16px; line-height: 20px; }
.home-side { display: grid; gap: 14px; }

.home-story-image {
  display: block;
  height: var(--article-card-image-height);
  border-radius: 4px;
  background: var(--color-surface);
  overflow: hidden;
}

.home-story-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-feature .home-story-image { height: 450px; background: var(--home-tint); }

.home-kicker {
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 15px;
  text-transform: uppercase;
}

.home-header-ad { padding-block: 16px; }
.home-ad {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-surface);
}

.home-ad--header { min-height: 76px; }
.home-ad--sidebar { min-height: 104px; }
.home-ad--content { min-height: 86px; }
.home-ad a { display: block; width: 100%; }
.home-ad img { display: block; width: 100%; max-height: 150px; object-fit: contain; }

.home-prayer {
  --prayer-green: #008348;
  --prayer-green-deep: #006139;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  scroll-margin-block-start: calc(var(--site-sticky-height, 136px) + 12px);
  border-radius: 8px;
  background: var(--color-surface);
}

.home-prayer h2 { font-size: 22px; line-height: 28px; }
.home-prayer__header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.home-prayer__location { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.home-prayer__city { display: flex; align-items: center; gap: 8px; min-width: 0; }
.home-prayer__location select { min-height: 36px; border-radius: 6px; font-family: inherit; cursor: pointer; }
.home-prayer__location select { min-width: 0; max-width: 100%; width: 9rem; padding-inline: 4px; border: 0; background: var(--color-surface); color: var(--color-text); font-size: 15px; font-weight: 700; }
.home-prayer__dates { display: grid; gap: 2px; color: var(--color-muted); font-size: 12px; font-weight: 600; }

.home-prayer__times { display: grid; gap: 7px; }

.home-prayer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 6px 10px;
  box-sizing: border-box;
  border-radius: 9px;
  background: var(--color-canvas);
  color: var(--color-text);
}

.home-prayer__row[aria-current="time"] {
  background: linear-gradient(155deg, var(--prayer-green), var(--prayer-green-deep));
  color: #fff;
}

.home-prayer__row dt { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.home-prayer__row dd { flex: none; font-size: 21px; font-weight: 700; }
.home-prayer time { font-variant-numeric: tabular-nums; }

.home-prayer__icon {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--prayer-green) 58%, #ffffff26 59%, #ffffff26 72%, transparent 73%), var(--prayer-green-deep);
}

.home-prayer__icon img { display: block; width: 16px; height: 16px; filter: brightness(0) invert(1); }
.home-prayer [data-update-error] { color: var(--color-muted); font-size: 13px; }
.home-prayer__unavailable { color: var(--color-muted); font-size: 13px; }

.home-page .home-link { justify-self: start; color: var(--color-primary); font-size: 14px; font-weight: 700; line-height: 18px; }
.home-feed, .home-services { display: grid; gap: 16px; }
.home-feed ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.home-feed__card { display: grid; gap: 12px; }
.home-feed--latest .home-feed__card { grid-template-rows: auto 1fr; height: 100%; }
.home-feed__details { gap: 5px; }
.home-feed h3 { font-size: 18px; line-height: 23px; }
.home-feed time { color: var(--color-muted); font-size: 12px; line-height: 15px; }
.home-feed--activities {
  --activity-border: color-mix(in srgb, var(--color-border) 28%, transparent);
  padding: clamp(16px, 2.4vw, 30px);
  border: 1px solid var(--activity-border);
  background: var(--color-surface);
}

.home-feed--activities h2 {
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.15;
}

.home-feed--activities h2::before {
  content: '';
  display: block;
  width: 40px;
  margin-block-end: 12px;
  border-block-start: 3px solid var(--color-accent);
}

.home-feed--activities ul { gap: 14px; }

.home-feed--activities .home-feed__card {
  height: 100%;
  box-sizing: border-box;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--activity-border);
  background: var(--color-canvas);
}

.home-feed--activities .home-feed__card:hover {
  border-color: var(--color-primary);
}

.home-feed--activities .home-feed__card:hover h3 { color: var(--color-primary); }
.home-feed--activities .home-story-image { border-radius: 0; background: var(--color-surface); }

.home-feed--activities .home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--color-primary);
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.home-feed--activities a.home-link:hover {
  background: var(--color-canvas);
  color: var(--color-primary);
  text-decoration: none;
}

@media (prefers-reduced-motion: no-preference) {
  .home-feed--activities .home-feed__card { transition: border-color 160ms ease; }
  .home-feed--activities .home-link { transition: background-color 160ms ease, color 160ms ease; }
}

.home-description { color: var(--color-muted); font-size: 14px; line-height: 18px; }
.home-description > * + * { margin-block-start: .5em; }

.home-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px 32px;
  padding: clamp(18px, 3vw, 36px);
  border: 1px solid color-mix(in srgb, var(--color-border) 30%, transparent);
  border-inline-start: 4px solid var(--color-primary);
  border-radius: 8px;
  background: linear-gradient(112deg, var(--color-surface), color-mix(in srgb, var(--color-primary) 6%, var(--color-surface)));
}

.home-download__intro {
  display: flex;
  flex: 1 1 350px;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
  min-width: 0;
}

.home-download__icon {
  flex: none;
  width: clamp(64px, 8vw, 96px);
  height: auto;
  border: 1px solid color-mix(in srgb, var(--color-border) 22%, transparent);
  border-radius: 20%;
  background: #fff;
  box-shadow: 0 5px 16px rgb(0 0 0 / 12%);
}

.home-download__copy { display: grid; gap: 6px; min-width: 0; }
.home-download h2 { font-size: clamp(24px, 2.7vw, 34px); line-height: 1.15; }
.home-download .home-description { max-width: 55ch; line-height: 1.45; }
.home-download .home-description a { color: var(--color-primary); text-decoration: underline; }
.home-services ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.home-services li { background: var(--color-surface); border-radius: 4px; }
.home-services a { display: grid; gap: 6px; padding: 14px; color: var(--color-muted); font-size: 12px; line-height: 16px; }
.home-services strong { color: var(--color-primary); font-size: 14px; line-height: 18px; }
.home-sermon {
  --sermon-divider: color-mix(in srgb, var(--color-border) 28%, transparent);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px clamp(24px, 4vw, 52px);
  padding: clamp(20px, 3.2vw, 40px);
  border: 1px solid var(--sermon-divider);
  border-block-start: 3px solid var(--color-accent);
  background: var(--color-surface);
}

.home-sermon:has(.home-sermon__previous) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }

.home-sermon__featured {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.home-sermon__featured .home-kicker {
  justify-self: start;
  padding-block-end: 6px;
  border-block-end: 1px solid var(--color-accent);
  letter-spacing: .06em;
}

.home-sermon h2 { font-size: clamp(28px, 3.25vw, 42px); line-height: 1.1; }
.home-sermon .home-description { max-width: 55ch; font: 17px/1.5 var(--editorial-font); }

.home-sermon a.home-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}

.home-sermon a.home-link:hover {
  background: var(--color-primary);
  color: var(--color-on-primary);
  text-decoration: none;
}

.home-sermon__previous {
  display: grid;
  align-content: start;
  padding: 0;
  border-inline-start: 1px solid var(--sermon-divider);
  list-style: none;
}

.home-sermon__previous li + li { border-block-start: 1px solid var(--sermon-divider); }

.home-sermon__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
}

.home-sermon__card:hover { background: var(--color-canvas); }
.home-sermon__card-copy { display: grid; gap: 5px; }
.home-sermon__card h3 { font-size: 18px; line-height: 1.22; }
.home-sermon__card:hover h3, .home-sermon__card-arrow { color: var(--color-primary); }
.home-sermon__card time { color: var(--color-muted); font-size: 12px; line-height: 16px; }

@media (min-width: 901px) {
  .home-lead--split .home-side {
    position: sticky;
    inset-block-start: calc(var(--site-sticky-height, 136px) + 16px);
  }
}

@media (max-width: 900px) {
  .home-page {
    --home-section-gap: 30px;
    padding-block: 10px 34px;
  }
  .home-page h1 { font-size: 27px; line-height: 35px; }
  .home-page h2 { font-size: 24px; line-height: 31px; }
  .home-lead { gap: 18px; }
  .home-lead--split { grid-template-columns: minmax(0, 1fr); }
  .home-feature .home-story-image { height: 180px; }
  .home-feature__excerpt { display: none; }
  .home-header-ad { padding-block: 12px; }
  .home-ad--header { min-height: 54px; }
  .home-ad--sidebar { min-height: 60px; }
  .home-ad--content { min-height: 64px; }
  .home-feed ul { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .home-feed--latest .home-feed__card { grid-template-columns: minmax(80px, var(--article-card-thumbnail-width)) minmax(0, 1fr); grid-template-rows: 1fr; }
  .home-feed h3 { font-size: 16px; line-height: 20px; }
  .home-feed--activities h2 { font-size: 26px; line-height: 31px; }
  .home-download__intro { flex-basis: 100%; }
  .home-services ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-sermon:has(.home-sermon__previous) { grid-template-columns: minmax(0, 1fr); }
  .home-sermon__previous { border-inline-start: 0; border-block-start: 1px solid var(--sermon-divider); }
  .home-sermon__card { padding-inline: 0; }
}


.home-services a { height: 100%; box-sizing: border-box; border-radius: inherit; }
.home-page .home-services a:hover { text-decoration: none; }
.home-services li:hover { background: color-mix(in srgb, var(--color-primary) 7%, var(--color-surface)); }
.home-services a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .home-services li { transition: transform 200ms ease, background-color 200ms ease, box-shadow 200ms ease; }
  .home-services li:hover { transform: translateY(-2px); box-shadow: 0 4px 14px color-mix(in srgb, var(--color-text) 7%, transparent); }
}
