:root {
  --ink: #1c1915;
  --muted: #5e584e;
  --paper: #f7f3eb;
  --card: #fffdf8;
  --pine: #1f4d3a;
  --pine-dark: #16382a;
  --gold: #b0893e;
  --line: #e4dccb;
  --danger: #8c3a2f;
  --shadow: 0 18px 40px rgba(28, 25, 21, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.5;
}
img { max-width: 100%; }
a { color: var(--pine); }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.2; font-weight: 600; }
.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.site-header, .portal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}
.brand { color: var(--ink); text-decoration: none; font-family: Georgia, serif; font-size: 1.35rem; }
.brand span { color: var(--gold); }
.nav-toggle { display: none; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; }
.site-nav { display: flex; gap: 18px; align-items: center; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover { color: var(--pine); }
.hero { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 32px; align-items: center; padding: 28px 0 48px; }
.eyebrow { letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.78rem; color: var(--gold); margin-bottom: 8px; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); margin: 0 0 12px; }
.lede { font-size: 1.15rem; color: var(--muted); }
.actions, .stack { display: flex; gap: 12px; flex-wrap: wrap; }
.button, button, .site-nav .button {
  display: inline-block;
  background: var(--pine);
  color: white;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
}
.button.secondary, button.secondary { background: transparent; color: var(--pine); border: 1px solid var(--pine); }
.button.danger { background: var(--danger); }
.grid-3, .grid-2 { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h2, .panel h2 { margin-top: 0; }
.section { padding: 10px 0 36px; }
.quote-band {
  background: var(--pine);
  color: #f7f3eb;
  border-radius: 28px;
  padding: 28px;
}
.quote-band a { color: white; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); }
label { display: block; font-size: 0.92rem; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d9d0c0;
  background: white;
  font: inherit;
  color: var(--ink);
}
textarea { min-height: 110px; }
.field-row { display: grid; grid-template-columns: 1.4fr 0.8fr 0.7fr 0.7fr; gap: 8px; }
.validation-summary-errors, .field-error, .input-validation-error + span { color: var(--danger); }
.banner { background: #fff4d8; border: 1px solid #efd7a0; border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 0 0 18px; list-style: none; }
.steps li { padding: 6px 10px; border-radius: 999px; background: white; border: 1px solid var(--line); font-size: 0.85rem; }
.steps li.on { background: var(--pine); color: white; border-color: var(--pine); }
.repeat-row { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.check-list { display: grid; gap: 8px; }
.check-list label { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.check-list input, label input[type="checkbox"], label input[type="radio"] { width: auto; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.portal-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.portal-nav { background: var(--pine-dark); color: #f7f3eb; padding: 20px 16px; }
.portal-nav a { display: block; color: #f7f3eb; text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.portal-nav a.on, .portal-nav a:hover { background: rgba(255,255,255,0.12); }
.portal-main { padding: 20px 24px 48px; }
.church-body { background: #e7e1d6; }
.church-exit {
  width: min(480px, 100%); margin: 0 auto; padding: 10px 18px;
  background: var(--pine, #1F4D3A); color: white;
}
.church-exit a { color: white; text-decoration: none; font-size: 0.92rem; font-weight: 600; }
.church-exit a:hover { text-decoration: underline; }
.church-app { width: min(480px, 100%); min-height: 100vh; margin: 0 auto; background: var(--paper); padding-bottom: 88px; }

/* Fixed install reminder for browsers that are not already running as an installed PWA. */
.pwa-install-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  width: min(480px, 100%);
  margin: 0 auto;
  display: none;
  grid-template-columns: 44px 1fr auto;
  gap: 10px 12px;
  align-items: center;
  padding: 10px 12px;
  background: #16382b;
  color: #f7f3eb;
  box-shadow: 0 8px 24px rgba(22, 56, 43, 0.28);
}
.pwa-install-banner.is-visible { display: grid; }
.pwa-install-banner img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fff;
}
.pwa-install-banner strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.25;
}
.pwa-install-banner p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #d7e5dc;
}
.pwa-install-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.pwa-install-banner button {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.pwa-install-banner [data-pwa-install] {
  background: var(--gold, #b0893e);
  color: #fff;
}
.pwa-install-banner [data-pwa-dismiss] {
  background: transparent;
  color: #d7e5dc;
  border: 1px solid rgba(215, 229, 220, 0.45);
}
body.has-pwa-install-banner .church-exit { margin-top: 0; }
.church-app header, .church-app main { padding: 18px 18px 0; }
.banner a { color: var(--pine); font-weight: 600; }
.church-nav {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(480px, 100%); display: grid; grid-template-columns: repeat(5, 1fr);
  background: white; border-top: 1px solid var(--line);
}
.church-nav a { text-align: center; text-decoration: none; color: var(--muted); padding: 12px 4px 16px; font-size: 0.82rem; }
.church-nav a.on { color: var(--pine); font-weight: 700; }

/* Clickable YouTube (or other video) sermon previews on the hosted church app. */
.sermon-grid { display: grid; gap: 14px; margin-top: 14px; }
.sermon-card {
  display: grid;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(28, 25, 21, 0.06);
}
.sermon-card-static { pointer-events: none; }
.sermon-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #1a1714;
}
.sermon-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sermon-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(31, 77, 58, 0.92);
  color: #fff;
  font-size: 1rem;
  padding-left: 3px;
}
.sermon-meta {
  display: grid;
  gap: 4px;
  padding: 0 14px 14px;
}
.sermon-meta strong { font-size: 1.02rem; color: var(--ink); }
.sermon-meta span { font-size: 0.88rem; color: var(--muted); }
.honeypot { position: absolute; left: -9999px; }
.qr-swal-popup .qr-swal-image {
  display: block;
  margin: 0 auto 12px;
  background: #fff;
  border: 1px solid #ddd4c3;
  border-radius: 12px;
  padding: 10px;
}
.qr-swal-popup .qr-swal-caption {
  margin: 0;
  font-size: 0.92rem;
  color: #5c564c;
  word-break: break-all;
}
.price { font-size: 1.4rem; margin: 0; }
@media (max-width: 860px) {
  .hero, .grid-3, .grid-2, .portal-shell, .field-row { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; flex-direction: column; align-items: flex-start; position: absolute; right: 16px; top: 64px; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 12px; z-index: 2; }
  .site-nav.open { display: flex; }
  .site-header { position: relative; }
}
