/* Neribo Family Church */
:root {
  --white: #FFFFFF;
  --ink: #1F1830;
  --muted: #55506A;
  --purple: #3A1D5C;
  --purple-deep: #26123F;
  --gold: #F2C24B;
  --gold-deep: #D9A21B;
  --wash: #FBF4E1;
  --line: #E4DCC6;
  --head: "Literata", Georgia, "Times New Roman", serif;
  --body: "Figtree", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 7rem; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--body); font-size: 1.0625rem; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; max-width: 62ch; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0; }
h2 { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 700; margin-bottom: 1.25rem; }
h3 { font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 0.4rem; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 2.5rem, 70rem); margin-inline: auto; }
.lead { font-size: 1.2rem; color: var(--muted); }

/* Buttons */
.btn { display: inline-block; padding: 0.85rem 1.4rem; border: 2px solid var(--purple); border-radius: 4px; font-weight: 700; text-decoration: none; line-height: 1.2; text-align: center; }
.btn-solid { background: var(--purple); color: #fff; }
.btn-solid:hover { background: var(--purple-deep); border-color: var(--purple-deep); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--purple-deep); }
.btn-gold:hover { background: #fff; border-color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--purple-deep); }
.btn-small { padding: 0.55rem 1.05rem; font-size: 0.95rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.text-link { font-weight: 700; color: var(--purple); text-underline-offset: 0.2em; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--white); border-bottom: 1px solid var(--line); }
.header-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.5rem 1rem; padding-block: 0.75rem; }
.brand { display: flex; align-items: center; gap: 0.65rem; font-family: var(--head); font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--purple); }
.brand-logo { height: 2.2rem; width: auto; flex: none; }
.nav { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 1.25rem; overflow-x: auto; }
.nav a { text-decoration: none; font-weight: 600; font-size: 0.95rem; white-space: nowrap; padding-block: 0.25rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--gold-deep); }

/* Hero */
.hero { background: var(--purple); color: #fff; padding-block: clamp(2.5rem, 7vw, 5rem); }
.hero-grid { display: grid; gap: 2.5rem; }
.hero h1 { font-size: clamp(2.3rem, 7vw, 4.2rem); font-weight: 700; letter-spacing: -0.01em; max-width: 14ch; margin-bottom: 1.25rem; }
.hero-lead { font-size: 1.2rem; color: #E6DDF2; max-width: 46ch; }
.hero-times { display: flex; flex-wrap: wrap; gap: 0.5rem 2.5rem; margin: 2rem 0 0.5rem; padding-left: 1.1rem; border-left: 4px solid var(--gold); }
.hero-times p { margin: 0; display: flex; flex-direction: column; }
.time { font-family: var(--head); font-weight: 700; font-size: clamp(3.2rem, 12vw, 5.5rem); line-height: 1; color: var(--gold); animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.hero-times p:nth-child(2) .time { animation-delay: .15s; }
.time-label { font-size: 0.95rem; color: #E6DDF2; margin-top: 0.25rem; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Images: file sits on a neutral warm gradient until the file exists */
.ph { background-size: cover; background-position: center; background-repeat: no-repeat; }
.ph-hero { aspect-ratio: 4 / 3; background-image: url("../images/hero-congregation.jpg"), linear-gradient(150deg, #5B3F80, #2F1750); }
.ph-community { aspect-ratio: 4 / 3; background-image: url("../images/community-1.jpg"), linear-gradient(150deg, #EADFC0, #CDBE95); }
.ph-worship { aspect-ratio: 4 / 3; background-image: url("../images/worship-1.jpg"), linear-gradient(150deg, #D9CFE8, #A997C4); }
.ph-event { aspect-ratio: 16 / 9; background-image: url("../images/event-1.jpg"), linear-gradient(150deg, #EADFC0, #CDBE95); }

/* Sections */
.section { padding-block: clamp(3rem, 8vw, 6rem); }
.section-wash { background: var(--wash); }
.split { display: grid; gap: 2rem; align-items: center; }
.split-body h3 { color: var(--purple); }

/* Table */
.table-wrap { overflow-x: auto; margin-top: 1.5rem; }
.schedule { width: 100%; max-width: 46rem; border-collapse: collapse; background: #fff; }
.schedule th, .schedule td { text-align: left; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); }
.schedule thead th { background: var(--purple); color: #fff; font-weight: 600; }
.schedule tbody th { font-weight: 700; color: var(--purple); white-space: nowrap; }
.schedule td:last-child { font-weight: 700; white-space: nowrap; }
.note { margin-top: 1.25rem; color: var(--muted); }

/* Sermon clips: animated in the page, no video files needed */
.videos { display: grid; gap: 2rem; margin-top: 2rem; }
.clip { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 4px; background: var(--purple-deep); color: #fff; container-type: inline-size; isolation: isolate; }
.clip-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform-origin: 70% 50%; }
.s1 { background-image: url("../images/sermon-1.jpg"), linear-gradient(140deg, #4B2A75, #2A1545); }
.s2 { background-image: url("../images/sermon-2.jpg"), linear-gradient(140deg, #5A3488, #33195A); }
/* Cards 3 and 4 use a closer crop of the same two photos */
.s3 { background-image: url("../images/sermon-1.jpg"), linear-gradient(140deg, #4B2A75, #2A1545); background-size: 170% auto, cover; background-position: 97% 0, center; }
.s4 { background-image: url("../images/sermon-2.jpg"), linear-gradient(140deg, #5A3488, #33195A); background-size: 170% auto, cover; background-position: 97% 100%, center; }
.clip-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(38,18,63,.88) 0%, rgba(38,18,63,.55) 38%, rgba(38,18,63,0) 70%), radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.35) 100%); opacity: 0.35; transition: opacity .4s; }
.clip-text { position: absolute; inset: 0; padding: 6cqw 6cqw 8cqw; display: flex; flex-direction: column; justify-content: center; width: 58%; }
.clip-text p, .clip-text h3 { opacity: 0; margin: 0; max-width: none; }
.c-church { font-family: var(--head); font-size: 3.2cqw; font-weight: 500; position: absolute; top: 5cqw; left: 6cqw; width: 50cqw; }
.c-title { font-size: 6.4cqw; line-height: 1.1; font-weight: 700; position: relative; padding-bottom: 2.2cqw; }
.c-title::after { content: ""; position: absolute; left: 0; bottom: 0; height: 0.5cqw; width: 12cqw; background: var(--gold); transform: scaleX(0); transform-origin: left; }
.c-sub { font-size: 3cqw; margin-top: 2.4cqw !important; color: #F1E9FA; }
.c-foot { font-size: 2.6cqw; position: absolute; left: 6cqw; bottom: 6cqw; color: var(--gold); width: 50cqw; }
.clip-fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.clip-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 0.8cqw; background: rgba(255,255,255,.18); opacity: 0; }
.clip-bar span { display: block; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }
.clip-btn { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; cursor: pointer; padding: 0; }
.clip-btn:hover .play { transform: scale(1.06); }
.play { position: absolute; left: 50%; top: 50%; width: 4.25rem; height: 4.25rem; margin: -2.125rem 0 0 -2.125rem; border-radius: 50%; background: var(--gold); transition: transform .2s; }
.play::after { content: ""; position: absolute; left: 1.65rem; top: 1.25rem; border-left: 1.2rem solid var(--purple-deep); border-top: 0.9rem solid transparent; border-bottom: 0.9rem solid transparent; }
.clip.done .play { background: #fff; }
.clip.done .play::after { display: none; }
.clip.done .play::before { content: "Watch again"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 700 0.85rem var(--body); color: var(--purple-deep); white-space: nowrap; }
.clip.done .play { width: 8rem; height: 2.75rem; margin: -1.375rem 0 0 -4rem; border-radius: 4px; }
.clip.playing .clip-btn, .clip.done .clip-btn { }
.clip.playing .clip-btn { display: none; }
.clip.done .clip-fade { opacity: 1; }

.clip.playing .clip-bg { animation: kb 20s linear forwards; }
.clip.playing .clip-shade { opacity: 1; }
.clip.playing .clip-text { animation: out 1.6s 18.2s ease forwards; }
.clip.playing .c-church { animation: up 1s 1s ease-out forwards; }
.clip.playing .c-title { animation: up 1.2s 3s ease-out forwards; }
.clip.playing .c-title::after { animation: line 1.2s 4.6s ease-out forwards; }
.clip.playing .c-sub { animation: up 1.2s 8s ease-out forwards; }
.clip.playing .c-foot { animation: up 1.2s 12s ease-out forwards; }
.clip.playing .clip-fade { animation: fade 20s linear forwards; }
.clip.playing .clip-bar { opacity: 1; }
.clip.playing .clip-bar span { animation: bar 20s linear forwards; }
@keyframes kb { from { transform: scale(1); } to { transform: scale(1.12) translateX(-2%); } }
@keyframes up { from { opacity: 0; transform: translateY(1.5cqw); } to { opacity: 1; transform: none; } }
@keyframes line { to { transform: scaleX(1); } }
@keyframes out { to { opacity: 0; } }
@keyframes bar { to { transform: scaleX(1); } }
@keyframes fade { 0% { opacity: 1; } 10% { opacity: 0; } 90% { opacity: 0; } 100% { opacity: 1; } }
.video-title { margin: 0.6rem 0 0; font-weight: 600; }


/* Giving */
.giving { display: grid; gap: 2rem; align-items: start; }
.bank { margin: 0; background: var(--purple); color: #fff; padding: 1.5rem; border-left: 6px solid var(--gold); }
.bank div { padding-block: 0.7rem; border-bottom: 1px solid rgba(255,255,255,.2); }
.bank div:last-child { border-bottom: 0; }
.bank dt { font-size: 0.9rem; color: #E6DDF2; }
.bank dd { margin: 0.1rem 0 0; font-family: var(--head); font-weight: 700; font-size: 1.35rem; overflow-wrap: anywhere; }

/* Events */
.events { display: grid; gap: 2rem; margin-top: 1.5rem; }
.event { border-top: 3px solid var(--purple); padding-top: 1rem; }
.event h3 { margin-top: 0; }
.event p { margin-bottom: 0.9rem; }
.event-when { font-weight: 700; color: var(--purple); margin-bottom: 0.3rem !important; }
.event-main { border-top: 0; padding-top: 0; background: #fff; }
.event-body { padding: 1.25rem 1.25rem 1.5rem; }

/* Footer */
.site-footer { background: var(--purple-deep); color: #E6DDF2; padding-top: 3rem; }
.site-footer :focus-visible { outline-color: var(--gold); }
.footer-grid { display: grid; gap: 1.5rem; }
.footer-grid p { margin: 0 0 0.3rem; }
.footer-logo { height: 1.8rem; width: auto; display: inline-block; vertical-align: middle; margin-right: 0.6rem; }
.footer-brand { font-family: var(--head); font-weight: 700; font-size: 1.4rem; color: #fff; }
.footer-grid a:not(.btn) { color: #fff; }
.footer-base { margin-top: 2.5rem; padding-block: 1.25rem; border-top: 1px solid rgba(255,255,255,.18); font-size: 0.9rem; }
.footer-base p { margin: 0; }

@media (min-width: 720px) {
  .header-row { grid-template-columns: auto 1fr auto; }
  .nav { grid-column: auto; grid-row: auto; justify-content: center; overflow: visible; }
  .hero-grid { grid-template-columns: 6fr 5fr; align-items: center; gap: 3.5rem; }
  .ph-hero { aspect-ratio: 4 / 5; }
  .split { grid-template-columns: 5fr 6fr; gap: 4rem; }
  .split-reverse { grid-template-columns: 6fr 5fr; }
  .split-reverse .split-media { order: 2; }
  .videos { grid-template-columns: 1fr 1fr; gap: 2.5rem 2rem; }
  .giving { grid-template-columns: 3fr 2fr; gap: 4rem; }
  .events { grid-template-columns: 1fr 1fr; gap: 2.5rem 2rem; }
  .event-main { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .event-main .ph-event { aspect-ratio: auto; min-height: 16rem; }
  .event-body { align-self: center; padding: 2rem; }
  .footer-grid { grid-template-columns: 2fr 2fr 1fr; align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .time { animation: none; }
  .clip.playing .clip-bg { animation: none; }
  .clip.playing .clip-text p, .clip.playing .clip-text h3 { animation: none; opacity: 1; }
  .clip.playing .c-title::after { animation: none; transform: none; }
  .clip.playing .clip-fade { animation: none; }
}
