/* Seventh Day Church of God (Reformed) Inc. – Mountain View Assembly */
:root {
  --brown-900: #1c0f06;
  --brown-800: #2a1709;
  --brown-700: #3d2412;
  --gold: #d4a537;
  --gold-light: #f0d27a;
  --gold-dark: #9c7420;
  --green: #1f6b35;
  --green-dark: #154d26;
  --red: #d42a1f;
  --zoom: #2d8cff;

  --bg: #fbf7ee;
  --bg-alt: #f3ebd9;
  --surface: #ffffff;
  --text: #2b1d12;
  --muted: #76664f;
  --border: #e6dac0;
  --shadow: 0 2px 10px rgba(60, 36, 10, .08), 0 1px 2px rgba(60, 36, 10, .06);
  --shadow-lg: 0 12px 30px rgba(60, 36, 10, .16);
  --radius: 14px;
  --heading: 'Cinzel', Georgia, serif;
  --body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #140b05; --bg-alt: #1d1209; --surface: #26180d; --text: #f3e9d6;
    --muted: #b6a385; --border: #3f2b18; --shadow: 0 2px 10px rgba(0,0,0,.4); --shadow-lg: 0 12px 30px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg: #140b05; --bg-alt: #1d1209; --surface: #26180d; --text: #f3e9d6;
  --muted: #b6a385; --border: #3f2b18; --shadow: 0 2px 10px rgba(0,0,0,.4); --shadow-lg: 0 12px 30px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); font-size: 17px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--gold-dark); }
h1, h2, h3 { font-family: var(--heading); line-height: 1.25; margin: 0 0 .6em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .95em; background: var(--bg-alt); padding: .1em .45em; border-radius: 6px; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.lead { font-size: 1.1rem; }
.empty { color: var(--muted); text-align: center; padding: 2rem 0; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--gold); color: #000; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Top banner */
.top-banner { background: var(--green); color: #fff; text-align: center; padding: .5rem 16px; font-weight: 600; font-size: .95rem; }

/* Header */
.site-header { background: linear-gradient(180deg, var(--brown-900), var(--brown-800)); border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: #fff; min-width: 0; }
.brand img { flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-church { font-family: var(--heading); font-size: .82rem; color: var(--gold-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-assembly { font-family: var(--heading); font-weight: 700; font-size: 1.15rem; color: #fff; }
.site-nav { display: flex; align-items: center; gap: .25rem; }
.site-nav a { color: #f3e9d6; text-decoration: none; padding: .5rem .8rem; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.site-nav a:hover, .site-nav a.active { background: rgba(212,165,55,.18); color: var(--gold-light); }
.theme-toggle, .nav-toggle { background: transparent; border: 1px solid rgba(240,210,122,.35); color: var(--gold-light); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 1rem; }
.theme-toggle { margin-left: .4rem; }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; place-items: center; flex-shrink: 0; }
  .site-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--brown-800); padding: .5rem 16px 1rem; border-bottom: 3px solid var(--gold); display: none; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .8rem; }
  .theme-toggle { margin: .4rem 0 0; width: 100%; }
  .brand-church { font-size: .7rem; max-width: 60vw; }
  .brand-assembly { font-size: 1rem; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.2rem; border-radius: 10px; font-weight: 700; font-size: .98rem; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-family: inherit; transition: transform .15s, box-shadow .15s, background .15s; line-height: 1.2; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-live { background: var(--red); color: #fff; }
.btn-zoom { background: var(--zoom); color: #fff; }
.btn-gold { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: var(--brown-900); }
.btn-green { background: var(--green); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-danger { background: #b3261e; color: #fff; }
.btn-sm { padding: .4rem .75rem; font-size: .85rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.live-pill { background: #fff; color: var(--red); font-size: .7rem; font-weight: 800; padding: .1rem .45rem; border-radius: 999px; letter-spacing: .05em; animation: pulse 1.6s infinite; }
.online-card .live-pill { background: var(--red); color: #fff; vertical-align: middle; }
@keyframes pulse { 50% { opacity: .55; } }

/* Hero */
.hero { background: radial-gradient(ellipse at 30% 40%, #4a2c12 0%, var(--brown-900) 70%); color: #f7eedb; padding: 3rem 0 3.5rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(240,210,122,.25) 1px, transparent 1px); background-size: 28px 28px; opacity: .25; pointer-events: none; }
.hero-inner > * { min-width: 0; }
.hero-inner { display: grid; grid-template-columns: minmax(220px, 400px) 1fr; gap: 2.5rem; align-items: center; position: relative; z-index: 1; }
.hero-logo { width: 100%; filter: drop-shadow(0 10px 30px rgba(0,0,0,.6)); }
.eyebrow { color: var(--gold-light); text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; font-weight: 700; margin: 0 0 .5rem; }
.hero h1 { font-size: clamp(1.6rem, 3.6vw, 2.6rem); color: #fff; margin-bottom: .2em; }
.hero-assembly { font-family: var(--heading); font-size: clamp(1.25rem, 2.6vw, 1.75rem); color: var(--gold); margin: 0 0 .5rem; font-weight: 700; }
.hero-tagline { font-style: italic; color: var(--gold-light); font-size: 1.1rem; margin: 0 0 1rem; }
.hero-welcome { max-width: 60ch; color: #e8dcc2; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
@media (max-width: 760px) {
  .hero { padding: 2rem 0 2.5rem; text-align: center; }
  .hero-inner { grid-template-columns: 1fr; gap: 1.25rem; }
  .hero-logo { max-width: 260px; margin: 0 auto; }
  .hero-actions { justify-content: center; }
  .hero-welcome { margin-left: auto; margin-right: auto; }
}

/* Next service strip */
.next-service { background: var(--green); color: #fff; padding: .85rem 0; }
.next-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.next-service .muted { color: #cfe6d5; }
.countdown { display: flex; gap: .5rem; }
.countdown span { background: rgba(0,0,0,.22); border-radius: 8px; padding: .25rem .6rem; font-size: .85rem; min-width: 3.2rem; text-align: center; }
.countdown b { font-size: 1.15rem; margin-right: 2px; }
.dot-live { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 0 0 rgba(255,77,77,.7); animation: ring 1.5s infinite; vertical-align: middle; }
@keyframes ring { 70% { box-shadow: 0 0 0 10px rgba(255,77,77,0); } 100% { box-shadow: 0 0 0 0 rgba(255,77,77,0); } }

/* Sections */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.search { position: relative; flex: 0 1 300px; }
.search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input[type=search] { width: 100%; padding: .65rem .9rem .65rem 2.4rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }

/* Link cards */
.link-group { margin-top: 1.5rem; }
.group-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-family: var(--body); font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: .4rem; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.link-card { --accent: var(--gold); display: flex; align-items: center; gap: .9rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; }
.link-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.link-icon { flex-shrink: 0; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 1.45rem; color: #fff; background: var(--accent); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.link-body { display: flex; flex-direction: column; min-width: 0; }
.link-title { font-weight: 700; font-size: 1.02rem; }
.link-desc { color: var(--muted); font-size: .88rem; line-height: 1.35; }
.link-ext { margin-left: auto; color: var(--muted); font-size: .8rem; opacity: .6; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.online-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.online-card { position: relative; border-top: 5px solid var(--red); }
.online-card.zoom { border-top-color: var(--zoom); }
.online-icon { font-size: 2rem; color: var(--red); margin-bottom: .4rem; }
.online-card.zoom .online-icon { color: var(--zoom); }
.zoom-details { margin: .5rem 0 0; }
.zoom-details div { display: flex; align-items: center; gap: .75rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.zoom-details dt { width: 6.5rem; color: var(--muted); font-weight: 600; }
.zoom-details dd { margin: 0; display: flex; align-items: center; gap: .4rem; }
.copy-btn:not(.btn) { background: none; border: 0; color: var(--muted); cursor: pointer; padding: .25rem; font-size: 1rem; }
.copy-btn:not(.btn):hover { color: var(--gold-dark); }

.announce-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.announce.pinned { border-left: 5px solid var(--gold); }
.pin { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-dark); margin-bottom: .4rem; }

/* Services */
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.service-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.service-list li { display: grid; grid-template-columns: 7rem 1fr auto; gap: .75rem; align-items: center; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: .5rem; }
.service-list li.is-next { border-color: var(--green); box-shadow: 0 0 0 2px rgba(31,107,53,.2); }
.svc-day { font-weight: 700; color: var(--gold-dark); }
.svc-name { font-weight: 600; display: flex; flex-direction: column; }
.svc-name small { color: var(--muted); font-weight: 400; }
.svc-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 520px) { .service-list li { grid-template-columns: 1fr auto; } .svc-day { grid-column: 1 / -1; } }
.scripture { margin: 0; padding: 2rem; background: linear-gradient(135deg, var(--brown-800), var(--brown-700)); color: #f3e9d6; border-radius: var(--radius); position: relative; box-shadow: var(--shadow-lg); }
.scripture > i { color: var(--gold); font-size: 1.8rem; }
.scripture p { font-family: var(--heading); font-size: 1.15rem; line-height: 1.6; }
.scripture cite { color: var(--gold-light); font-style: normal; font-weight: 700; }

/* Visit */
.address { font-size: 1.1rem; font-weight: 600; }
.map-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); aspect-ratio: 4/3; }
.map-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

/* YouTube page */
.yt-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.yt-head h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.yt-head h1 i { color: var(--red); }
.yt-status { padding: .4rem .9rem; border-radius: 999px; font-weight: 700; font-size: .92rem; background: var(--bg-alt); border: 1px solid var(--border); }
.yt-status.status-live { background: var(--red); color: #fff; border-color: var(--red); }
.yt-status.status-upcoming { background: var(--gold); color: var(--brown-900); }
.yt-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.yt-layout.with-chat { grid-template-columns: 1fr 360px; }
@media (max-width: 980px) { .yt-layout.with-chat { grid-template-columns: 1fr; } }
.player-wrap { aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.player-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-empty { height: 100%; display: grid; place-items: center; align-content: center; color: #aaa; text-align: center; }
.player-empty i { font-size: 4rem; color: var(--red); }
.chat-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); min-height: 420px; }
.chat-wrap iframe { width: 100%; height: 100%; min-height: 420px; border: 0; }
.yt-title { margin-top: 1rem; font-family: var(--body); font-weight: 700; font-size: 1.3rem; }
.recent-title { margin-top: 2.5rem; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.video-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s; }
.video-card:hover { transform: translateY(-3px); }
.video-card.current { border-color: var(--red); box-shadow: 0 0 0 2px rgba(212,42,31,.3); }
.thumb { position: relative; aspect-ratio: 16/9; background: #000; display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb i { position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; display: grid; place-items: center; background: rgba(212,42,31,.9); color: #fff; border-radius: 50%; opacity: 0; transition: opacity .15s; }
.video-card:hover .thumb i { opacity: 1; }
.video-meta { padding: .7rem .85rem; display: flex; flex-direction: column; gap: .2rem; }
.video-title { font-weight: 600; font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; }
.form label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-weight: 400;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: .9rem 1.1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; }
.alert ul { margin: 0; padding-left: 1.2rem; }
.alert-success { background: #e7f4ea; border-color: #9bcfa7; color: #154d26; }
.alert-error { background: #fbe9e7; border-color: #f0a9a1; color: #8a1c13; }
.alert-info { background: #fdf6e3; border-color: #ead18a; color: #6b4f0e; }

/* Footer */
.site-footer { background: var(--brown-900); color: #d9cbb0; padding: 2.5rem 0 1rem; border-top: 3px solid var(--gold); margin-top: 0; }
.site-footer a { color: var(--gold-light); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer h3 { color: var(--gold); font-size: 1rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.footer-logo { float: left; margin-right: .8rem; }
.footer-name { font-family: var(--heading); font-size: .95rem; color: #f3e9d6; }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { display: flex; gap: .6rem; margin-bottom: .5rem; }
.footer-list i { color: var(--gold); margin-top: .3rem; }
.social-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.social-row a { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: rgba(212,165,55,.15); font-size: 1.15rem; }
.social-row a:hover { background: var(--gold); color: var(--brown-900); text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; border-top: 1px solid rgba(212,165,55,.2); margin-top: 2rem; padding-top: 1rem; font-size: .85rem; }
.admin-link { opacity: .7; }

/* Toast */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--brown-800); color: #fff; padding: .7rem 1.2rem; border-radius: 10px; box-shadow: var(--shadow-lg); opacity: 0; transition: .25s; z-index: 200; border: 1px solid var(--gold); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .hero-actions, .map-wrap, .next-service { display: none; } }

/* Prevent long words / grids from causing sideways scroll on phones */
html, body { overflow-x: hidden; }
h1, h2, h3, p { overflow-wrap: break-word; }
.link-grid, .online-grid, .announce-grid, .video-grid, .footer-grid, .two-col > * { min-width: 0; }
@media (max-width: 520px) {
  .link-grid, .online-grid, .announce-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.45rem; }
  .countdown span { min-width: 2.8rem; }
}
