/* eDestiny Family Church — brand system
   Primary: Grape | Secondary: Orange, Olive, Nordic | Accent: Magenta, Lime, Grey, Deep Blue */
:root {
  --grape: #59216e;
  --grape-dark: #401553;
  --orange: #ef8e1c;
  --olive: #6b7a3e;
  --nordic: #4fa3ac;
  --magenta: #b23fa0;
  --lime: #a4c639;
  --grey: #7d7d7d;
  --deepblue: #223a63;
  --black: #17141a;
  --white: #ffffff;
  --ink: #26212b;
  --paper: #faf8fb;

  --font-body: 'Open Sans', Arial, Helvetica, sans-serif;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--font-body);
  color: var(--grape);
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.2rem, 5vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
p { margin: 0 0 1em; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
section { padding: 72px 0; }
.section-tight { padding: 40px 0; }

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 12px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-2px); opacity: 0.92; }
.btn-primary { background: var(--orange); color: var(--white); }
.btn-outline { background: transparent; border-color: var(--white); color: var(--white); }
.btn-outline-dark { background: transparent; border-color: var(--grape); color: var(--grape); }
.btn-grape { background: var(--grape); color: var(--white); }
.btn-row { display: flex; gap: 16px; flex-wrap: wrap; }

.btn-primary, .nav-give {
  animation: btn-pulse 2.4s ease-in-out infinite;
}
.btn-primary:hover, .nav-give:hover { animation-play-state: paused; }
@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,142,28,0.55); }
  50% { box-shadow: 0 0 0 10px rgba(239,142,28,0); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-primary, .nav-give { animation: none; }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid #eee;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}
.logo img { height: 48px; width: auto; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--grape);
  margin: 5px 0;
  border-radius: 2px;
}
.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.main-nav a.nav-link {
  font-weight: 600;
  color: var(--ink);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}
.main-nav a.nav-link:hover,
.main-nav li.active > a.nav-link { color: var(--grape); border-bottom-color: var(--orange); }
.has-dropdown { position: relative; }
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  border-radius: 10px;
  padding: 10px;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.dropdown a:hover { background: var(--paper); color: var(--grape); }
.nav-give { background: var(--orange); color: var(--white) !important; padding: 10px 22px !important; border-radius: 999px; border-bottom: none !important; }

/* Marquee */
.marquee-bar {
  background: var(--grape-dark);
  color: var(--white);
  overflow: hidden;
  white-space: nowrap;
  padding: 9px 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 24s linear infinite;
}
.marquee-track span { padding: 0 40px; white-space: nowrap; }
@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; padding-left: 24px; }
}

/* Hero */
.hero {
  color: var(--white);
  padding: 90px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  opacity: 0;
  transition: opacity 1.8s ease;
}
.hero-bg-slide.active { opacity: 1; }
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg, rgba(89,33,110,0.72) 0%, rgba(64,21,83,0.58) 45%, rgba(23,20,26,0.4) 100%);
}
.hero .container { position: relative; z-index: 2; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero-media { border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.4); }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
}
.hero p.lead { font-size: 1.2rem; color: rgba(255,255,255,0.88); }
.page-hero {
  background:
    linear-gradient(120deg, rgba(89,33,110,0.82) 0%, rgba(34,58,99,0.8) 100%),
    url('../img/gallery/gallery-service.jpg') center 25%/cover no-repeat;
  color: var(--white);
  padding: 80px 0 60px;
}
.page-hero p { color: rgba(255,255,255,0.85); max-width: 640px; }
.hero h1, .hero h2, .hero h3,
.page-hero h1, .page-hero h2, .page-hero h3 { color: var(--white); }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}
.card {
  background: var(--paper);
  border-radius: 14px;
  padding: 32px;
  border: 1px solid #eee0ec;
}
.card h3 { margin-bottom: 10px; }
.card .icon { font-size: 2rem; margin-bottom: 14px; display: block; }

.band {
  background: var(--grape);
  color: var(--white);
}
.band h2, .band h3 { color: var(--white); }
.band-olive { background: var(--olive); color: var(--white); }
.band-olive h2, .band-olive h3 { color: var(--white); }
.band-nordic { background: var(--nordic); color: var(--white); }
.band-nordic h2, .band-nordic h3 { color: var(--white); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 780px) {
  .two-col { grid-template-columns: 1fr; }
}

.pill {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: var(--black);
}
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Ministries / Events grid items */
.tile {
  border-radius: 14px;
  padding: 28px;
  color: var(--white);
}
.tile h3 { color: var(--white); margin-bottom: 8px; }
.tile-1 { background: var(--grape); }
.tile-2 { background: var(--orange); }
.tile-3 { background: var(--olive); }
.tile-4 { background: var(--nordic); }
.tile-5 { background: var(--deepblue); }
.tile-6 { background: var(--magenta); }
.tile-7 { background: var(--grey); }
.tile-8 { background: var(--grape-dark); }

.event-card {
  display: flex;
  gap: 20px;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 24px;
  align-items: flex-start;
}
.event-thumb {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.event-date {
  background: var(--orange);
  color: var(--white);
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
  font-weight: 700;
  min-width: 84px;
}
.event-date small { display: block; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.08em; }
.event-date span { font-size: 1.5rem; }

/* Forms */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
}
.newsletter-form { display: flex; gap: 12px; flex-wrap: wrap; }
.newsletter-form input { flex: 1; min-width: 220px; padding: 14px 16px; border-radius: 999px; border: none; }

.auth-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background: var(--paper);
}
.auth-card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid #eee0ec;
  padding: 40px;
  max-width: 420px;
  width: 100%;
}
.auth-card h1 { font-size: 1.8rem; }
.auth-footer-link { text-align: center; margin-top: 18px; font-size: 0.95rem; }
.auth-error {
  background: #fdecec;
  border: 1px solid #f5b8b8;
  color: #9a1f1f;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-bottom: 18px;
  display: none;
}
.auth-error.show { display: block; }

.note {
  background: var(--paper);
  border: 1px solid #eee0ec;
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 0.92rem;
  color: var(--grey);
}

/* Footer */
.site-footer {
  background: var(--black);
  color: rgba(255,255,255,0.8);
  padding: 60px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}
.site-footer h4 { color: var(--white); font-size: 1rem; margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a:hover { color: var(--orange); }
.footer-logo img { height: 40px; margin-bottom: 16px; filter: brightness(0) invert(1); }
.social-row { display: flex; gap: 14px; margin-top: 16px; }
.social-row a {
  width: 38px; height: 38px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}
.social-row a:hover { background: var(--orange); border-color: var(--orange); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 20px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Mobile nav */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
  }
  .main-nav.open {
    max-height: 85vh;
    opacity: 1;
    overflow-y: auto;
    padding: 8px 0;
  }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 0; }
  .main-nav li { width: 100%; }
  .main-nav a.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 24px;
    border-bottom: none;
  }
  .has-dropdown > a.nav-link::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--grey);
    border-bottom: 2px solid var(--grey);
    transform: rotate(45deg);
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin-left: 12px;
  }
  .has-dropdown.open > a.nav-link::after { transform: rotate(-135deg); }
  .dropdown {
    position: static;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    min-width: 0;
    background: var(--paper);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .has-dropdown.open .dropdown { max-height: 320px; padding: 6px 0 10px; }
  .dropdown a { padding: 11px 24px 11px 36px; font-size: 0.93rem; }
  .nav-give { display: inline-flex; justify-content: center; margin: 16px 24px; }
}

/* Chat widget */
.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--grape);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(0,0,0,0.3);
  animation: btn-pulse 2.4s ease-in-out infinite;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.chat-toggle:hover { transform: scale(1.06); }
.chat-bubble {
  background: var(--white);
  color: var(--ink);
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  cursor: pointer;
  border: none;
}
.chat-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  animation: chat-bubble-bounce 1.8s ease-in-out infinite;
}
@keyframes chat-bubble-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.04); }
}
.chat-panel {
  display: none;
  flex-direction: column;
  width: min(340px, calc(100vw - 40px));
  height: min(480px, calc(100vh - 120px));
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
  overflow: hidden;
}
.chat-panel.open { display: flex; }
.chat-panel-header {
  background: var(--grape);
  color: var(--white);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  flex-shrink: 0;
}
.chat-panel-header button {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.chat-msg-bot {
  background: var(--paper);
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-msg-user {
  background: var(--grape);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}
.chat-input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
}
@media (max-width: 480px) {
  .chat-widget { right: 14px; bottom: 14px; }
  .chat-bubble { font-size: 0.85rem; padding: 10px 14px; }
}

/* Giving */
.give-panel {
  background: var(--white);
  border: 1px solid #eee0ec;
  border-radius: 16px;
  padding: 32px;
}
.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.amount-btn {
  padding: 14px 8px;
  border: 2px solid #ddd;
  border-radius: 10px;
  background: var(--white);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.amount-btn:hover { border-color: var(--orange); }
.amount-btn.amount-selected { border-color: var(--orange); background: #fff6e8; color: var(--orange); }
.custom-amount-wrap { position: relative; margin-bottom: 18px; }
.custom-amount-wrap span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: var(--grey);
}
.custom-amount-wrap input { padding-left: 30px; }

/* Calendar */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-month-label { margin: 0; font-size: 1.1rem; color: var(--grape); }
.cal-nav {
  background: var(--paper);
  border: 1px solid #eee0ec;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--grape);
}
.cal-nav:hover { background: #f1e6f3; }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day {
  aspect-ratio: 1;
  border: 1px solid #eee;
  border-radius: 8px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  padding: 4px;
}
.cal-day:hover { border-color: var(--orange); }
.cal-day-empty { border: none; cursor: default; background: transparent; }
.cal-day-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); margin-top: 3px; }
.cal-day-today { border-color: var(--grape); font-weight: 800; }
.cal-day-has-events { font-weight: 700; }
.cal-day-selected { background: var(--grape); color: var(--white); border-color: var(--grape); }
.cal-day-selected .cal-day-dot { background: var(--white); }

.gcal-add-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid #eee0ec;
  color: var(--grape);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  align-self: flex-start;
}
.gcal-add-btn:hover { background: var(--orange); color: var(--white); border-color: var(--orange); }

/* Giving summary */
.giving-counter {
  background: var(--grape);
  color: var(--white);
  border-radius: 16px;
  padding: 28px 32px;
  text-align: center;
}
.giving-counter .amount { font-size: 2.4rem; font-weight: 800; }
.giving-counter .label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; opacity: 0.85; }

/* Cookie consent banner */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1100;
  max-width: 640px;
  margin: 0 auto;
  background: var(--ink, #1f1f1f);
  color: var(--white);
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.cookie-banner p {
  margin: 0;
  flex: 1 1 260px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.9);
}
.cookie-banner a { color: var(--orange); text-decoration: underline; }
.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cookie-banner-actions .btn { padding: 8px 16px; font-size: 0.9rem; animation: none; }
.cookie-banner-actions .btn-outline-dark {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.4);
}
.cookie-banner-actions .btn-outline-dark:hover { background: rgba(255,255,255,0.1); }
@media (max-width: 520px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 13px 14px;
    gap: 10px;
    border-radius: 12px;
  }
  .cookie-banner p { font-size: 0.8rem; line-height: 1.4; }
  .cookie-banner-actions { justify-content: flex-end; gap: 8px; }
  .cookie-banner-actions .btn { padding: 7px 13px; font-size: 0.8rem; }
}
