/* ============================================================
   The BrightBrick Project — site styles
   Palette: official brand cyan + black outlines on white (from the logo).
   All colors checked against WCAG 2.1 AA contrast ratios.
   Fonts: Baloo 2 & Nunito, self-hosted (SIL Open Font License).
   ============================================================ */

/* ---------- Self-hosted fonts (no third-party requests) ---------- */

@font-face {
  font-family: "Baloo 2";
  src: url("../assets/fonts/Baloo2-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/Nunito-latin.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand palette taken from the official logo: bright cyan brick,
     black outlines, white background. Interactive elements use a deeper
     cyan so white text clears WCAG 2.1 AA (4.5:1). */
  --cyan: #23C1F0;         /* bright brand cyan — decorative / brick highlights */
  --cyan-mid: #45CDF2;     /* lighter cyan (brick top face) */
  --sky: #B8E7F8;          /* pale cyan (brick side, tints) */
  --cyan-deep: #0B6E92;    /* white text on this: 5.4:1 — passes AA */
  --cyan-deeper: #085B79;  /* button hover */
  --deep: #0C3B4C;         /* deep teal for dark bands (stats, footer) */
  --ink: #14181C;          /* near-black text/outlines, matches the logo */
  --muted: #556069;        /* on white: 6.2:1 — passes AA */
  --tint: #F1FAFD;         /* very light cyan section background */
  --navy: #14181C;         /* legacy alias → ink (kept so old rules still resolve) */

  /* Legacy aliases — old brick-scheme names remapped onto the cyan palette so
     every existing rule resolves. New code should use the names above. */
  --cream: #FFFFFF;
  --yellow: #23C1F0;
  --yellow-dark: #45CDF2;
  --red: #0B6E92;
  --red-dark: #085B79;
  --blue: #0B6E92;
  --green: #B8E7F8;

  --white: #FFFFFF;
  --line: #DCEBF2;         /* soft cyan-gray border */
  --radius: 14px;
  --shadow: 0 6px 24px rgba(12, 59, 76, 0.12);
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Baloo 2", "Nunito", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Anchored sections scroll clear of the sticky header */
[id] { scroll-margin-top: 5.5rem; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
}

img, svg { max-width: 100%; }

img { height: auto; }

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

/* ---------- Accessibility helpers ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  padding: 0.7rem 1.3rem;
  border-radius: 0 0 12px 0;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand img { width: 48px; height: auto; }

/* Wordmark lockup — matches the official badge type: "BRIGHTBRICK" over a
   letter-spaced "PROJECT". */
.brand-name {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  line-height: 1;
}

.brand-name .wm-1 {
  font-weight: 800;
  font-size: 1.16rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
}

.brand-name .wm-2 {
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--cyan-deep);
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--navy);
  font-weight: 700;
  padding: 0.35rem 0.15rem;
  border-bottom: 3px solid transparent;
}

.nav-links a:hover { border-bottom-color: var(--yellow); }

.nav-links a[aria-current="page"] { border-bottom-color: var(--red); }

/* The Donate pill keeps white-on-red even though .nav-links a sets navy */
.nav-links a.btn-primary {
  color: var(--white);
  border-bottom: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--navy);
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  font-size: 1.15rem;
  color: var(--navy);
  cursor: pointer;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
  text-align: center;
  padding: 0.72rem 1.5rem;
  border-radius: 999px;
  border: 2.5px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:hover { background: var(--red-dark); }

.btn-secondary {
  background: var(--yellow);
  color: var(--navy);
}

.btn-secondary:hover { background: var(--yellow-dark); }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
}

.btn-lg { font-size: 1.12rem; padding: 0.85rem 1.9rem; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0 5rem;
  background:
    radial-gradient(circle at 12% 20%, rgba(35, 193, 240, 0.16) 0 220px, transparent 221px),
    radial-gradient(circle at 88% 75%, rgba(11, 110, 146, 0.10) 0 260px, transparent 261px),
    var(--white);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 3rem;
}

.eyebrow {
  display: inline-block;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan-deep);
  background: rgba(35, 193, 240, 0.14);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1rem;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.12;
  color: var(--navy);
  margin: 0 0 1rem;
}

h1 .highlight { color: var(--red); }

.lede {
  font-size: 1.18rem;
  color: var(--muted);
  max-width: 34rem;
  margin: 0 0 1.8rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.hero-art {
  display: flex;
  justify-content: center;
}

.hero-art svg { width: min(340px, 80%); height: auto; }

.hero-badge {
  width: min(360px, 84%);
  height: auto;
  filter: drop-shadow(0 12px 28px rgba(12, 59, 76, 0.14));
}

/* ---------- Sections ---------- */

section { padding: 4rem 0; }

.section-tight { padding: 3rem 0; }

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  color: var(--navy);
  margin: 0 0 0.6rem;
}

.section-intro {
  color: var(--muted);
  max-width: 44rem;
  margin: 0 0 2.2rem;
}

.center { text-align: center; }

.center .section-intro { margin-inline: auto; }

/* Readable prose column (left-aligned) for statements like Our Vision */
.prose { max-width: 46rem; margin-inline: auto; }
.prose p { margin: 0 0 1.1rem; font-size: 1.08rem; color: var(--ink); }
.prose p:last-child { margin-bottom: 0; }

/* brick-stud divider */
.studs {
  height: 14px;
  background-image: radial-gradient(circle at 10px 14px, var(--yellow) 7px, transparent 8px);
  background-size: 34px 14px;
  background-repeat: repeat-x;
  background-position: center bottom;
  width: min(240px, 60%);
  margin: 0 auto 2rem;
}

/* ---------- Logo badge (full circular logo, interior pages) ---------- */

.logo-badge {
  display: block;
  width: 180px;
  height: auto;
  margin: 0 auto 1.4rem;
}

/* ---------- Photos ---------- */

figure.photo {
  margin: 0;
}

figure.photo img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

figure.photo.banner img {
  max-height: 420px;
  object-fit: cover;
  object-position: center;
}

figure.photo figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
  margin-top: 0.45rem;
}

figure.photo figcaption a {
  color: var(--muted);
  text-decoration: underline;
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
  box-shadow: var(--shadow);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--navy);
  margin: 0.8rem 0 0.5rem;
}

.card p { margin: 0; color: var(--muted); }

.card .step-num {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--white);
}

.step-1 .step-num { background: var(--cyan-deep); }
.step-2 .step-num { background: #0E5C7A; }
.step-3 .step-num { background: var(--deep); }

.card-icon { font-size: 2rem; line-height: 1; }

/* ---------- Impact stats band ---------- */

.stats-band {
  background: var(--deep);
  color: var(--white);
  padding: 3.2rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--cyan); /* bright cyan on deep teal ≈ 6:1 — passes AA */
  line-height: 1.1;
}

.stat-label { font-weight: 700; }

/* ---------- Story / split sections ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.split .photo-frame {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(
    45deg,
    rgba(35, 193, 240, 0.14),
    rgba(35, 193, 240, 0.14) 14px,
    rgba(11, 110, 146, 0.08) 14px,
    rgba(11, 110, 146, 0.08) 28px
  );
  border-radius: 10px;
  min-height: 300px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  padding: 1rem;
}

/* ---------- Callout (highlighted opportunity, e.g. Teen Impact Board) ---------- */

.callout {
  background: linear-gradient(120deg, rgba(35, 193, 240, 0.12), rgba(69, 205, 242, 0.10));
  border: 1px solid var(--line);
  border-left: 6px solid var(--cyan);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 2.2rem;
}

.callout-body { max-width: 46rem; }

.callout h2 { margin-top: 0.2rem; }

.callout .btn { margin-top: 0.6rem; }

.callout-deadline {
  color: var(--ink);
  font-size: 1.05rem;
}

/* ---------- CTA band ---------- */

.cta-band {
  background: linear-gradient(120deg, var(--cyan) 0%, var(--cyan-mid) 100%);
  padding: 3.6rem 0;
}

.cta-band h2 { margin-bottom: 0.4rem; color: var(--ink); }

.cta-band p { color: var(--ink); font-weight: 600; margin: 0 0 1.6rem; }

/* ---------- Donate page ---------- */

.give-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  align-items: stretch;
}

.give-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.give-card .btn { margin-top: auto; align-self: flex-start; }

/* Group of action buttons pinned to the bottom of a give-card */
.give-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-start;
}

.give-actions .btn { margin-top: 0; }

/* Placeholder button that isn't a live link yet (e.g. "coming soon") */
.btn.is-disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.give-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.4rem 0 1rem;
}

.amount {
  font-family: var(--font-display);
  font-weight: 700;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  padding: 0.45rem 0.95rem;
  color: var(--navy);
}

.amount.featured {
  border-color: var(--cyan-deep);
  background: rgba(35, 193, 240, 0.10);
}

.fine-print { font-size: 0.9rem; color: var(--muted); }

/* ---------- Impact page ---------- */

.story-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
}

.story-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 6px solid var(--cyan);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.6rem 1.4rem;
}

.story-card:nth-child(2) { border-left-color: var(--cyan-deep); }
.story-card:nth-child(3) { border-left-color: var(--deep); }
.story-card:nth-child(4) { border-left-color: var(--sky); }

.story-card blockquote {
  margin: 0 0 0.8rem;
  font-size: 1.08rem;
  color: var(--ink);
}

.story-card cite {
  font-style: normal;
  font-weight: 700;
  color: var(--muted);
}

/* ---------- Press ("As featured in") ---------- */

.press-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
}

.press-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.6rem 1.4rem;
}

.press-outlet {
  display: inline-block;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan-deep);
  background: rgba(35, 193, 240, 0.12);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  margin-bottom: 0.7rem;
}

.press-card h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  color: var(--navy);
  margin: 0 0 0.6rem;
}

.press-card blockquote {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
  font-style: italic;
  color: var(--ink);
}

.press-card p:not(.press-date) {
  color: var(--muted);
  margin: 0 0 0.4rem;
}

.press-date {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.press-card .btn { font-size: 0.92rem; padding: 0.5rem 1.1rem; }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 3px solid var(--yellow);
}

.timeline li {
  position: relative;
  padding: 0 0 1.6rem 1.6rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 0.45rem;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: var(--red);
  border: 3px solid var(--cream);
}

.timeline .when {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--blue);
  display: block;
}

/* ---------- Contact page ---------- */

.contact-methods {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 6px solid var(--cyan);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.6rem;
}

.contact-icon { font-size: 1.9rem; line-height: 1; }

.contact-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--navy);
  margin: 0 0 0.2rem;
}

.contact-card a {
  color: var(--cyan-deep);
  font-weight: 700;
  text-decoration: none;
  word-break: break-word;
}

.contact-card a:hover,
.contact-card a:focus-visible { text-decoration: underline; }

/* ---------- Values ---------- */

.value-emoji { font-size: 2.1rem; line-height: 1; }

/* ---------- Legal pages (privacy policy) ---------- */

.legal-content {
  max-width: 46rem;
}

.legal-content h2 {
  font-size: 1.45rem;
  margin-top: 2.4rem;
}

.legal-content ul { color: var(--ink); }

.legal-updated {
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
}

/* ---------- Cookie notice (disabled by default; see js/main.js) ---------- */

.cookie-notice {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  width: min(560px, 94%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 32px rgba(31, 42, 68, 0.22);
  padding: 1rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.cookie-notice p {
  margin: 0;
  flex: 1 1 18rem;
  font-size: 0.95rem;
}

.cookie-notice .btn {
  font-size: 0.92rem;
  padding: 0.5rem 1.1rem;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--deep);
  color: rgba(255, 255, 255, 0.9);
  padding: 3rem 0 2rem;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.site-footer .brand-name .wm-1 { color: var(--white); }

.site-footer .brand-name .wm-2 { color: var(--cyan); }

.site-footer h4 {
  font-family: var(--font-display);
  color: var(--yellow);
  margin: 0 0 0.7rem;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }

.site-footer li { margin-bottom: 0.45rem; }

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--yellow);
  text-decoration: underline;
}

.footer-tagline { margin-top: 0.6rem; font-size: 0.95rem; max-width: 26rem; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}

.footer-bottom p { margin: 0.3rem 0; }

/* ---------- Page hero (interior pages) ---------- */

.page-hero {
  background:
    radial-gradient(circle at 85% 30%, rgba(35, 193, 240, 0.16) 0 180px, transparent 181px),
    var(--tint);
  padding: 3.4rem 0 2.6rem;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }

.page-hero .lede { margin-bottom: 0; }

/* ---------- Reveal animation ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js .reveal.visible {
  opacity: 1;
  transform: none;
}

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

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .hero-inner, .split { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art svg { width: min(240px, 60%); }
  .hero-badge { width: min(230px, 62%); }
  .card-grid, .give-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .story-grid { grid-template-columns: 1fr; }
  .press-grid { grid-template-columns: 1fr; }
  .contact-methods { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    padding: 0.6rem 4%;
  }

  .nav-links.open { display: flex; }

  .nav-links li { width: 100%; }

  .nav-links a {
    display: block;
    padding: 0.8rem 0.2rem;
    border-bottom: 1px solid var(--line);
  }

  .nav-links a[aria-current="page"] { border-bottom-color: var(--red); }

  .nav-links .btn {
    margin: 0.8rem 0;
    border-bottom: none;
    width: auto;
  }
}
