/* ─── MWC design tokens (palette from muslimwellnesscenter.org) ───────── */
:root {
  --teal: #1f92a0;        /* MWC primary */
  --deep: #0c3d43;        /* MWC secondary — headings, dark bands */
  --ink: #041c1f;         /* MWC near-black — body text, footer */
  --tint: #e7f2f3;        /* pale wash — header bar, kickers, soft bands */
  --tint-2: #f4f9f9;      /* extra-light wash */
  --muted: #55686b;
  --white: #ffffff;
  --radius: 18px;
  --shadow: 0 2px 14px rgba(4, 28, 31, 0.08);
  --font: "Montserrat", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
}
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.12; color: var(--deep); }
a { color: var(--teal); }

/* ─── Header (Roots-style bar: wordmark left, hamburger right) ────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.6rem;
  background: var(--tint);
  position: sticky;
  top: 0;
  z-index: 30;
}
.logo {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  color: var(--deep);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.logo b { font-weight: 800; }
.logo .slashes { color: var(--teal); font-weight: 600; margin: 0 0.15em; }
.logo span:not(.slashes) { font-weight: 300; }

/* Menu button = the MWC logo, split in four; the pieces unfold apart when
   the menu opens and fold back together when it closes. */
.nav-toggle {
  position: relative;
  width: 46px;
  height: 46px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
}
.nav-toggle .q {
  position: absolute;
  width: 50%;
  height: 50%;
  background-image: url("../images/logo.png");
  background-size: 200% 200%;
  background-repeat: no-repeat;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-toggle .q1 { top: 0; left: 0; background-position: 0 0; }
.nav-toggle .q2 { top: 0; right: 0; background-position: 100% 0; }
.nav-toggle .q3 { bottom: 0; left: 0; background-position: 0 100%; }
.nav-toggle .q4 { bottom: 0; right: 0; background-position: 100% 100%; }
.nav-toggle:hover .q1 { transform: translate(-1.5px, -1.5px); }
.nav-toggle:hover .q2 { transform: translate(1.5px, -1.5px); }
.nav-toggle:hover .q3 { transform: translate(-1.5px, 1.5px); }
.nav-toggle:hover .q4 { transform: translate(1.5px, 1.5px); }
.nav-toggle[aria-expanded="true"] .q1 { transform: translate(-6px, -6px) rotate(-6deg); }
.nav-toggle[aria-expanded="true"] .q2 { transform: translate(6px, -6px) rotate(6deg); }
.nav-toggle[aria-expanded="true"] .q3 { transform: translate(-6px, 6px) rotate(6deg); }
.nav-toggle[aria-expanded="true"] .q4 { transform: translate(6px, 6px) rotate(-6deg); }
@media (prefers-reduced-motion: reduce) {
  .nav-toggle .q, .site-nav, .program-card { transition: none; }
}

/* Roots keeps the hamburger at every width — full-screen overlay menu */
.site-nav {
  position: fixed;
  inset: 0;
  top: 68px;
  background: var(--tint);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s;
  z-index: 25;
}
.site-nav.open { opacity: 1; visibility: visible; }
.site-nav a {
  color: var(--deep);
  text-decoration: none;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 600;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 8px;
}

/* ─── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(rgba(12, 61, 67, 0.28), rgba(12, 61, 67, 0.45)), var(--deep);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.hero-home     { background-image: linear-gradient(rgba(12, 61, 67, 0.28), rgba(12, 61, 67, 0.45)), url("../images/hero-home.webp"); }
.hero-calendar { background-image: linear-gradient(rgba(12, 61, 67, 0.28), rgba(12, 61, 67, 0.45)), url("../images/hero-calendar.webp"); }
.hero-programs { background-image: linear-gradient(rgba(12, 61, 67, 0.28), rgba(12, 61, 67, 0.45)), url("../images/hero-programs.webp"); }
.hero-about    { background-image: linear-gradient(rgba(12, 61, 67, 0.28), rgba(12, 61, 67, 0.45)), url("../images/hero-about.webp"); }
.hero-sustain  { background-image: linear-gradient(rgba(12, 61, 67, 0.28), rgba(12, 61, 67, 0.45)), url("../images/hero-sustain.webp"); }
.hero h1 {
  color: var(--white);
  font-weight: 800;
  font-size: clamp(2.7rem, 8.5vw, 5.5rem);
  letter-spacing: -0.025em;
  line-height: 1;
  text-align: center;
  margin: 0 1rem 2.2rem;
  text-shadow: 0 3px 24px rgba(4, 28, 31, 0.5);
}

/* ─── Bands & curves (Roots' organic section transitions) ─────────────── */
.band { padding: 4.5rem 1.6rem; }
.band-tint { background: var(--tint-2); }
.band-deep { background: var(--deep); color: var(--white); }
.band-deep h2, .band-deep h3 { color: var(--white); }
.curve-bottom { clip-path: ellipse(90% 100% at 50% 0%); padding-bottom: 5.5rem; }
.curve-top { clip-path: ellipse(90% 100% at 50% 100%); padding-top: 5.5rem; }

.section { padding: 4.5rem 1.6rem; }
.section-inner { max-width: 1080px; margin: 0 auto; }
.center { text-align: center; }

h1, h2 { letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); font-weight: 800; margin: 0.3rem 0 0.8rem; }
.tagline {
  font-size: clamp(1.35rem, 3.6vw, 2rem);
  font-weight: 600;
  color: var(--deep);
  text-align: center;
  max-width: 30ch;
  margin: 0 auto;
  line-height: 1.4;
}
.kicker {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--deep);
  background: var(--tint);
  padding: 0.2rem 0.7rem;
  border-radius: 6px;
}
.muted { color: var(--muted); }
.lead { max-width: 58ch; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ─── Program calendar widget (Roots homepage centerpiece) ────────────── */
.group-label {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
  border-bottom: 2px solid var(--tint);
  padding-bottom: 0.5rem;
  margin: 3rem 0 1.4rem;
}
.card-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}
.program-card {
  background: var(--white);
  border: 1px solid #e2ebec;
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.3rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.program-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(4, 28, 31, 0.13); }
.program-card h3 { margin: 0 0 0.15rem; font-size: 1.18rem; font-weight: 700; }
.program-card .when { font-style: italic; color: var(--muted); margin: 0 0 0.7rem; font-size: 0.95rem; }
.program-card p { margin: 0 0 0.9rem; font-size: 0.95rem; }
.program-card .chips { margin-bottom: 0.7rem; }
.program-card .more {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--teal);
}
.program-card .more:hover { text-decoration: underline; }

.chip {
  display: inline-block;
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.22rem 0.68rem;
  border-radius: 999px;
  margin: 0 0.35rem 0.3rem 0;
}

/* quirky service icons (muted per-category tint set inline by js/icons.js) */
.icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.icon-badge svg { width: 22px; height: 22px; }
.icon-badge--sm { width: 28px; height: 28px; border-radius: 9px; margin-right: 0.55rem; vertical-align: middle; }
.icon-badge--sm svg { width: 16px; height: 16px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.card-head .chips { margin-bottom: 0; }

/* ─── Photo split section ──────────────────────────────────────────────── */
.split {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
}
@media (min-width: 820px) { .split { grid-template-columns: 1fr 1fr; } }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; object-fit: cover; }
.photo-stack { display: grid; gap: 1.2rem; }
.photo-stack .ph:last-child { margin-left: 2.5rem; width: calc(100% - 2.5rem); }

/* cohesive teal grade on section photos */
.ph { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.ph img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; box-shadow: none; filter: saturate(0.85); }
.ph::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(31, 146, 160, 0.16), rgba(12, 61, 67, 0.18));
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* ─── Buttons & forms ──────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  background: var(--teal);
  color: var(--white);
  font-family: var(--font);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  transition: background 0.2s;
}
.btn:hover { background: var(--deep); }
.band-deep .btn { background: var(--white); color: var(--deep); }
.band-deep .btn:hover { background: var(--tint); }

.form {
  max-width: 560px;
  margin: 1.5rem auto 0;
  display: grid;
  gap: 0.9rem;
  text-align: left;
}
.form label { font-weight: 600; font-size: 0.9rem; }
.form input, .form textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid #cfe0e2;
  border-radius: 10px;
  background: var(--white);
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
.form-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.form-row input { flex: 1; min-width: 220px; }

/* ─── Calendar page ────────────────────────────────────────────────────── */
.legend { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 0 0 1.8rem; }
.legend-chip {
  border: 0;
  cursor: pointer;
  color: var(--white);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.42rem 1rem;
  border-radius: 999px;
  transition: opacity 0.15s, transform 0.15s;
}
.legend-chip:hover { transform: translateY(-1px); }
.legend-chip--off { opacity: 0.3; }
.event-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  margin-right: 0.6rem;
  vertical-align: middle;
}
#calendar-notice {
  background: var(--tint-2);
  border: 1.5px dashed var(--teal);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
}
/* Custom MWC skin over FullCalendar — our own calendar wrapped around the
   Google Calendar data, not the default look. */
.calendar-shell {
  background: var(--white);
  border: 1px solid #e2ebec;
  border-radius: 24px;
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
@media (max-width: 640px) { .calendar-shell { padding: 0.8rem; } }

.fc { font-family: var(--font); }
.fc .fc-toolbar.fc-header-toolbar { flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.4rem; }
.fc .fc-toolbar-title { font-weight: 800; font-size: 1.45rem; color: var(--deep); }
.fc .fc-button-primary {
  background: var(--deep);
  border-color: var(--deep);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.88rem;
  text-transform: capitalize;
  border-radius: 999px;
  padding: 0.42rem 1.05rem;
}
.fc .fc-button-primary:not(:disabled):hover,
.fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--teal); border-color: var(--teal); }
.fc .fc-button-primary:focus, .fc .fc-button-primary:not(:disabled).fc-button-active:focus { box-shadow: 0 0 0 3px var(--tint); }
.fc .fc-button-group > .fc-button { border-radius: 999px; margin-left: 4px; }

/* grid */
.fc-theme-standard .fc-scrollgrid { border: none; }
.fc-theme-standard td, .fc-theme-standard th { border-color: #eef4f5; }
.fc .fc-col-header-cell { border: none; }
.fc .fc-col-header-cell-cushion {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--teal);
  padding: 10px 4px;
  text-decoration: none;
}
.fc .fc-daygrid-day-number {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--deep);
  padding: 7px 9px;
  text-decoration: none;
}
.fc .fc-day-other .fc-daygrid-day-top { opacity: 0.3; }
.fc .fc-daygrid-day.fc-day-today { background: transparent; }
.fc .fc-day-today .fc-daygrid-day-number {
  background: var(--teal);
  color: var(--white);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  margin: 3px;
}
.fc .fc-daygrid-day:hover { background: var(--tint-2); }

/* event pills */
.fc .fc-daygrid-event {
  border: none;
  border-radius: 7px;
  padding: 2px 7px;
  font-size: 0.74rem;
  font-weight: 600;
  margin: 1px 3px;
}
.fc .fc-daygrid-event .fc-event-time { font-weight: 400; }
.fc .fc-daygrid-more-link { color: var(--teal); font-weight: 600; font-size: 0.74rem; }

/* list view */
.fc .fc-list { border: none; }
.fc .fc-list-day-cushion { background: var(--tint-2); }
.fc .fc-list-day-text, .fc .fc-list-day-side-text { color: var(--deep); font-weight: 700; text-decoration: none; }
.fc .fc-list-event:hover td { background: var(--tint); }
.fc .fc-list-event-title a { color: var(--ink); text-decoration: none; font-weight: 600; }

/* Zeffy donation forms — Zeffy draws its own card, so no extra chrome. */
.zeffy-wrap {
  position: relative;
  width: 100%;
  max-width: 620px;
  height: min(680px, 85vh);
  margin: 1.5rem auto 0;
}
.zeffy-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* compact version inside the homepage Sustainer band + sustain page */
.zeffy-mini {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 560px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 18px 44px rgba(4, 28, 31, 0.3);
}
.zeffy-mini iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.zeffy-mini--light { border: 1px solid #e2ebec; box-shadow: var(--shadow); }

/* Stay Updated + Contact cards */
.connect-grid { display: grid; gap: 1.5rem; }
@media (min-width: 860px) { .connect-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.panel-card {
  background: var(--white);
  border: 1px solid #e2ebec;
  border-radius: var(--radius);
  padding: 2rem 1.8rem;
  box-shadow: var(--shadow);
}
.panel-title { font-size: 1.35rem; margin: 0.5rem 0 0.4rem; }
.panel-card .form { margin: 1rem 0 0; max-width: none; }
.band-deep .kicker { background: rgba(255, 255, 255, 0.14); color: var(--white); }

/* Day-peek widget: hover/click a calendar day → scrollable list of that day's events */
#day-pop {
  position: absolute;
  z-index: 60;
  width: 320px;
  max-width: calc(100vw - 2rem);
  background: var(--white);
  border: 1px solid #e2ebec;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(4, 28, 31, 0.22);
  padding: 0.9rem;
}
#day-pop .dp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--deep);
  margin: 0.1rem 0.1rem 0.65rem;
}
#day-pop .dp-close {
  border: 0;
  background: var(--tint-2);
  color: var(--deep);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
  cursor: pointer;
}
#day-pop .dp-list {
  max-height: 300px;
  overflow-y: auto;
  display: grid;
  gap: 0.4rem;
  scrollbar-width: thin;
}
#day-pop .dp-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  width: 100%;
  text-align: left;
  background: none;
  font-family: var(--font);
  padding: 0.5rem 0.55rem;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
}
#day-pop .dp-row:hover { background: var(--tint-2); border-color: #e2ebec; }
#day-pop .dp-meta { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
#day-pop .dp-title { font-size: 0.86rem; font-weight: 700; color: var(--ink); }
#day-pop .dp-sub { font-size: 0.72rem; font-weight: 600; color: var(--muted); }
#day-pop .dp-label {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.26rem 0.62rem;
  border-radius: 999px;
}

/* ─── Event modal ──────────────────────────────────────────────────────── */
#event-dialog {
  border: 0;
  border-radius: var(--radius);
  max-width: 470px;
  width: calc(100vw - 2rem);
  padding: 0;
  box-shadow: 0 24px 60px rgba(4, 28, 31, 0.35);
}
#event-dialog::backdrop { background: rgba(4, 28, 31, 0.6); }
.dlg-img { width: 100%; max-height: 230px; object-fit: cover; display: block; }
.dlg-body { padding: 1.4rem 1.5rem 1.6rem; }
.dlg-title { margin: 0.45rem 0 0.3rem; font-weight: 800; }
.dlg-when { font-weight: 600; margin: 0; }
.dlg-where, .dlg-desc { color: var(--muted); white-space: pre-line; }
.dlg-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  border: 0;
  background: var(--white);
  color: var(--deep);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(4, 28, 31, 0.3);
}
.dlg-top { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.2rem; }

/* ─── Footer (3 columns: brand · links · subscribe) ────────────────────── */
.site-footer {
  background: var(--ink);
  color: var(--tint);
  padding: 3.5rem 1.6rem 2rem;
}
.site-footer a { color: var(--white); }
.footer-grid { max-width: 1080px; margin: 0 auto; display: grid; gap: 2.5rem; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.4fr 0.6fr; } }
.footer-logo { width: 88px; margin-bottom: 1rem; filter: brightness(0) invert(1); opacity: 0.9; }
.footer-brand p { margin: 0; line-height: 1.8; }
.footer-col h3 {
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 0.8rem;
}
.footer-col > a { display: block; text-decoration: none; margin: 0.4rem 0; font-weight: 600; }
.footer-col > a:hover { text-decoration: underline; }
.footer-col p { margin: 0 0 0.8rem; }
.fineprint { font-size: 0.8rem; color: #7fa0a4; margin-top: 2.5rem; text-align: center; }

/* ─── Interaction states & form notes ──────────────────────────────────── */
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.btn:active, .legend-chip:active { transform: scale(0.96); }
.form-note { font-size: 0.85rem; font-weight: 600; color: #a03030; margin: 0.6rem 0 0; }
.form-note--ok { color: var(--teal); }
