/*
Theme Name: CCBS
Description: Custom theme for the Cambridge Center for Behavioral Studies.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: ccbs
*/

:root {
  --navy: #0c2b6e;
  --navy-deep: #071a45;
  --ink: #1c2a4a;
  --muted: #4b5875;
  --label: #133d98;
  --gold: #f6c331;
  --gold-dark: #e2a913;
  --blue-50: #eef5fc;
  --cream: #fdf6e8;
  --mint: #eef4ee;
  --line: #d9e3f0;
  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wrap: 1200px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--label); }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); margin: 0; line-height: 1.15; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; z-index: 100; top: 8px; left: 8px;
  background: #fff; padding: 8px 14px; border-radius: 6px;
}
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  font: 600 18px/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 0; border-radius: 6px; padding: 15px 26px;
  transition: background .15s, transform .15s;
}
.btn svg { width: 20px; height: 20px; flex: none; transition: transform .15s; }
.btn:hover svg { transform: translateX(3px); }
.btn-gold { background: var(--gold); color: var(--navy-deep); box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-navy { background: var(--navy); color: #fff; width: 100%; }
.btn-navy svg { color: var(--gold); }
.btn-navy:hover { background: var(--navy-deep); }

/* Header */
.site-header { background: #fff; position: relative; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 120px; }
.brand img { height: 100px; width: auto; }
.header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 22px; }
.utility { display: flex; align-items: center; gap: 22px; }
.utility ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.utility li + li::before { content: "|"; color: var(--navy); margin: 0 14px; }
.utility nav a, .utility button.link {
  color: var(--navy); text-decoration: none; font-size: 15px; background: none; border: 0;
  padding: 0; cursor: pointer; font-family: var(--sans); display: inline-flex; align-items: center; gap: 8px;
}
.utility nav a:hover, .utility button.link:hover { text-decoration: underline; }
.utility button.link svg { width: 20px; height: 20px; }
.btn-donate { padding: 12px 28px; font-size: 19px; font-weight: 700; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.main-nav a { color: var(--label); text-decoration: none; font-size: 15px; font-weight: 600; }
.main-nav a:hover { color: var(--navy-deep); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.search-form { display: none; gap: 8px; }
.search-form.open { display: flex; }
.search-form input {
  font: inherit; font-size: 15px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; width: 220px;
}
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; color: var(--navy); cursor: pointer;
}
.nav-toggle svg { width: 24px; height: 24px; }

/* Hero */
.hero { position: relative; background: var(--navy-deep); color: #fff; overflow: hidden; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-art svg { width: 100%; height: 100%; max-width: none; }
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding-top: 72px; padding-bottom: 72px; min-height: 520px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(44px, 6.4vw, 78px); font-weight: 700; letter-spacing: -.01em; line-height: 1.04; }
.hero h1 span { display: block; }
.hero h1 .gold { color: var(--gold); }
.hero .lead { font-size: clamp(19px, 2.1vw, 26px); line-height: 1.4; margin: 22px 0 30px; max-width: 30ch; }
.mission { border-left: 3px solid var(--gold); padding: 22px 0 22px 36px; }
.mission svg { width: 84px; height: 84px; margin-bottom: 14px; }
.mission h2 { font-family: var(--sans); color: var(--gold); font-size: 24px; font-weight: 700; letter-spacing: .02em; margin-bottom: 8px; }
.mission p { font-size: 17px; line-height: 1.6; }

/* Campaign */
.campaign { padding: 22px 0 0; }
.campaign-card { background: var(--blue-50); border-radius: 6px; padding: 22px 28px 24px; }
.eyebrow { display: flex; align-items: center; gap: 16px; color: var(--label); font-weight: 600; font-size: 16px; letter-spacing: .03em; text-transform: uppercase; }
.eyebrow::after { content: ""; height: 2px; background: var(--gold); width: 270px; max-width: 30vw; }
.campaign-top { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; margin-top: 6px; }
.campaign h2 { font-size: clamp(26px, 3.2vw, 37px); }
.campaign-top p { color: var(--muted); font-size: 16.5px; margin-top: 12px; }
.campaign-meter { display: grid; grid-template-columns: auto 1fr auto; gap: 40px; align-items: center; margin-top: 14px; }
.amount { font-size: clamp(34px, 4vw, 46px); font-weight: 700; color: var(--navy); line-height: 1.05; letter-spacing: -.01em; }
.amount-sub { color: var(--muted); font-size: 17px; }
.pct { text-align: right; }
.pct strong { display: block; font-size: clamp(34px, 4vw, 46px); color: var(--label); line-height: 1.05; }
.pct span { color: var(--muted); font-size: 17px; }

.bar { height: 14px; background: #dde6f1; border-radius: 99px; overflow: hidden; }
.bar.big { height: 30px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(180deg, #f8cd45, #efb51c); border-radius: inherit; transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.bar i.go { width: var(--w); }

/* Section titles */
.section-title { text-align: center; margin: 34px 0 18px; }
.section-title h2 {
  display: flex; align-items: center; justify-content: center; gap: 26px;
  font-family: var(--sans); color: var(--label); font-size: 21px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.section-title h2::before, .section-title h2::after { content: ""; height: 2px; width: 92px; background: var(--gold); flex: none; }
.section-title p { color: var(--label); font-size: 16px; margin-top: 4px; }

/* Funds */
.funds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fund { border-radius: 6px; padding: 20px 22px 22px; display: flex; flex-direction: column; }
.fund.tint-blue { background: var(--blue-50); }
.fund.tint-cream { background: var(--cream); }
.fund.tint-mint { background: var(--mint); }
.fund-head { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: start; }
.fund-icon { width: 96px; height: 96px; }
.fund h3 { font-size: 24px; margin-bottom: 6px; }
.fund-head p { color: var(--muted); font-size: 16px; line-height: 1.4; }
.fund-stats { margin-top: auto; padding-top: 22px; }
.fund-raised { font-size: 16.5px; color: var(--muted); margin-bottom: 8px; }
.fund-raised strong { font-size: 21px; color: var(--navy); }
.fund-bar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; margin-bottom: 18px; }
.fund-bar b { color: var(--navy); font-size: 17px; }
.fund .btn { padding: 14px 20px; font-size: 18px; }

/* Impact */
.impact { list-style: none; margin: 0; padding: 0 0 34px; display: grid; grid-template-columns: repeat(5, 1fr); }
.impact li { text-align: center; position: relative; padding: 0 10px; }
.impact li + li::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 6px; width: 1px; background: var(--line); }
.impact .ico { width: 112px; height: 112px; margin: 0 auto 6px; border-radius: 50%; background: var(--blue-50); display: grid; place-items: center; }
.impact .ico svg { width: 72px; height: 72px; }
.impact span { display: block; color: var(--label); font-weight: 600; font-size: 19px; line-height: 1.2; }

/* Closing band */
.closing { position: relative; color: #fff; overflow: hidden; background: #22324f; }
.closing-art { position: absolute; inset: 0; }
.closing-art svg { width: 100%; height: 100%; max-width: none; }
.closing .wrap { position: relative; display: grid; grid-template-columns: 1fr 1.25fr; gap: 48px; padding-top: 64px; padding-bottom: 64px; align-items: center; }
.closing h2 { color: #fff; font-style: italic; font-size: clamp(32px, 3.8vw, 44px); }
.closing p.lead { font-size: 19px; line-height: 1.5; margin: 18px 0 26px; max-width: 34ch; }
.goals-title { display: flex; align-items: center; justify-content: center; gap: 18px; font: 700 21px/1 var(--sans); letter-spacing: .03em; text-transform: uppercase; margin: 0 0 26px; color: #fff; }
.goals-title::before, .goals-title::after { content: ""; height: 2px; width: 72px; background: var(--gold); }
.goals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.goals li { text-align: center; padding: 0 14px; border-left: 2px solid var(--gold); }
.goals li:last-child { border-right: 2px solid var(--gold); }
.goals svg { width: 76px; height: 76px; margin: 0 auto 10px; }
.goals h3 { font: 600 18px/1.25 var(--sans); color: #fff; margin-bottom: 8px; }
.goals p { font-size: 15px; line-height: 1.45; color: #eef1f7; }

/* Giving notice */
dialog.give-dialog { border: 0; border-radius: 10px; padding: 28px 30px; max-width: 420px; width: calc(100% - 32px); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog.give-dialog::backdrop { background: rgba(7,26,69,.55); }
dialog.give-dialog h2 { font-size: 24px; margin-bottom: 10px; }
dialog.give-dialog p { color: var(--muted); margin-bottom: 20px; }

/* Footer */
.site-footer { background: var(--navy-deep); color: #c8d3ea; font-size: 15px; padding: 26px 0; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: #fff; }

/* Generic content pages */
.content { padding: 56px 0 72px; }
.content h1 { font-size: 40px; margin-bottom: 24px; }
.content .entry > * + * { margin-top: 1em; }

/* Responsive */
@media (max-width: 1100px) {
  .main-nav ul { gap: 18px; }
  .main-nav a { font-size: 14px; }
  .brand img { height: 76px; }
}
@media (max-width: 960px) {
  :root { --gutter: 20px; }
  .site-header .wrap { min-height: 88px; flex-wrap: wrap; }
  .brand img { height: 62px; }
  .header-right { flex-direction: row; align-items: center; gap: 12px; }
  .utility nav, .utility button.search-toggle, .utility .search-form { display: none; }
  .nav-toggle { display: inline-flex; }
  .main-nav { display: none; width: 100%; order: 3; padding-bottom: 16px; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav li { border-top: 1px solid var(--line); }
  .main-nav a { display: block; padding: 12px 0; font-size: 16px; }
  .main-nav .mobile-only { display: block; }
  .hero-art::after { content: ""; position: absolute; inset: 0; background: rgba(5, 14, 40, .5); }
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; padding-top: 56px; padding-bottom: 56px; min-height: 0; }
  .mission { padding: 4px 0 4px 24px; }
  .mission svg { width: 60px; height: 60px; }
  .campaign-top { grid-template-columns: 1fr; gap: 0; }
  .campaign-meter { grid-template-columns: 1fr auto; gap: 16px 24px; }
  .campaign-meter .bar { grid-column: 1 / -1; grid-row: 2; }
  .funds { grid-template-columns: 1fr; }
  .impact { grid-template-columns: repeat(3, 1fr); row-gap: 24px; }
  .impact li:nth-child(4)::before { display: none; }
  .closing .wrap { grid-template-columns: 1fr; gap: 40px; }
}
@media (min-width: 961px) { .main-nav .mobile-only { display: none; } }
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .brand img { height: 50px; }
  .btn-donate { padding: 10px 18px; font-size: 17px; }
  .campaign-card { padding: 20px 18px; }
  .eyebrow { font-size: 14px; }
  .eyebrow::after { width: 60px; }
  .section-title h2 { font-size: 18px; gap: 12px; }
  .section-title h2::before, .section-title h2::after { width: 28px; }
  .fund-head { grid-template-columns: 76px 1fr; gap: 16px; }
  .fund-icon { width: 76px; height: 76px; }
  .fund h3 { font-size: 21px; }
  .impact { grid-template-columns: repeat(2, 1fr); }
  .impact li::before { display: none; }
  .impact li:last-child { grid-column: 1 / -1; }
  .impact .ico { width: 92px; height: 92px; }
  .impact .ico svg { width: 58px; height: 58px; }
  .impact span { font-size: 17px; }
  .goals { grid-template-columns: 1fr; gap: 26px; }
  .goals li, .goals li:last-child { border: 0; border-top: 2px solid var(--gold); padding-top: 22px; }
  .goals-title::before, .goals-title::after { width: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar i { transition: none; }
}
