/* ==========================================================================
   Theme tokens — change brand colors here.
   ========================================================================== */
:root {
  /* Logo palette, slightly brightened */
  --navy: #1f2b6b;
  --sky: #8fb4f0;
  --gold: #e8cfa8;
  --cream: #f3e9dc;

  --brand: var(--navy);
  --brand-strong: #16205a;
  --brand-ink: #ffffff;
  --accent: var(--gold);
  --accent-strong: #ddbf91;
  --accent-ink: var(--navy);

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f7fc;
  --text: #161b33;
  --muted: #646b82;
  --border: #e7e9f0;
  --danger: #c0352b;
  --success: #1f8a58;

  --cat-general: #4a74d9;
  --cat-professional: #8a5cd6;
  --cat-social: #ec8f3a;
  --cat-service: #2fa36f;
  --cat-cultural: #df4f7c;

  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: "Saira", var(--font);
  --maxw: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: var(--sky);
    --brand-strong: #adc8f5;
    --brand-ink: #10162e;
    --bg: #10162e;
    --surface: #151c3a;
    --surface-2: #1b2348;
    --text: #f2ede6;
    --muted: #a5abc3;
    --border: #283260;
    --danger: #f19087;
    --success: #74d4a5;
    --cat-general: #84a6f0;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
a { color: var(--brand); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1, h2 { font-family: var(--font-display); font-weight: 700; color: var(--brand); }
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.75rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
code { background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.section { padding: 64px 0; }
.section-alt { background: var(--surface-2); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: 0.92rem; font-weight: 500; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 58ch; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Placeholder boxes for photos/logos to be swapped later */
.logo-placeholder, .img-placeholder {
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
}
.img-placeholder { aspect-ratio: 1; border-radius: 50%; }

/* ==========================================================================
   Buttons, forms, notices
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0.6em 1.15em;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit; font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--brand-strong); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); border-color: var(--danger); }
.btn-sm { padding: 0.35em 0.85em; font-size: 0.88rem; }

label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 4px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  padding: 0.55em 0.75em;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
input[type="checkbox"] { width: auto; accent-color: var(--brand); }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

.notice { padding: 10px 14px; border-radius: 8px; background: var(--surface-2); }
.notice-error { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.notice-success { color: var(--success); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }

/* ==========================================================================
   Header / footer
   ========================================================================== */
.demo-banner { background: var(--surface-2); color: var(--muted); text-align: center; font-size: 0.8rem; padding: 5px 16px; }
#site-header {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.brand img { height: 30px; width: auto; }
.brand-school { padding-left: 14px; border-left: 1px solid var(--border); color: var(--muted); font-size: 0.78rem; line-height: 1.2; }
@media (max-width: 420px) { .brand-school { display: none; } }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) { padding: 8px 12px; text-decoration: none; color: var(--muted); font-weight: 500; }
.site-nav a:not(.btn):hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--brand); }
.site-nav .btn { margin-left: 8px; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
  }
  .site-nav.open { display: flex; }
  .site-nav .btn { margin: 8px 0 0; }
}

#site-footer { border-top: 1px solid var(--border); color: var(--muted); padding: 32px 0; margin-top: 64px; font-size: 0.88rem; }
#site-footer a { color: var(--muted); text-decoration: none; }
#site-footer a:hover { color: var(--brand); }
#site-footer strong { color: var(--text); font-weight: 600; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.footer-brand { display: flex; gap: 14px; align-items: center; }
.footer-brand img { height: 44px; width: auto; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ==========================================================================
   Home
   ========================================================================== */
.hero { padding: 88px 0 72px; }
.hero-inner { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.hero-logo { width: 200px; height: auto; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.76rem; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.eyebrow::before { content: ""; display: inline-block; width: 24px; height: 2px; background: var(--gold); vertical-align: middle; margin-right: 10px; }
@media (max-width: 720px) {
  .hero { padding: 48px 0 40px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-logo { display: none; }
}

.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.pillar {
  background: var(--navy);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 28px 24px;
  border-top: 3px solid var(--gold);
}
.pillar h3 { color: #fff; font-size: 1.15rem; margin-bottom: 8px; }
.pillar p { margin: 0; color: color-mix(in srgb, var(--cream) 88%, transparent); }
.pillar .icon {
  width: 48px; height: 48px; margin-bottom: 18px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--gold);
}
.pillar .icon svg { width: 26px; height: 26px; }
@media (prefers-color-scheme: dark) {
  .pillar { background: #22306f; }
}

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.officers { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 28px; text-align: center; }
.officer .img-placeholder { width: 104px; margin: 0 auto 12px; }
.officer strong { display: block; font-weight: 600; }
.officer span { color: var(--muted); font-size: 0.88rem; }

.sponsor-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.sponsor-row .logo-placeholder { height: 72px; }

.join { text-align: center; padding: 8px 0; }
.join .lead { margin-inline: auto; }
.join .hero-actions { justify-content: center; }

/* ==========================================================================
   Events
   ========================================================================== */
.event-list { display: grid; }
.event-card { display: flex; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.event-card:first-child { padding-top: 0; }
.event-card:last-child { border-bottom: 0; }
.event-date { flex: none; width: 48px; text-align: center; }
.event-date .month { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.event-date .day { display: block; font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; line-height: 1.05; color: var(--brand); }
.event-body { min-width: 0; }
.event-body h3 { margin-bottom: 2px; }
.event-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 6px; }
.event-desc { margin-bottom: 8px; }
.event-tags { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 0.8rem; }
.tag { color: var(--muted); text-transform: capitalize; text-decoration: none; }
.event-tags .tag:first-child::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cat-color, var(--brand)); margin-right: 6px; vertical-align: 1px; }
.tag-points { color: var(--text); font-weight: 600; background: color-mix(in srgb, var(--gold) 45%, transparent); padding: 1px 8px; border-radius: 999px; }
.tag-link { text-transform: none; }
.tag-link:hover { color: var(--brand); text-decoration: underline; }

.cat-general { --cat-color: var(--cat-general); }
.cat-professional { --cat-color: var(--cat-professional); }
.cat-social { --cat-color: var(--cat-social); }
.cat-service { --cat-color: var(--cat-service); }
.cat-cultural { --cat-color: var(--cat-cultural); }

.calendar { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; gap: 8px; }
.cal-head h2 { margin: 0; font-size: 1.2rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { padding: 6px 8px; text-align: center; font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.cal-day {
  min-height: 92px; padding: 6px; border: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border);
  background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
}
.cal-day:nth-child(7n + 1) { border-left: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.other-month { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.cal-day.today .num { background: var(--brand); color: var(--brand-ink); }
.cal-day.selected { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--brand); }
.cal-day .num { font-size: 0.82rem; font-weight: 500; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-chip {
  font-size: 0.72rem; padding: 1px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--cat-color, var(--brand)) 14%, transparent); color: var(--text);
}
@media (max-width: 720px) {
  .cal-day { min-height: 52px; align-items: center; }
  .cal-chip { width: 6px; height: 6px; padding: 0; border-radius: 50%; font-size: 0; background: var(--cat-color, var(--brand)); }
  .cal-chips { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
}
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.82rem; color: var(--muted); margin-top: 12px; }
.legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cat-color); margin-right: 6px; vertical-align: 1px; }

/* ==========================================================================
   Leaderboard
   ========================================================================== */
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.segmented button { border: 0; background: none; font: inherit; font-weight: 500; font-size: 0.9rem; padding: 5px 14px; border-radius: 999px; color: var(--muted); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: end; margin-bottom: 40px; }
.podium-spot { text-align: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 12px; }
.podium-spot.p1 { order: 2; padding-top: 32px; border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.podium-spot.p2 { order: 1; }
.podium-spot.p3 { order: 3; }
.podium-spot .medal {
  width: 34px; height: 34px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  color: var(--navy);
}
.medal-1 { background: #f2cf6b; }
.medal-2 { background: #d5dbe6; }
.medal-3 { background: #e7b48c; }
.podium-spot .name { font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.podium-spot .pts { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--brand); }
@media (max-width: 560px) {
  .podium { gap: 8px; }
  .podium-spot { padding: 14px 6px; }
  .podium-spot .pts { font-size: 1.3rem; }
  .podium-spot .sub { display: none; }
}

.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.rank { width: 64px; font-weight: 600; color: var(--muted); }
.bar { height: 4px; border-radius: 2px; background: var(--surface-2); margin-top: 6px; overflow: hidden; max-width: 280px; }
.bar > span { display: block; height: 100%; background: var(--sky); }
@media (max-width: 560px) { .hide-sm { display: none; } th, td { padding: 10px; } }

.mini-board li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.mini-board li:last-child { border-bottom: 0; }
.mini-board ol { list-style: none; margin: 0; padding: 0; }
.mini-board .r { color: var(--muted); width: 2em; display: inline-block; }

/* ==========================================================================
   Admin
   ========================================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 500; padding: 10px 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .admin-grid { grid-template-columns: 1fr; } }
.member-picker { max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.member-picker label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-weight: 400; cursor: pointer; margin: 0; }
.member-picker label:last-child { border-bottom: 0; }
.member-picker label:hover { background: var(--surface-2); }
.member-picker label.already { color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input { flex: 1; min-width: 160px; }
.login-card { max-width: 400px; margin: 48px auto; }
