/* ==========================================================
   SAMAAJ-NA — Saraswati Madhyamik Alumni Association
   Janakpur (North America)
   ========================================================== */

:root {
  /* Sindoor red & turmeric gold — colors drawn from Mithila/Madhubani art,
     the painting tradition of the Janakpur region. --brand/--brand-deep/--gold
     stay constant across themes (solid color chips: buttons, logo, footer).
     Everything else is theme-aware, redefined below for dark mode. */
  --brand: #8b2635;
  --brand-deep: #631a25;
  --gold: #c99a2e;
  --on-brand: #fdf6ee;
  --teal: #2f6f62;

  --cream: #fbf3e7;
  --surface: #ffffff;
  --ink: #241a17;
  --ink-soft: #6b5a4c;
  --border: #e8dcc7;
  --heading: #631a25;
  --label: #a67c1f;
  --shadow: 0 8px 24px rgba(139, 38, 53, 0.09);

  --radius: 12px;
  --max-width: 1120px;
  --font-body: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #1c1512;
    --surface: #2a1f1a;
    --ink: #f3e9de;
    --ink-soft: #cbb9a9;
    --border: #3d2d25;
    --heading: #f0aab2;
    --label: #e3bc5c;
    --teal: #7fc4b3;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --cream: #1c1512;
  --surface: #2a1f1a;
  --ink: #f3e9de;
  --ink-soft: #cbb9a9;
  --border: #3d2d25;
  --heading: #f0aab2;
  --label: #e3bc5c;
  --teal: #7fc4b3;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--heading);
  line-height: 1.2;
  margin: 0 0 16px;
}

h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 16px; color: var(--ink-soft); }

a { color: var(--heading); text-decoration: none; }
a:hover { color: var(--label); }

ul { padding-left: 1.2em; color: var(--ink-soft); }
ul li { margin-bottom: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--brand-deep); color: var(--on-brand); }

.btn-outline {
  background: transparent;
  border-color: var(--heading);
  color: var(--heading);
}
.btn-outline:hover { background: var(--brand); color: var(--on-brand); }

.btn-small { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--cream) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.4rem;
  flex-shrink: 0;
}
.brand-mark.small { width: 32px; height: 32px; font-size: 1.1rem; margin-right: 8px; vertical-align: middle; }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand-text strong { color: var(--heading); font-size: 1.05rem; }
.brand-text small { color: var(--ink-soft); font-size: 0.72rem; max-width: 260px; }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.primary-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
}
.primary-nav a:hover { color: var(--heading); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--heading);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(circle at 15% 20%, rgba(201, 154, 46, 0.18), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(139, 38, 53, 0.14), transparent 40%),
    var(--cream);
  padding: 88px 0 72px;
  text-align: center;
}
.hero-inner { max-width: 780px; margin: 0 auto; }

.eyebrow, .section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--label);
  margin-bottom: 12px;
}

.hero h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); margin-bottom: 20px; }
.hero-sub { font-size: 1.05rem; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-note { color: var(--ink-soft); font-size: 0.88rem; font-style: italic; margin-top: 8px; }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}
.mission-list { margin-top: 20px; }

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-content: start;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--heading);
  font-weight: 700;
}
.stat-label { font-size: 0.78rem; color: var(--ink-soft); }
.stat-note {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-soft);
  margin: 4px 0 0;
}

/* Events */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.event-date {
  background: var(--brand);
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 14px 20px;
  font-size: 0.85rem;
}
.event-body { padding: 20px; }
.event-body h3 { margin-bottom: 8px; }
.event-body p { margin: 0; font-size: 0.92rem; }

/* Membership */
.membership-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}
.benefits-list { margin-top: 20px; }
.membership-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  text-align: center;
}
.membership-card h3 { margin-bottom: 8px; }
.membership-card .btn { margin: 16px 0 10px; }
.fine-print { font-size: 0.78rem; color: var(--ink-soft); margin: 0; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: start;
}
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}
.contact-form input,
.contact-form textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.form-status {
  font-size: 0.85rem;
  color: var(--heading);
  min-height: 1em;
  margin: 0;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.info-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.info-label {
  display: block;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--label);
  font-weight: 700;
  margin-bottom: 4px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brand-deep);
  color: rgba(253, 246, 238, 0.85);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
}
.footer-inner strong { color: var(--on-brand); }
.footer-inner p { color: rgba(253, 246, 238, 0.75); margin: 0; }
.back-to-top { color: var(--gold); font-weight: 600; }
.back-to-top:hover { color: var(--on-brand); }

/* ---------- Motif divider ----------
   A hand-drawn border line, in the spirit of the Mithila (Madhubani)
   painting tradition of Janakpur: a wave punctuated by small "fish-eye"
   diamonds. Built once as a CSS background tile rather than hand-authored
   SVG paths in markup. */
.motif-divider {
  height: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='22' viewBox='0 0 72 22'%3E%3Cpath d='M0,11 Q9,2 18,11 T36,11 T54,11 T72,11' fill='none' stroke='%23c99a2e' stroke-width='1.4' stroke-linecap='round'/%3E%3Cg fill='%238b2635'%3E%3Cpath d='M18,11 l3.4,3.4 -3.4,3.4 -3.4,-3.4 Z' opacity='0.85'/%3E%3Cpath d='M54,11 l3.4,3.4 -3.4,3.4 -3.4,-3.4 Z' opacity='0.85'/%3E%3Ccircle cx='18' cy='11' r='1.4' fill='%23c99a2e'/%3E%3Ccircle cx='54' cy='11' r='1.4' fill='%23c99a2e'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  background-size: 72px 22px;
  opacity: 0.75;
}

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid,
  .membership-inner,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 24px;
    gap: 14px;
    display: none;
  }
  .primary-nav.open { display: flex; }
  .primary-nav .btn { margin-top: 6px; }

  .brand-text small { display: none; }

  .about-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .hero { padding: 64px 0 48px; }
  .section { padding: 56px 0; }
}
