/* ============================================================
   Equitable Futures — main.css
   1 Fonts · 2 Tokens · 3 Base · 4 Header · 5 Nav · 6 Footer
   ============================================================ */

/* 1 ── Fonts (self-hosted variable fonts) */
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* 2 ── Tokens */
:root {
  --c-bg: #FAFAF9;
  --c-surface: #FFFFFF;
  --c-text: #1C1C1C;
  --c-text-2: #454745;
  --c-text-3: #6B6E6B;
  --c-border: #E6E6E5;
  --c-green: #276A17;
  --c-accent: #D64C13;
  --c-accent-dark: #C0420F;
  --coral: #fa5a4a;


  --f-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-head: 'Lora', Georgia, serif;

  --gutter: max(80px, calc((100vw - 1280px) / 2));
}
@media (max-width: 1280px) { :root { --gutter: 40px; } }
@media (max-width: 900px)  { :root { --gutter: 24px; } }

/* 3 ── Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--f-body);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

.onepage {
  display: flex;
  flex-direction: column;
  max-width: var(--page-max);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--c-bg);
}

.row-content {
  flex: 1 0 auto;
  padding: 48px var(--gutter);
  min-height: 600px;
}

:focus-visible { outline: 3px solid var(--c-text); outline-offset: 2px; }
.row-nav :focus-visible,
.row-footer :focus-visible { outline-color: #FFFFFF; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
  word-wrap: normal;
}
.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  width: auto;
  height: auto;
  margin: 0;
  padding: 12px 20px;
  overflow: visible;
  clip: auto;
  clip-path: none;
  background: #FFFFFF;
  color: var(--c-text);
  font-weight: 700;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 4 ── Header */
.row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  min-height: 110px;
  padding: 24px var(--gutter);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  color: inherit;
  text-decoration: none;
}

.logo-circle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 56px;
  height: 56px;
  background: var(--c-green);
  border-radius: 50%;
  flex-shrink: 0;
}
.logo-circle svg { width: 32px; height: 32px; }

.custom-logo { display: block; width: auto; height: 56px; flex-shrink: 0; }

.brand-text { display: flex; flex-direction: column; gap: 2px; }

.brand-name {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 26px;
  line-height: 33px;
  color: var(--c-text);
  white-space: nowrap;
}

.brand-desc { max-width: 480px; font-size: 14px; line-height: 1.4; color: var(--c-text-2); }

/* header action button */
.header-action { flex-shrink: 0; }
.nav-action { display: none; }

.btn-donate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 22px;
  background: var(--coral);
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  line-height: 19px;
  color: #FFFFFF;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-donate:hover { background: var(--c-accent-dark); }
.btn-donate svg { width: 1em; height: 1em; flex-shrink: 0; }

.header-aside { display: flex; align-items: center; gap: 24px; margin-left: auto; flex-shrink: 0; }

.header-social { display: flex; gap: 8px; list-style: none; }
.header-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  color: var(--c-text-2);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.header-social a:hover { background: #F2F7F0; border-color: var(--c-green); color: var(--c-green); }
.header-social svg { display: block; width: 20px; height: 20px; }

@media (max-width: 1280px) {
  .header-social a { width: 36px; height: 36px; }
  .header-social svg { width: 18px; height: 18px; }
}
@media (max-width: 900px) {
  .header-aside { gap: 16px; }
  .header-social { gap: 6px; }
  .header-social a { width: 32px; height: 32px; font-size: 12px; }
  .header-social svg { width: 16px; height: 16px; }
}

/* 5 ── Navigation */
.row-nav {
  position: relative;
  z-index: 100;
  background: var(--c-accent);
}

.nav-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
  padding: 0 var(--gutter);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin: 8px var(--gutter);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle:hover { background: rgba(255, 255, 255, 0.15); }

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: #FFFFFF;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-links {
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 60px;
  list-style: none;
}

.nav-links > li {
  position: relative;
  display: flex;
  align-items: stretch;
  transition: background 0.2s;
}

.nav-links a {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-weight: 700;
  font-size: 14px;
  line-height: 19px;
  color: #FFFFFF;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links > .current-menu-item,
.nav-links > .current-menu-ancestor { background: var(--c-accent-dark); }

.nav-links > li:not(.current-menu-item):not(.current-menu-ancestor):hover,
.nav-links > li:not(.current-menu-item):not(.current-menu-ancestor).is-open { background: rgba(255, 255, 255, 0.12); }

.nav-links > .menu-item-has-children > a { padding-right: 0; }

.submenu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  background: transparent;
  border: 0;
  color: #FFFFFF;
  cursor: pointer;
}
.submenu-toggle svg { transition: transform 0.2s; }
.is-open > .submenu-toggle svg { transform: rotate(180deg); }

.nav-links .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  min-width: 240px;
  padding: 4px 0;
  list-style: none;
  background: var(--c-accent-dark);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}
.nav-links .sub-menu a { padding: 12px 20px; white-space: normal; }
.nav-links .sub-menu a:hover { background: rgba(255, 255, 255, 0.12); }
.nav-links .sub-menu .current-menu-item > a { background: rgba(0, 0, 0, 0.15); }

@media (min-width: 901px) {
  .nav-links > li:hover > .sub-menu,
  .nav-links > li.is-open > .sub-menu,
  html:not(.js) .nav-links > li:focus-within > .sub-menu { display: block; }
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 213px;
  height: 30px;
  margin-left: auto;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.20);
  border-radius: 4px;
}
.nav-search:focus-within { outline: 2px solid #FFFFFF; outline-offset: 2px; }

.nav-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 18px;
  color: #FFFFFF;
}
.nav-search input::placeholder { color: rgba(255, 255, 255, 0.75); }
.nav-search input::-webkit-search-cancel-button { display: none; }

.nav-search-btn {
  order: -1;
  display: flex;
  align-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  color: #FFFFFF;
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  html:not(.js) .nav-toggle { display: none; }
  .js .nav-panel:not(.is-open) { display: none; }

  .nav-panel { flex-direction: column; align-items: stretch; padding: 0; }

  .nav-links { flex-direction: column; gap: 0; height: auto; border-top: 1px solid rgba(255, 255, 255, 0.2); }
  .nav-links > li { flex-wrap: wrap; }
  .nav-links > li > a { flex: 1; padding: 14px var(--gutter); white-space: normal; }
  .nav-links > li { border-bottom: 1px solid rgba(255, 255, 255, 0.15); }

  .submenu-toggle { width: 52px; border-left: 1px solid rgba(255, 255, 255, 0.15); }

  .nav-links .sub-menu {
    position: static;
    flex-basis: 100%;
    min-width: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--c-accent-dark);
  }
  .nav-links > li.is-open > .sub-menu { display: block; }
  .nav-links .sub-menu a { padding: 12px calc(var(--gutter) + 16px); }

  .nav-search { width: auto; height: 40px; margin: 8px var(--gutter) 16px; }
}

/* 6 ── Footer */
.row-footer {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px var(--gutter);
  background: var(--c-green);
  color: #FFFFFF;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.footer-brand { display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.footer-brand .brand-name { font-size: 28px; line-height: 36px; color: #FFFFFF; }
.footer-brand .brand-desc { font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, 0.80); }

.footer-content { gap: 40px; }
.footer-brand   { flex: 0 1 320px; }
.footer-links   { flex: 1 1 0; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 32px 40px; }
.footer-contact { flex: 0 1 280px; }

.footer-brand .brand-address { display: flex; gap: 10px; margin-top: 8px; font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, 0.80); }
.footer-brand .brand-address svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; }

/* Widgets in the footer (menus, raw HTML, text) */
.row-footer .widget { font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, 0.80); }
.row-footer .widget-title { margin-bottom: 14px; font-weight: 700; font-size: 13px; line-height: 18px; text-transform: uppercase; color: #FFFFFF; }
.row-footer .widget ul { list-style: none; }
.row-footer .widget li + li { margin-top: 10px; }
.row-footer .widget p + p { margin-top: 8px; }
.row-footer .widget a { color: rgba(255, 255, 255, 0.80); text-decoration: none; }
.row-footer .widget a:hover { color: #FFFFFF; text-decoration: underline; }

/* Contact lines: any link that starts with an icon */
.footer-contact .widget a:has(> svg) { display: flex; align-items: center; gap: 10px; width: fit-content; padding: 6px 0; }
.footer-contact .widget a > svg { flex-shrink: 0; width: 18px; height: 18px; }

/* Round social buttons (from the "social" menu) */
.footer-social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; list-style: none; }
.footer-social a {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 50%;
  font-weight: 700; font-size: 15px; color: #FFFFFF; text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.footer-social a:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.5); }
.footer-social svg { display: block; width: 20px; height: 20px; }

.footer-legal a { color: inherit; }
.footer-legal a:hover { text-decoration: underline; }

.footer-legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  line-height: 18px;
  color: rgba(255, 255, 255, 0.80);
}

@media (max-width: 900px) {
  .row-header { gap: 16px; padding-top: 20px; padding-bottom: 20px; }
  .brand-name { white-space: normal; }

  .footer-content { flex-direction: column; gap: 32px; }
  .footer-brand, .footer-links, .footer-contact { flex: none; width: 100%; }
  .footer-legal { flex-direction: column; align-items: flex-start; }
  .row-footer .contact-lines li + li { margin-top: 0; }
  .footer-contact .widget + .widget { margin-top: 8px; }
}

/* Sidebar: sticky while it sits at the right (above 900px) */
@media (min-width: 901px) {
  .content-sidebar {
    position: sticky;
    top: 24px;
    align-self: flex-start;
    max-height: calc(100vh - 48px);  /* taller than the window: scrolls inside itself, nothing gets cut off */
    overflow-y: auto;
  }
}

/* Back-to-top button */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--c-green);
  border: 0;
  border-radius: 50%;
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s, background 0.2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { background: #1E5412; }
.to-top:focus-visible { outline-color: var(--c-text); }

@media (max-width: 900px) {
  .to-top { right: 16px; bottom: 16px; }
}

/* Phones only: the donate button moves from the header into the navbar, next to the hamburger */
@media (max-width: 600px) {
  .header-aside { display: none; }

  .row-nav { display: flex; flex-wrap: wrap; align-items: center; }
  .nav-toggle { margin-right: 0; }
  .nav-action { display: block; margin-left: auto; margin-right: var(--gutter); }
  .nav-panel { flex: 0 0 100%; }

  /* white on the orange bar, otherwise it would disappear */
  .nav-action .btn-donate { height: 36px; padding: 0 16px; background: #FFFFFF; color: var(--coral); }
  .nav-action .btn-donate:hover { background: #F5F5F4; }
}
