/* ==========================================================================
   Mustafa Institute of California — Updated Website Stylesheet
   ========================================================================== */

:root {
  --emerald-900: #0b3b2d;
  --emerald-800: #0f4c3a;
  --emerald-700: #16654e;
  --emerald-100: #e7f2ee;
  --gold-600: #b5822a;
  --gold-500: #c8963e;
  --gold-100: #fbf4e6;
  --cream: #f7f2e8;
  --surface: #ffffff;
  --ink-900: #1a211e;
  --ink-700: #3d4843;
  --ink-500: #66736d;
  --border: #e5ddd0;
  --danger-bg: #fef2f2;
  --danger-text: #991b1b;
  --danger-border: #fecaca;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(15, 76, 58, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 76, 58, 0.08);
  --shadow-lg: 0 20px 45px rgba(11, 59, 45, 0.12);
  --max-width: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink-900);
  background-color: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--emerald-800);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--gold-600);
}

h1, h2, h3, h4 {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--emerald-900);
  line-height: 1.2;
  margin-top: 0;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Top Utility Bar */
.topbar {
  background: var(--emerald-900);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

.topbar a {
  color: rgba(255, 255, 255, 0.92);
}

.topbar a:hover {
  color: var(--gold-500);
}

.topbar-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--emerald-900);
  flex-shrink: 0;
}

.brand img {
  width: 48px;
  height: 44px;
  object-fit: contain;
  border-radius: 6px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--emerald-900);
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.74rem;
  color: var(--ink-500);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.main-nav {
  margin-left: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 0.72rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-700);
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--emerald-800);
  background: var(--emerald-100);
}

.header-cta {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.58rem 1.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.35rem;
  font-size: 0.94rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--emerald-800);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 76, 58, 0.22);
}

.btn-primary:hover {
  background: var(--emerald-900);
  color: #ffffff;
}

.btn-gold {
  background: var(--gold-500);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(200, 150, 62, 0.28);
}

.btn-gold:hover {
  background: var(--gold-600);
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  color: var(--emerald-800);
  border-color: var(--emerald-800);
}

.btn-outline:hover {
  background: var(--emerald-800);
  color: #ffffff;
}

.btn-light {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-light:hover {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  font-size: 1.25rem;
  color: var(--emerald-900);
  cursor: pointer;
}

/* Hero & Page Headers */
.hero {
  position: relative;
  background: radial-gradient(circle at 22% 28%, rgba(200, 150, 62, 0.16), transparent 52%),
    linear-gradient(135deg, var(--emerald-900) 0%, #145a45 60%, #1d6f55 100%);
  color: #ffffff;
  padding: 4.5rem 0 4rem;
  overflow: hidden;
}

.hero-greeting {
  font-size: 0.96rem;
  font-weight: 500;
  color: rgba(251, 244, 230, 0.92);
  margin: 0 0 0.45rem;
  letter-spacing: 0.01em;
}

/* Masjid Du'as Cards */
.dua-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.dua-card {
  background: var(--gold-100);
  border: 1px solid rgba(200, 150, 62, 0.35);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
}

.dua-label {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-600);
  margin-bottom: 0.5rem;
}

.dua-arabic {
  font-family: "Amiri", "Noto Naskh Arabic", Georgia, serif;
  font-size: 1.45rem;
  line-height: 1.8;
  color: var(--emerald-900);
  direction: rtl;
  text-align: right;
  margin: 0.25rem 0 0.55rem;
}

.dua-translit {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--ink-700);
  margin: 0 0 0.25rem;
}

.dua-meaning {
  font-size: 0.92rem;
  color: var(--ink-900);
  margin: 0;
}

@media (max-width: 960px) {
  .dua-grid {
    grid-template-columns: 1fr;
  }
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(200, 150, 62, 0.15) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-500);
  background: rgba(200, 150, 62, 0.14);
  border: 1px solid rgba(200, 150, 62, 0.35);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  color: #ffffff;
  font-size: clamp(2.1rem, 4vw, 3.25rem);
  margin-bottom: 1rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.08rem;
  max-width: 58ch;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.hero-card h3 {
  color: #ffffff;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.hero-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
  font-size: 0.94rem;
  color: rgba(255, 255, 255, 0.9);
}

.page-header {
  background: linear-gradient(135deg, var(--emerald-900) 0%, var(--emerald-800) 100%);
  color: #ffffff;
  padding: 3.25rem 0;
  text-align: center;
}

.page-header h1 {
  color: #ffffff;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  margin-bottom: 0.65rem;
}

.page-header p {
  color: rgba(255, 255, 255, 0.86);
  max-width: 62ch;
  margin: 0 auto;
}

/* Sections & Cards */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: #ffffff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-heading {
  text-align: center;
  max-width: 660px;
  margin: 0 auto 2.5rem;
}

.section-heading h2 {
  font-size: clamp(1.65rem, 2.8vw, 2.25rem);
  margin-bottom: 0.6rem;
}

.section-heading p {
  color: var(--ink-500);
  margin: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.65rem;
  box-shadow: var(--shadow-sm);
}

.card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}

.card p {
  color: var(--ink-700);
  margin-top: 0;
}

/* MasjidApp Widget Containers */
.widget-frame-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.widget-frame-wrap iframe {
  width: 100%;
  border: 0;
  display: block;
}

.slides-frame {
  width: 100%;
  height: 380px;
  border: 0;
  border-radius: var(--radius-sm);
}

.widget-note {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--ink-500);
  text-align: center;
}

/* Fundraising Thermometer */
.campaign-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
}

.progress-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.progress-raised {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--emerald-800);
}

.progress-goal {
  font-size: 1rem;
  color: var(--ink-500);
  font-weight: 600;
}

.progress-bar-track {
  width: 100%;
  height: 18px;
  background: var(--emerald-100);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-bar-fill {
  height: 100%;
  width: 41.7%;
  background: linear-gradient(90deg, var(--emerald-700), var(--gold-500));
  border-radius: 999px;
}

.quote-box {
  background: var(--gold-100);
  border-left: 4px solid var(--gold-500);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
}

.quote-box p {
  margin: 0 0 0.4rem;
  color: var(--ink-900);
  font-style: italic;
}

.quote-box cite {
  font-size: 0.85rem;
  font-style: normal;
  font-weight: 600;
  color: var(--gold-600);
}

/* Status Banner */
.status-banner {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.status-badge {
  display: inline-block;
  background: var(--danger-text);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-right: 0.6rem;
}

/* Leadership Directory */
.person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.15rem 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.person-photo {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 12%;
  background: var(--emerald-100);
  border: 3px solid var(--emerald-100);
  box-shadow: 0 4px 12px rgba(15, 76, 58, 0.08);
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.person-body {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.person-name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--emerald-900);
  margin: 0 0 0.25rem;
}

.person-role {
  font-size: 0.84rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold-600);
  margin: 0 0 0.6rem;
}

.person-phone {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--emerald-800);
}

/* Sponsors */
.sponsor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.sponsor-card img {
  max-height: 150px;
  width: auto;
  object-fit: contain;
}

/* Donation Actions & Modal */
.donate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.donate-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 59, 45, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 1000;
}

.donate-modal-backdrop.open {
  display: flex;
}

.donate-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.donate-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-700);
}

.donate-option-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin-top: 1rem;
  background: var(--cream);
}

.donate-option-card h4 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.donate-option-card p {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  color: var(--ink-700);
}

.ein-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}

.ein-code {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: var(--emerald-900);
}

/* Jumu'ah Spotlight */
.jumuah-spotlight {
  background: var(--gold-100);
  border: 1px solid rgba(200, 150, 62, 0.35);
  border-left: 5px solid var(--gold-500);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.6rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.jumuah-badge {
  display: inline-block;
  background: var(--emerald-800);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}

/* Facebook Live Banner */
.live-banner {
  background: #7f1d1d;
  color: #ffffff;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.live-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8);
  animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Config-Driven Announcements Slider */
.announcements-slider {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.announcement-slide {
  display: none;
}

.announcement-slide.active {
  display: block;
}

.announcement-slide img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.announcement-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Footer */
.site-footer {
  background: var(--emerald-900);
  color: rgba(255, 255, 255, 0.84);
  padding: 3.5rem 0 2rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.site-footer h3,
.site-footer h4 {
  color: #ffffff;
  margin-bottom: 0.85rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.84);
}

.site-footer a:hover {
  color: var(--gold-500);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.68);
}

/* Responsive */
@media (max-width: 1080px) {
  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    margin-left: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-md);
  }

  .main-nav.open {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .nav-links a {
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
  }

  .header-cta {
    display: none;
  }
}

@media (max-width: 960px) {
  .hero-inner,
  .grid-2,
  .grid-3,
  .grid-4,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
