/* =========================================================
   Hội Thánh Nguồn Sống Atlanta
   Clean professional stylesheet — mobile first
   ========================================================= */

:root {
  --navy: #123A6B;
  --navy-mid: #1D3968;
  --navy-light: #2A4A78;
  --navy-dark: #0C274C;
  --gold: #F0C75E;
  --gold-hover: #DDA63A;
  --gold-soft: #FFE9A8;
  --cream: #F7F3EB;
  --cream-dark: #EFE8DA;
  --white: #FFFFFF;
  --text: #1C1917;
  --text-muted: #5E574D;
  --line: rgba(18, 58, 107, 0.10);
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 8px 28px rgba(12, 39, 76, 0.10);
  --shadow-lg: 0 16px 48px rgba(12, 39, 76, 0.16);
  --header-h: 76px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --max: 1140px;
  --ease: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--cream);
  line-height: 1.65;
  font-size: 15.5px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button {
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
html { scroll-padding-top: calc(var(--header-h) + 10px); }
* { -webkit-tap-highlight-color: transparent; }
ul { list-style: none; }
iframe { border: 0; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 20000;
  background: var(--gold);
  color: var(--navy-dark);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { top: calc(var(--safe-top) + 12px); }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  transition: transform var(--ease), background var(--ease), box-shadow var(--ease), border-color var(--ease);
  text-align: center;
}
.btn i { font-size: 0.95em; }
.btn-primary {
  background: var(--gold);
  color: var(--navy-dark);
  border-color: var(--gold);
  box-shadow: 0 6px 18px rgba(221, 166, 58, 0.28);
}
.btn-primary:hover {
  background: var(--gold-hover);
  border-color: var(--gold-hover);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.55);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--white);
}
.btn-full { width: 100%; }

/* ---------- Header ---------- */
/* Production-stable header: keep the exact same size and position at every
   scroll offset. Do not shrink, hide, or translate the header on scroll. */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(18, 58, 107, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: calc(10px + var(--safe-top)) 0 10px;
  box-shadow: 0 6px 18px rgba(6, 25, 50, 0.10);
  transition: none;
  transform: translateZ(0);
  will-change: auto;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  min-width: 0;
}
.logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 4px;
  flex-shrink: 0;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.logo-text strong {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--gold);
}
.logo-text span {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  opacity: 0.82;
}

.nav-desktop { display: none; }
.btn-donate { display: none; }

.menu-toggle {
  margin-left: auto;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.10);
  color: #fff;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Mobile menu ---------- */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 40, 0.58);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--ease), visibility var(--ease);
}
.menu-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu {
  position: fixed;
  top: 0; right: 0;
  width: min(86vw, 360px);
  height: 100vh;
  height: 100dvh;
  background: var(--navy);
  z-index: 1200;
  transform: translateX(105%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: calc(16px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
  box-shadow: -16px 0 40px rgba(0,0,0,0.28);
}
.mobile-menu.open { transform: translateX(0); }

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.mobile-menu-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,0.10);
  color: #fff;
  font-size: 1.2rem;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.98rem;
}
.mobile-nav a.active,
.mobile-nav a:hover {
  background: rgba(240, 199, 94, 0.14);
  color: var(--gold);
}
.mnav-ic {
  width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}
.icon-homes {
  position: relative;
  width: 22px;
  height: 18px;
  display: inline-block;
}
.icon-homes i {
  position: absolute;
  font-size: 0.58rem;
  line-height: 1;
}
.icon-homes i:nth-child(1) {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}
.icon-homes i:nth-child(2) {
  bottom: 0;
  left: 0;
}
.icon-homes i:nth-child(3) {
  bottom: 0;
  right: 0;
}
.mobile-menu-footer { margin-top: auto; padding-top: 18px; }

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(var(--header-h) + var(--safe-top) + 24px) 20px 32px;
  text-align: center;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(12, 39, 76, 0.80) 0%, rgba(18, 58, 107, 0.84) 55%, rgba(12, 39, 76, 0.92) 100%),
    url("../images/church-bg.jpg") center/cover no-repeat;
}
.hero-content { width: 100%; max-width: 760px; margin: 0 auto 22px; }
.hero h1,
.hero-title-gold {
  font-family: var(--serif);
  color: var(--gold);
  font-size: clamp(1.7rem, 5.8vw, 2.85rem);
  font-weight: 700;
  line-height: 1.16;
  margin-bottom: 12px;
}
.name-gold { color: inherit; }
.home-title-en[hidden],
.home-title-vi[hidden] { display: none !important; }
.home-title-en .home-title-line {
  display: block;
  white-space: nowrap;
}
html[lang="en"] .home-hero-title {
  font-size: clamp(1.3rem, 5vw, 2.85rem);
}

/* English About hero uses the approved church name without a duplicate “Church” label. */
.about-title-en[hidden],
.about-title-vi[hidden] { display: none !important; }
.about-title-en .about-title-line {
  display: block;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .about-title-en .about-title-line { white-space: normal; }
}
.hero-desc {
  color: rgba(255,255,255,0.92);
  font-size: clamp(0.92rem, 3.2vw, 1.08rem);
  max-width: 540px;
  margin: 0 auto;
}
.mission-line { display: block; }
.hero-btns {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  margin: 20px auto 0;
  max-width: 420px;
}
.hero-btns .btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 12px;
  white-space: nowrap;
}

.hero-slider {
  width: min(920px, 100%);
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16 / 10;
  background: #0C274C;
}
.hero-slides { position: relative; width: 100%; height: 100%; }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.hero-slide.active { opacity: 1; z-index: 1; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-slider-dots {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.hero-slider-dots .dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.45);
}
.hero-slider-dots .dot.active {
  width: 28px;
  background: var(--gold);
}
.hero-slider-dots .dot {
  position: relative;
}
.hero-slider-dots .dot::before {
  content: "";
  position: absolute;
  inset: -8px;
}
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(12, 39, 76, 0.72);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
}
.slider-nav i { color: #fff; font-size: 0.95rem; line-height: 1; }
.slider-nav:hover { background: rgba(12, 39, 76, 0.92); }
.slider-prev { left: 10px; }
.slider-next { right: 10px; }

/* ---------- Page hero ---------- */
.page-hero {
  background:
    linear-gradient(rgba(12, 39, 76, 0.86), rgba(18, 58, 107, 0.90)),
    url("../images/church-bg.jpg") center/cover no-repeat;
  color: #fff;
  text-align: center;
  padding: calc(var(--header-h) + var(--safe-top) + 36px) 20px 40px;
}
.page-hero h1 {
  color: var(--gold);
  font-size: clamp(1.85rem, 6vw, 2.9rem);
  margin-bottom: 10px;
}
.page-hero h1.hero-title-gold { color: var(--gold); }
.page-hero p,
.page-hero .hero-desc {
  color: rgba(255,255,255,0.92);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.02rem;
}

/* ---------- Sections ---------- */
section { position: relative; }
.values,
.about-intro,
.ministries,
.cells,
.contact-section,
.events,
.sermon { padding: 44px 0; background: var(--cream); }

.section-title {
  text-align: center;
  font-size: clamp(1.5rem, 3.8vw, 2.1rem);
  margin-bottom: 10px;
  color: var(--navy);
}
.section-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 2px;
  margin: 10px auto 0;
  background: var(--gold);
  border-radius: 2px;
}
.title-gold { color: var(--gold) !important; }
.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 32px;
}
.sub-line { display: block; }

.intro-copy {
  max-width: 740px;
  margin: 0 auto 36px;
}
.intro-copy p {
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.72;
  font-size: 0.98rem;
}

/* ---------- Value cards ---------- */
.values-grid {
  display: grid;
  gap: 16px;
}
.value-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}
.value-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(240, 199, 94, 0.16);
  color: var(--navy);
  font-size: 1.25rem;
}
.value-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.value-card p { color: var(--text-muted); font-size: 0.96rem; }
@media (hover: hover) {
  .value-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: rgba(18, 58, 107, 0.16); }
}
.val-line { display: block; }

/* ---------- Ministries ---------- */
.ministry-grid {
  display: grid;
  gap: 18px;
}
.ministry-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform var(--ease), box-shadow var(--ease);
}
@media (hover: hover) {
  .ministry-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
  }
}
.ministry-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.ministry-card { isolation: isolate; }
.ministry-card img { display: block; }
@media (hover: hover) {
  .ministry-card:hover img { transform: scale(1.04); }
}
.ministry-body { padding: 18px 18px 22px; }
.ministry-body h3 { margin-bottom: 8px; font-size: 1.2rem; }
.ministry-body p { color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Events ---------- */
.section-card {
  background: var(--navy);
  color: #fff;
  border-radius: 16px;
  padding: 24px 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.08);
}
.events-card,
.sermon-section-card { max-width: 820px; margin: 0 auto; }
.events-card .section-title,
.sermon-section-card .section-title { color: var(--gold); }
.events-card .section-subtitle,
.sermon-section-card .section-subtitle { color: rgba(255,255,255,0.82); }

.event-list { display: grid; gap: 12px; }
.event-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px;
  color: #fff;
}
.event-date {
  flex: 0 0 86px;
  background: rgba(255,255,255,0.10);
  border-radius: 12px;
  text-align: center;
  padding: 10px 6px;
}
.event-date .day {
  display: block;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
}
.event-date .month {
  display: block;
  color: rgba(255,255,255,0.75);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  margin-top: 2px;
}
.event-info { flex: 1; text-align: left; min-width: 0; }
.event-info h3 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.event-meta {
  color: rgba(255,255,255,0.78);
  font-size: 0.9rem;
}
.event-meta svg { color: var(--gold); }

/* ---------- Sermon ---------- */
.sermon-card {
  background: var(--navy-mid);
  border-radius: 16px;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}
.sermon-body {
  padding: 22px 20px 26px;
  text-align: center;
}
.sermon-body h3 {
  color: var(--gold);
  font-size: 1.25rem;
  margin-bottom: 8px;
}
.sermon-meta {
  color: rgba(255,255,255,0.85);
  margin-bottom: 16px;
}


.sermon-card-live {
  background: var(--navy-mid);
}
.sermon-video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #071a33;
  overflow: hidden;
}
.latest-sermon-frame,
.latest-sermon-player,
.latest-sermon-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #071a33;
}
.sermon-resolver-status {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: #071a33;
  color: #fff;
}
.sermon-resolver-status[hidden] { display: none; }
.sermon-status-icon {
  color: var(--gold);
  font-size: 1.65rem;
  line-height: 1;
}
.sermon-resolver-status strong {
  color: var(--gold);
  font-size: clamp(1rem, 2.5vw, 1.18rem);
}
.sermon-resolver-status span {
  max-width: 590px;
  color: rgba(255,255,255,0.84);
  font-size: 0.9rem;
  line-height: 1.5;
}
.sermon-status-link { margin-top: 4px; }
.sermon-auto-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(240, 199, 94, 0.42);
  border-radius: 999px;
  background: rgba(240, 199, 94, 0.10);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.sermon-auto-badge i { font-size: 0.7rem; }

/* ---------- Cells ---------- */
.cells-layout {
  display: grid;
  gap: 16px;
}
.cell-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cell-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px;
  color: inherit;
  box-shadow: 0 2px 10px rgba(18,58,107,0.05);
  min-height: 68px;
}
.cell-item:hover {
  border-color: rgba(18, 58, 107, 0.22);
}
.cell-item.active {
  background: rgba(18, 58, 107, 0.08);
  box-shadow: inset 4px 0 0 var(--gold);
  border-color: rgba(18, 58, 107, 0.16);
}
.cell-info { min-width: 0; }
.cell-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(240, 199, 94, 0.18);
  color: var(--navy);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.cell-info h4 {
  font-size: 0.98rem;
  color: var(--navy);
  line-height: 1.2;
}
.cell-kicker {
  display: block;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.map-container,
.map-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 280px;
  background: #d9e2ee;
  box-shadow: var(--shadow);
}
.map-container iframe,
.map-wrap iframe {
  width: 100%;
  height: 320px;
}
.open-maps-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: #fff;
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.16);
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}
.contact-card {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-height: 116px;
  background: linear-gradient(145deg, #ffffff 0%, #fbfcfe 100%);
  border-radius: 18px;
  padding: 18px;
  text-align: left;
  border: 1px solid rgba(18, 58, 107, 0.10);
  box-shadow: 0 10px 30px rgba(13, 42, 77, 0.08);
  overflow: hidden;
}
.contact-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--gold);
  opacity: 0.95;
}
.contact-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(240, 199, 94, 0.18);
  border: 1px solid rgba(240, 199, 94, 0.42);
  color: var(--navy);
  font-size: 1.05rem;
}
.contact-card-content { min-width: 0; }
.contact-card h3 {
  font-family: var(--font);
  font-size: 0.76rem;
  line-height: 1.25;
  letter-spacing: 0.09em;
  margin: 0 0 7px;
  color: var(--navy);
}
.contact-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}
.contact-card-link { color: inherit; text-decoration: none; }
.contact-card-link p { color: var(--navy); font-weight: 600; }
.contact-card-arrow {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--navy);
  background: rgba(18, 58, 107, 0.06);
  font-size: 0.7rem;
  opacity: 0.65;
  transition: transform var(--ease), background-color var(--ease), opacity var(--ease);
}
.contact-card-link:hover .contact-card-arrow,
.contact-card-link:focus-visible .contact-card-arrow {
  transform: translateX(2px);
  background: rgba(240, 199, 94, 0.24);
  opacity: 1;
}

/* ---------- CTA ---------- */
.cta-band {
  background: var(--cream);
  padding: 8px 16px 48px;
}
.cta-card,
.page-cta-card,
.ministries-cta-card {
  background: var(--navy);
  color: #fff;
  border-radius: 18px;
  padding: 28px 20px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.10);
}
.cta-card h2,
.page-cta-card h2,
.ministries-cta-card h2 {
  color: var(--gold);
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  margin-bottom: 12px;
}
.cta-card p,
.page-cta-card p,
.ministries-cta-card p {
  color: rgba(255,255,255,0.92);
  margin-bottom: 20px;
  font-size: 1.02rem;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.92);
  padding: 40px 0 18px;
}
.footer-grid {
  display: grid;
  gap: 28px;
}
.footer .logo { margin-bottom: 12px; }
.footer .logo img { width: 42px; height: 42px; }
.footer .logo-text strong { font-size: 0.88rem; }
.footer .logo-text span { font-size: 0.62rem; }
.footer-mission-text {
  margin: 0 0 16px;
  color: rgba(255,255,255,0.82);
  font-size: 0.9rem;
  line-height: 1.55;
}
.fm-line { display: inline; }
.fm-line:not(:last-child)::after { content: " "; }
.social-links {
  display: flex;
  gap: 8px;
}
.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.85rem;
}
.social-links a:hover { background: var(--gold); color: var(--navy-dark); }

.footer-links,
.footer-contact { min-width: 0; }
.footer-links h4,
.footer-contact h4 {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin: 0 0 14px;
}
.footer-links ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  row-gap: 8px;
}
@media (min-width: 800px) {
  .footer-links ul { grid-template-columns: 1fr; }
}
.footer-links a {
  display: inline-block;
  color: rgba(255,255,255,0.9);
  padding: 2px 0;
  font-size: 0.88rem;
  font-weight: 500;
}
.footer-links a:hover { color: var(--gold); }
.footer-contact-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  margin: 0 0 10px;
  color: rgba(255,255,255,0.9);
  font-size: 0.88rem;
  line-height: 1.45;
}
.footer-contact-item i {
  color: var(--gold);
  width: 18px;
  margin-top: 4px;
  font-size: 0.82rem;
  text-align: center;
}
.footer-bottom {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.10);
  text-align: center;
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.15fr 1fr 1.15fr;
    gap: 32px 36px;
    align-items: start;
  }
  .footer-links h4,
  .footer-contact h4 {
    min-height: 0;
  }
}

/* ---------- Back to top ---------- */
.back-top {
  position: fixed;
  right: 16px;
  bottom: calc(16px + var(--safe-bottom));
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: var(--ease);
  z-index: 900;
}
.back-top.visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ---------- Contact modal ---------- */
.contact-modal[hidden] { display: none; }
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
}
.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 40, 0.55);
}
.contact-modal-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 420px);
  margin: 16vh auto 0;
  background: #fff;
  border-radius: 18px;
  padding: 28px 22px 22px;
  box-shadow: var(--shadow-lg);
}
.contact-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: none;
  font-size: 1.6rem;
  color: var(--text-muted);
}
.contact-modal-sub { color: var(--text-muted); margin: 6px 0 16px; }
.contact-modal-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 420px) {
  .contact-modal-row { grid-template-columns: 64px 1fr; }
  .contact-modal-copy { justify-self: start; }
}
.contact-modal-label { font-size: 0.8rem; color: var(--text-muted); }
.contact-modal-value { font-weight: 600; color: var(--navy); }
.contact-modal-copy {
  border: 0;
  background: var(--cream);
  color: var(--navy);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}
.contact-modal-note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .values-grid { grid-template-columns: repeat(3, 1fr); }
  .ministry-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .contact-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 164px;
    padding: 22px 20px;
    text-align: center;
  }
  .contact-card::before {
    inset: 0 0 auto 0;
    width: auto;
    height: 4px;
  }
  .contact-card-icon { margin-bottom: 2px; }
  .contact-card-arrow {
    position: absolute;
    top: 14px;
    right: 14px;
  }
  .hero-slider { aspect-ratio: 16 / 9; }
  .map-container iframe,
  .map-wrap iframe { height: 380px; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  :root { --header-h: 76px; }
  .container { padding: 0 28px; }
  .menu-toggle { display: none; }
  .nav-desktop {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
  }
  .nav-desktop a {
    color: rgba(255,255,255,0.88);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 8px 9px;
    border-radius: 999px;
    white-space: nowrap;
  }
  .nav-desktop a:hover,
  .nav-desktop a.active {
    color: var(--navy-dark);
    background: var(--gold);
  }
  .btn-donate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gold);
    color: var(--navy-dark);
    font-weight: 700;
    font-size: 0.84rem;
    padding: 10px 18px;
    border-radius: 999px;
    min-height: 42px;
  }
  .btn-donate:hover { background: var(--gold-hover); }

  .hero { padding-top: calc(var(--header-h) + 40px); }
  .ministry-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .contact-card { min-height: 188px; padding: 26px 18px 22px; }
  .contact-card-icon { width: 54px; height: 54px; border-radius: 16px; font-size: 1.12rem; }
  .contact-card h3 { margin-bottom: 8px; }
  .contact-card p { font-size: 0.92rem; }
  .ministry-card img { height: 200px; }
  .cells-layout { grid-template-columns: 1fr 1.15fr; align-items: start; }
  .map-container iframe { height: 100%; min-height: 520px; }
  .footer-grid {
    grid-template-columns: 1.15fr 1fr 1.15fr;
    gap: 40px;
  }
  .cta-card,
  .page-cta-card,
  .ministries-cta-card { padding: 48px 40px; }
}

@media (min-width: 1280px) {
  .nav-desktop a { padding: 8px 14px; font-size: 0.86rem; }
}

/* Small phones */
@media (max-width: 380px) {
  .hero-btns { gap: 8px; max-width: 100%; }
  .hero-btns .btn { font-size: 0.8rem; padding: 10px 8px; }
  .event-date { flex-basis: 70px; }
  .logo-text strong { font-size: 0.82rem; }
  .cell-icon { width: 30px; height: 30px; }
  .cell-info h4 { font-size: 0.84rem; }
  .slider-nav { width: 34px; height: 34px; }
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}
.value-card,
.ministry-card,
.event-item,
.cell-item,
.contact-card {
  animation: rise 0.65s ease both;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* =========================================================
   Final polish: accessibility, responsive detail, interaction
   ========================================================= */
body { overflow-wrap: break-word; }

/* Keep off-canvas navigation out of the visual/keyboard flow when closed. */
.mobile-menu {
  visibility: hidden;
  overscroll-behavior: contain;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.32s;
}
.mobile-menu.open {
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}
.menu-toggle,
.mobile-menu-close,
.back-top { touch-action: manipulation; }
.mobile-menu-close,
.contact-modal-close { min-width: 44px; min-height: 44px; }

/* Remove layout-forcing editorial line breaks on narrow screens. */
.val-line,
.sub-line { display: inline; }
.val-line:not(:last-child)::after,
.sub-line:not(:last-child)::after { content: " "; }

/* More deliberate interactive feedback without making the site feel busy. */
.nav-desktop a,
.mobile-nav a,
.social-links a,
.footer-links a,
.footer-contact-item,
.contact-card-link,
.open-maps-btn,
.cell-item { transition: color var(--ease), background-color var(--ease), border-color var(--ease), box-shadow var(--ease), transform var(--ease); }

.social-links a {
  width: 44px;
  height: 44px;
}
.open-maps-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.contact-card-link:hover,
.contact-card-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.contact-card a,
.footer-contact-item span { overflow-wrap: anywhere; }

/* Make selected cell state clear to mouse, touch, and keyboard users. */
.cell-item[aria-pressed="true"] {
  background: rgba(18, 58, 107, 0.08);
  box-shadow: inset 4px 0 0 var(--gold);
  border-color: rgba(18, 58, 107, 0.16);
}
.cell-item:focus-visible { position: relative; z-index: 1; }

/* More robust modal positioning on short phones and landscape screens. */
.contact-modal {
  display: grid;
  place-items: center;
  padding: max(20px, var(--safe-top)) 16px max(20px, var(--safe-bottom));
}
.contact-modal[hidden] { display: none; }
.contact-modal-card {
  width: min(92vw, 440px);
  margin: 0;
  max-height: calc(100vh - 40px);
  max-height: min(720px, calc(100dvh - 40px));
  overflow: auto;
}
.contact-modal-close {
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
}
.contact-modal-close:hover { background: var(--cream); color: var(--navy); }

/* Fine-tune carousel focus and reduce paint work for inactive slides. */
.hero-slider:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 5px;
}
.hero-slide[aria-hidden="true"] { pointer-events: none; }

/* A slightly more comfortable mobile reading size without changing the design. */
@media (max-width: 639px) {
  body { font-size: 16px; }
  .container { padding-left: 18px; padding-right: 18px; }
  .intro-copy p { font-size: 0.96rem; }
  .ministry-body { padding: 18px 18px 24px; }
  .ministry-body p { line-height: 1.7; }
  .section-subtitle { margin-bottom: 28px; }
  .footer-links a { min-height: 36px; display: inline-flex; align-items: center; }
}

@media (min-width: 1024px) {
  .nav-desktop a:focus-visible,
  .btn-donate:focus-visible { outline-offset: 2px; }
  .footer-links a:hover { transform: translateX(2px); }
}

@media (prefers-reduced-motion: reduce) {
  .value-card:hover,
  .contact-card-link:hover,
  .contact-card-link:focus-visible,
  .footer-links a:hover { transform: none; }
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.cta-actions .btn { min-width: 150px; }
@media (max-width: 420px) {
  .cta-actions { flex-direction: column; }
  .cta-actions .btn { width: 100%; }
}


/* ---------- Language switch ---------- */
.lang-switch {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 2px;
  color: rgba(255,255,255,0.62);
  white-space: nowrap;
}
.lang-option {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.72);
  min-width: 31px;
  min-height: 44px;
  padding: 0 3px;
  border-radius: 7px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  cursor: pointer;
  transition: color var(--ease), background var(--ease), transform var(--ease);
}
.lang-option.active,
.lang-option[aria-pressed="true"] {
  color: var(--gold);
}
.lang-divider {
  color: rgba(255,255,255,0.38);
  font-size: 0.78rem;
  user-select: none;
}
.lang-option:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
@media (hover:hover) and (pointer:fine) {
  .lang-option:hover { color: #fff; background: rgba(255,255,255,0.08); }
  .lang-option.active:hover { color: var(--gold); }
}
@media (max-width: 560px) {
  /* Keep the complete church brand visible on phones while preserving
     enough room for VN | ENG and the menu control. */
  .header-inner { gap: 6px; }
  .header .logo {
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
  }
  .header .logo img {
    width: 40px;
    height: 40px;
    padding: 3px;
  }
  .header .logo-text {
    display: flex;
    min-width: 0;
    line-height: 1.05;
  }
  .header .logo-text strong {
    font-size: 0.72rem;
    letter-spacing: 0.015em;
    white-space: nowrap;
  }
  .header .logo-text span {
    font-size: 0.50rem;
    letter-spacing: 0.12em;
    white-space: nowrap;
  }
  .lang-switch { margin-left: auto; gap: 2px; }
  .lang-option { min-width: 27px; font-size: 0.70rem; padding: 0 1px; }
  .menu-toggle { width: 42px; height: 42px; margin-left: 0; }
}

@media (max-width: 360px) {
  .header-inner { gap: 4px; }
  .header .logo { gap: 5px; }
  .header .logo img { width: 36px; height: 36px; }
  .header .logo-text strong { font-size: 0.64rem; }
  .header .logo-text span { font-size: 0.46rem; letter-spacing: 0.10em; }
  .lang-option { min-width: 25px; font-size: 0.66rem; }
  .menu-toggle { width: 40px; height: 40px; }
}
@media (min-width: 1024px) {
  .lang-switch { margin-left: 0; min-height: 42px; }
  .lang-option { min-height: 42px; }
}
@media (min-width: 1024px) and (max-width: 1150px) {
  .header-inner { gap: 9px; }
  .logo-text { display: none; }
  .nav-desktop a { padding-left: 7px; padding-right: 7px; font-size: 0.75rem; }
  .btn-donate { padding-left: 13px; padding-right: 13px; }
}

/* Keep the longer Vietnamese giving label compact in the desktop header. */
@media (min-width: 1024px) {
  html[lang="vi"] .header .btn-donate {
    white-space: nowrap;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 14px;
    gap: 6px;
    font-size: 0.78rem;
    line-height: 1;
  }
}

/* VN header brand: keep NGUỒN SỐNG on a single line while ATLANTA remains below. */
html[lang="vi"] .header .logo-text {
  flex-shrink: 0;
}
html[lang="vi"] .header .logo-text strong {
  white-space: nowrap;
}

/* ---------- Desktop header breathing room ----------
   Keep the Vietnamese brand and the first navigation pill visually separated.
   The main page content remains capped at 1140px; only the header gets extra room. */
@media (min-width: 1151px) {
  .header .container {
    max-width: 1320px;
  }
  .header .nav-desktop {
    margin-left: 8px;
    min-width: 0;
  }
}
@media (min-width: 1280px) {
  .header .nav-desktop a {
    padding-left: 12px;
    padding-right: 12px;
  }
}
