/* ============================================================
   AL-NOOR COMMUNITY MOSQUE — STYLESHEET
   Modern Swiss: precision grid, bold type, restrained palette
   ============================================================ */

/* ---------- 1. Variables & Reset ---------- */
:root {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F4F4F4;
  --bg-tertiary: #ECECEC;
  --text-primary: #0A0A0A;
  --text-secondary: #4A4A4A;
  --border-color: #DCDCDC;
  --shadow-color: rgba(0,0,0,0.10);
  --accent: #0000FF;
  --accent-dark: #0000CC;
  --accent-red: #FF0000;
  --radius-btn: 24px;
  --radius-card: 16px;
  --radius-input: 12px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 64px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg-primary: #0A0A0A;
  --bg-secondary: #161616;
  --bg-tertiary: #202020;
  --text-primary: #F5F5F5;
  --text-secondary: #B5B5B5;
  --border-color: #333333;
  --shadow-color: rgba(0,0,0,0.55);
  color-scheme: dark;
}

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

body {
  margin: 0;
  font-family: 'Helvetica Neue', Arial, 'Suisse Intl', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s cubic-bezier(0.4,0,0.2,1), color 0.3s cubic-bezier(0.4,0,0.2,1);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; margin: 0; padding: 0; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ---------- 2. Typography ---------- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 var(--space-sm); }
h1 { font-size: clamp(2.25rem, 6vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.375rem, 3vw, 1.75rem); font-weight: 600; }
h4 { font-size: clamp(1.125rem, 2vw, 1.375rem); font-weight: 600; }
p { font-size: clamp(1rem, 1.4vw, 1.125rem); color: var(--text-secondary); margin: 0 0 var(--space-sm); }
.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

/* ---------- 3. Focus & Motion ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

.fade-in { opacity: 0; transform: translateY(24px); transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1), transform 0.6s cubic-bezier(0.4,0,0.2,1); }
.fade-in.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- 4. Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-primary);
  border-bottom: 2px solid var(--text-primary);
  transition: box-shadow 0.3s cubic-bezier(0.4,0,0.2,1);
}
.site-header.scrolled { box-shadow: 0 4px 16px var(--shadow-color); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}

.logo {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.logo span { color: var(--accent); }

.main-nav { display: flex; align-items: center; }

.nav-list { display: flex; gap: var(--space-md); align-items: center; }

.nav-list a {
  font-size: 0.9375rem;
  font-weight: 600;
  padding: var(--space-xs) 2px;
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-list a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 6px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
}
.nav-list a:hover::after, .nav-list li.active a::after { width: 100%; }
.nav-list li.active a { color: var(--accent); }

.mobile-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-input);
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.25rem;
}

/* ---------- 5. Theme Toggle ---------- */
.theme-toggle {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 1.375rem;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 16px var(--shadow-color);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 8px 24px var(--shadow-color); }
.theme-toggle:active { transform: scale(0.95); }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: var(--radius-btn);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.btn-primary { background: var(--accent); color: #FFFFFF; box-shadow: 0 4px 14px var(--shadow-color); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px var(--shadow-color); background: var(--accent-dark); }
.btn-secondary { background: transparent; color: var(--text-primary); border: 2px solid var(--text-primary); }
.btn-secondary:hover { background: var(--text-primary); color: var(--bg-primary); }

/* ---------- 7. Layout Helpers ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-md); }
section { padding: var(--space-xl) 0; }
.section-alt { background-color: var(--bg-secondary); }

.section-head { max-width: 720px; margin-bottom: var(--space-lg); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- 8. Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-lg);
  align-items: center;
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}
.hero-copy { display: flex; flex-direction: column; justify-content: center; }
.hero-media { position: relative; }
.hero-media img { border-radius: var(--radius-card); box-shadow: 0 16px 40px var(--shadow-color); width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.hero-media::before {
  content: '';
  position: absolute;
  top: -16px; left: -16px;
  width: 100%; height: 100%;
  border: 3px solid var(--accent);
  border-radius: var(--radius-card);
  z-index: -1;
}
.hero-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-top: var(--space-md); }
.hero-stats { display: flex; gap: var(--space-lg); margin-top: var(--space-lg); flex-wrap: wrap; }
.hero-stat strong { display: block; font-size: clamp(1.75rem,3vw,2.5rem); color: var(--accent); }
.hero-stat span { font-size: 0.875rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- 9. Cards ---------- */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: var(--space-md);
  box-shadow: 0 2px 8px var(--shadow-color);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s cubic-bezier(0.4,0,0.2,1);
}
.card:hover { transform: translateY(-6px); box-shadow: 0 12px 28px var(--shadow-color); }
.card img { border-radius: var(--radius-input); width: 100%; object-fit: cover; aspect-ratio: 16/10; margin-bottom: var(--space-sm); }
.card-tag { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: var(--space-xs); }

/* ---------- 10. Prayer Times Table ---------- */
.prayer-table-wrap { overflow-x: auto; border-radius: var(--radius-card); border: 1px solid var(--border-color); box-shadow: 0 2px 8px var(--shadow-color); }
table.prayer-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.prayer-table th, .prayer-table td { padding: var(--space-sm) var(--space-md); text-align: left; border-bottom: 1px solid var(--border-color); }
.prayer-table thead th { background: var(--text-primary); color: var(--bg-primary); font-weight: 700; text-transform: uppercase; font-size: 0.8125rem; letter-spacing: 0.06em; }
.prayer-table tbody tr:last-child td { border-bottom: none; }
.prayer-table tbody tr:hover { background: var(--bg-secondary); }

/* ---------- 11. Forms ---------- */
.form-group { margin-bottom: var(--space-md); }
.form-group label { display: block; margin-bottom: var(--space-xs); font-weight: 600; color: var(--text-primary); }
.form-group input, .form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-input);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color 0.3s cubic-bezier(0.4,0,0.2,1), background 0.3s cubic-bezier(0.4,0,0.2,1);
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(0,0,255,0.12);
}

.contact-section { background: var(--bg-secondary); }
.contact-section h2 { text-align: center; margin-bottom: var(--space-xs); }
.contact-section > .container > p { text-align: center; color: var(--text-secondary); margin-bottom: var(--space-lg); }
.contact-form { max-width: 620px; margin: 0 auto; padding: var(--space-lg); background: var(--bg-primary); border-radius: var(--radius-card); box-shadow: 0 4px 16px var(--shadow-color); border: 1px solid var(--border-color); }
.submit-btn { width: 100%; padding: 14px 24px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius-btn); font-size: 1.0625rem; font-weight: 600; cursor: pointer; transition: all 0.3s cubic-bezier(0.4,0,0.2,1); min-height: 48px; }
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,255,0.3); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.form-status { margin-top: var(--space-md); padding: var(--space-sm); border-radius: var(--radius-input); text-align: center; display: none; }
.form-status.success { display: block; background: #d1fae5; color: #065f46; }
.form-status.error { display: block; background: #fee2e2; color: #991b1b; }

.map-frame { border-radius: var(--radius-card); overflow: hidden; box-shadow: 0 4px 16px var(--shadow-color); border: 1px solid var(--border-color); }

/* ---------- 12. Donate ---------- */
.donate-tiers { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: var(--space-md); }
.tier-card { text-align: center; }
.tier-amount { font-size: clamp(1.75rem,4vw,2.25rem); color: var(--accent); font-weight: 700; margin-bottom: var(--space-xs); }

.bank-details { background: var(--bg-secondary); border-radius: var(--radius-card); padding: var(--space-lg); border: 1px solid var(--border-color); }
.bank-details dl { display: grid; grid-template-columns: 160px 1fr; gap: var(--space-xs) var(--space-md); margin: 0; }
.bank-details dt { font-weight: 700; color: var(--text-primary); }
.bank-details dd { margin: 0; color: var(--text-secondary); }

/* ---------- 13. Footer ---------- */
.site-footer { background: var(--text-primary); color: var(--bg-primary); padding: var(--space-xl) 0 var(--space-md); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: var(--space-lg); }
.footer-inner h3, .footer-inner h4 { color: var(--bg-primary); }
.footer-inner p, .footer-inner address { color: #B5B5B5; font-style: normal; font-size: 0.9375rem; }
.footer-inner ul li { margin-bottom: var(--space-xs); }
.footer-inner ul a { color: #B5B5B5; font-size: 0.9375rem; transition: color 0.3s; }
.footer-inner ul a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid #333; margin-top: var(--space-lg); padding-top: var(--space-md); text-align: center; }
.footer-bottom p { color: #808080; font-size: 0.8125rem; margin: 0; }

/* ---------- 14. Responsive Breakpoints ---------- */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .bank-details dl { grid-template-columns: 120px 1fr; }
}

@media (max-width: 768px) {
  .nav-list {
    position: fixed;
    top: 68px;
    right: 0;
    height: calc(100vh - 68px);
    width: min(78vw, 320px);
    background: var(--bg-primary);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-lg) var(--space-md);
    gap: var(--space-md);
    box-shadow: -8px 0 24px var(--shadow-color);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    border-left: 2px solid var(--text-primary);
  }
  .nav-list.open { transform: translateX(0); }
  .mobile-nav-toggle { display: flex; }
  .footer-inner { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  section { padding: var(--space-lg) 0; }
  .bank-details dl { grid-template-columns: 1fr; }
  .bank-details dt { margin-top: var(--space-sm); }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-sm); }
  .theme-toggle { width: 48px; height: 48px; bottom: var(--space-sm); right: var(--space-sm); }
}


/* Header nav spacing floor (normalizer): keep the brand and the
   menu separated when the flex container runs out of width. */
header nav, header nav > div { gap: 1rem; flex-wrap: wrap; }
@media (max-width: 1280px) { header nav ul { gap: 1rem; } }
