:root {
  --color-primary: #2f5d7c;
  --color-secondary: #7daac3;
  --color-accent: #f4a259;
  --color-dark: #1f2c39;
  --color-text: #1b2733;
  --color-muted: #65758a;
  --color-surface: #ffffff;
  --color-background: #f4f7f9;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-soft: 0 18px 40px -24px rgba(33, 64, 88, 0.35);
  --shadow-hover: 0 22px 44px -20px rgba(33, 64, 88, 0.45);
  --max-width: 1100px;
  --transition: 180ms ease-in-out;
  font-size: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-background);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}

.container {
  width: min(90%, var(--max-width));
  margin: 0 auto;
}

.site-header {
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(125, 170, 195, 0.25);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.03em;
}

.brand img {
  width: 48px;
  height: auto;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-links a {
  font-weight: 600;
  color: var(--color-text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.nav-links .btn {
  padding: 0.65rem 1.4rem;
  white-space: nowrap;
  color: #fff;
  flex-shrink: 0; /* Prevent Safari flexbox collapse */
}

.nav-links .btn:hover,
.nav-links .btn:focus-visible {
  color: #fff;
}

.nav-cta {
  box-shadow: var(--shadow-soft);
}

.nav-links a:not(.btn):hover,
.nav-links a:not(.btn):focus-visible {
  background: rgba(125, 170, 195, 0.15);
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 0;
}

.nav-toggle svg {
  width: 1.75rem;
  height: 1.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-hero {
  padding: 4rem 0 2rem;
}

.hero-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0 0;
}

.hero-logo img {
  width: min(60vw, 180px);
  max-width: 180px;
  margin: 0 auto;
  filter: drop-shadow(0 22px 40px rgba(33, 64, 88, 0.25));
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero-grid--home {
  align-items: stretch;
}

.hero-grid--join {
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.hero-copy {
  display: grid;
  gap: 1.5rem;
}

.hero-grid--join .hero-copy {
  grid-column: 1 / -1;
  max-width: none;
}

.hero-copy .hero-text {
  margin-bottom: 0;
}

.hero-grid--join .hero-text {
  max-width: none;
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-grid--home .hero-visual {
  justify-content: flex-start;
}

.hero-grid--home .hero-visual {
  align-self: stretch;
}

.hero-grid--home .hero-visual img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

.hero-visual img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  object-fit: cover;
}

.hero-badge {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-secondary);
}

.hero-title {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  margin: 0.5rem 0 1rem;
  line-height: 1.15;
  color: var(--color-dark);
}

.hero-grid--home .hero-title {
  font-size: clamp(2.1rem, 3vw, 2.8rem);
}

.hero-text {
  max-width: 40ch;
  margin-bottom: 1.75rem;
  color: var(--color-muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-grid--home .hero-copy {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: center;
  height: 100%;
}

.hero-grid--home .hero-actions {
  margin-top: auto;
}

.hero-highlight {
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.form-embed {
  margin-top: 1.5rem;
}

.hero-grid--join .form-embed {
  margin-top: 0;
}

.form-embed iframe {
  width: 100%;
  height: 1100px;
  border: 0;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.65rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid rgba(47, 93, 124, 0.4);
}

.btn-outline:hover {
  background: rgba(125, 170, 195, 0.15);
}

.section {
  padding: 4rem 0;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  margin: 0;
  color: var(--color-dark);
}

.section-header p {
  max-width: 60ch;
  margin: 0;
  color: var(--color-muted);
}

.cards-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--color-dark);
}

.card p {
  margin: 0;
  color: var(--color-muted);
}

.highlight-card {
  display: grid;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(47, 93, 124, 0.95), rgba(125, 170, 195, 0.9));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-soft);
}

.highlight-card span {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.highlight-card h3 {
  margin: 0;
  font-size: 1.8rem;
}

.highlight-card p {
  margin: 0;
  max-width: 50ch;
  color: rgba(255, 255, 255, 0.92);
}

.highlight-card .btn,
.highlight-card .btn-outline {
  background: #fff;
  color: var(--color-primary);
  border-color: transparent;
  box-shadow: none;
}

.highlight-card .btn:hover,
.highlight-card .btn-outline:hover {
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-primary);
  box-shadow: 0 14px 32px -18px rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.highlight-card .details-list {
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 18px 36px -28px rgba(33, 64, 88, 0.55);
  color: var(--color-primary);
}

.highlight-card .details-list li {
  color: var(--color-text);
}

.highlight-card .details-list strong {
  color: var(--color-primary);
}

.details-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.details-list li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  color: var(--color-muted);
}

.details-list strong {
  color: var(--color-surface);
}

.details-list a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
}

.details-list a:hover {
  color: var(--color-accent);
}

.highlight-card .details-list a {
  color: var(--color-primary);
}

.info-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.board-list {
  display: grid;
  gap: 1.25rem;
  padding: 0;
  list-style: none;
}

.board-list li {
  background: var(--color-surface);
  border: 1px solid rgba(47, 93, 124, 0.08);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.event-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--color-secondary);
  font-size: 0.95rem;
  font-weight: 600;
}

.contact-card {
  display: grid;
  gap: 1rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
}

.contact-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  color: var(--color-primary);
  font-weight: 600;
}

.contact-links a:hover {
  color: var(--color-accent);
}

form {
  display: grid;
  gap: 1rem;
}

label {
  font-weight: 600;
  color: var(--color-dark);
}

input,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(47, 93, 124, 0.2);
  background: rgba(255, 255, 255, 0.95);
  font: inherit;
  transition: border var(--transition), box-shadow var(--transition);
}

input:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(125, 170, 195, 0.2);
}

.site-footer {
  background: #10202d;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 5rem;
  padding: 2.5rem 0;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.footer-brand img {
  width: 70px;
  margin-bottom: 0.75rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.72);
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 1.5rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

.tagline {
  color: rgba(255, 255, 255, 0.8);
  max-width: 45ch;
}

.map-note {
  background: rgba(255, 255, 255, 0.85);
  padding: 1rem;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
}

.map-embed iframe {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.calendar-embed {
  background: var(--color-surface);
  padding: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.calendar-embed iframe {
  width: 100%;
  height: clamp(420px, 65vw, 540px);
  min-height: 420px;
  border: 0;
  display: block;
  background: var(--color-surface);
}

.error-page {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 0;
}

.error-card {
  background: var(--color-surface);
  padding: 3rem 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 1.75rem;
  max-width: 480px;
}

.error-code {
  font-size: 4rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}

.error-text {
  margin: 0;
  color: var(--color-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(47, 93, 124, 0.1);
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.two-column {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  align-items: start;
}

.prayer-times-grid {
  gap: 2.5rem;
}

.prayer-widget-card {
  display: grid;
  gap: 1.5rem;
}

.prayer-widget-frame {
  border: 1px solid rgba(47, 93, 124, 0.15);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--color-surface);
}

.prayer-widget-frame iframe {
  width: 100%;
  height: clamp(420px, 65vw, 540px);
  min-height: 420px;
  border: 0;
  display: block;
}

.widget-note {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.prayer-reminders {
  display: grid;
  gap: 1.5rem;
}

.prayer-reminders-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.25rem;
}

.prayer-reminders-list li {
  color: var(--color-muted);
}

.prayer-reminders-list strong {
  color: var(--color-dark);
  display: block;
  margin-bottom: 0.3rem;
}

.prayer-reminders a {
  color: var(--color-primary);
  font-weight: 600;
}

.highlight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.highlight-list li {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid rgba(47, 93, 124, 0.08);
  box-shadow: var(--shadow-soft);
}

.highlight-list strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--color-dark);
}

.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.stat-card span {
  display: block;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--color-primary);
}

.stat-card small {
  color: var(--color-muted);
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid--home {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }

  .hero-grid--join {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }

  .hero-grid--prayer {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }
}

@media (max-width: 840px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    inset: calc(100% + 12px) auto auto 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 35px -30px rgba(31, 44, 57, 0.5);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
  }

  .nav-links a {
    width: 100%;
    padding: 0.75rem;
  }

  .nav-links .btn {
    justify-content: center;
  }

  .nav-links.is-open {
    transform: scaleY(1);
    opacity: 1;
    visibility: visible;
  }

  .hero-grid--home .hero-visual {
    align-self: center;
  }

  .hero-grid--home .hero-visual img {
    height: auto;
    width: clamp(220px, 70vw, 420px);
  }
}

@media (max-width: 620px) {
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .highlight-card {
    padding: 2rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
