:root {
  --paper: #faf6ec;
  --paper-alt: #f1ead8;
  --ink: #1c2b24;
  --ink-soft: #55645a;
  --gold: #b8863b;
  --gold-soft: #e8d3ab;
  --teal: #2f5d4f;
  --teal-dark: #142d28;
  --border: #e2d8bd;
  --white: #fffdf8;
  --shadow: 0 20px 40px -24px rgba(20, 45, 40, 0.35);
  --radius: 14px;
  --font-display: "Fraunces", serif;
  --font-body: "Public Sans", sans-serif;
  --font-arabic: "Amiri", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.5em;
  line-height: 1.15;
}

p { margin: 0 0 1em; }

a {
  color: var(--teal);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--teal);
  color: var(--white);
  padding: 0.6em 1em;
  z-index: 200;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--gold);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.nav-menu {
  display: flex;
  gap: 28px;
}

.nav-menu a {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  padding: 4px 0;
}
.nav-menu a:hover {
  color: var(--teal);
  text-decoration: none;
}
.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.nav-menu a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  margin: 0 8px;
  background: var(--ink);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 24px 96px;
  text-align: center;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-alt) 100%);
}

.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 12% 18%, var(--gold-soft) 0, transparent 42%),
    radial-gradient(circle at 88% 78%, var(--gold-soft) 0, transparent 38%);
  background-size: 100% 100%;
}
.hero-pattern::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-conic-gradient(from 0deg at 50% 50%, transparent 0deg 42deg, rgba(184, 134, 59, 0.06) 42deg 45deg);
  mask-image: radial-gradient(circle at 50% 0%, black, transparent 70%);
}

.hero-inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.bismillah {
  font-family: var(--font-arabic);
  color: var(--gold);
  font-size: 1.6rem;
  margin-bottom: 28px;
  animation: fade-up 0.7s ease both;
}

h1 { margin-bottom: 18px; }

.site-name-ar {
  display: block;
  font-family: var(--font-arabic);
  font-weight: 700;
  font-size: 3.4rem;
  color: var(--ink);
  line-height: 1.3;
  animation: fade-up 0.7s ease 0.08s both;
}

.site-name-en {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.7rem;
  color: var(--teal);
  margin-top: 6px;
  animation: fade-up 0.7s ease 0.16s both;
}

.tagline {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 420px;
  margin: 0 auto 32px;
  animation: fade-up 0.7s ease 0.24s both;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fade-up 0.7s ease 0.32s both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--teal);
  color: var(--white);
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--teal-dark); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--gold); color: var(--teal); }

/* ---------- Sections ---------- */

.section { padding: 72px 24px; }
.section-alt { background: var(--paper-alt); }

.section-inner {
  max-width: 720px;
  margin: 0 auto;
}

.two-col {
  max-width: 940px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: start;
}

.section-date {
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 28px;
}

.section-lede {
  color: var(--ink-soft);
  margin-bottom: 28px;
}

.fine-print {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* ---------- Next prayer card ---------- */

.next-prayer-card {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}

.next-prayer-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  background: var(--gold-soft);
  padding: 3px 9px;
  border-radius: 999px;
}

.next-prayer-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}

.next-prayer-time {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--teal);
}

.next-prayer-countdown {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* ---------- Asr toggle ---------- */

.asr-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
  background: var(--white);
}
.asr-toggle button {
  border: none;
  background: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.asr-toggle button.is-active {
  background: var(--teal);
  color: var(--white);
}

/* ---------- Prayer table ---------- */

.prayer-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 40px;
}
.prayer-table td {
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 1.05rem;
}
.prayer-table td:first-child { font-family: var(--font-display); }
.time-cell { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.row-muted td { color: var(--ink-soft); font-size: 0.95rem; }
.row-next td:first-child {
  position: relative;
}
.row-next td:first-child::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--gold);
  border-radius: 2px;
}
.row-next .time-cell { color: var(--gold); }

/* ---------- Jumu'ah ---------- */

.jumuah-heading { margin-top: 0; }

.jumuah-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.jumuah-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.jumuah-card h4 { font-size: 1.02rem; margin-bottom: 10px; }
.jumuah-card p { margin: 4px 0; color: var(--ink-soft); font-size: 0.92rem; }
.jumuah-card strong { color: var(--ink); font-family: var(--font-display); }

.jumuah-grid.is-today .jumuah-card,
#jumuah-card.is-today .jumuah-card {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-soft) inset;
}

/* ---------- Programs ---------- */

.program-list {
  list-style: none;
  margin: 0 0 40px;
  padding: 0;
  border-top: 1px solid var(--border);
}
.program-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.program-when {
  font-family: var(--font-body);
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.program-tbd {
  color: var(--teal);
  background: var(--gold-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.announcements-heading { margin-top: 0; }

.announcements-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  color: var(--ink-soft);
}
.announcements-empty p:last-child { margin-bottom: 0; }

/* ---------- Visit ---------- */

address { font-style: normal; color: var(--ink-soft); margin-bottom: 24px; font-size: 1.05rem; }

.button-row { display: flex; gap: 12px; flex-wrap: wrap; }

.visit-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-dark);
  border-radius: var(--radius);
  min-height: 220px;
}
.visit-pin { width: 76px; height: 76px; color: var(--gold); }

/* ---------- Contact / form ---------- */

.contact-card h2 { margin-bottom: 20px; }
.contact-name { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 2px; }
.contact-title { color: var(--ink-soft); margin-bottom: 18px; }

.message-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.message-form label {
  font-weight: 600;
  font-size: 0.88rem;
  margin: 14px 0 6px;
}
.message-form label:first-of-type { margin-top: 0; }

.message-form input,
.message-form textarea {
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}
.message-form input:focus,
.message-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.message-form .btn { margin-top: 18px; }

.form-help {
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin-top: 10px;
  margin-bottom: 0;
}
.form-status {
  color: var(--teal);
  font-weight: 600;
  font-size: 0.88rem;
  margin-top: 8px;
  margin-bottom: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--teal-dark);
  color: #cfe0da;
  padding: 48px 24px;
}
.footer-inner {
  max-width: 720px;
  margin: 0 auto;
}
.footer-inner p { margin: 0 0 6px; font-size: 0.92rem; }
.footer-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--white);
  margin-bottom: 10px;
}
.site-footer a { color: var(--gold-soft); }
.footer-association { margin-top: 10px; }
.footer-copyright { color: #90a89d; margin-top: 14px; }

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 18px;
    gap: 14px;
    display: none;
  }
  .nav-menu.is-open { display: flex; }

  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .visit-card { min-height: 140px; }

  .site-name-ar { font-size: 2.6rem; }
  .site-name-en { font-size: 1.4rem; }

  .jumuah-grid { grid-template-columns: 1fr; }

  .row-next td:first-child::before { left: -12px; }
}
