/* ==========================================================================
   St. Moses the Strong Coptic Orthodox Church — Stylesheet
   Mobile-first, token-driven design system.

   NOTE ON TAILWIND: Every page also loads Tailwind CSS from the CDN (see the
   <script> block in each <head>) with `preflight` disabled, so Tailwind's
   base reset never fights with the rules below. Tailwind utility classes are
   used directly in markup for the hero sections, header topbar, and footer
   gradient; this stylesheet still owns the reusable component classes
   (buttons, cards, forms, nav, etc.) used across every page and partial.

   Sections:
     1. Design tokens
     2. Base / reset
     3. Layout utilities
     4. Buttons
     5. Header & navigation
     6. Footer
     7. Hero
     8. Sections & cards
     9. Forms
    10. Components (schedule, accordion, badges, spinner, modal, calendar)
    11. Page-specific helpers
    12. Accessibility & motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette — warm, trustworthy, inspired by Coptic iconography */
  --color-primary: #7a1f2b;        /* deep burgundy */
  --color-primary-dark: #5b1620;
  --color-primary-light: #9a3542;
  --color-accent: #c9a227;         /* gold */
  --color-accent-dark: #a3821c;
  --color-bg: #faf6ef;             /* warm cream */
  --color-surface: #ffffff;
  --color-surface-alt: #f3ecdf;
  --color-text: #2b2b33;
  --color-text-muted: #5c5c66;
  --color-text-on-dark: #f8f4ec;
  --color-border: #e3dccc;
  --color-error: #b3261e;
  --color-success: #1e6b3a;
  --color-focus: #1a4f9c;

  /* Typography */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  /* Misc */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(43, 43, 51, 0.08);
  --shadow-md: 0 4px 16px rgba(43, 43, 51, 0.12);
  --container-max: 72rem;
  --header-height: 4.5rem;
}

/* --------------------------------------------------------------------------
   2. Base / reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--space-4);
  color: var(--color-primary-dark);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
h4 { font-size: 1.2rem; }

p { margin: 0 0 var(--space-4); }

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

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

ul, ol { padding-left: 1.25rem; }

/* Visible focus for keyboard users */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 200;
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary-dark);
  color: var(--color-text-on-dark);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.skip-link:focus {
  top: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   3. Layout utilities
   -------------------------------------------------------------------------- */
.container {
  width: min(100% - 2.5rem, var(--container-max));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-7);
}

.section--alt { background: var(--color-surface-alt); }
.section--dark {
  background: linear-gradient(160deg, var(--color-primary-dark) 0%, #3a0e15 100%);
  color: var(--color-text-on-dark);
}
.section--dark h2, .section--dark h3 { color: var(--color-text-on-dark); }
.section--dark a { color: var(--color-accent); }

.section-header {
  max-width: 44rem;
  margin-bottom: var(--space-6);
}

.section-header--center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  margin-bottom: var(--space-2);
}

.section--dark .eyebrow { color: var(--color-accent); }

.grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 40rem) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 64rem) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.split {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

@media (min-width: 64rem) {
  .split { grid-template-columns: 1fr 1fr; }
}

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
  color: #fff;
  box-shadow: 0 4px 14px rgba(122, 31, 43, 0.28);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(122, 31, 43, 0.35);
}

.btn-gold {
  background: linear-gradient(180deg, #d9b64a, var(--color-accent));
  color: #33280a;
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.35);
}

.btn-gold:hover {
  background: var(--color-accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(201, 162, 39, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: currentColor;
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(122, 31, 43, 0.2);
}

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

.btn-outline--light {
  color: var(--color-text-on-dark);
}

.btn-outline--light:hover {
  background: var(--color-text-on-dark);
  color: var(--color-primary-dark);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* --------------------------------------------------------------------------
   5. Header & navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.site-header--banner {
  background: linear-gradient(180deg, var(--color-primary-dark) 0%, #4a1219 100%);
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
  box-shadow: 0 8px 24px -12px rgba(58, 14, 21, 0.65);
}

.brand-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--header-height);
  max-width: 72rem;
  margin-inline: auto;
  padding: 0.55rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-primary-dark);
  min-width: 0;
}

.brand--banner {
  color: #fff;
}

.brand--banner:hover {
  color: #fff;
}

.brand__mark {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 3px var(--color-accent);
}

.brand__mark--lg {
  width: 52px;
  height: 52px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18), 0 0 0 3px var(--color-accent);
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.15;
}

.brand--banner .brand__name {
  color: #fff;
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  letter-spacing: 0.01em;
}

.brand__location {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.brand--banner .brand__location {
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.15rem;
}

.brand-banner__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.brand-banner__give {
  padding: 0.5rem 1.05rem;
  font-size: 0.9rem;
}

.pages-menu {
  position: relative;
}

.pages-menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pages-menu__toggle:hover,
.pages-menu__toggle:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-accent);
  outline: none;
}

.pages-menu__toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--color-accent);
}

.pages-menu__chevron {
  transition: transform 0.2s ease;
}

.pages-menu__toggle[aria-expanded="true"] .pages-menu__chevron {
  transform: rotate(180deg);
}

.pages-menu__panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 13.5rem;
  padding: var(--space-2);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 16px 40px -18px rgba(58, 14, 21, 0.55);
  z-index: 120;
}

.pages-menu__panel[hidden] {
  display: none !important;
}

.pages-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pages-menu .site-nav__link {
  display: block;
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text);
  border-radius: var(--radius-sm);
}

.pages-menu .site-nav__link:hover {
  background: var(--color-surface-alt);
  color: var(--color-primary);
}

.pages-menu .site-nav__link[aria-current="page"] {
  color: var(--color-primary);
  background: rgba(122, 31, 43, 0.08);
  box-shadow: inset 3px 0 0 var(--color-accent);
}

@media (max-width: 30rem) {
  .brand__location {
    display: none;
  }

  .brand-banner {
    padding-inline: 1rem;
  }
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--color-primary-dark);
  color: var(--color-text-on-dark);
  padding-block: var(--space-7) var(--space-5);
  margin-top: var(--space-8);
}

.site-footer a { color: var(--color-text-on-dark); }
.site-footer a:hover { color: var(--color-accent); }

.site-footer__grid {
  display: grid;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

@media (min-width: 40rem) {
  .site-footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 64rem) {
  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.site-footer h3 {
  color: var(--color-accent);
  font-size: 1.15rem;
  margin-bottom: var(--space-3);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li { margin-bottom: var(--space-2); }

.site-footer__bottom {
  border-top: 1px solid rgba(248, 244, 236, 0.2);
  padding-top: var(--space-4);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
}

.social-links {
  display: flex;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(248, 244, 236, 0.35);
  border-radius: 50%;
}

.social-links a:hover {
  border-color: var(--color-accent);
  background: rgba(201, 162, 39, 0.15);
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background:
    linear-gradient(rgba(52, 12, 18, 0.78), rgba(52, 12, 18, 0.78)),
    url("../assets/images/hero.svg") center / cover no-repeat,
    var(--color-primary-dark);
  color: var(--color-text-on-dark);
  padding-block: var(--space-8);
  text-align: center;
}

.hero h1 {
  color: #fff;
  margin-bottom: var(--space-3);
}

.hero__tagline {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  max-width: 40rem;
  margin: 0 auto var(--space-6);
  color: var(--color-text-on-dark);
}

.hero .btn-group { justify-content: center; }

.hero--page {
  padding-block: var(--space-7);
}

/* Landing hero layout, entrance, and ambient motion */
.landing-hero__inner {
  display: flex;
  align-items: center;
  min-height: min(78vh, 44rem);
}

.landing-hero__grid {
  display: grid;
  align-items: center;
  gap: var(--space-7);
  width: 100%;
}

.landing-hero__content {
  text-align: center;
}

.landing-hero__glow {
  animation: hero-glow-drift 12s ease-in-out infinite alternate;
  transform: scale(1.04);
}

.landing-hero__pattern {
  animation: hero-pattern-drift 18s ease-in-out infinite alternate;
}

.landing-hero__cross {
  position: absolute;
  color: rgba(230, 199, 107, 0.18);
  filter: drop-shadow(0 0 14px rgba(201, 162, 39, 0.16));
  animation: hero-cross-float 9s ease-in-out infinite;
}

.landing-hero__cross--one {
  top: 12%;
  left: 7%;
  width: clamp(4rem, 8vw, 7rem);
  animation-delay: -1s;
}

.landing-hero__cross--two {
  right: 8%;
  bottom: 10%;
  width: clamp(5rem, 10vw, 9rem);
  color: rgba(230, 199, 107, 0.14);
  animation-delay: -4s;
  animation-duration: 11s;
}

.landing-hero__cross--three {
  top: 18%;
  right: 24%;
  width: clamp(2.5rem, 5vw, 4.5rem);
  color: rgba(255, 255, 255, 0.1);
  animation-delay: -7s;
  animation-duration: 13s;
}

.landing-hero__eyebrow,
.landing-hero__title,
.landing-hero__divider,
.landing-hero__copy,
.landing-hero__actions {
  opacity: 0;
  animation: hero-reveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.landing-hero__eyebrow { animation-delay: 0.1s; }
.landing-hero__title { animation-delay: 0.24s; }
.landing-hero__divider { animation-delay: 0.34s; }
.landing-hero__copy { animation-delay: 0.44s; }
.landing-hero__actions { animation-delay: 0.58s; }

.landing-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.05rem;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.landing-hero__title {
  margin: var(--space-5) 0 0;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.08;
  color: #fff;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.landing-hero__gold-text {
  display: block;
  margin-top: 0.15em;
  background: linear-gradient(100deg, var(--color-accent), #f3dc95, var(--color-accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hero-gold-shimmer 5s ease-in-out 1.1s infinite;
}

.landing-hero__divider {
  display: block;
  width: 7rem;
  height: 2px;
  margin: var(--space-5) auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}

.landing-hero__copy {
  max-width: 34rem;
  margin: var(--space-5) auto 0;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
  text-wrap: balance;
}

.landing-hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.landing-hero__portrait {
  position: relative;
  width: min(100%, 20rem);
  margin: 0 auto;
  opacity: 0;
  animation:
    hero-portrait-reveal 1s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards,
    hero-portrait-float 7s ease-in-out 1.4s infinite;
}

/* Thin outer frame, echoing a traditional icon panel */
.landing-hero__portrait-ring {
  position: absolute;
  inset: -0.85rem;
  border-radius: 1.65rem;
  border: 1px solid rgba(230, 199, 107, 0.35);
}

@media (min-width: 40rem) {
  .landing-hero__actions {
    flex-direction: row;
  }
}

@media (min-width: 48rem) {
  .landing-hero__grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(14rem, 0.85fr);
    gap: var(--space-7);
  }

  .landing-hero__content {
    text-align: left;
  }

  .landing-hero__divider,
  .landing-hero__copy {
    margin-inline: 0;
  }

  .landing-hero__actions {
    justify-content: flex-start;
  }
}

@media (min-width: 64rem) {
  .landing-hero__grid {
    gap: var(--space-8);
  }

  .landing-hero__portrait {
    width: min(100%, 23rem);
  }
}

.landing-hero__portrait img {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 1rem;
  border: 3px solid rgba(230, 199, 107, 0.72);
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.06),
    0 28px 65px -24px rgba(0, 0, 0, 0.7);
}

.landing-hero__portrait-glow {
  position: absolute;
  inset: 6%;
  border-radius: 1.5rem;
  background: rgba(201, 162, 39, 0.38);
  filter: blur(36px);
  animation: hero-portrait-pulse 5s ease-in-out infinite;
}

.landing-hero__button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3.35rem;
  padding: 0.7rem 0.85rem 0.7rem 1.35rem;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.75);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease;
}

.landing-hero__button::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.42) 48%, transparent 76%);
  transform: translateX(-125%);
  transition: transform 0.7s ease;
}

.landing-hero__button:hover {
  transform: translateY(-3px);
  text-decoration: none;
  box-shadow: 0 20px 36px -16px rgba(0, 0, 0, 0.85);
}

.landing-hero__button:hover::before {
  transform: translateX(125%);
}

.landing-hero__button:active {
  transform: translateY(-1px);
}

.landing-hero__button--primary {
  color: #33280a;
  background: linear-gradient(135deg, #e6c76b, var(--color-accent));
  border-color: rgba(255, 235, 168, 0.75);
}

.landing-hero__button--primary:hover {
  color: #251c06;
  background: linear-gradient(135deg, #f0d783, #d5ad2e);
}

.landing-hero__button--secondary {
  padding-right: 1.35rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(10px);
}

.landing-hero__button--secondary:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(230, 199, 107, 0.8);
}

.landing-hero__button-icon {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(51, 40, 10, 0.12);
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.landing-hero__button--secondary .landing-hero__button-icon {
  background: rgba(255, 255, 255, 0.12);
}

.landing-hero__button:hover .landing-hero__button-icon {
  transform: scale(1.08);
}

.landing-hero__button--primary:hover .landing-hero__button-icon {
  transform: translateX(2px) scale(1.08);
}

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

@keyframes hero-portrait-reveal {
  from {
    opacity: 0;
    transform: translate3d(24px, 10px, 0) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes hero-portrait-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -9px, 0); }
}

@keyframes hero-portrait-pulse {
  0%, 100% { opacity: 0.65; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes hero-glow-drift {
  from { transform: scale(1.04) translate3d(-1%, -1%, 0); }
  to { transform: scale(1.1) translate3d(1.5%, 1%, 0); }
}

@keyframes hero-pattern-drift {
  from { transform: scale(1); }
  to { transform: scale(1.035) translate3d(0.5%, -0.5%, 0); }
}

@keyframes hero-cross-float {
  0%, 100% {
    opacity: 0.55;
    transform: translate3d(0, 0, 0) rotate(-2deg);
  }
  50% {
    opacity: 1;
    transform: translate3d(0, -12px, 0) rotate(2deg);
  }
}

@keyframes hero-gold-shimmer {
  0%, 25% { background-position: 100% center; }
  60%, 100% { background-position: 0 center; }
}

/* --------------------------------------------------------------------------
   8. Sections & cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.card__media {
  aspect-ratio: 16 / 9;
  background: var(--color-surface-alt);
  overflow: hidden;
}

.card__media img,
.card__media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.card__body h3 { margin-bottom: 0; }

.card__meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.card__footer { margin-top: auto; padding-top: var(--space-3); }

.card--clickable:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
  transform: translateY(-3px);
}

/* Icon circle for ministry / value cards */
.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--color-surface-alt), #e9dfc7);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  box-shadow: inset 0 0 0 1px var(--color-border);
  transition: background 0.2s ease, transform 0.2s ease;
}

.card--clickable:hover .icon-circle {
  background: linear-gradient(160deg, var(--color-accent), var(--color-accent-dark));
  color: #fff;
  transform: scale(1.05);
}

/* Testimonial */
.testimonial {
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

.testimonial blockquote {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
}

.testimonial cite {
  font-style: normal;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   9. Forms
   -------------------------------------------------------------------------- */
.form {
  display: grid;
  gap: var(--space-4);
}

.form-row {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 40rem) {
  .form-row--2 { grid-template-columns: 1fr 1fr; }
}

.form-field {
  display: grid;
  gap: var(--space-1);
}

.form-field label {
  font-weight: 600;
  font-size: 0.95rem;
}

.form-field .hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  font: inherit;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
}

.form-field textarea { resize: vertical; min-height: 7rem; }

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 1px;
}

.form-field input[aria-invalid="true"],
.form-field select[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
  border-color: var(--color-error);
}

.form-field .field-error {
  color: var(--color-error);
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 1.1em;
  margin: 0;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.form-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}

fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
}

legend {
  font-weight: 700;
  padding-inline: var(--space-2);
}

/* Success / status messages */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-sm);
  border: 1px solid;
}

.alert--success {
  background: #e8f4ec;
  border-color: #b7dcc4;
  color: var(--color-success);
}

.alert--success h3 { color: var(--color-success); margin-bottom: var(--space-2); }

.alert--info {
  background: #eef2fa;
  border-color: #c3d0ea;
  color: #23458a;
}

/* --------------------------------------------------------------------------
   10. Components
   -------------------------------------------------------------------------- */

/* Service schedule table */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.schedule-table caption {
  text-align: left;
  font-weight: 700;
  padding-bottom: var(--space-3);
}

.schedule-table th,
.schedule-table td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.schedule-table tbody tr:last-child th,
.schedule-table tbody tr:last-child td { border-bottom: none; }

.schedule-table thead {
  background: var(--color-primary);
  color: #fff;
}

.schedule-table tbody th {
  font-weight: 700;
  color: var(--color-primary-dark);
  white-space: nowrap;
}

/* Compact schedule list (hero strip / footer) */
.schedule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.schedule-list strong { color: inherit; }

/* Accordion (native details/summary) */
.accordion {
  display: grid;
  gap: var(--space-3);
}

.accordion details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.accordion summary {
  cursor: pointer;
  font-weight: 700;
  padding: var(--space-4) var(--space-5);
  list-style: none;
  position: relative;
  padding-right: 3rem;
}

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

.accordion summary::after {
  content: "+";
  position: absolute;
  right: var(--space-5);
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--color-accent-dark);
}

.accordion details[open] summary::after { content: "\2212"; }

.accordion details > div {
  padding: 0 var(--space-5) var(--space-4);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--color-surface-alt);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-border);
}

.badge--gold { background: var(--color-accent); color: #33280a; border: none; }

/* Date block for event cards */
.date-block {
  flex-shrink: 0;
  width: 4.25rem;
  text-align: center;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  align-self: flex-start;
}

.date-block__month {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.date-block__day {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

/* HTMX loading indicator (spinner) */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.spinner {
  width: 1.1em;
  height: 1.1em;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Dim buttons of an in-flight form */
form.htmx-request .btn[type="submit"] {
  opacity: 0.6;
  pointer-events: none;
}

/* Detail panel (loaded via HTMX on ministries/sermons/events) */
.detail-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  margin-top: var(--space-6);
}

.detail-panel:empty { display: none; }

.detail-panel__close {
  float: right;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text-muted);
}

.detail-panel__close:hover { color: var(--color-primary); border-color: currentColor; }

/* Modal (native dialog) */
.modal {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  width: min(92vw, 34rem);
}

.modal::backdrop {
  background: rgba(43, 43, 51, 0.55);
}

/* Media/embed placeholders (livestream, map, video) */
.media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  aspect-ratio: 16 / 9;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-5);
}

.media-placeholder--map { aspect-ratio: 4 / 3; }

/* Real embedded Google Map — replaces the dashed placeholder once a location is known. */
.map-embed {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Calendar layout (events page) */
.calendar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.calendar__head,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar__head {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.calendar__head > div { padding: var(--space-2); }

.calendar__grid > div {
  min-height: 4.25rem;
  padding: var(--space-1) var(--space-2);
  border-top: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  font-size: 0.85rem;
}

.calendar__grid > div:nth-child(7n + 1) { border-left: none; }

.calendar__day-num { font-weight: 700; color: var(--color-text-muted); }

.calendar__event {
  display: block;
  margin-top: var(--space-1);
  padding: 0.1rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  background: var(--color-surface-alt);
  color: var(--color-primary-dark);
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.calendar__event--liturgy { background: #eef2fa; color: #23458a; }

.calendar__day--other { background: #fbfaf6; color: #b8b2a4; }

@media (max-width: 40rem) {
  .calendar__grid > div { min-height: 3rem; }
  .calendar__event { font-size: 0.6rem; }
}

/* --------------------------------------------------------------------------
   11. Page-specific helpers
   -------------------------------------------------------------------------- */

/* Quick info strip under the home hero */
.info-strip {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.info-strip__grid {
  display: grid;
  gap: var(--space-5);
  padding-block: var(--space-5);
}

@media (min-width: 64rem) {
  .info-strip__grid { grid-template-columns: repeat(3, 1fr); }
}

.info-strip h2 {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-dark);
  margin-bottom: var(--space-2);
}

/* Priest welcome / portrait */
.portrait-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 6px solid var(--color-surface);
  box-shadow: var(--shadow-md);
  background: var(--color-surface-alt);
}

/* Small circular portrait — e.g. the "Word from our Priest" section, where a
   full-width photo would overpower the message. EDIT: adjust width to resize. */
.portrait-frame--sm {
  width: 9rem;
  margin: 0 auto;
  border-radius: 50%;
  border-width: 4px;
  aspect-ratio: 1;
}
.portrait-frame--sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (min-width: 48rem) {
  .portrait-frame--sm { width: 11rem; margin: 0; }
}

.welcome-block {
  display: grid;
  gap: var(--space-6);
  align-items: start;
  text-align: center;
}
@media (min-width: 48rem) {
  .welcome-block {
    grid-template-columns: 11rem 1fr;
    align-items: center;
    text-align: left;
  }
}

/* Sermon / event list item layout */
.event-card {
  display: flex;
  gap: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

.event-card__body { flex: 1; display: flex; flex-direction: column; gap: var(--space-2); }
.event-card__body h3 { margin-bottom: 0; }

/* Filter toolbar (sermons) */
.filter-bar {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

@media (min-width: 40rem) {
  .filter-bar { grid-template-columns: 2fr 1fr; align-items: end; }
}

/* Values list */
.values-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.values-list li {
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
}

/* Leadership / staff cards */
.person-card { text-align: center; }

.person-card .card__media {
  aspect-ratio: 1;
  border-radius: 50%;
  width: 9rem;
  margin: var(--space-5) auto 0;
  border: 4px solid var(--color-surface-alt);
}

/* Creed / statement of faith block */
.creed-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.creed-block p {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

/* --------------------------------------------------------------------------
   12. Accessibility & motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .landing-hero__eyebrow,
  .landing-hero__title,
  .landing-hero__divider,
  .landing-hero__copy,
  .landing-hero__actions,
  .landing-hero__portrait {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header, .site-footer, .pages-menu, .btn { display: none !important; }
}
