/* Bethel Pentecostal Church Bath — shared styles, mobile-first */

:root {
  --color-primary: #7a2436;
  --color-primary-dark: #4d1725;
  --color-primary-light: #a8425a;
  --color-accent: #c9a24b;
  --color-accent-light: #e6c977;
  --color-text: #241d1a;
  --color-text-muted: #6b6059;
  --color-bg: #fffdfb;
  --color-bg-alt: #f8f1e7;
  --color-border: #e9ddcc;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1120px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(36, 29, 26, 0.06);
  --shadow: 0 10px 30px rgba(36, 29, 26, 0.09);
  --shadow-lg: 0 20px 48px rgba(36, 29, 26, 0.14);
  color-scheme: light;

  /* Fixed maroon — the service-times bar always uses this, regardless of theme */
  --service-gradient-start: #4d1725;
  --service-gradient-end: #7a2436;
}

:root[data-theme="dark"] {
  --color-primary: #c9536b;
  --color-primary-dark: #8a2f42;
  --color-primary-light: #e0839a;
  --color-accent: #d9b565;
  --color-accent-light: #f0d99a;
  --color-text: #f3ece1;
  --color-text-muted: #b6a996;
  --color-bg: #17120e;
  --color-bg-alt: #221b15;
  --color-border: #3a2e24;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

:root[data-theme="dark"] .site-footer {
  background: linear-gradient(180deg, var(--color-bg-alt), #120d0a);
}

:root[data-theme="dark"] .site-header {
  background: rgba(23, 18, 14, 0.85);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.6rem;
  color: var(--color-text);
}

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

a {
  color: var(--color-primary);
}

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

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 0.6rem;
}

/* Fade-in on load — pure CSS, no JS dependency, so content can never get stuck hidden */
.reveal {
  animation: reveal-in 0.7s ease both;
}

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
  }
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 251, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-text);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.2;
}

.brand-tagline {
  display: block;
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  font-weight: 700;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-top: -4px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  border-color: var(--color-accent-light);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  flex-direction: column;
  padding: 0.5rem 1.5rem 1rem;
  display: none;
}

.nav-links.is-open {
  display: flex;
  animation: nav-drop-in 0.2s ease;
}

@keyframes nav-drop-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-links.is-open {
    animation: none;
  }
}

.nav-links a {
  display: block;
  padding: 0.75rem 0;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}

.nav-links a:last-child {
  border-bottom: none;
}

.nav-links a.current {
  color: var(--color-primary);
}

@media (min-width: 720px) {
  .nav-toggle {
    display: none;
  }

  .nav-controls {
    gap: 1.75rem;
  }

  .nav-links {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    padding: 0;
    margin-top: -12px;
    gap: 1.85rem;
  }

  .nav-links a {
    padding: 0;
    border-bottom: none;
    position: relative;
  }

  .nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -6px;
    height: 2px;
    background: var(--color-accent);
    transition: right 0.25s ease;
  }

  .nav-links a:hover::after,
  .nav-links a.current::after {
    right: 0;
  }
}

/* Gallery carousel — one large photo at a time, crossfading to the front */
.gallery-section {
  background: var(--color-bg-alt);
  padding: 2.5rem 0;
}

.carousel {
  position: relative;
  max-width: 1050px;
  margin: 0 auto;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--color-bg-alt);
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-track img,
.carousel-track video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1s ease, transform 4s ease-out;
}

.carousel-track img.is-active,
.carousel-track video.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.gallery-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1.5rem;
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-size: 1.2rem;
  text-align: center;
}

.carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1rem;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.carousel-dots[hidden] {
  display: none;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.carousel-dot.is-active {
  background: #fff;
  transform: scale(1.35);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(23, 18, 14, 0.25);
  color: #fff;
  cursor: pointer;
  opacity: 0.6;
  transform: translateY(-50%);
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.carousel-arrow:hover {
  opacity: 1;
  background: rgba(23, 18, 14, 0.45);
}

.carousel-arrow.prev {
  left: 0.85rem;
}

.carousel-arrow.next {
  right: 0.85rem;
}

.carousel-arrow svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.carousel-arrow[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track img,
  .carousel-track video {
    transition: opacity 0.3s ease;
    transform: none;
  }
}

/* Mobile: carousel fills the space edge-to-edge, no gap above/below */
@media (max-width: 719px) {
  .gallery-section {
    padding: 0;
  }

  .gallery-section .container {
    padding: 0;
    max-width: none;
  }

  .carousel {
    border-radius: 0;
    box-shadow: none;
  }
}

/* Hero */
.hero {
  background: radial-gradient(ellipse 120% 100% at 50% 0%, var(--color-bg-alt), var(--color-bg) 70%);
  padding: 3.5rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  margin: 0 0 0.75rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 42rem;
  margin: 0 auto 1.5rem;
}

.button {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  text-decoration: none;
  padding: 0.8rem 1.7rem;
  border-radius: 999px;
  font-weight: 600;
  margin: 0.3rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.button.secondary {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  padding: 0.7rem 1.6rem;
  box-shadow: none;
}

.button.secondary:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Service times strip */
.service-times {
  background: linear-gradient(135deg, var(--service-gradient-start), var(--service-gradient-end));
  color: #fff;
}

.service-times .container {
  display: grid;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  grid-template-columns: 1fr;
  text-align: center;
}

.service-times .time-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.service-times .time-item span {
  font-size: 0.85rem;
  opacity: 0.85;
}

@media (min-width: 640px) {
  .service-times .container {
    gap: 0.85rem;
    padding: 1.1rem 1.5rem;
    grid-template-columns: repeat(3, 1fr);
  }

  .service-times .time-item {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
  }

  .service-times .time-item:last-child {
    border-right: none;
  }
}

/* Sections */
section {
  padding: 3rem 0;
}

section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.75rem;
}

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

.card-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Movable card rail — drag/swipe/arrow-driven, like soulchurch.com's section */
.card-rail-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-rail {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.5rem 0 1.25rem;
  margin: -0.5rem 0 -1.25rem;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.card-rail::-webkit-scrollbar {
  display: none;
}

.card-rail.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.card-rail.is-dragging .rail-card {
  pointer-events: none;
}

.rail-card {
  flex: 0 0 auto;
  width: 80%;
  max-width: 320px;
  scroll-snap-align: start;
}

@media (min-width: 640px) {
  .rail-card {
    width: 320px;
  }
}

/* Desktop: show only whole cards, never a partial one at either edge */
@media (min-width: 720px) {
  .card-rail-wrap {
    margin-top: 2rem;
  }

  .rail-card {
    width: calc((100% - 1.25rem) / 2);
    max-width: none;
  }
}

@media (min-width: 960px) {
  .rail-card {
    width: calc((100% - 2 * 1.25rem) / 3);
  }
}

.rail-arrow {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.rail-arrow:hover {
  background: var(--color-bg-alt);
  transform: scale(1.06);
}

.rail-arrow svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

@media (min-width: 720px) {
  .rail-arrow {
    display: inline-flex;
  }
}

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

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

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--color-accent-light);
}

.card h3 {
  margin-top: 0;
  font-size: 1.15rem;
}

.card p {
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.card .card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-primary);
}

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent-light), var(--color-accent));
  color: var(--color-primary-dark);
  margin-bottom: 0.9rem;
}

.icon-badge svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

/* Events / schedule table */
.schedule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.schedule-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  transition: box-shadow 0.25s ease;
}

.schedule-item:hover {
  box-shadow: var(--shadow-sm);
}

.schedule-item .when {
  font-weight: 700;
  color: var(--color-primary);
  min-width: 9rem;
}

/* Team grid */
.team-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .team-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.team-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem;
}

.team-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.team-card-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--color-bg-alt);
}

.team-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}

.team-card-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.15rem;
}

.team-card-role {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.7rem;
}

.team-card-desc {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Ministry / program detail pages */
.ministry-detail {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 800px) {
  .ministry-detail {
    grid-template-columns: 3fr 2fr;
  }
}

.ministry-facts {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--color-bg-alt);
}

.ministry-facts dt {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 1rem;
}

.ministry-facts dt:first-child {
  margin-top: 0;
}

.ministry-facts dd {
  margin: 0.2rem 0 0;
  color: var(--color-text-muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}

/* Contact */
.contact-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.contact-list a {
  text-decoration: none;
  font-weight: 600;
}

.map-frame {
  border: 0;
  width: 100%;
  height: 280px;
  border-radius: var(--radius);
}

/* Footer */
.site-footer {
  background: linear-gradient(180deg, var(--color-bg-alt), #f1e7d8);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
  margin-bottom: 1.75rem;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.site-footer h4 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.site-footer a {
  text-decoration: none;
  color: var(--color-text-muted);
}

.site-footer a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 1.25rem;
}
