/* =========================================================
   BeLoved Encounters — Editorial Illuminated Design System
   v2 — larger, more accessible text
   ========================================================= */

:root {
  --ink: #0f1729;
  --ink-soft: #2a324b;
  --parchment: #f7f0df;
  --parchment-deep: #ede2c8;
  --whisper: #fbf7ec;
  --gold: #b88b3a;
  --gold-bright: #d4a953;
  --gold-deep: #8a651f;
  --copper: #8b4513;
  --rule: rgba(15, 23, 41, 0.12);
  --rule-strong: rgba(15, 23, 41, 0.28);

  --serif-display: "Cormorant Garamond", "Times New Roman", serif;
  --serif-body: "EB Garamond", Georgia, serif;
  --sans-meta: "Cormorant SC", "Cormorant Garamond", serif;

  --measure: 68ch;
  --container: 1200px;
  --radius: 2px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 18px; }

body {
  margin: 0;
  font-family: var(--serif-body);
  font-size: 1.35rem;          /* ~24px, was 19px */
  line-height: 1.7;
  color: var(--ink);
  background: var(--parchment);
  background-image:
    radial-gradient(at 15% 8%, rgba(212, 169, 83, 0.10) 0px, transparent 50%),
    radial-gradient(at 85% 92%, rgba(139, 69, 19, 0.08) 0px, transparent 55%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.35  0 0 0 0 0.18  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--gold-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s ease;
}
a:hover { color: var(--copper); }

/* ---------- Typography (all sizes bumped up) ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .6em;
}
h1 { font-size: clamp(3.2rem, 7vw, 6rem); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(2.4rem, 4.2vw, 3.6rem); line-height: 1.15; }
h3 { font-size: clamp(1.7rem, 2.8vw, 2.4rem); line-height: 1.25; }
h4 { font-size: 1.4rem; font-weight: 600; }

.eyebrow {
  font-family: var(--sans-meta);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.95rem;
  color: var(--gold-deep);
  font-weight: 600;
}

.scripture {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 38em;
}
.scripture cite {
  display: block;
  font-style: normal;
  font-family: var(--sans-meta);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--gold-deep);
  margin-top: 1rem;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

section { padding-block: clamp(3rem, 7vw, 6rem); }

.divider {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule-strong), transparent);
  margin: 0;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 240, 223, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
  gap: 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .9rem;
  text-decoration: none;
  color: var(--ink);
}
.brand img { width: 64px; height: auto; }
.brand-name {
  font-family: var(--serif-display);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
}
.brand-tag {
  font-family: var(--sans-meta);
  font-size: 0.8rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: block;
  margin-top: 4px;
}
.nav-links {
  display: flex;
  list-style: none;
  margin: 0; padding: 0;
  gap: 2rem;
}
.nav-links a {
  font-family: var(--sans-meta);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  padding-block: .25rem;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule-strong);
  width: 46px; height: 46px;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  margin: 0 auto;
  position: relative;
}
.nav-toggle span::before { content: ""; position: absolute; top: -6px; left: 0; right: 0; }
.nav-toggle span::after  { content: ""; position: absolute; top:  6px; left: 0; right: 0; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--parchment);
    border-bottom: 1px solid var(--rule);
    padding: 1rem 1.5rem 2rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--rule); }
  .nav-links a { display: block; padding-block: 1.1rem; font-size: 1.1rem; }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(4rem, 9vw, 8rem) clamp(3rem, 6vw, 5rem);
  position: relative;
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: end;
}
@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.2fr 1fr; gap: 4rem; }
}
.hero h1 {
  margin: 1rem 0 1.5rem;
  font-style: italic;
}
.hero h1 em {
  font-style: normal;
  color: var(--gold-deep);
}
.hero-image { position: relative; }
.hero-image img {
  border: 1px solid var(--rule-strong);
  box-shadow: 0 30px 60px -25px rgba(15, 23, 41, 0.35);
  border-radius: var(--radius);
}
.hero-image::before {
  content: "";
  position: absolute;
  inset: 16px -16px -16px 16px;
  border: 1px solid var(--gold);
  z-index: -1;
  border-radius: var(--radius);
}

/* Ornamental flourish */
.flourish {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
}
.flourish::before, .flourish::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.flourish span {
  font-family: var(--serif-display);
  color: var(--gold-deep);
  font-size: 1.6rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--sans-meta);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 1rem;
  font-weight: 600;
  padding: 1.1rem 2rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--whisper);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all .25s ease;
  cursor: pointer;
}
.btn:hover {
  background: var(--gold-deep);
  border-color: var(--gold-deep);
  color: var(--whisper);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--whisper);
}
.btn-gold {
  background: var(--gold-deep);
  border-color: var(--gold-deep);
}
.btn-gold:hover {
  background: var(--ink);
  border-color: var(--ink);
}

/* ---------- Card grid (CTAs) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 2.5rem;
}
@media (min-width: 720px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: block;
  background: var(--whisper);
  border: 1px solid var(--rule-strong);
  padding: 2.25rem 2rem;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  border-radius: var(--radius);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -20px rgba(15, 23, 41, 0.4);
  border-color: var(--gold);
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 32px; height: 1px;
  background: var(--gold);
  transition: width .3s ease;
}
.card:hover::before { width: 100%; }
.card .eyebrow { display: block; margin-bottom: .75rem; }
.card h3 { margin: 0 0 .75rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: 1.2rem; }
.card-arrow {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--sans-meta);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.95rem;
  color: var(--gold-deep);
}
.card-arrow::after {
  content: " →";
  transition: margin-left .25s ease;
  display: inline-block;
}
.card:hover .card-arrow::after { margin-left: 6px; }

/* ---------- Posts list ---------- */
.posts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 800px) { .posts { grid-template-columns: 1fr 1fr; } }

.post-card {
  display: grid;
  gap: 1rem;
  text-decoration: none;
  color: var(--ink);
}
.post-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--parchment-deep);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.post-card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.post-card:hover .post-card-image img { transform: scale(1.04); }
.post-card h3 { margin: 0; transition: color .25s ease; }
.post-card:hover h3 { color: var(--gold-deep); }
.post-card p { margin: 0; color: var(--ink-soft); font-size: 1.2rem; }

/* ---------- Article ---------- */
.article-header {
  padding-block: clamp(3rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem);
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-family: var(--sans-meta);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold-deep);
  margin-top: 1.5rem;
}
.article-body {
  max-width: var(--measure);
  margin-inline: auto;
  padding-block: clamp(2rem, 5vw, 4rem);
}
.article-body p,
.article-body ul,
.article-body ol { margin: 0 0 1.25em; font-size: 1.35rem; line-height: 1.8; }
.article-body h2 {
  margin-top: 2.5em;
  padding-top: 1em;
  border-top: 1px solid var(--rule);
}
.article-body img {
  margin: 2.5em auto;
  border: 1px solid var(--rule-strong);
  box-shadow: 0 20px 40px -20px rgba(15, 23, 41, 0.3);
  border-radius: var(--radius);
}
.article-body figure { margin: 2.5em 0; }
.article-body figcaption {
  text-align: center;
  font-family: var(--sans-meta);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold-deep);
  margin-top: 1rem;
}
.dropcap::first-letter {
  font-family: var(--serif-display);
  font-size: 4.5em;
  float: left;
  line-height: 0.85;
  padding: 0.1em 0.12em 0 0;
  color: var(--gold-deep);
  font-weight: 600;
}

/* ---------- Section headings ---------- */
.section-head {
  text-align: center;
  max-width: 50em;
  margin: 0 auto 3rem;
}
.section-head .eyebrow { display: block; margin-bottom: 1rem; }

/* ---------- Image gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-block: 2.5rem;
}
.gallery figure {
  margin: 0;
  border: 1px solid var(--rule-strong);
  background: var(--whisper);
  padding: 0.5rem;
  border-radius: var(--radius);
}
.gallery img {
  width: 100%; height: 280px; object-fit: cover;
  border-radius: var(--radius);
}

/* ---------- Video embed ---------- */
.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px -25px rgba(15, 23, 41, 0.45);
}
.video-wrap iframe,
.video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--whisper);
  flex-direction: column;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
label {
  display: block;
  font-family: var(--sans-meta);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold-deep);
  margin-bottom: .5rem;
  font-weight: 600;
}
input, textarea, select {
  width: 100%;
  font-family: var(--serif-body);
  font-size: 1.2rem;
  padding: 1rem 1.1rem;
  background: var(--whisper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(184, 139, 58, 0.18);
}
textarea { resize: vertical; min-height: 180px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--parchment);
  padding-block: 4rem 2rem;
  margin-top: 4rem;
  font-size: 1.15rem;
}
.site-footer a { color: var(--gold-bright); }
.site-footer a:hover { color: var(--whisper); }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}
.footer-grid h4 {
  font-family: var(--sans-meta);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 1rem;
  color: var(--gold-bright);
  margin: 0 0 1rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid ul li { margin-bottom: .6rem; }
.footer-grid p { color: rgba(247, 240, 223, 0.75); margin: 0 0 1rem; }
.footer-bottom {
  border-top: 1px solid rgba(212, 169, 83, 0.25);
  margin-top: 3rem;
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 1rem;
  color: rgba(247, 240, 223, 0.6);
}

/* ---------- Page reveal animation ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(20px); animation: reveal .9s ease forwards; }
  .reveal[data-delay="1"] { animation-delay: 0.1s; }
  .reveal[data-delay="2"] { animation-delay: 0.25s; }
  .reveal[data-delay="3"] { animation-delay: 0.4s; }
  .reveal[data-delay="4"] { animation-delay: 0.55s; }
  @keyframes reveal {
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ---------- Skip link (accessibility) ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--whisper);
  padding: 1rem;
  z-index: 100;
}
.skip:focus { left: 0; }

/* =========================================================
   Exit-Intent Popup — Host a Home Church
   ========================================================= */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 41, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity .35s ease;
}
.popup-overlay.open {
  display: flex;
  opacity: 1;
}
.popup-modal {
  position: relative;
  background: var(--parchment);
  background-image:
    radial-gradient(at 15% 8%, rgba(212, 169, 83, 0.12) 0px, transparent 50%),
    radial-gradient(at 85% 92%, rgba(139, 69, 19, 0.08) 0px, transparent 55%);
  border: 1px solid var(--gold);
  box-shadow: 0 40px 80px -20px rgba(15, 23, 41, 0.6);
  border-radius: var(--radius);
  max-width: 640px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  animation: popupIn .45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.popup-modal::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--gold);
  pointer-events: none;
  border-radius: var(--radius);
  opacity: 0.5;
}
@keyframes popupIn {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.popup-content {
  padding: clamp(2rem, 4vw, 3rem);
  position: relative;
  z-index: 1;
}
.popup-content h2 {
  margin: 1rem 0 1rem;
  color: var(--ink);
}
.popup-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 44px; height: 44px;
  background: var(--whisper);
  border: 1px solid var(--rule-strong);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  border-radius: 50%;
  z-index: 2;
  transition: all .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif-display);
}
.popup-close:hover {
  background: var(--ink);
  color: var(--whisper);
  transform: rotate(90deg);
}
.popup-content .form-grid label {
  font-size: 0.85rem;
}
.popup-content .form-grid input,
.popup-content .form-grid textarea {
  font-size: 1.05rem;
  padding: 0.7rem 0.85rem;
}
.popup-content .form-grid textarea {
  min-height: 80px;
}
@media (max-width: 640px) {
  .popup-modal { max-height: 96vh; }
  .popup-content { padding: 1.5rem 1.25rem 2rem; }
  .popup-content h2 { font-size: 1.9rem; }
}
