/* ---------- Design tokens ---------- */
:root {
  --color-bg: #faf7f1;
  --color-surface: #ffffff;
  --color-surface-2: #f3ede1;
  --color-text: #1c1a16;
  --color-text-muted: #6b6355;
  --color-border: #e6dcc8;
  --color-green: #1f4d38;
  --color-green-dark: #123024;
  --color-green-tint: #e7efe9;
  --color-gold: #b8912c;
  --color-gold-light: #d9b65a;
  --color-gold-tint: #f7edd2;

  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --shadow-sm: 0 1px 2px rgba(28, 26, 22, 0.06), 0 1px 1px rgba(28, 26, 22, 0.04);
  --shadow-md: 0 8px 24px rgba(28, 26, 22, 0.08), 0 2px 8px rgba(28, 26, 22, 0.05);
  --shadow-lg: 0 24px 64px rgba(18, 48, 36, 0.16), 0 8px 24px rgba(18, 48, 36, 0.08);

  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: 100%/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.01em; }

h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--color-text-muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-green);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--color-gold);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--color-green); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-green-dark); box-shadow: var(--shadow-md); }

.btn-gold { background: var(--color-gold); color: #211a08; box-shadow: var(--shadow-sm); }
.btn-gold:hover { background: var(--color-gold-light); box-shadow: var(--shadow-md); }

.btn-ghost { background: transparent; color: var(--color-green); border-color: var(--color-border); }
.btn-ghost:hover { border-color: var(--color-green); background: var(--color-green-tint); }

@media (hover: none) { .btn:hover { box-shadow: var(--shadow-sm); } }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 247, 241, 0.78);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(230, 220, 200, 0.7);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--color-green-dark);
}
.brand .brand-mark { color: var(--color-gold); font-size: 1.4rem; line-height: 1; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  position: relative;
  padding: 4px 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--color-gold);
  border-radius: 2px;
  transition: right 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .nav a:hover::after { right: 0; }
}

/* ---------- Hero ---------- */
.hero { padding: 64px 0 24px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
}
.hero-copy p.lede { font-size: 1.1rem; color: var(--color-text-muted); max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; }

.video-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--color-green-dark);
}
.video-embed { position: relative; padding-top: 81.82%; }
.video-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* ---------- Section shell ---------- */
.section { padding: 72px 0; }
.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-alt { background: var(--color-surface); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }

/* ---------- Article / card grid ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), border-color 200ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #d8caa6; }
}
.card-media {
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h3 { margin: 0; }
.card-body p { margin: 0; flex: 1; font-size: 0.95rem; }
.card-link {
  align-self: flex-start;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-green);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card-link .arrow { transition: transform 160ms var(--ease-out); }
.card:hover .card-link .arrow { transform: translateX(3px); }

/* card-as-button for modal triggers */
.card-trigger { text-align: left; width: 100%; background: none; border: none; padding: 0; font: inherit; cursor: pointer; }
.card-trigger:active { transform: scale(0.99); }

/* ---------- Free Quran banner ---------- */
.quran-banner {
  background: linear-gradient(135deg, var(--color-green) 0%, var(--color-green-dark) 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 56px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 40px;
  align-items: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.quran-banner::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(217, 182, 90, 0.25), transparent 70%);
  pointer-events: none;
}
@media (max-width: 780px) {
  .quran-banner { grid-template-columns: 1fr; text-align: center; padding: 40px 28px; }
  .quran-banner .quran-icon { margin: 0 auto; }
}
.quran-banner h2 { color: #fff; margin-bottom: 0.35em; }
.quran-banner p { color: rgba(255,255,255,0.82); margin-bottom: 0; max-width: 46ch; }
.quran-icon { width: 96px; height: 96px; flex-shrink: 0; }

/* ---------- Contact ---------- */
.contact-shell {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 620px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 640px) { .contact-shell { padding: 32px 22px; } }

.mauticform-row { margin-bottom: 18px; }
.mauticform-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}
.mauticform-input, .mauticform-textarea {
  width: 100%;
  padding: 0.85em 1em;
  font: inherit;
  font-size: 0.98rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.mauticform-textarea { min-height: 120px; resize: vertical; }
.mauticform-input:focus, .mauticform-textarea:focus {
  outline: none;
  border-color: var(--color-green);
  background: #fff;
  box-shadow: 0 0 0 3px var(--color-green-tint);
}
.mauticform-errormsg { display: block; font-size: 0.82rem; color: #b5462f; margin-top: 6px; }
.mauticform-row.mauticform-has-error .mauticform-input,
.mauticform-row.mauticform-has-error .mauticform-textarea { border-color: #b5462f; }
.mauticform-message { color: var(--color-green); font-weight: 600; margin-bottom: 16px; }
.mauticform-error { color: #b5462f; font-weight: 600; margin-bottom: 16px; }
.mauticform-button-wrapper { margin-top: 6px; }
.mauticform-button {
  width: 100%;
  padding: 0.9em 1.6em;
  border-radius: 999px;
  border: none;
  background: var(--color-green);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.mauticform-button:hover { background: var(--color-green-dark); }
.mauticform-button:active { transform: scale(0.98); }
.mauticform-button[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- Modal (Explore More) ---------- */
dialog.site-modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 460px;
  width: calc(100% - 40px);
  box-shadow: var(--shadow-lg);
  background: var(--color-surface);
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
dialog.site-modal[open] { opacity: 1; transform: scale(1); }
@starting-style {
  dialog.site-modal[open] { opacity: 0; transform: scale(0.95); }
}
dialog.site-modal::backdrop {
  background: rgba(18, 48, 36, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 200ms var(--ease-out), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
dialog.site-modal[open]::backdrop { opacity: 1; }
@starting-style { dialog.site-modal[open]::backdrop { opacity: 0; } }

.modal-media {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.modal-body { padding: 28px 28px 32px; }
.modal-body h3 { margin-bottom: 8px; }
.modal-body p { margin-bottom: 22px; }
.modal-actions { display: flex; gap: 10px; }
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  color: var(--color-text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 140ms var(--ease-out), background-color 140ms ease;
}
.modal-close:hover { background: #fff; }
.modal-close:active { transform: scale(0.94); }

@media (prefers-reduced-motion: reduce) {
  dialog.site-modal, dialog.site-modal::backdrop { transition: opacity 160ms ease; transform: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-green-dark);
  color: rgba(255,255,255,0.72);
  padding: 48px 0 28px;
  margin-top: 64px;
}
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.78); text-decoration: none; font-size: 0.92rem; }
.footer-links a:hover { color: #fff; }
.footer-brand { font-family: var(--font-serif); font-size: 1.1rem; color: #fff; margin-bottom: 6px; }
.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}

/* ---------- Article page ---------- */
.article-hero { padding: 56px 0 8px; }
.article-hero .eyebrow { margin-bottom: 14px; }
.article-body {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 0 64px;
  font-size: 1.05rem;
}
.article-body h2 { margin-top: 1.6em; }
.article-body p, .article-body li { color: var(--color-text); }
.article-body ul { padding-left: 1.2em; }
.article-body blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--color-gold);
  color: var(--color-text-muted);
  font-style: italic;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--color-green);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: opacity 300ms ease; transform: none; }
}

/* ---------- Mobile nav ---------- */
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    cursor: pointer;
  }
  .nav {
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 24px 24px;
    gap: 16px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 200ms;
  }
  .nav.is-open { opacity: 1; transform: translateY(0); visibility: visible; }
}
