/* Shared components: nav, mobile menu, footer.
   Used by every prototype page. Values come from tokens.css. */
/* ─── Navigation ────────────────────────────────────────────────── */
    .nav {
      position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
      height: var(--nav-h);
      background: var(--nav-bg);
      border-bottom: 1px solid rgba(var(--gold-rgb),.15);
      transition: box-shadow .3s;
    }
    .nav.scrolled {
      box-shadow: 0 2px 20px rgba(var(--black-rgb),.35);
    }
    .nav__inner {
      display: flex; align-items: center; height: 100%;
      max-width: var(--max-w); margin: 0 auto; padding: 0 32px;
      gap: 0;
    }

    /* Logo */
    .nav__logo {
      display: flex; align-items: center;
      flex-shrink: 0; margin-right: 40px;
    }
    .nav__logo-img {
      height: 48px; width: auto;
    }
    .footer__logo-img {
      height: 48px; width: auto; margin-bottom: 12px;
    }

    /* Main links */
    .nav__links {
      display: flex; align-items: center; gap: 2px; flex: 1;
      list-style: none; margin: 0; padding: 0;
    }
    .nav__item { position: relative; list-style: none; }
    .nav__link {
      display: flex; align-items: center; gap: 5px;
      padding: 8px 16px; border-radius: var(--r-sm);
      font-family: var(--font-display); font-weight: 500; font-size: 14px;
      color: rgba(var(--cream-rgb),.85); letter-spacing: .02em;
      transition: color .2s, background .2s;
    }
    .nav__link:hover, .nav__item:hover .nav__link {
      color: var(--gold-300); background: rgba(var(--gold-rgb),.08);
    }
    .nav__chevron {
      width: 12px; height: 12px; stroke: currentColor; fill: none;
      stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
      transition: transform .2s;
    }
    .nav__item:hover .nav__chevron { transform: rotate(180deg); }

    /* Dropdown */
    .nav__dropdown {
      position: absolute; top: 100%; left: 0;
      background: var(--espresso-800);
      border: 1px solid rgba(var(--gold-rgb),.15);
      border-radius: var(--r-md); min-width: 220px;
      box-shadow: var(--shadow-lg);
      padding: 16px 0 8px; opacity: 0; pointer-events: none;
      transform: translateY(-6px);
      transition: opacity .18s, transform .18s;
    }
    .nav__item:hover .nav__dropdown,
    .nav__item:focus-within .nav__dropdown {
      opacity: 1; pointer-events: auto; transform: translateY(0);
    }
    .nav__dropdown a {
      display: block; padding: 9px 20px;
      font-family: var(--font-display); font-size: 13.5px; font-weight: 400;
      color: rgba(var(--cream-rgb),.8);
      transition: color .15s, background .15s;
    }
    .nav__dropdown a:hover { color: var(--gold-300); background: rgba(var(--gold-rgb),.07); }
    .nav__dropdown-divider {
      height: 1px; background: rgba(var(--gold-rgb),.1); margin: 6px 0;
    }
    /* Two-column mega dropdown (Projects) */
    .nav__dropdown--mega { display: flex; gap: 4px; min-width: 520px; padding: 16px 4px 12px; }
    .nav__dropdown--mega .nav__col { flex: 1; min-width: 244px; }
    .nav__dropdown--mega .nav__col + .nav__col { border-left: 1px solid rgba(var(--gold-rgb),.1); }
    .nav__col-head {
      font-family: var(--font-display); font-weight: 700; font-size: 11px;
      letter-spacing: .12em; text-transform: uppercase; color: var(--gold-400);
      padding: 2px 20px 10px;
    }

    /* Right side */
    .nav__right {
      display: flex; align-items: center; gap: 12px; margin-left: auto;
    }
    .nav__search {
      display: none; align-items: center; justify-content: center;
      width: 36px; height: 36px; border-radius: 50%;
      color: rgba(var(--cream-rgb),.6); transition: color .2s, background .2s;
    }
    .nav__search:hover { color: var(--gold-300); background: rgba(var(--gold-rgb),.08); }
    .nav__search svg { width: 18px; height: 18px; }
    .nav__donate {
      background: var(--gold-400); color: var(--espresso-900);
      font-family: var(--font-display); font-weight: 700; font-size: 12px;
      letter-spacing: .1em; text-transform: uppercase;
      padding: 9px 20px; border-radius: var(--r-sm);
      transition: background .2s;
    }
    .nav__donate:hover { background: var(--gold-300); }

    /* Mobile hamburger */
    .nav__hamburger {
      display: none; flex-direction: column; gap: 5px;
      padding: 8px; margin-left: auto; color: var(--cream-100);
    }
    .nav__hamburger span {
      display: block; width: 24px; height: 2px;
      background: currentColor; border-radius: 2px;
      transition: transform .25s, opacity .25s;
    }
    .nav__hamburger.open span { border-radius: 0; }
    .nav__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav__hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .nav__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* Mobile menu */
    .nav__mobile {
      display: none; position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
      background: var(--espresso-900); border-top: 1px solid rgba(var(--gold-rgb),.15);
      z-index: 999; overflow: hidden;
    }
    .nav__mobile.open { display: flex; }
    .mob-panels {
      display: flex; width: 200%; height: 100%; flex-shrink: 0;
      transition: transform .28s cubic-bezier(.4,0,.2,1);
    }
    .mob-panels.show-sub { transform: translateX(-50%); }
    .mob-panel {
      width: 50%; height: 100%; overflow-y: auto; padding-bottom: 40px;
    }
    .mob-top-item {
      display: flex; align-items: center; justify-content: space-between;
      width: 100%; padding: 18px 24px;
      font-family: var(--font-display); font-size: 22px; font-weight: 600;
      color: var(--cream-100); background: none; border: none; cursor: pointer;
      text-align: left;
    }
    .mob-top-item:active { background: rgba(var(--white-rgb),.05); }
    .mob-top-item svg { width: 18px; height: 18px; stroke: var(--gold-400); stroke-width: 2; fill: none; flex-shrink: 0; }
    .mob-back {
      display: flex; align-items: center; gap: 8px;
      width: 100%; padding: 22px 24px;
      background: none; border: none;
      cursor: pointer; font-family: var(--font-display); font-size: 14px; font-weight: 700;
      letter-spacing: .1em; text-transform: uppercase; color: var(--gold-400); margin-bottom: 4px;
    }
    .mob-back svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }
    .mob-panel-title {
      font-family: var(--font-display); font-size: 26px; font-weight: 700;
      color: var(--cream-100); padding: 8px 24px 16px;
    }
    .mob-sub-link {
      display: block; padding: 14px 24px;
      font-family: var(--font-display); font-size: 19px; color: rgba(var(--cream-rgb),.8);
    }
    .mob-sub-link:active { background: rgba(var(--white-rgb),.05); color: var(--gold-300); }
    .mob-sub-divider { height: 1px; background: rgba(var(--gold-rgb),.12); margin: 8px 24px; }
    .mob-sub-heading {
      font-family: var(--font-display); font-weight: 700; font-size: 11px;
      letter-spacing: .12em; text-transform: uppercase; color: var(--gold-400);
      padding: 20px 24px 6px;
    }
    .mob-donate {
      display: block; margin: 24px 24px 0; text-align: center;
      background: var(--gold-400); color: var(--espresso-900);
      font-family: var(--font-display); font-weight: 700; font-size: 14px;
      letter-spacing: .08em; text-transform: uppercase;
      padding: 14px; border-radius: var(--r-sm);
    }
    /* Trust badges in the open mobile menu, below Donate */
    .mob-badges {
      display: flex; justify-content: center; align-items: center; flex-wrap: wrap;
      gap: 16px; margin: 34px 24px 0;
    }
    .mob-badges a { display: inline-flex; }
    .mob-badges img { height: 44px; width: auto; display: block; }
    .mob-search {
      display: none; align-items: center; gap: 10px;
      margin: 16px 24px 0;
      background: rgba(var(--cream-rgb),.08); border: 1px solid rgba(var(--gold-rgb),.2);
      border-radius: var(--r-sm); padding: 12px 16px;
    }
    .mob-search svg { width: 18px; height: 18px; flex-shrink: 0; color: rgba(var(--gold-rgb),.6); }
    .mob-search__input {
      background: none; border: none; outline: none; width: 100%;
      font-family: var(--font-display); font-size: 16px; color: var(--cream-100);
    }
    .mob-search__input::placeholder { color: rgba(var(--cream-rgb),.4); }

    /* Trust badges in the header, beside Donate */
    .nav__badges { display: flex; align-items: center; gap: 8px; margin-right: 4px; }
    .nav__badges a { display: inline-flex; transition: opacity .2s ease; }
    .nav__badges a:hover { opacity: .8; }
    .nav__badges img { height: 30px; width: auto; display: block; }
    [data-theme="2"] .footer { background: var(--nav-bg); }

    /* ─── Footer ─────────────────────────────────────────────────────── */
    .footer {
      background: var(--espresso-900);
      border-top: 1px solid rgba(var(--gold-rgb),.12);
      padding: 64px 0 40px;
    }
    .footer__top {
      display: flex; flex-direction: column; gap: 40px;
      margin-bottom: 40px;
    }
    .footer__brand-row {
      display: grid; grid-template-columns: 280px 1fr; gap: 64px;
    }
    .footer__brand-name {
      font-family: var(--font-display); font-weight: 700; font-size: 18px;
      color: var(--cream-100); margin-bottom: 4px; margin-top: 12px;
    }
    .footer__brand-tagline {
      font-family: var(--font-body); font-size: 14px;
      color: rgba(var(--cream-rgb),.45); line-height: 1.5; margin-bottom: 20px;
    }
    .footer__social { display: flex; gap: 12px; }
    .footer__social-link {
      width: 36px; height: 36px; border-radius: 50%;
      border: 1px solid rgba(var(--gold-rgb),.2);
      display: flex; align-items: center; justify-content: center;
      color: rgba(var(--cream-rgb),.5);
      transition: border-color .2s, color .2s;
    }
    .footer__social-link:hover { border-color: var(--gold-400); color: var(--gold-400); }
    .footer__social-link svg { width: 16px; height: 16px; }

    .footer__links {
      display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
    }
    .footer__col-head {
      font-family: var(--font-display); font-weight: 700; font-size: 11px;
      letter-spacing: .14em; text-transform: uppercase; color: var(--gold-400);
      margin-bottom: 16px;
    }
    .footer__link {
      display: block; padding: 4px 0;
      font-family: var(--font-display); font-size: 13.5px;
      color: rgba(var(--cream-rgb),.55);
      transition: color .15s;
    }
    .footer__link:hover { color: var(--gold-300); }


    /* ─── Theme Picker ───────────────────────────────────────────────── */
    .nav__logo-wrap { position: relative; }
    .theme-picker {
      position: absolute; top: calc(100% + 10px); left: 0;
      background: var(--espresso-800); border: 1px solid rgba(var(--gold-rgb),.2);
      border-radius: var(--r-md); padding: 8px;
      box-shadow: 0 8px 24px rgba(var(--black-rgb),.4);
      display: flex; flex-direction: column; gap: 4px;
      opacity: 0; pointer-events: none; transform: translateY(-6px);
      transition: opacity .18s, transform .18s; z-index: 200;
      min-width: 140px;
    }
    .theme-picker.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
    .theme-option {
      display: flex; align-items: center; gap: 10px;
      padding: 8px 10px; border-radius: var(--r-sm);
      font-family: var(--font-display); font-size: 12px; font-weight: 600;
      letter-spacing: .06em; color: var(--cream-100);
      cursor: pointer; transition: background .15s; text-align: left;
    }
    .theme-option:hover { background: rgba(var(--cream-rgb),.08); }
    .theme-option.active { background: rgba(var(--gold-rgb),.12); color: var(--gold-300); }
    .theme-swatch {
      width: 18px; height: 18px; border-radius: 50%;
      border: 1.5px solid rgba(var(--cream-rgb),.25); flex-shrink: 0;
    }

    .footer__bottom {
      display: flex; align-items: center; justify-content: space-between;
      padding-top: 24px; border-top: 1px solid rgba(var(--gold-rgb),.1);
      gap: 16px; flex-wrap: wrap;
    }
    .footer__copy {
      font-family: var(--font-display); font-size: 12px;
      color: rgba(var(--cream-rgb),.3);
    }
    .footer__legal { display: flex; gap: 20px; }
    .footer__legal-link {
      font-family: var(--font-display); font-size: 12px;
      color: rgba(var(--cream-rgb),.3); transition: color .15s;
    }
    .footer__legal-link:hover { color: rgba(var(--cream-rgb),.7); }

    @media (max-width: 768px) {
      .nav__links, .nav__right { display: none; }
      .nav__hamburger { display: flex; }
      .footer__links  { grid-template-columns: repeat(2, 1fr); }
}

    /* ─── Donate modal (<site-donate>) ───────────────────────────────── */
    .modal-overlay {
      position: fixed; inset: 0; z-index: 2000;
      background: rgba(var(--ink-rgb),.75); backdrop-filter: blur(4px);
      display: flex; align-items: center; justify-content: center;
      padding: 24px; opacity: 0; pointer-events: none;
      transition: opacity .25s;
    }
    .modal-overlay.open { opacity: 1; pointer-events: auto; }
    .modal {
      background: var(--cream-100); border-radius: var(--r-lg);
      width: 100%; max-width: 500px; overflow: hidden;
      box-shadow: 0 24px 80px rgba(var(--black-rgb),.4);
      transform: translateY(16px);
      transition: transform .25s;
    }
    .modal-overlay.open .modal { transform: translateY(0); }
    .modal__header {
      background: var(--espresso-900); padding: 28px 32px;
      display: flex; align-items: center; justify-content: space-between;
    }
    .modal__header-title {
      font-family: var(--font-display); font-weight: 700; font-size: 20px;
      color: var(--cream-100);
    }
    .modal__close {
      width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
      border-radius: 50%; color: rgba(var(--cream-rgb),.6);
      transition: color .2s, background .2s;
    }
    .modal__close:hover { color: var(--cream-100); background: rgba(var(--white-rgb),.1); }
    .modal__close svg { width: 18px; height: 18px; }
    .modal__body { padding: 32px; }
    .modal__subtitle {
      font-size: 15px; line-height: 1.65; color: var(--brown-800); margin-bottom: 24px;
    }
    .donate-freq {
      display: flex; background: var(--cream-300); border-radius: 8px;
      padding: 4px; margin-bottom: 24px; gap: 4px;
    }
    .donate-amounts {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px;
    }
    .donate-amount {
      padding: 12px 8px; border-radius: var(--r-sm); text-align: center;
      font-family: var(--font-display); font-weight: 700; font-size: 17px;
      color: var(--espresso-900);
      border: 2px solid rgba(var(--brown-rgb),.2);
      background: var(--white); transition: border-color .2s, background .2s;
    }
    .donate-amount:hover { border-color: var(--brown-700); }
    .donate-amount.selected { border-color: var(--brown-700); background: var(--gold-100); }
    .donate-amount small {
      display: block; font-family: var(--font-body); font-size: 11px;
      font-weight: 400; color: var(--brown-400); margin-top: 2px;
    }
    .donate-custom {
      display: flex; align-items: center; gap: 8px;
      margin-bottom: 24px;
    }
    .donate-impact {
      background: var(--gold-100); border-radius: var(--r-sm);
      padding: 14px 16px; margin-bottom: 24px;
      font-family: var(--font-body); font-size: 14px; color: var(--brown-800);
      line-height: 1.5; font-style: italic;
      border-left: 3px solid var(--gold-400);
    }
    .donate-submit {
      width: 100%; padding: 16px;
      background: var(--brown-700); color: var(--cream-100);
      font-family: var(--font-display); font-weight: 700; font-size: 14px;
      letter-spacing: .1em; text-transform: uppercase;
      border-radius: var(--r-sm); transition: background .2s;
    }
    .donate-submit:hover { background: var(--brown-600); }
    .donate-note {
      text-align: center; margin-top: 12px;
      font-family: var(--font-display); font-size: 11px; color: var(--brown-400);
    }
    .donate-freq__btn {
      flex: 1; padding: 8px; border-radius: 6px;
      font-family: var(--font-display); font-weight: 600; font-size: 13px;
      color: var(--brown-400); transition: background .2s, color .2s;
    }
    .donate-freq__btn.active {
      background: var(--brown-700); color: var(--cream-100);
    }
    .donate-custom__label {
      font-family: var(--font-display); font-weight: 600; font-size: 20px;
      color: var(--espresso-900);
    }
    .donate-custom__input {
      flex: 1; padding: 10px 12px;
      font-family: var(--font-display); font-weight: 600; font-size: 18px;
      color: var(--espresso-900); background: var(--white);
      border: 1.5px solid rgba(var(--brown-rgb),.25); border-radius: var(--r-sm);
      outline: none;
    }
    .donate-custom__input:focus { border-color: var(--brown-700); }
    .donate-custom__placeholder { color: var(--brown-300); font-weight: 400; }

    /* The prototype's theme switch. It used to hang off the logo, which
       meant the logo did not go home. */
    .theme-trigger {
      display: inline-grid; place-items: center;
      width: 22px; height: 22px; margin-left: 10px; flex: none;
      background: transparent; border: 0; cursor: pointer; border-radius: 50%;
      opacity: .45; transition: opacity .2s;
    }
    .theme-trigger:hover, .theme-trigger[aria-expanded="true"] { opacity: 1; }
    .theme-trigger__dot {
      width: 11px; height: 11px; border-radius: 50%;
      background: linear-gradient(135deg, var(--theme-1-swatch) 50%, var(--theme-2-swatch) 50%);
      box-shadow: 0 0 0 1.5px rgba(var(--cream-rgb), .55);
    }

    /* ─── Newsletter (in <site-footer>) ──────────────────────────────── */
    .newsletter {
      padding: 80px 0;
      background: var(--gold-100);
      border-top: 1px solid rgba(var(--gold-rgb),.3);
    }
    .newsletter__inner {
      display: flex; align-items: center; justify-content: space-between;
      gap: 48px;
    }
    .newsletter__text { flex: 1; max-width: 480px; }
    .newsletter__text .section-title { font-size: clamp(22px, 2.5vw, 32px); }
    .newsletter__text .section-body { font-size: 15px; margin-top: 10px; }
    .newsletter__form { flex: 1; max-width: 440px; }
    .newsletter__row {
      display: flex; gap: 10px;
    }
    .newsletter__input {
      flex: 1; padding: 14px 18px;
      font-family: var(--font-body); font-size: 15px;
      background: var(--white); color: var(--espresso-900);
      border: 1.5px solid rgba(var(--brown-rgb),.25);
      border-radius: var(--r-sm); outline: none;
      transition: border-color .2s;
    }
    .newsletter__input::placeholder { color: var(--brown-300); }
    .newsletter__input:focus { border-color: var(--brown-700); }
    .newsletter__note {
      font-family: var(--font-display); font-size: 11px;
      color: var(--brown-400); margin-top: 10px; line-height: 1.5;
    }
    .newsletter__preview-link {
      color: var(--brown-700); text-decoration: none; white-space: nowrap;
    }
    .newsletter__preview-link:hover { text-decoration: underline; }

    @media (max-width: 768px) {
      .newsletter__inner { flex-direction: column; }
      .newsletter__form { width: 100%; max-width: 100%; }
      .newsletter__row { flex-direction: column; }
    }
