/* Homepage modules after Mission/Vision: Upcoming Events, Latest Messages, Get Involved.
   Layout follows the approved standalone design; type sizes come from site-typography.css tokens,
   colours from tokens.css, buttons from buttons.css. Content edge matches Mission/Vision (1180px). */

/* Kept from earlier homepage work (Mission/Vision boundary). */
:is(body.home-view, body.home) .fh-purpose-block + article { border-top: 0; }

.hr-section {
  --hr-navy: var(--rl-navy, #062B33);
  --hr-red: var(--rl-red, #B0001B);
  --hr-gold: var(--rl-gold);
  --hr-copy: #3D5864;
  font-family: 'Ubuntu', sans-serif;
  color: var(--hr-navy);
}
.hr-section *, .hr-section *::before, .hr-section *::after { box-sizing: border-box; }
.hr-section h2, .hr-section h3, .hr-section p { margin: 0; }
.hr-section a:not(.rl-btn) { text-decoration: none; color: inherit; }
.hr-wrap { width: min(1180px, calc(100% - 60px)); margin-inline: auto; }

.hr-eyebrow { display: flex; align-items: center; gap: 12px; text-transform: uppercase; }
.hr-eyebrow::before { content: ''; width: 31px; height: 2px; flex: none; background: var(--hr-gold); }
.hr-eyebrow--gold { color: #fff; }
.hr-eyebrow--red { color: var(--hr-red); }
.hr-eyebrow--red::before { background: var(--hr-red); }
.hr-eyebrow--center { justify-content: center; }
.hr-eyebrow--center::after { content: ''; width: 31px; height: 2px; flex: none; background: var(--hr-gold); }
.hr-gold { color: var(--hr-gold); }
.hr-red { color: var(--hr-red); }

/* Shared details: metadata rows, round arrows, image zoom, duration and play badges. */
.hr-ev-meta, .hr-msg-meta { display: flex; align-items: flex-start; gap: 9px; margin-top: 8px !important; }
.hr-ev-meta img, .hr-msg-meta img { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.hr-ev-meta { color: #E1EAF0; }
.hr-ev-meta img { filter: brightness(0) saturate(100%) invert(76%) sepia(46%) saturate(512%) hue-rotate(5deg) brightness(92%) contrast(89%); }
.hr-msg-meta { color: #365362; }
.hr-circle { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid currentColor; transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease; }
.hr-circle--light { color: #fff; }
.hr-circle--dark { width: 34px; height: 34px; color: #1B465B; border-color: #D5DDE1; }
.hr-zoom { display: block; overflow: hidden; position: relative; }
.hr-zoom img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .55s ease; }
.hr-duration { position: absolute; right: 7px; bottom: 7px; padding: 3px 7px; border-radius: 4px; background: rgba(7, 25, 29, .88); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.3; }
.hr-play { position: absolute; left: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--hr-navy); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.hr-event-state, .hr-message-state { color: inherit; }
.hr-event-state a, .hr-message-state a { text-decoration: underline; }

/* ---------------- Upcoming Events: featured event left, timeline right ---------------- */
.hr-events {
  color: #fff;
  padding: 44px 0 52px;
  background: radial-gradient(ellipse at 72% 34%, rgba(33, 79, 100, .48), transparent 53%), var(--hr-navy);
}
.hr-events__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .96fr);
  grid-template-areas: "head ." "feature aside";
  column-gap: clamp(40px, 5.1vw, 78px);
}
.hr-events__head { grid-area: head; }
.hr-events h2 { color: #fff; margin: 12px 0 10px; }
.hr-events__intro { color: #E9EEF1; margin-bottom: 16px !important; }
.hr-events__feature { grid-area: feature; margin-top: 20px; min-width: 0; }
.hr-events__aside { grid-area: aside; min-width: 0; margin-top: -24px; }
.hr-feature__media { aspect-ratio: 1.615; border-radius: 6px; background: #25424D; }
.hr-date-badge { position: absolute; top: 18px; left: 18px; min-width: 76px; padding: 9px 12px 8px; border-radius: 6px; background: var(--hr-red); color: #fff; text-align: center; text-transform: uppercase; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.hr-date-badge span { display: block; font-size: 14px; font-weight: 700; letter-spacing: .06em; }
.hr-date-badge strong { display: block; font-size: 34px; line-height: 1.1; font-weight: 700; }
.hr-feature__under { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 16px; }
.hr-feature__title { margin-bottom: 6px !important; }
.hr-feature h3 a:hover, .hr-tl-content h3 a:hover { color: var(--hr-gold); }

.hr-timeline { --hr-tl-gap: clamp(35px, 4.1vw, 51px); position: relative; border-top: 2px solid rgba(234, 162, 44, .8); padding-top: clamp(36px, 4vw, 52px); }
.hr-tl-entry { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) clamp(80px, 8.1vw, 108px); gap: clamp(12px, 1.7vw, 23px); min-height: clamp(140px, 14.8vw, 190px); align-items: start; }
.hr-tl-entry + .hr-tl-entry { padding-top: var(--hr-tl-gap); border-top: 1px solid rgba(255, 255, 255, .28); }
/* Gold line from each date badge down to the next, with a marker dot half way. */
.hr-tl-entry:not(:last-child)::before { content: ''; position: absolute; left: 31px; top: 78px; bottom: calc(-1 * var(--hr-tl-gap)); width: 2px; background: var(--hr-gold); transform-origin: top; transition: transform 1s cubic-bezier(.2, .6, .3, 1); }
.hr-tl-entry + .hr-tl-entry:not(:last-child)::before { top: calc(var(--hr-tl-gap) + 78px); }
.hr-tl-entry:not(:last-child)::after { content: ''; position: absolute; left: 26px; top: calc(78px + 34%); width: 12px; height: 12px; border-radius: 50%; background: var(--hr-gold); }
.hr-tl-date { position: relative; z-index: 2; width: 64px; height: 78px; border-radius: 5px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-transform: uppercase; }
.hr-tl-date span { color: var(--hr-red); font-size: 14px; font-weight: 700; }
.hr-tl-date strong { color: var(--hr-navy); font-size: 30px; line-height: 1.15; font-weight: 700; white-space: nowrap; }
.hr-tl-content h3 { margin: 6px 0 10px !important; color: #fff; }
.hr-tl-photo { aspect-ratio: .87; border-radius: 7px; }

/* ---------------- One light surface for Messages and Get Involved (no seam) ---------------- */
.hr-light-flow { position: relative; isolation: isolate; background: linear-gradient(to bottom, #FBFAF8 0%, #FDFCFA 26%, #FFFFFF 67%, #FFFFFF 100%); }
.hr-light-flow::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 80% 27% at 5% 0%, rgba(248, 245, 240, .45), transparent 80%); }
.hr-light-flow .hr-messages, .hr-light-flow .hr-involved { background: transparent; }

/* ---------------- Latest Messages: featured sermon left, two rows + Bible right ---------------- */
.hr-messages { padding: 48px 0 0; }
.hr-messages__grid { display: grid; grid-template-columns: minmax(0, .77fr) minmax(0, 1.23fr); gap: clamp(42px, 5.6vw, 78px); }
.hr-messages__left, .hr-messages__right { min-width: 0; }
.hr-messages h2 { margin: 12px 0 14px; }
.hr-messages__intro { color: var(--hr-copy); max-width: 320px; margin-bottom: 16px !important; }
.hr-featured-sermon { margin-top: 26px; }
.hr-featured-sermon__media { aspect-ratio: 2.28; border-radius: 7px; background: #542537; }
.hr-featured-sermon h3 { margin: 12px 0 2px !important; }
.hr-featured-sermon h3 a:hover, .hr-sermon-row h3 a:hover { color: var(--hr-red); }
.hr-sermon-stack { display: flex; flex-direction: column; gap: 6px; }
.hr-sermon-row { position: relative; display: grid; grid-template-columns: clamp(148px, 15vw, 190px) minmax(0, 1fr) 34px; gap: clamp(13px, 1.6vw, 22px); align-items: center; min-height: clamp(103px, 10.4vw, 132px); padding: 12px 14px 12px 12px; border-radius: 8px; background: rgba(255, 255, 255, .94); box-shadow: 0 5px 20px rgba(20, 40, 45, .04); transition: transform .25s ease, box-shadow .25s ease; }
.hr-sermon-row__media { aspect-ratio: 1.81; border-radius: 7px; background: #561A25; }
.hr-sermon-row h3 { margin: 0 0 4px !important; }
/* The title link covers the row, so the whole card is one link (images and arrow are decorative). */
.hr-sermon-row h3 a::after { content: ''; position: absolute; inset: 0; border-radius: 8px; }
.hr-sermon-row:focus-within { outline: 3px solid var(--hr-navy); outline-offset: 3px; }
.hr-sermon-row h3 a:focus-visible { outline: none; }
.hr-messages__bible { display: block; width: 100%; height: clamp(155px, 17vw, 220px); margin-top: 14px; object-fit: contain; object-position: right center; -webkit-mask-image: radial-gradient(ellipse 72% 78% at 55% 52%, #000 55%, transparent 100%); mask-image: radial-gradient(ellipse 72% 78% at 55% 52%, #000 55%, transparent 100%); }
.hr-section a:focus-visible { outline: 3px solid var(--hr-navy); outline-offset: 4px; border-radius: 4px; }
.hr-events a:focus-visible { outline-color: var(--hr-gold); }

/* ---------------- Get Involved: compact interlocking three-step infographic ---------------- */
.hr-involved { padding: 28px 0 60px; text-align: center; }
.hr-involved__inner { display: flex; flex-direction: column; align-items: center; }
.hr-involved h2 { margin: 12px 0 10px; }
.hr-involved__intro { color: var(--hr-copy); margin-bottom: 30px !important; }
.hr-steps { width: min(100%, 890px); margin: 0 auto; padding: 0 10px; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; text-align: left; }
.hr-step { --hr-step: var(--hr-red); position: relative; min-width: 0; aspect-ratio: 280 / 210; transition: transform .28s ease; }
.hr-step--two { --hr-step: #176A84; }
.hr-step--three { --hr-step: var(--hr-navy); }
.hr-step__border { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; filter: drop-shadow(-3px 5px 4px rgba(0, 0, 0, .12)); }
.hr-step__border path { fill: #fff; stroke: var(--hr-step); stroke-width: 4.7; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.hr-step__number { position: absolute; z-index: 2; left: -15px; top: 48%; transform: translateY(-50%); color: var(--hr-step); font-size: clamp(75px, 8vw, 112px); line-height: 1; font-weight: 700; letter-spacing: -4px; user-select: none; text-shadow: 1px 4px 3px rgba(0, 0, 0, .08); }
.hr-step__content { position: relative; z-index: 3; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 16px clamp(14px, 1.8vw, 24px) 14px clamp(42px, 3.8vw, 54px); }
/* Steps 1 and 2 keep their text clear of the notch on the right (about 14% of the panel). */
.hr-step--one .hr-step__content, .hr-step--two .hr-step__content { padding-right: calc(14% + 10px); }
.hr-step__icon { width: 24px; height: 24px; color: var(--hr-step); margin-bottom: 6px; flex: none; }
.hr-step h3 { color: var(--hr-step); margin-bottom: 6px !important; }
.hr-step p { color: #365262; }
.hr-involved__cta { margin-top: 22px; min-width: 220px; }

/* Hover feedback (pointer devices only). */
@media (hover: hover) and (pointer: fine) {
  .hr-zoom:hover img, .hr-feature:hover .hr-feature__media img, .hr-tl-entry:hover .hr-tl-photo img, .hr-sermon-row:hover .hr-sermon-row__media img, .hr-featured-sermon:hover .hr-featured-sermon__media img { transform: scale(1.04); }
  .hr-feature:hover .hr-circle--light { transform: translateX(3px); background: #fff; color: var(--hr-navy); }
  .hr-sermon-row:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(20, 40, 45, .08); }
  .hr-sermon-row:hover .hr-circle--dark { transform: translateX(3px); background: var(--hr-red); border-color: var(--hr-red); color: #fff; }
  .hr-step:hover { transform: translateY(-5px); }
}

/* Gentle reveals. Only when JS adds .hr-motion, so content is visible without JS. */
.hr-motion [data-hr-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s cubic-bezier(.15, .65, .25, 1); transition-delay: var(--hr-delay, 0ms); }
.hr-motion [data-hr-reveal].is-visible { opacity: 1; transform: none; }
.hr-motion .hr-timeline:not(.is-drawn) .hr-tl-entry::before { transform: scaleY(0); }
.hr-motion .hr-step[data-hr-reveal].is-visible:hover { transform: translateY(-5px); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .hr-tl-entry { grid-template-columns: 60px minmax(0, 1fr) 84px; }
}
@media (max-width: 850px) {
  .hr-wrap { width: min(660px, calc(100% - 60px)); }
  .hr-events__grid { grid-template-columns: 1fr; grid-template-areas: "head" "feature" "aside"; }
  .hr-events__aside { margin-top: 30px; }
  .hr-timeline { padding-top: 28px; }
  .hr-messages__grid { grid-template-columns: 1fr; gap: 18px; }
  .hr-messages__left, .hr-messages__right { display: contents; }
  .hr-messages__left > :is(.hr-eyebrow, h2, p, .rl-btn) { justify-self: start; }
  .hr-featured-sermon-slot { order: 1; }
  .hr-sermon-stack { order: 2; }
  .hr-messages__bible { order: 3; margin-top: 0; }
  .hr-featured-sermon { margin-top: 6px; }
  .hr-steps { width: min(100%, 580px); display: flex; flex-direction: column; gap: 18px; padding: 0 22px; }
  .hr-step { width: 100%; aspect-ratio: auto; height: 190px; }
  .hr-step__number { font-size: 105px; left: -19px; }
  .hr-step__content { padding-left: 100px; padding-right: 40px; }
}
@media (max-width: 650px) {
  .hr-wrap { width: calc(100% - 44px); }
  .hr-events { padding: 36px 0 44px; }
  .hr-date-badge { top: 12px; left: 12px; min-width: 64px; padding: 7px 10px; }
  .hr-date-badge strong { font-size: 28px; }
  .hr-tl-entry { grid-template-columns: 56px minmax(0, 1fr) 64px; gap: 10px; min-height: 150px; }
  .hr-tl-date { width: 56px; height: 69px; }
  .hr-tl-date strong { font-size: 25px; }
  .hr-tl-date span { font-size: 12px; }
  .hr-tl-entry:not(:last-child)::before { left: 27px; top: 69px; }
  .hr-tl-entry + .hr-tl-entry:not(:last-child)::before { top: calc(var(--hr-tl-gap) + 69px); }
  .hr-tl-entry:not(:last-child)::after { left: 22px; top: calc(69px + 34%); }
  .hr-tl-photo { aspect-ratio: 1; }
  .hr-feature .hr-circle { width: 40px; height: 40px; }
  .hr-messages { padding-top: 40px; }
  .hr-sermon-row { grid-template-columns: 112px minmax(0, 1fr) 30px; gap: 10px; padding: 10px; min-height: 92px; }
  .hr-sermon-row .hr-duration { font-size: 11px; padding: 2px 5px; }
  .hr-sermon-row .hr-play { width: 24px; height: 24px; left: 6px; bottom: 6px; }
  .hr-circle--dark { width: 30px; height: 30px; }
  .hr-messages__bible { height: 140px; }
  .hr-step { height: 205px; }
  .hr-step__number { font-size: 90px; }
  .hr-step__content { padding: 14px 30px 14px 82px; }
  .hr-steps { padding: 0 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .hr-section *, .hr-section *::before, .hr-section *::after { transition-duration: .01ms !important; animation: none !important; }
  .hr-motion [data-hr-reveal] { opacity: 1 !important; transform: none !important; }
}

/* Text colours. Doubled class selectors outrank the homepage-wide .faithful-home p/h2/h3 colours
   without !important. */
.hr-section :is(p, h2, h3) { color: inherit; }
.hr-section.hr-events h2, .hr-section.hr-events h3, .hr-section.hr-events .hr-eyebrow--gold { color: #fff; }
.hr-section .hr-events__intro { color: #E9EEF1; }
.hr-section .hr-ev-meta { color: #E1EAF0; }
.hr-section .hr-eyebrow--red { color: var(--hr-red); }
.hr-section .hr-msg-meta { color: #365362; }
.hr-section .hr-messages__intro, .hr-section .hr-involved__intro { color: var(--hr-copy); }
.hr-section .hr-step h3 { color: var(--hr-step); }
.hr-section .hr-step p { color: #365262; }
.hr-section .hr-gold { color: var(--hr-gold); }
.hr-section .hr-red { color: var(--hr-red); }
.hr-section.hr-events .hr-feature h3 a:hover, .hr-section.hr-events .hr-tl-content h3 a:hover { color: var(--hr-gold); }
.hr-section .hr-featured-sermon h3 a:hover, .hr-section .hr-sermon-row h3 a:hover { color: var(--hr-red); }

/* Keep the viewport as the sticky scroll container on the mobile homepage. */
@media (max-width: 650px) and (prefers-reduced-motion: no-preference) {
  body.hr-stacking,
  .hr-stacking main.faithful-home { overflow: clip visible; }
  .hr-stacking [data-hr-stack]::after {
    content: '';
    min-height: 56px;
  }
  .hr-stacking [data-hr-stack] .hr-step[data-hr-reveal] {
    position: sticky;
    top: calc(var(--header-h, 72px) + var(--hr-stack-offset));
    height: auto;
    min-height: 205px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    opacity: 1;
    transform: none;
    transform-origin: center top;
    transition: scale 200ms ease, filter 200ms ease;
  }
  .hr-stacking [data-hr-stack] .hr-step--one { --hr-stack-offset: 16px; z-index: 1; }
  .hr-stacking [data-hr-stack] .hr-step--two { --hr-stack-offset: 28px; z-index: 2; }
  .hr-stacking [data-hr-stack] .hr-step--three { --hr-stack-offset: 40px; z-index: 3; }
  .hr-stacking [data-hr-stack] .hr-step__content { min-height: 205px; height: auto; }
  .hr-stacking [data-hr-stack] .hr-step.is-covered { scale: .96; filter: brightness(.97); }
}

@media (max-width: 650px) and (prefers-reduced-motion: reduce) {
  [data-hr-stack] .hr-step { transform: none !important; }
}
