/* =====================================================================
   BCD Public Charitable Trust (Gateman) -- Design System
   Palette matched to the organization logo: trust blue + gateman orange
   + signal red, with a neutral charcoal for text.
   Signature motif: concentric "growth rings" from the original build --
   left in place as a section-divider/impact-stat visual element.
   ===================================================================== */

:root {
  --forest: #0178B8;
  --forest-dark: #004265;
  --forest-tint: #489DCB;
  --sand: #EDF5FA;
  --cream: #FAFBFC;
  --marigold: #EB7712;
  --clay: #E73E31;
  --ink: #302E2E;
  --white: #FFFFFF;
  --line: rgba(1, 120, 184, 0.14);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 28px;
  --shadow-soft: 0 12px 32px -14px rgba(1, 120, 184, 0.28);
}

* { 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; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--forest-dark);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay);
  display: inline-block;
  margin-bottom: 0.8em;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--forest); color: #fff;
  padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------------------------- Buttons ---------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 24px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; border: 2px solid transparent;
  cursor: pointer; transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--marigold); color: var(--forest-dark); }
.btn-primary:hover { background: #d9922f; }
.btn-secondary { background: var(--forest); color: var(--white); }
.btn-secondary:hover { background: var(--forest-dark); }
.btn-outline { background: transparent; border-color: var(--forest); color: var(--forest); }
.btn-outline:hover { background: var(--forest); color: #fff; }
.btn-ghost { background: transparent; color: var(--forest-dark); padding: 10px 16px; }
.btn-ghost:hover { color: var(--clay); transform: none; }
.btn-clay { background: var(--clay); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------------------------- Header ---------------------------- */
.site-header { background: var(--cream); position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--forest-dark); display: flex; flex-direction: column; line-height: 1.2; max-width: 230px; }
.brand-text small { font-family: var(--font-mono); font-weight: 500; font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--clay); margin-top: 2px; }
.brand-text.light { flex-direction: row; align-items: center; gap: 8px; color: var(--sand); font-size: 1.1rem; max-width: none; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--forest-dark); display: block; }

.primary-nav { display: flex; align-items: center; gap: 24px; flex: 1; justify-content: flex-end; }
.primary-nav ul { display: flex; gap: 20px; flex-wrap: wrap; }
.primary-nav ul a { font-weight: 600; font-size: 0.94rem; color: var(--forest-dark); padding: 6px 2px; border-bottom: 2px solid transparent; }
.primary-nav ul a:hover { border-color: var(--marigold); }
.nav-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

@media (max-width: 980px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--cream);
    flex-direction: column; align-items: stretch; border-bottom: 1px solid var(--line);
    padding: 16px 24px 24px; display: none; gap: 16px;
  }
  .primary-nav.open { display: flex; }
  .primary-nav ul { flex-direction: column; gap: 6px; }
  .nav-actions { flex-direction: column; align-items: stretch; }
}

/* ---------------------------- Flash messages ---------------------------- */
.flash { padding: 14px 0; font-weight: 600; text-align: center; }
.flash-success { background: #E4EFE6; color: var(--forest-dark); }
.flash-error { background: #F6E1DA; color: var(--clay); }

/* ---------------------------- Hero ---------------------------- */
.hero {
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-dark) 100%);
  color: var(--sand); position: relative; overflow: hidden;
}
.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.hero h1 { color: #fff; }
.hero p.lead { font-size: 1.15rem; color: var(--sand); max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-rings { position: relative; width: 100%; aspect-ratio: 1/1; max-width: 420px; margin: 0 auto; }
.hero-rings svg { width: 100%; height: 100%; }
@media (max-width: 900px) { .hero .container { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 48px; } }

/* ---------------------------- Sections ---------------------------- */
.section { padding: 88px 0; }
.section-alt { background: var(--sand); }
.section-header { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-header.left { margin-left: 0; text-align: left; }

/* ---------------------------- Impact stat rings (signature element) ---------------------------- */
.impact-rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 32px; }
.impact-ring { text-align: center; }
.impact-ring svg { width: 130px; height: 130px; margin: 0 auto 16px; }
.impact-ring .num { font-family: var(--font-mono); font-size: 1.8rem; font-weight: 500; color: var(--forest-dark); display: block; }
.impact-ring .label { color: var(--clay); font-weight: 600; font-size: 0.9rem; }

/* ---------------------------- Cards ---------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.card {
  background: var(--white); border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-soft); display: flex; flex-direction: column;
  border: 1px solid var(--line);
}
.card-media { aspect-ratio: 16/10; background: var(--sand); display: flex; align-items: center; justify-content: center; color: var(--forest-tint); }
.card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.card-tag { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--clay); margin-bottom: 8px; }
.card-body h3 { margin-bottom: 10px; }
.card-body p { color: #55584f; flex: 1; }
.card-body .card-cta { margin-top: 14px; font-weight: 700; color: var(--forest); }

.progress-bar { background: var(--sand); border-radius: 999px; height: 8px; overflow: hidden; margin: 12px 0; }
.progress-bar span { display: block; height: 100%; background: var(--marigold); }

/* ---------------------------- Program / What we do ---------------------------- */
.program-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.program-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 28px; }
.program-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--sand); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--forest); }

/* ---------------------------- Forms ---------------------------- */
.form-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 40px; box-shadow: var(--shadow-soft); max-width: 620px; margin: 0 auto;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.95rem; background: var(--cream); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(232,163,61,0.4); border-color: var(--marigold); }
.field { margin-bottom: 18px; }
textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.85rem; color: #66695f; margin-top: 6px; }
.help-error { color: var(--clay); font-size: 0.85rem; margin-top: 6px; }

/* ---------------------------- Gallery ---------------------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gallery-item { border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 1/1; background: var(--sand); position: relative; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item .cap { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(0deg, rgba(18,39,29,0.85), transparent); color: #fff; padding: 14px 12px 10px; font-size: 0.82rem; font-weight: 600; }

/* ---------------------------- Bank transfer / donate ---------------------------- */
.bank-card { background: var(--forest); color: var(--sand); border-radius: var(--radius-lg); padding: 36px; }
.bank-card h3 { color: #fff; }
.bank-details { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin: 20px 0; font-family: var(--font-mono); font-size: 0.9rem; }
.bank-details dt { color: var(--marigold); text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.1em; }
.bank-details dd { margin: 2px 0 0; color: #fff; font-weight: 600; }

/* ---------------------------- Tables (dashboard) ---------------------------- */
.table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius-md); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
th { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--clay); background: var(--sand); }
tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge-pending { background: #FBEBD3; color: #9A6A17; }
.badge-approved, .badge-verified, .badge-active { background: #E1EEE3; color: var(--forest-dark); }
.badge-declined, .badge-rejected, .badge-suspended { background: #F6DFD8; color: var(--clay); }

/* ---------------------------- Dashboard shell ---------------------------- */
.dash-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 70vh; }
.dash-sidebar { background: var(--forest-dark); color: var(--sand); padding: 32px 20px; }
.dash-sidebar h4 { color: #fff; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.7; margin: 24px 0 10px; }
.dash-sidebar ul { display: flex; flex-direction: column; gap: 4px; }
.dash-sidebar a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.92rem; }
.dash-sidebar a:hover, .dash-sidebar a.active { background: rgba(255,255,255,0.08); color: #fff; }
.dash-main { padding: 40px; background: var(--cream); }
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 32px; }
.stat-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 22px; }
.stat-box .num { font-family: var(--font-mono); font-size: 1.9rem; color: var(--forest-dark); display: block; }
.stat-box .label { color: var(--clay); font-weight: 600; font-size: 0.85rem; }
@media (max-width: 860px) {
  .dash-shell { grid-template-columns: 1fr; }
  .dash-sidebar { display: flex; flex-wrap: wrap; gap: 4px; padding: 16px 20px; }
  .dash-sidebar h4 { display: none; }
  .dash-sidebar ul { flex-direction: row; flex-wrap: wrap; }
}

/* ---------------------------- Footer ---------------------------- */
.site-footer { background: var(--forest-dark); color: var(--sand); padding-top: 64px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-col h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-mono); margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col a:hover { color: var(--marigold); }
.footer-col p { color: rgba(240,230,210,0.75); font-size: 0.92rem; }
.footer-bottom { text-align: center; padding: 20px 0; font-size: 0.82rem; color: rgba(240,230,210,0.6); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------------------------- Misc ---------------------------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.tag-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.tag { background: var(--sand); color: var(--forest-dark); font-size: 0.78rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.empty-state { text-align: center; padding: 60px 20px; color: #66695f; }

:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
