/* Oak Grove Church — "Warm Welcome" with light and dark themes */

:root {
  --bg: #FAF8F3;
  --text: #252C35;
  --soft: #ECE8DF;
  --panel: #FFFFFF;
  --accent: #075B98;
  --on-accent: #FFFFFF;
  --muted: #58616B;
  --live: #B42318;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #191D23;
  --text: #F1EEE6;
  --soft: #252C35;
  --panel: #202831;
  --accent: #78BDF1;
  --on-accent: #101F2C;
  --muted: #B6C0CA;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font: 17px/1.6 var(--sans);
  color: var(--text);
  background: var(--bg);
  transition: background-color .25s, color .25s;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { max-width: 1200px; margin-inline: auto; padding-inline: 32px; }
@media (max-width: 650px) { .wrap { padding-inline: 20px; } }

h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font: normal clamp(2.4rem, 5.5vw, 3.75rem)/1.06 var(--serif); letter-spacing: -0.02em; }
h2 { font: normal clamp(1.75rem, 3vw, 2.1rem)/1.2 var(--serif); }
h3 { font-size: 1.1rem; line-height: 1.4; font-weight: 600; }

.eyebrow {
  display: block; font-size: 13px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}
.muted { color: var(--muted); }
.link { font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px;
  padding: 12px 20px; border-radius: 4px; font-size: 16px; font-weight: 600;
  border: 1.5px solid transparent;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-light { background: #FFFFFF; color: #153D5C; }
.btn-ghost { border-color: rgba(255,255,255,.8); color: #FFFFFF; }

/* Live banner */
.live-banner {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px;
  padding: 12px 24px; background: var(--live); color: #FFFFFF;
  font-weight: 600; font-size: 15px; text-align: center;
}
.live-banner:hover { text-decoration: none; }
.live-banner .dot { width: 10px; height: 10px; border-radius: 50%; background: #FFFFFF; animation: pulse 1.6s infinite; }
.live-banner .underline { text-decoration: underline; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-banner .dot { animation: none; } }

/* Announcement banners */
.notice-warning { --n-bg: #FCEFC7; --n-fg: #4A3504; --n-icon: #B7791F; }
.notice-info { --n-bg: #DCEBF7; --n-fg: #0E2F4A; --n-icon: #075B98; }
:root[data-theme="dark"] .notice-warning { --n-bg: #3B2F12; --n-fg: #FBE8B5; --n-icon: #E3B341; }
:root[data-theme="dark"] .notice-info { --n-bg: #13304A; --n-fg: #D6E9F8; --n-icon: #78BDF1; }
.notice { background: var(--n-bg); color: var(--n-fg); border-bottom: 1px solid color-mix(in srgb, var(--n-fg) 15%, transparent); }
.notice-row { display: flex; align-items: center; gap: 14px; padding-block: 12px; }
.notice-icon {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--n-icon); color: #FFFFFF; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.notice-text { margin: 0; flex: 1; min-width: 0; font-weight: 600; font-size: 16px; line-height: 1.45; }
.notice-close {
  flex: none; width: 44px; height: 44px; margin: -10px -10px -10px 0; border: 0; border-radius: 50%;
  background: transparent; color: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.notice-close:hover { background: color-mix(in srgb, var(--n-fg) 10%, transparent); }

/* Header */
.header-row {
  display: grid; grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand nav toggle";
  align-items: center; gap: 12px 24px; padding-block: 14px;
}
.brand { grid-area: brand; }
.nav { grid-area: nav; justify-self: end; }
.theme-toggle { grid-area: toggle; justify-self: end; }

/* Dark mode uses a version of the logo with lighter gray lettering */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.brand img { height: 66px; width: auto; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 26px; font-size: 16px; font-weight: 500; }
.nav > a { color: var(--text); padding-block: 10px; }
.nav > a:hover { color: var(--accent); text-decoration: none; }
.theme-toggle {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--soft);
  background: var(--panel); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
/* Phones: logo left, light/dark button top right, menu spread evenly underneath */
@media (max-width: 650px) {
  .header-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand toggle" "nav nav"; row-gap: 6px; padding-block: 12px 4px;
  }
  .brand img { height: 56px; }
  .nav {
    justify-self: stretch; justify-content: space-between; gap: 0;
    border-top: 1px solid var(--soft); font-size: 15px;
  }
  .nav > a { padding-block: 12px; }
}

/* Hero */
.hero { position: relative; isolation: isolate; color: #FFFFFF; background: #182631; }
.hero-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 38%; z-index: -2;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(17,28,39,.94) 0%, rgba(17,28,39,.75) 45%, rgba(17,28,39,.3) 100%);
}
.hero-copy { padding-block: 88px 96px; display: flex; flex-direction: column; gap: 20px; }
.hero-copy > * { max-width: 620px; }
.hero .eyebrow { color: #D2E7F9; }
.hero p { margin: 0; font-size: 19px; color: #E4ECF3; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
@media (max-width: 650px) {
  .hero-copy { padding-block: 56px 64px; }
  .hero::after { background: rgba(17,28,39,.8); }
}

/* Shared section pieces */
.section { padding-block: 72px; display: flex; flex-direction: column; gap: 28px; }
.section-head { display: flex; flex-direction: column; gap: 8px; }
.btn-accent { background: var(--accent); color: var(--on-accent); }

/* Service times strip */
.visit-strip { background: var(--soft); }
.visit-row {
  display: grid; grid-template-columns: 260px minmax(0, 1fr);
  align-items: center; gap: 24px 48px; padding-block: 40px;
}
.visit-intro { display: flex; flex-direction: column; gap: 6px; }
.visit-intro p { margin: 0; font-size: 15px; }
/* The times switch between 2 and 4 across based on the room they have, not the window size */
.times-wrap { container-type: inline-size; min-width: 0; }
.times { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@container (min-width: 680px) { .times { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); } }
.times > div {
  background: var(--panel); border-radius: 8px; padding: 20px 22px;
  display: flex; flex-direction: column; gap: 6px;
}
.times dd {
  margin: 0; display: flex; align-items: baseline; gap: 6px;
  font-family: var(--sans); font-variant-numeric: lining-nums tabular-nums; line-height: 1;
}
.times .t { font-size: 34px; font-weight: 600; letter-spacing: -0.02em; }
.times .ampm { font-size: 15px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.times dt { font-size: 15px; font-weight: 500; color: var(--muted); }
@media (max-width: 1100px) {
  .visit-row { grid-template-columns: minmax(0, 1fr); }
}

/* Watch */
.watch-grid {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px 40px; align-items: start;
}
.watch-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.watch-side h3 { font: normal 1.6rem/1.25 var(--serif); }
.next-live { margin: 16px 0 12px; padding-top: 16px; border-top: 1px solid var(--soft); width: 100%; color: var(--muted); }
.next-live strong { color: var(--text); font-weight: 600; }
@media (max-width: 900px) { .watch-grid { grid-template-columns: minmax(0, 1fr); } }

.video-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.badge-live {
  background: var(--live); color: #FFFFFF; font-size: 12px; font-weight: 700;
  letter-spacing: .08em; padding: 4px 10px; border-radius: 4px;
}

.player {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #172633; border-radius: 8px; overflow: hidden;
}
.player .fb-video, .player .fb-video > span, .player iframe { width: 100% !important; height: 100% !important; }
.player-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.player-fallback img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player-fallback::after { content: ""; position: absolute; inset: 0; background: rgba(12,24,35,.35); }
.player-fallback .play {
  position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255,255,255,.95); color: #19344A;
  display: flex; align-items: center; justify-content: center;
}

/* Recent services */
.recent { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; border-top: 1px solid var(--soft); }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.video-grid p { margin: 0; grid-column: 1 / -1; }
.video-card {
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  background: none; border: 0; padding: 0; color: var(--text); font: inherit; cursor: pointer;
}
.video-card .thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--soft); }
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-card .len {
  position: absolute; right: 10px; bottom: 10px; background: #172633; color: #FFFFFF;
  font-size: 12px; padding: 3px 7px; border-radius: 4px; font-variant-numeric: tabular-nums;
}
.video-card .title { font-weight: 600; }
.video-card .date { font-size: 14px; color: var(--muted); }
.video-card:hover .title { color: var(--accent); }

/* Facebook + map: headings share one row, boxes share the next, so both line up */
.connect-band { background: var(--soft); }
.connect {
  display: grid; padding-block: 72px;
  grid-template-columns: 502px minmax(0, 1fr);
  grid-template-areas: "newsh maph" "newsb mapb";
  gap: 28px 40px;
}
.box {
  height: 602px; border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 8px; overflow: hidden; background: var(--panel);
}
.feed { position: relative; background: #FFFFFF; }
.feed .fb-page { position: relative; z-index: 1; }
.feed-fallback {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 24px;
  text-align: center; font-size: 14px; color: #58616B;
}
.map-card { display: flex; flex-direction: column; }
.map { flex: 1; width: 100%; border: 0; display: block; min-height: 0; }
.map-info {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 20px; padding: 18px 22px; border-top: 1px solid var(--soft);
}
.map-info address { font-style: normal; line-height: 1.45; }
@media (max-width: 960px) {
  .connect {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "newsh" "newsb" "maph" "mapb";
  }
  .feed { max-width: 502px; width: 100%; }
  .box { height: 560px; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--soft); background: var(--soft); }
.footer-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 20px 40px; padding-block: 32px; font-size: 15px;
}
.footer-logo { height: 54px; width: auto; }
.footer-info { display: flex; flex-direction: column; gap: 2px; color: var(--muted); }
.admin-link {
  width: 44px; height: 44px; border-radius: 50%; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; opacity: .7;
}
.admin-link:hover { opacity: 1; color: var(--accent); background: color-mix(in srgb, var(--text) 8%, transparent); }
