/*
Theme Name: Brain Foundation Modern
Theme URI: https://brain-foundation.org/
Author: OpenAI for The Brain Foundation
Description: A modern, accessible WordPress theme for The Brain Foundation, with seeded pages, houses, team, events, donation information, governance archive, and a secure contact form.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: brain-foundation-modern
*/

:root {
  --bf-navy: #15324a;
  --bf-navy-deep: #0b2235;
  --bf-teal: #147d7a;
  --bf-teal-dark: #0c5e5b;
  --bf-gold: #d8a63f;
  --bf-cream: #f7f3eb;
  --bf-paper: #ffffff;
  --bf-ink: #24313c;
  --bf-muted: #667581;
  --bf-line: #dbe3e7;
  --bf-success: #176b43;
  --bf-danger: #a12c2c;
  --bf-shadow: 0 16px 40px rgba(17, 48, 72, .10);
  --bf-radius: 18px;
  --bf-container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--bf-ink);
  background: var(--bf-paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--bf-teal-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--bf-navy); }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid rgba(216,166,63,.72); outline-offset: 3px; }

.bf-skip-link { position: fixed; z-index: 9999; left: 1rem; top: -100px; background: #fff; color: #000; padding: .75rem 1rem; border-radius: 8px; box-shadow: var(--bf-shadow); }
.bf-skip-link:focus { top: 1rem; }
.bf-container { width: min(calc(100% - 2rem), var(--bf-container)); margin-inline: auto; }
.bf-narrow { width: min(calc(100% - 2rem), 820px); margin-inline: auto; }
.bf-section { padding: clamp(3.6rem, 7vw, 6.8rem) 0; }
.bf-section--cream { background: var(--bf-cream); }
.bf-section--navy { background: var(--bf-navy-deep); color: #fff; }
.bf-section--teal { background: var(--bf-teal-dark); color: #fff; }
.bf-kicker { margin: 0 0 .5rem; color: var(--bf-teal); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.bf-section--navy .bf-kicker, .bf-section--teal .bf-kicker { color: #f2c96e; }
.bf-title { margin: 0 0 1rem; color: var(--bf-navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.08; letter-spacing: -.035em; }
.bf-section--navy .bf-title, .bf-section--teal .bf-title { color: #fff; }
.bf-lead { max-width: 760px; margin: 0; color: var(--bf-muted); font-size: clamp(1.05rem, 2vw, 1.28rem); }
.bf-section--navy .bf-lead, .bf-section--teal .bf-lead { color: rgba(255,255,255,.82); }
.bf-section-head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2.25rem; }
.bf-section-head > div { max-width: 790px; }

/* Header */
.bf-topbar { background: var(--bf-navy-deep); color: rgba(255,255,255,.82); font-size: .86rem; }
.bf-topbar__inner { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bf-topbar a { color: #fff; text-decoration: none; }
.bf-site-header { position: sticky; z-index: 1000; top: 0; background: rgba(255,255,255,.97); border-bottom: 1px solid rgba(21,50,74,.08); backdrop-filter: blur(16px); }
.bf-header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.bf-brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--bf-navy); text-decoration: none; }
.bf-brand__mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(145deg, var(--bf-teal), var(--bf-navy)); box-shadow: 0 8px 20px rgba(20,125,122,.22); font-family: Georgia, serif; font-size: 1.35rem; font-weight: 800; }
.bf-brand__name { display: block; font-family: Georgia, serif; font-weight: 800; font-size: 1.18rem; line-height: 1.05; }
.bf-brand__tag { display: block; color: var(--bf-muted); font-size: .69rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.bf-nav-wrap { display: flex; align-items: center; gap: 1rem; }
.bf-nav ul { display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.bf-nav a { display: block; padding: .7rem .66rem; border-radius: 8px; color: var(--bf-navy); font-size: .91rem; font-weight: 700; text-decoration: none; }
.bf-nav a:hover, .bf-nav .current-menu-item > a { background: var(--bf-cream); color: var(--bf-teal-dark); }
.bf-menu-toggle { display: none; border: 0; border-radius: 10px; background: var(--bf-cream); padding: .7rem .82rem; color: var(--bf-navy); cursor: pointer; }

/* Buttons */
.bf-button, .wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 46px; padding: .78rem 1.15rem; border: 2px solid var(--bf-teal);
  border-radius: 999px; background: var(--bf-teal); color: #fff !important;
  font-weight: 800; text-decoration: none; box-shadow: 0 8px 22px rgba(20,125,122,.18);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.bf-button:hover { transform: translateY(-2px); background: var(--bf-teal-dark); border-color: var(--bf-teal-dark); }
.bf-button--gold { background: var(--bf-gold); border-color: var(--bf-gold); color: var(--bf-navy-deep) !important; box-shadow: 0 8px 22px rgba(216,166,63,.22); }
.bf-button--outline { background: transparent; color: var(--bf-navy) !important; border-color: rgba(21,50,74,.35); box-shadow: none; }
.bf-button--outline:hover { background: var(--bf-navy); border-color: var(--bf-navy); color: #fff !important; }
.bf-section--navy .bf-button--outline, .bf-section--teal .bf-button--outline { color: #fff !important; border-color: rgba(255,255,255,.55); }
.bf-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.55rem; }

/* Hero */
.bf-hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(120deg, var(--bf-navy-deep), #174865 60%, #177f7b); }
.bf-hero::before, .bf-hero::after { content: ""; position: absolute; border-radius: 999px; background: rgba(255,255,255,.06); }
.bf-hero::before { width: 480px; height: 480px; right: -180px; top: -220px; }
.bf-hero::after { width: 290px; height: 290px; left: 42%; bottom: -220px; }
.bf-hero__inner { position: relative; z-index: 1; min-height: min(730px, 78vh); display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(2rem, 5vw, 5rem); padding-block: clamp(4.6rem, 8vw, 7.5rem); }
.bf-hero__eyebrow { display: inline-flex; gap: .5rem; align-items: center; padding: .42rem .75rem; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: rgba(255,255,255,.08); color: #f5d991; font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.bf-hero h1 { margin: 1.1rem 0 1rem; max-width: 760px; font-family: Georgia, serif; font-size: clamp(2.8rem, 6.5vw, 5.6rem); line-height: .99; letter-spacing: -.05em; }
.bf-hero p { max-width: 690px; margin: 0; color: rgba(255,255,255,.82); font-size: clamp(1.05rem, 2vw, 1.32rem); }
.bf-hero__visual { position: relative; min-height: 470px; }
.bf-hero__photo { position: absolute; inset: 0 0 0 4%; overflow: hidden; border-radius: 34px; box-shadow: 0 28px 70px rgba(0,0,0,.28); transform: rotate(1.5deg); }
.bf-hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.bf-hero__photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11,34,53,.45), transparent 55%); }
.bf-hero__badge { position: absolute; z-index: 2; left: -10px; bottom: 26px; width: 175px; padding: 1.05rem 1.15rem; border-radius: 18px; background: #fff; color: var(--bf-navy); box-shadow: var(--bf-shadow); }
.bf-hero__badge strong { display: block; color: var(--bf-teal-dark); font-family: Georgia, serif; font-size: 2rem; line-height: 1; }
.bf-hero__badge span { display: block; margin-top: .3rem; font-size: .83rem; font-weight: 700; line-height: 1.3; }

/* Stats and layouts */
.bf-stats { position: relative; z-index: 5; margin-top: -42px; }
.bf-stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; border: 1px solid var(--bf-line); border-radius: var(--bf-radius); background: #fff; box-shadow: var(--bf-shadow); }
.bf-stat { padding: 1.35rem; text-align: center; border-right: 1px solid var(--bf-line); }
.bf-stat:last-child { border-right: 0; }
.bf-stat strong { display: block; color: var(--bf-navy); font-family: Georgia, serif; font-size: clamp(1.65rem, 4vw, 2.55rem); line-height: 1; }
.bf-stat span { display: block; margin-top: .35rem; color: var(--bf-muted); font-size: .85rem; font-weight: 700; }
.bf-split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2rem, 6vw, 5rem); }
.bf-image-frame { position: relative; }
.bf-image-frame img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 26px; box-shadow: var(--bf-shadow); }
.bf-image-frame::before { content: ""; position: absolute; z-index: -1; width: 72%; height: 78%; right: -18px; bottom: -18px; border-radius: 28px; background: var(--bf-gold); opacity: .45; }
.bf-checks { display: grid; gap: .85rem; padding: 0; margin: 1.5rem 0 0; list-style: none; }
.bf-checks li { display: flex; align-items: flex-start; gap: .65rem; }
.bf-checks li::before { content: "✓"; flex: 0 0 auto; width: 1.45rem; height: 1.45rem; display: grid; place-items: center; border-radius: 50%; background: rgba(20,125,122,.12); color: var(--bf-teal-dark); font-weight: 900; }

/* Cards */
.bf-grid { display: grid; gap: 1.35rem; }
.bf-grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.bf-grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.bf-card { overflow: hidden; border: 1px solid var(--bf-line); border-radius: var(--bf-radius); background: #fff; box-shadow: 0 9px 26px rgba(17,48,72,.07); }
.bf-card__image { aspect-ratio: 4/3; overflow: hidden; background: #e8eeef; }
.bf-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.bf-card:hover .bf-card__image img { transform: scale(1.035); }
.bf-card__body { padding: 1.2rem 1.25rem 1.35rem; }
.bf-card__eyebrow { color: var(--bf-teal-dark); font-size: .74rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.bf-card h3 { margin: .25rem 0 .45rem; color: var(--bf-navy); font-family: Georgia, serif; font-size: 1.45rem; line-height: 1.18; }
.bf-card p { margin: 0; color: var(--bf-muted); font-size: .94rem; }
.bf-card__meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.bf-chip { display: inline-flex; padding: .28rem .55rem; border-radius: 999px; background: var(--bf-cream); color: var(--bf-navy); font-size: .74rem; font-weight: 800; }
.bf-house-card__number { position: absolute; right: .9rem; top: .9rem; min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.93); color: var(--bf-navy); font-family: Georgia, serif; font-weight: 800; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.bf-house-card .bf-card__image { position: relative; }
.bf-team-card { padding: 1.3rem; text-align: center; }
.bf-avatar { width: 78px; height: 78px; display: grid; place-items: center; margin: 0 auto .85rem; border-radius: 50%; background: linear-gradient(145deg, var(--bf-teal), var(--bf-navy)); color: #fff; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 800; }
.bf-team-card h3 { margin: 0; font-size: 1.25rem; }
.bf-role { margin: .28rem 0 0; color: var(--bf-teal-dark); font-size: .83rem; font-weight: 800; }

/* Quote, callout, timeline */
.bf-quote { position: relative; padding: clamp(1.5rem, 4vw, 2.7rem); border-radius: 24px; background: #fff; box-shadow: var(--bf-shadow); }
.bf-quote::before { content: "“"; position: absolute; right: 1.3rem; top: .5rem; color: rgba(20,125,122,.12); font-family: Georgia, serif; font-size: 7rem; line-height: 1; }
.bf-quote p { position: relative; margin: 0; color: var(--bf-navy); font-family: Georgia, serif; font-size: clamp(1.25rem, 2.5vw, 1.8rem); line-height: 1.45; }
.bf-quote cite { display: block; margin-top: 1rem; color: var(--bf-muted); font-family: inherit; font-size: .9rem; font-style: normal; font-weight: 700; }
.bf-callout { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2rem; padding: clamp(1.5rem, 4vw, 2.8rem); border-radius: 26px; background: linear-gradient(135deg, var(--bf-navy), var(--bf-teal-dark)); color: #fff; box-shadow: var(--bf-shadow); }
.bf-callout h2 { margin: 0 0 .45rem; font-family: Georgia, serif; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.1; }
.bf-callout p { margin: 0; color: rgba(255,255,255,.82); }
.bf-timeline { display: grid; gap: 1rem; }
.bf-timeline__item { display: grid; grid-template-columns: 90px 1fr; gap: 1.2rem; padding: 1.2rem 0; border-bottom: 1px solid var(--bf-line); }
.bf-timeline__year { color: var(--bf-teal-dark); font-family: Georgia, serif; font-size: 1.35rem; font-weight: 800; }
.bf-timeline__item h3 { margin: 0 0 .25rem; color: var(--bf-navy); }
.bf-timeline__item p { margin: 0; color: var(--bf-muted); }

/* Page hero and content */
.bf-page-hero { padding: clamp(3rem, 7vw, 5rem) 0; color: #fff; background: linear-gradient(135deg, var(--bf-navy-deep), var(--bf-navy)); }
.bf-page-hero h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(2.5rem, 6vw, 4.8rem); line-height: 1.05; letter-spacing: -.04em; }
.bf-page-hero p { max-width: 720px; margin: .8rem 0 0; color: rgba(255,255,255,.78); font-size: 1.1rem; }
.bf-entry-content > :first-child { margin-top: 0; }
.bf-entry-content h2, .bf-entry-content h3 { color: var(--bf-navy); }
.bf-entry-content h2 { font-family: Georgia, serif; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.15; }
.bf-entry-content .bf-section:last-child { margin-bottom: 0; }

/* Financials and events */
.bf-doc-group { margin-bottom: 2rem; }
.bf-doc-group h3 { color: var(--bf-navy); }
.bf-doc-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; padding: 0; list-style: none; }
.bf-doc-list a, .bf-doc-list span { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1rem; border: 1px solid var(--bf-line); border-radius: 12px; background: #fff; color: var(--bf-navy); text-decoration: none; }
.bf-doc-list a:hover { border-color: var(--bf-teal); }
.bf-doc-list small { color: var(--bf-muted); }
.bf-notice { padding: 1rem 1.1rem; border-left: 4px solid var(--bf-gold); border-radius: 8px; background: #fff8e7; color: #614b19; }
.bf-event { display: grid; grid-template-columns: 120px 1fr; gap: 1.3rem; padding: 1.3rem; border: 1px solid var(--bf-line); border-radius: var(--bf-radius); background: #fff; }
.bf-event__date { display: grid; place-items: center; align-content: center; min-height: 100px; border-radius: 15px; background: var(--bf-navy); color: #fff; text-align: center; }
.bf-event__date strong { font-family: Georgia, serif; font-size: 2rem; line-height: 1; }
.bf-event__date span { font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.bf-event h3 { margin: 0; color: var(--bf-navy); font-family: Georgia, serif; font-size: 1.5rem; }
.bf-event p { margin: .45rem 0 0; color: var(--bf-muted); }

/* Forms */
.bf-form { display: grid; gap: 1rem; }
.bf-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.bf-field label { display: block; margin-bottom: .35rem; color: var(--bf-navy); font-size: .86rem; font-weight: 800; }
.bf-field input, .bf-field textarea, .bf-field select { width: 100%; border: 1px solid #c9d4d9; border-radius: 10px; background: #fff; padding: .78rem .85rem; color: var(--bf-ink); }
.bf-field textarea { min-height: 150px; resize: vertical; }
.bf-hp { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.bf-alert { margin-bottom: 1rem; padding: .85rem 1rem; border-radius: 10px; font-weight: 700; }
.bf-alert--success { background: #e7f6ee; color: var(--bf-success); }
.bf-alert--error { background: #fdeeee; color: var(--bf-danger); }
.bf-contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 2rem; }
.bf-contact-panel { padding: 1.5rem; border-radius: var(--bf-radius); background: var(--bf-navy); color: #fff; }
.bf-contact-panel h3 { margin-top: 0; color: #fff; font-family: Georgia, serif; font-size: 1.6rem; }
.bf-contact-panel a { color: #fff; }
.bf-contact-item { padding: .8rem 0; border-top: 1px solid rgba(255,255,255,.15); }
.bf-contact-item strong { display: block; color: #f5d991; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }

/* Footer */
.bf-site-footer { background: var(--bf-navy-deep); color: rgba(255,255,255,.75); }
.bf-footer-main { display: grid; grid-template-columns: 1.25fr .8fr 1fr; gap: 3rem; padding: 4rem 0 3rem; }
.bf-footer-main h3 { margin: 0 0 .8rem; color: #fff; font-family: Georgia, serif; }
.bf-footer-main a { color: rgba(255,255,255,.88); }
.bf-footer-links { list-style: none; padding: 0; margin: 0; }
.bf-footer-links li { margin: .4rem 0; }
.bf-footer-bottom { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; }

/* Utility */
.bf-center { text-align: center; }
.bf-center .bf-lead { margin-inline: auto; }
.bf-mt-0 { margin-top: 0; }
.bf-mb-0 { margin-bottom: 0; }
.bf-muted { color: var(--bf-muted); }
.bf-admin-verify { display: inline-block; margin-left: .4rem; padding: .12rem .35rem; border-radius: 5px; background: #fff1c9; color: #694b00; font-size: .65rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }

@media (max-width: 1020px) {
  .bf-menu-toggle { display: inline-flex; }
  .bf-nav { position: fixed; inset: 116px 1rem auto 1rem; display: none; max-height: calc(100vh - 135px); overflow: auto; padding: .75rem; border: 1px solid var(--bf-line); border-radius: 16px; background: #fff; box-shadow: var(--bf-shadow); }
  .bf-nav.is-open { display: block; }
  .bf-nav ul { display: block; }
  .bf-nav a { padding: .85rem; }
  .bf-header-donate { display: none; }
  .bf-hero__inner { grid-template-columns: 1fr; }
  .bf-hero__visual { min-height: 390px; }
  .bf-grid--4 { grid-template-columns: repeat(2,1fr); }
  .bf-footer-main { grid-template-columns: 1fr 1fr; }
  .bf-footer-main > :first-child { grid-column: 1/-1; }
}
@media (max-width: 760px) {
  .bf-topbar { display: none; }
  .bf-nav { inset-block-start: 88px; }
  .bf-brand__tag { display: none; }
  .bf-hero__inner { min-height: auto; padding-block: 4.4rem 5rem; }
  .bf-hero__visual { min-height: 320px; }
  .bf-hero__photo { inset-left: 0; }
  .bf-hero__badge { left: 8px; bottom: 10px; }
  .bf-stats { margin-top: -25px; }
  .bf-stats__grid { grid-template-columns: repeat(2,1fr); }
  .bf-stat:nth-child(2) { border-right: 0; }
  .bf-stat:nth-child(-n+2) { border-bottom: 1px solid var(--bf-line); }
  .bf-split, .bf-contact-grid { grid-template-columns: 1fr; }
  .bf-grid--3, .bf-grid--4 { grid-template-columns: 1fr; }
  .bf-section-head { display: block; }
  .bf-section-head .bf-button { margin-top: 1rem; }
  .bf-callout { grid-template-columns: 1fr; }
  .bf-form-row { grid-template-columns: 1fr; }
  .bf-doc-list { grid-template-columns: 1fr; }
  .bf-event { grid-template-columns: 1fr; }
  .bf-event__date { min-height: 80px; }
  .bf-timeline__item { grid-template-columns: 70px 1fr; }
  .bf-footer-main { grid-template-columns: 1fr; gap: 1.5rem; }
  .bf-footer-main > :first-child { grid-column: auto; }
  .bf-footer-bottom { display: block; }
}
