:root {
  /* Brand palette (from the client's mockup): steel blue #84A1B5, pale
     blue-gray #C9D7DF, dark slate #364A57. White text on steel blue only
     reaches ~2.7:1 contrast, so anywhere white text sits on a fill we use
     --color-accent / --color-ice (a darker mid-tone derived from the same
     hues, ~4.8:1) instead of the raw steel blue. */
  --color-primary: #364a57;
  --color-secondary: #84a1b5;
  --color-accent: #587689;
  --color-accent-dark: #46606f;
  --color-tone: #c9d7df;
  --color-tertiary: #e4ebef;
  --color-dark: #26343d;
  --color-dark-tone: #364a57;
  --color-text: #364a57;
  --color-ice: #587689;
  --color-ice-dark: #364a57;
  --color-cream: #efe3d0;
  --color-sand: #d4c4a0;
  --color-offwhite: #fff7f4;
  --font-heading: "Montserrat", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-display: "Playfair Display", serif;
  --container-max: 1140px;
  --gradient-brand: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  --gradient-warm: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.6;
  background: #c9d7df;
}

h1, h2, h3, h4, .brand, .nav-toggle, .site-nav a, .btn {
  font-family: var(--font-heading);
}

a {
  color: inherit;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Top bar */
.search-form {
  position: relative;
}

.nav-search-form {
  margin-bottom: 1.25rem;
}

.search-form input {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #fff;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  width: 100%;
}

.search-form input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.footer-search-form {
  max-width: 260px;
}

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  z-index: 60;
  max-height: 320px;
  overflow-y: auto;
}

.search-dropdown.open {
  display: block;
}

.search-dropdown-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.85rem;
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid #eee;
}

.search-dropdown-item:last-child {
  border-bottom: none;
}

.search-dropdown-item:hover {
  background: var(--color-tertiary);
}

.search-dropdown-item strong {
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 0.9rem;
}

.search-dropdown-item span {
  color: #666;
  font-size: 0.8rem;
}

.search-dropdown-empty {
  padding: 0.75rem 0.85rem;
  color: #888;
  font-size: 0.85rem;
}

.search-result-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.25rem 0;
  border-bottom: 1px solid #eee;
}

.search-result-item h3 {
  color: var(--color-primary);
  margin: 0 0 0.3rem;
}

.search-result-item p {
  color: var(--color-text);
  margin: 0;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  opacity: 1;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.social-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.social-icon:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.15);
}

.footer-social .social-facebook:hover {
  color: #1877f2;
}

.footer-social .social-instagram:hover {
  color: #e1306c;
}

.footer-social .social-youtube:hover {
  color: #ff0000;
}

/* Header */
.hero-wrap {
  position: relative;
}

.site-header {
  position: relative;
  background: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
  text-decoration: none;
}

.brand img {
  height: 88px;
  flex: 0 0 auto;
  display: block;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Primary nav: visible inline on desktop */
.primary-nav {
  display: none;
  align-items: center;
  gap: clamp(1.5rem, 3.5vw, 3rem);
  margin-left: auto;
  margin-right: clamp(1rem, 4vw, 3.5rem);
}

.primary-nav a {
  position: relative;
  color: var(--color-primary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  padding: 0.45rem 0;
  transition: color 0.15s ease;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.primary-nav a:hover {
  color: var(--color-accent);
}

.primary-nav a:hover::after,
.primary-nav a:focus-visible::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  margin-left: 1rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  transition: background 0.15s ease;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 25;
}

.nav-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.site-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--color-primary);
  padding: 1.5rem 1.75rem 2rem;
  position: fixed;
  top: 0;
  right: -340px;
  bottom: 0;
  width: min(320px, 85vw);
  z-index: 30;
  transition: right 0.3s ease;
  overflow-y: auto;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.25);
}

.site-nav.open {
  right: 0;
}

.nav-close {
  align-self: flex-end;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  margin-bottom: 0.5rem;
}

.site-nav a {
  position: relative;
  color: #fff;
  text-decoration: none;
  padding: 0.9rem 0.15rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.site-nav-more {
  display: flex;
  flex-direction: column;
  margin-top: 0.75rem;
  padding-top: 0.25rem;
}

.site-nav-more-label {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 0.15rem 0.35rem;
}

.site-nav-more a {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  padding: 0.7rem 0.15rem;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.site-nav a:hover {
  color: var(--color-tone);
  padding-left: 0.5rem;
}

/* On desktop, the primary items already show inline in the header,
   so the hamburger dropdown only needs the secondary items. */
@media (min-width: 900px) {
  .primary-nav {
    display: flex;
  }

  /* the links are all in the header, so the slide-out menu bar isn't needed */
  .nav-toggle,
  .nav-backdrop,
  .site-nav {
    display: none;
  }
}

/* Every page: the hero, with the menu laid over it, is a rounded card with the
   pale page color showing around it (as in the design) */
.hero-wrap {
  margin: clamp(8px, 1.1vw, 16px);
  border-radius: clamp(16px, 1.8vw, 26px);
  overflow: hidden;
}

.hero-full::after {
  display: none;
}

.hero-wrap .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: transparent;
}

.brand-name {
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.primary-nav a {
  color: var(--color-cream);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.primary-nav a::after {
  background: var(--color-cream);
}

.primary-nav a:hover {
  color: var(--color-tone);
}

.nav-toggle span {
  background: #fff;
}

.brand img {
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.45));
}

/* Hero */
.hero {
  position: relative;
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 5rem 1.25rem;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(38, 52, 61, 0.72);
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: var(--gradient-warm);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.hero.hero-sm {
  padding: 10rem 1.25rem 7.5rem;
  min-height: clamp(380px, 52vh, 560px);
  text-align: left;
}

.hero.hero-sm .hero-content {
  /* left-aligned to the header instead of a centered container -- centering
     it here left a big empty gap on wide screens before the title even
     started. The extra padding beyond .hero.hero-sm's own 1.25rem lines the
     title up under the center of the header logo, not its left edge. */
  max-width: none;
  padding-left: 25px;
}

.hero.hero-sm h1 {
  text-transform: none;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: clamp(3rem, 9vw, 5.5rem);
  line-height: 1.05;
  color: var(--color-cream);
}

/* same dark steel-blue tint as the home page hero, instead of a fade that
   left these banners looking washed out. */
.hero.hero-sm::before {
  background: rgba(38, 52, 61, 0.72);
}

/* wavy edge into the page, as in the design */
.hero.hero-sm::after {
  height: 64px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'%3E%3Cpath d='M0,62 C260,8 520,112 820,58 C1060,16 1250,52 1440,34 L1440,100 L0,100 Z' fill='%23c9d7df'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}

/* solid-color bands (no photo) */
.hero.hero-slate {
  background: var(--color-primary);
}

.hero.hero-slate::before {
  display: none;
}

.hero.hero-steel {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 60%, var(--color-secondary) 100%);
}

.hero.hero-steel::before {
  display: none;
}

/* Full-bleed home hero */
.hero-full {
  min-height: calc(100vh - clamp(16px, 2.2vw, 32px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 1.25rem 4rem;
}

.hero-tagline {
  color: var(--color-cream);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.hero-subtitle {
  color: var(--color-cream);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  margin: 0 0 1.5rem;
  opacity: 0.95;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(54, 74, 87, 0.25);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--color-ice-dark);
  color: #fff;
}

.btn-primary {
  background: var(--color-ice);
  color: #fff;
}

.btn-accent {
  background: #fff;
  color: var(--color-ice-dark);
  border: 2px solid var(--color-ice);
  padding: calc(0.85rem - 2px) calc(1.75rem - 2px);
}

.btn-accent:hover {
  box-shadow: 0 8px 18px rgba(88, 118, 137, 0.35);
}

/* Steel-blue button from the design; dark text keeps it readable (cream on steel is too faint) */
.btn-steel {
  background: var(--color-secondary);
  color: var(--color-dark);
}

.btn-steel:hover {
  background: #9db4c4;
}

.btn-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* Service Details */
.wave-divider {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  line-height: 0;
  pointer-events: none;
  overflow: hidden;
}

.wave-divider svg {
  display: block;
  width: 100%;
  height: 100%;
}

.wave-divider-offwhite path {
  fill: var(--color-offwhite);
}

.wave-divider-slate path {
  fill: var(--color-primary);
}

.wave-divider-steel path {
  fill: var(--color-secondary);
}

.wave-divider-tertiary path {
  fill: var(--color-tertiary);
}

/* Scrolling gallery: never pauses, never runs out of photos */
.gallery-scroll-wrap {
  overflow: hidden;
  margin-top: 1rem;
  padding: 3rem 0; /* room for the wave and for the enlarged hover photo */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.gallery-scroll-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  padding-right: 1rem; /* same as the gap, so every copy is exactly the same width */
  /* constant speed however many photos there are */
  animation: gallery-scroll calc(var(--count, 7) * 6s) linear infinite;
}

.gallery-scroll-item {
  margin: 0;
  flex: 0 0 auto;
  text-align: center;
  display: flex;
  align-items: center;
}

/* each photo is on the same row, so a hover z-index only needs to beat its
   siblings inside the shared flex track */
.gallery-scroll-item:hover,
.gallery-scroll-item:focus-within {
  z-index: 20;
}

.gallery-scroll-item img {
  width: 220px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform-origin: center;
}

.gallery-scroll-item img:hover,
.gallery-scroll-item img:focus-visible {
  transform: scale(1.6);
  position: relative;
  z-index: 20;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  outline: none;
}

@keyframes gallery-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-100% / var(--reps, 2)));
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-scroll-track {
    animation: none;
    overflow-x: auto;
  }
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-wavy-bottom {
  position: relative;
  padding-bottom: 5.5rem;
}

.section-tone {
  background: var(--color-tone);
}

.section-tertiary {
  background: var(--color-tertiary);
}

.section h2 {
  position: relative;
  text-align: center;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: 1rem;
}

.section h2.text-left {
  text-align: left;
}

.section .lead {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  color: var(--color-text);
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-header p {
  color: var(--color-text);
}

/* Info cards (home bottom row) */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.info-card {
  text-align: center;
  padding: 1.5rem;
}

.info-card h3 {
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}

.info-card p {
  color: var(--color-text);
  margin: 0.2rem 0;
}

/* Event / ministry cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  position: relative;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 1.5rem;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.event-card {
  padding: 0;
}

.event-card-body {
  padding: 1.5rem;
}

.event-card-image {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-warm);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(54, 74, 87, 0.12);
}

.card:hover::before {
  transform: scaleX(1);
}

.card h3 {
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.card .meta {
  color: var(--color-accent-dark);
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0.2rem 0;
}

.event-card {
  cursor: pointer;
}

.card .place {
  color: var(--color-text);
  font-size: 0.9rem;
}

/* About: story card, pastor */
.story-section {
  padding-top: 2.5rem;
}

.story-card {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2.25rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: 26px;
  text-align: center;
  box-shadow: 0 14px 32px rgba(54, 74, 87, 0.22);
}

.story-card h2 {
  margin: 0 0 1rem;
  color: var(--color-cream);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.story-card p {
  margin: 0 0 1rem;
  color: #fff;
}

.story-card p:last-child {
  margin-bottom: 0;
}

.pastor-section h2 {
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 2rem;
}

.pastor-row {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 1.75rem;
  align-items: stretch;
}

.pastor-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(54, 74, 87, 0.25);
}

.pastor-card {
  padding: 2rem 2.25rem;
  background: var(--color-sand);
  color: var(--color-text);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(54, 74, 87, 0.18);
}

.pastor-card h3 {
  margin: 0 0 0.75rem;
  color: var(--color-primary);
  font-size: 1.4rem;
}

.pastor-card p {
  margin: 0 0 1rem;
}

.pastor-card p:last-child {
  margin-bottom: 0;
}

.team-dark {
  position: relative;
  overflow: hidden;
  background: var(--color-primary);
  color: var(--color-cream);
  padding: 3.5rem 0 7rem;
}

.team-contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--color-secondary);
  stroke-width: 3;
  opacity: 0.3;
  pointer-events: none;
}

.team-dark .container {
  position: relative;
  z-index: 1;
}

.team-dark-heading {
  margin: 0 0 2rem;
  color: var(--color-cream);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.25rem);
  text-align: left;
}

.team-dark-heading.is-right {
  text-align: right;
}

.leader-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 3rem;
}

.leader-card {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.leader-photo {
  display: block;
  flex-shrink: 0;
  width: min(46%, 230px);
  aspect-ratio: 0.58;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.leader-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: var(--color-cream);
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 300;
}

.leader-info h4 {
  margin: 0 0 0.25rem;
  color: var(--color-cream);
  font-size: 1.3rem;
  font-weight: 500;
}

.leader-info p {
  margin: 0;
  color: rgba(239, 227, 208, 0.8);
}

.team-dark-heading-spaced {
  margin-top: 3.5rem;
}

@media (max-width: 768px) {
  .leader-grid {
    grid-template-columns: 1fr;
  }

  .leader-photo {
    width: min(38%, 150px);
  }

  .team-dark-heading.is-right {
    text-align: left;
  }
}

/* Beliefs */
.belief-item {
  margin-bottom: 1.75rem;
}

.belief-item h4 {
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}

.belief-item p {
  color: var(--color-text);
}

/* Give */
.give-quote {
  font-style: italic;
  font-size: 1.2rem;
  max-width: 650px;
  margin: 0 auto 1.5rem;
  padding: 1rem 1.5rem;
  text-align: center;
  color: var(--color-primary);
  border-left: 4px solid var(--color-accent);
  border-right: 4px solid var(--color-accent);
  border-radius: 4px;
  background: var(--color-tertiary);
}

/* Contact / Prayer form */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.form-field {
  margin-bottom: 1rem;
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(132, 161, 181, 0.2);
}

/* Contact page: "Reach out" block + Connection Card */
.contact-reach {
  text-align: center;
  padding: 3.5rem 0 5rem;
}

.reach-lead,
.reach-line {
  margin: 0;
  color: var(--color-primary);
  font-size: clamp(1.5rem, 3.6vw, 2.25rem);
  font-weight: 300;
  line-height: 1.5;
}

.reach-line a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(54, 74, 87, 0.4);
}

.reach-line a:hover {
  border-bottom-color: currentColor;
}

.reach-address {
  margin: 1.25rem 0 0;
  color: var(--color-text);
}

.reach-maps {
  justify-content: center;
}

.contact-reach .reach-maps a {
  color: var(--color-primary);
}

.reach-prompt {
  margin: 2.5rem 0 1.25rem;
  color: var(--color-primary);
  font-size: 1.15rem;
}

.give-qr {
  text-align: center;
  margin-top: 2rem;
}

.give-qr p.give-qr-heading {
  margin: 0 0 0.75rem;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--color-primary);
}

.give-qr img {
  width: 100%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 1rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(54, 74, 87, 0.18);
}

.give-qr p {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--color-text);
}

.btn-lg {
  padding: 1rem 3rem;
  font-size: 1.1rem;
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(54, 74, 87, 0.28);
}

body.modal-open {
  overflow: hidden;
}

/* show immediately on open (so the first field can take focus); still fades out on close */
.modal.connection-modal.open {
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s;
}

.modal.connection-modal {
  width: min(560px, 94vw);
  max-height: 90vh;
  padding: 2rem 2rem 2.25rem;
}

.connection-modal h3 {
  margin: 0 2rem 0.5rem 0;
  color: var(--color-primary);
  font-size: 1.6rem;
}

.cc-intro {
  margin: 0 0 1.5rem;
  color: var(--color-text);
}

.cc-field {
  margin: 0 0 1.1rem;
  padding: 0;
  border: 0;
}

.cc-field > label,
.cc-field > legend {
  display: block;
  margin-bottom: 0.4rem;
  padding: 0;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 500;
}

.cc-req {
  color: #b3261e;
}

.cc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.cc-form input[type="text"],
.cc-form input[type="email"],
.cc-form input[type="tel"],
.cc-form select,
.cc-form textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid #a9b7c0;
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
}

.cc-form input:focus,
.cc-form select:focus,
.cc-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(132, 161, 181, 0.3);
}

.cc-options label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.25rem 0;
  font-family: var(--font-body);
  font-weight: 400;
  cursor: pointer;
}

.cc-options input {
  flex-shrink: 0;
  margin-top: 0.3rem;
}

.cc-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #d3dde3;
}

.cc-section h4 {
  margin: 0 0 1rem;
  color: var(--color-primary);
  font-size: 1.15rem;
}

.cc-submit {
  display: block;
  margin: 1.5rem auto 0;
  padding: 0.85rem 3rem;
}

@media (max-width: 520px) {
  .cc-row {
    grid-template-columns: 1fr;
  }

  .modal.connection-modal {
    padding: 1.5rem 1.25rem 1.75rem;
  }
}

/* Flash messages */
.flash-messages {
  list-style: none;
  margin: 1rem auto 0;
  padding: 0;
  max-width: 700px;
}

.flash-messages li {
  background: var(--color-tertiary);
  color: var(--color-primary);
  border: 1px solid var(--color-secondary);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  background: var(--color-dark);
  color: #ddd;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2rem 0;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  padding-bottom: 2rem;
}

.footer-social .social-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
}

.footer-social .social-icon svg {
  width: 20px;
  height: 20px;
}

.footer-grid h3 {
  color: #fff;
  font-size: 1rem;
  margin-top: 0;
}

.footer-grid a {
  color: var(--color-secondary);
  text-decoration: none;
}

.map-links {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.map-links a {
  color: var(--color-secondary);
  text-decoration: underline;
}

.footer-bottom {
  background: var(--color-dark-tone);
  padding: 0.85rem 0;
  font-size: 0.85rem;
}

/* Large desktop */
@media (min-width: 1400px) {
  :root {
    --container-max: 1320px;
  }

  html {
    font-size: 18px;
  }

  .card {
    padding: 2rem;
  }

  .brand img {
    height: 104px;
  }

  .card-grid {
    gap: 2rem;
  }

  .hero {
    padding: 6.5rem 1.25rem;
  }

  .hero.hero-sm {
    padding: 11rem 1.25rem 8rem;
  }

  .hero.hero-sm .hero-content {
    /* the header logo is bigger at this breakpoint, so its center moves
       further right too -- match it here. */
    padding-left: 54px;
  }
}

/* Calendar */
.calendar {
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(54, 74, 87, 0.08);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section h2.calendar-title {
  margin: 0;
  color: var(--color-primary);
  font-size: 1.4rem;
  text-align: left;
  padding-bottom: 0;
}

.section h2.calendar-title::after {
  content: none;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-today-btn {
  background: #fff;
  color: var(--color-ice-dark);
  border: 2px solid var(--color-ice);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.calendar-today-btn:hover {
  background: var(--color-ice);
  color: #fff;
}

.calendar-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  color: var(--color-primary);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.calendar-nav-btn:hover {
  background: var(--color-tertiary);
  border-color: var(--color-ice);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.5rem;
}

.calendar-weekdays span {
  padding: 0.5rem 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-day {
  position: relative;
  min-height: 84px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.calendar-day.is-empty {
  border-color: transparent;
}

.calendar-day-num {
  font-weight: 600;
  font-size: 0.85rem;
  color: #555;
}

.calendar-day.is-today {
  border-color: var(--color-ice);
  background: var(--color-tertiary);
}

.calendar-day.is-today .calendar-day-num {
  color: var(--color-ice-dark);
}

.calendar-day.has-event {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calendar-day.has-event:hover,
.calendar-day.has-event:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(54, 74, 87, 0.15);
  outline: none;
}

.calendar-day-chip {
  display: block;
  min-width: 0;
  max-width: 100%;
  background: var(--color-ice);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.calendar-day-chip.is-members-only {
  background: var(--color-accent-dark);
}

.badge-members-only {
  display: inline-block;
  vertical-align: middle;
  background: var(--color-accent-dark);
  color: var(--color-cream);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 45;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(480px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.modal.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: #888;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--color-primary);
}

.event-modal-flyer {
  display: block;
  width: calc(100% + 4rem);
  margin: -2rem -2rem 1.25rem;
  max-width: none;
  border-radius: 12px 12px 0 0;
}

.event-modal h3 {
  color: var(--color-primary);
  margin: 0 0 0.4rem;
}

.event-modal-meta {
  color: var(--color-ice-dark);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 0.3rem;
}

.event-modal-location {
  color: var(--color-text);
  margin: 0 0 0.5rem;
}

.event-modal-desc {
  color: var(--color-text);
}

.event-modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.event-modal-gallery img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
}

.event-modal-divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 1.25rem 0;
}

/* "Join us for a Sunday" */
.sunday-section {
  padding: 4rem 0 5rem;
}

.sunday-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch;
}

.sunday-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 14px 32px rgba(54, 74, 87, 0.28);
}

.sunday-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sunday-card {
  background: var(--color-accent);
  color: #fff;
  border-radius: 28px;
  padding: 2rem 1.75rem;
  text-align: center;
  box-shadow: 0 14px 32px rgba(54, 74, 87, 0.22);
}

.sunday-card h2 {
  color: var(--color-cream);
  font-weight: 400;
  margin: 0 0 0.75rem;
  padding-bottom: 0;
}

.sunday-card p {
  margin: 0 0 1.25rem;
  color: #fff;
}

.sunday-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  flex: 1;
}

.sunday-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.25rem 1rem;
  text-align: center;
  font-weight: 600;
  font-size: clamp(0.8rem, 2.5vw, 0.95rem);
  line-height: 1.4;
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  box-shadow: 0 8px 20px rgba(54, 74, 87, 0.14);
}

.sunday-tile span {
  text-wrap: balance;
}

.sunday-tile svg {
  width: 56px;
  height: 56px;
}

/* Upcoming Events: dark slate band with cream heading and sand-colored cards */
.section-events {
  background: var(--color-primary);
  color: var(--color-cream);
}

.section-events .section-header h2 {
  color: var(--color-cream);
  font-weight: 400;
}

.section-events .section-header p {
  color: rgba(239, 227, 208, 0.85);
}

.section-events .event-card {
  background: var(--color-sand);
  border-color: transparent;
}

.section-events .event-card::before {
  display: none;
}

.section-events .event-card .meta {
  color: var(--color-primary);
}

.section-events .event-card .place {
  color: var(--color-text);
}

/* Next Steps */
.section-nextsteps {
  background: var(--color-secondary);
  padding: 3.5rem 0 4.5rem;
}

.section-nextsteps h2 {
  color: var(--color-primary);
  font-weight: 400;
}

.nextsteps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.nextstep-card {
  display: flex;
  flex-direction: column;
  background: var(--color-tone);
  border-radius: 24px;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 12px 26px rgba(54, 74, 87, 0.25);
}

.nextstep-card img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.nextstep-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem;
}

.nextstep-body h3 {
  margin: 0;
  color: var(--color-primary);
}

.nextstep-body p {
  margin: 0 0 0.75rem;
  color: var(--color-text);
}

.nextstep-body .btn {
  margin-top: auto;
}

@media (max-width: 768px) {
  .sunday-grid {
    grid-template-columns: 1fr;
  }

  .sunday-photo img {
    min-height: 240px;
    height: 260px;
  }

  .sunday-tiles {
    grid-template-columns: 1fr;
  }

  .hero.hero-sm {
    padding: 8rem 1.25rem 5rem;
    min-height: 320px;
  }

}

/* Ministries: photo tile mosaic (2 across, 1 wide, 3 across, repeating) */
.ministry-mosaic {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 220px;
  gap: 1rem;
}

.ministry-tile {
  position: relative;
  grid-column: span 3;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: var(--color-primary);
  box-shadow: 0 10px 24px rgba(54, 74, 87, 0.22);
}

.ministry-tile:nth-child(6n + 3) {
  grid-column: span 6;
}

.ministry-tile:nth-child(6n + 4),
.ministry-tile:nth-child(6n + 5),
.ministry-tile:nth-child(6n) {
  grid-column: span 2;
}

/* a short last row still fills the width */
.ministry-tile:nth-child(6n + 1):last-child,
.ministry-tile:nth-child(6n + 4):last-child {
  grid-column: span 6;
}

.ministry-tile:nth-child(6n + 4):nth-last-child(2),
.ministry-tile:nth-child(6n + 5):last-child {
  grid-column: span 3;
}

.ministry-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: transform 0.4s ease;
}

a.ministry-tile {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.ministry-tile:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.ministry-caption h3,
.ministry-caption p {
  display: block;
}

.ministry-more {
  position: absolute;
  right: 1rem;
  bottom: 0.95rem;
  z-index: 1;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  background: var(--color-secondary);
  color: var(--color-dark);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

.ministry-tile:hover .ministry-more,
.ministry-tile:focus-visible .ministry-more {
  background: #9db4c4;
}

/* a ministry's own page */
.ministry-detail-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.25rem 2.5rem;
  background: var(--color-sand);
  color: var(--color-text);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(54, 74, 87, 0.18);
}

.ministry-when {
  margin: 0 0 1rem;
  color: var(--color-primary);
  font-size: 1.1rem;
}

.ministry-detail-card p {
  line-height: 1.7;
}

.ministry-detail-card .btn-row {
  margin-top: 1.75rem;
}

.ministry-tile:hover img {
  transform: scale(1.05);
}

/* uniform steel-blue tint on every tile (consistent look photo to photo),
   with a bit more darkening near the bottom so the cream caption stays
   readable no matter how light or dark that particular photo is */
.ministry-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(38, 52, 61, 0.78) 0%, rgba(38, 52, 61, 0.4) 35%, rgba(38, 52, 61, 0.4) 100%);
  pointer-events: none;
}

.ministry-caption {
  position: absolute;
  right: 8.5rem;
  bottom: 0.95rem;
  left: 1.1rem;
  z-index: 1;
  color: var(--color-cream);
}

.ministry-caption h3 {
  margin: 0;
  color: var(--color-cream);
  font-weight: 400;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  line-height: 1.15;
}

.ministry-caption p {
  margin: 0.25rem 0 0;
  color: rgba(239, 227, 208, 0.92);
  font-size: 0.9rem;
}

@media (max-width: 700px) {
  .ministry-mosaic {
    grid-template-columns: 1fr;
    grid-auto-rows: 190px;
  }

  .ministry-tile,
  .ministry-tile:nth-child(n) {
    grid-column: auto !important;
  }
}

/* What We Believe + Statement of Faith dropdown */
.believe-section {
  padding: 2.5rem 0 5rem;
  background: var(--color-offwhite);
  text-align: center;
}

.believe-section h2 {
  margin: 0 0 2rem;
  color: var(--color-primary);
  font-weight: 300;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
}

.faith-accordion {
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}

.faith-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(54, 74, 87, 0.25);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  list-style: none;
  cursor: pointer;
}

.faith-accordion summary::-webkit-details-marker {
  display: none;
}

.faith-accordion summary::after {
  content: "";
  flex-shrink: 0;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}

.faith-accordion[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}

.faith-accordion summary:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.faith-body {
  margin-top: 1rem;
  padding: 1.5rem 1.75rem 1.75rem;
  background: var(--color-tone);
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(54, 74, 87, 0.12);
}

.faith-body h3 {
  margin: 1.25rem 0 0.35rem;
  color: var(--color-primary);
  font-size: 1.05rem;
}

.faith-body h3:first-child {
  margin-top: 0;
}

.faith-body p {
  margin: 0;
  color: var(--color-text);
}

/* Mobile */
@media (max-width: 768px) {
  .brand img {
    height: 56px;
  }

  .header-inner {
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }

  .nav-toggle {
    margin-left: 0.25rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .gallery-scroll-item img {
    width: 160px;
    height: 110px;
  }

  .calendar {
    padding: 1rem;
  }

  .calendar-day {
    min-height: 56px;
    padding: 0.25rem;
  }

  .calendar-day-chip {
    font-size: 0.6rem;
    padding: 0.15rem 0.3rem;
  }

  .section h2.calendar-title {
    font-size: 1.1rem;
  }

  .brand-name {
    font-size: clamp(0.65rem, 3.6vw, 0.85rem);
  }

  .hero-full {
    min-height: 80vh;
    padding: 6.5rem 1.25rem 3rem;
  }

  .info-grid,
  .card-grid,
  .footer-grid,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .pastor-row {
    grid-template-columns: 1fr;
  }

  .pastor-photo {
    width: 230px;
    height: 230px;
    max-height: none;
    margin: 0 auto;
    border-radius: 50%;
    object-position: center 12%;
  }

  .pastor-row {
    justify-items: center;
    text-align: center;
  }
}

.calendar-subscribe {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-primary);
}

.calendar-subscribe a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
}

.event-modal-addcal {
  margin: 1rem 0 0;
}

.viewer-note {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  opacity: 0.9;
}

.viewer-note a {
  font-weight: 700;
  text-decoration: underline;
  margin-left: 0.4rem;
}

.flash-inline {
  max-width: 360px;
  margin: 1rem auto 0;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  background: #fbe9e7;
  color: #8a2c1c;
  font-size: 0.9rem;
}
