/* Shared chrome for every page: header, primary nav, hamburger, footer.
   Loaded after each page's <style> and after fosters-v2.css.
   Selectors are prefixed so leftover per-page nav/footer rules cannot win. */

:root {
  --brown: #3B2010;
  --rust: #8B3A1A;
  --amber: #C8711A;
  /* Small text and cream-on-amber fills need deeper shades of the same amber. */
  --amber-ink: #8A4E12;
  --amber-fill: #A45C15;
  --gold: #D4A853;
  --cream: #FAF6F0;
  --warm: #F2E9DC;
  --warmer: #EAD9C4;
  --heart: #A63222;
  /* Heart red on the brown footer and giveback band. */
  --heart-on-dark: #E07062;
  --text: #2C1A0E;
  --muted: #785A43;
  --border: #DDC9B0;
  --white: #ffffff;
  --green: #2C764D;
  --yellow: #C8930A;
  --red: #A63222;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 76px;
  padding: 0 4%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--brown);
  box-shadow: 0 2px 16px rgba(59, 32, 16, 0.35);
}

.site-header .nav-logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  line-height: 0;
  text-decoration: none;
}

.site-header .nav-logo-img {
  height: 58px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

/* Reset any leftover page rule that still styles every <nav>. */
.site-header .site-nav {
  position: static;
  top: auto;
  z-index: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
}

.site-header .nav-links {
  display: flex;
  align-items: center;
  gap: 1.05rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header .nav-links a {
  color: rgba(250, 246, 240, 0.75);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 400;
  white-space: nowrap;
  transition: color 0.2s;
}

.site-header .nav-links a:hover,
.site-header .nav-links a[aria-current="page"] {
  color: var(--gold);
}

.site-header .mobile-cta {
  display: none;
}

.site-header .nav-call {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.86rem;
  line-height: 1;
  white-space: nowrap;
  border: 1.5px solid rgba(212, 168, 83, 0.55);
  border-radius: 50px;
  padding: 0.42rem 0.85rem;
}

.site-header .nav-call:hover {
  background: rgba(212, 168, 83, 0.14);
  color: var(--cream);
}

.site-header .nav-cta {
  flex: 0 0 auto;
  background: var(--amber-fill);
  color: var(--cream);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.4px;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(200, 113, 26, 0.3);
  transition: background 0.2s, color 0.2s;
}

.site-header .nav-cta:hover {
  background: var(--gold);
  color: var(--brown);
}

.site-header .nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 200;
}

.site-header .nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--cream);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.site-header .nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header .nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.site-header .nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-header .nav-hamburger:focus-visible,
.site-header .nav-call:focus-visible,
.site-header .nav-cta:focus-visible,
.site-header .nav-links a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

body.nav-open {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .site-header .nav-cta {
    display: none;
  }

  .site-header .nav-call {
    margin-left: auto;
  }

  .site-header .nav-hamburger {
    display: flex;
  }

  .site-header .site-nav {
    display: block;
    flex: 0 0 auto;
  }

  .site-header .nav-links {
    display: none;
    flex-direction: column;
    justify-content: safe center;
    align-items: center;
    gap: 1.45rem;
    position: fixed;
    top: 76px;
    right: 0;
    bottom: 0;
    left: 0;
    margin: 0;
    background: var(--brown);
    z-index: 150;
    overflow-y: auto;
  }

  .site-header .nav-links.open {
    display: flex;
  }

  .site-header .nav-links a {
    color: var(--cream);
    font-size: 1.3rem;
  }

  .site-header .nav-links a:hover,
  .site-header .nav-links a[aria-current="page"] {
    color: var(--gold);
  }

  .site-header .mobile-cta {
    display: list-item;
  }

  .site-header .nav-links li.mobile-cta a {
    background: var(--amber-fill);
    color: var(--cream);
    padding: 0.7rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.05rem;
  }

  .site-header .nav-links li.mobile-cta a:hover {
    background: var(--gold);
    color: var(--brown);
  }
}

@media (max-width: 420px) {
  .site-header {
    padding: 0 3.5%;
    gap: 0.45rem;
  }

  .site-header .nav-logo-img {
    height: 46px;
  }

  .site-header .nav-call {
    font-size: 0.78rem;
    padding: 0.38rem 0.65rem;
  }
}

.site-footer {
  background: var(--brown);
  border-top: 4px solid var(--amber);
  color: rgba(250, 246, 240, 0.55);
  position: relative;
  z-index: 1;
}

.site-footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 6%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 2rem;
}

.site-footer .footer-logo-img {
  height: 48px;
  width: auto;
  display: block;
  margin-bottom: 0.4rem;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.site-footer .footer-logo-tag {
  font-size: 0.72rem;
  color: rgba(250, 246, 240, 0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

.site-footer .footer-hint {
  font-size: 0.82rem;
  color: var(--heart-on-dark);
  font-style: italic;
  margin-top: 0.3rem;
}

.site-footer .footer-mid {
  font-size: 0.88rem;
  color: rgba(250, 246, 240, 0.55);
  line-height: 1.7;
  font-style: italic;
  text-align: center;
}

.site-footer .footer-mid strong {
  color: rgba(250, 246, 240, 0.85);
  font-style: normal;
}

.site-footer .footer-mid a {
  color: var(--gold);
  text-decoration: none;
}

.site-footer .footer-copy {
  font-size: 0.78rem;
  color: rgba(250, 246, 240, 0.52);
  text-align: right;
  line-height: 1.6;
}

.site-footer .footer-links {
  display: inline;
}

.site-footer .footer-links a {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.8rem;
}

.site-footer .footer-links a:hover,
.site-footer .footer-mid a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .site-footer .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .site-footer .footer-mid,
  .site-footer .footer-copy {
    text-align: center;
  }
}

/* Picture wrappers keep the same box the img had on its own. */
.site-header .nav-logo picture,
.site-footer picture,
.featured-img-icon picture,
.card-img picture {
  display: block;
  line-height: 0;
}

.avatar-circle picture {
  display: block;
  width: 100%;
  height: 100%;
}

/* WCAG 2.1 AA. Brand hues stay; only text and fills that failed contrast move. */

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.6rem;
  z-index: 300;
  padding: 0.55rem 0.9rem;
  background: var(--gold);
  color: var(--brown);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
  text-decoration: none;
  border-radius: 8px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.skip-link:focus {
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  overflow: visible;
}

#main {
  scroll-margin-top: 76px;
}

#main:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--brown);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: var(--amber-ink);
  box-shadow: 0 0 0 4px var(--brown);
}

.search-box:focus-within {
  border-color: var(--amber-ink);
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--brown);
}

.search-box input:focus,
.search-box input:focus-visible {
  outline: none;
  box-shadow: none;
}

.btn-outline {
  border-color: rgba(250, 246, 240, 0.45);
}

.btn-primary,
.plan-btn,
.btn-cta,
.also-btn,
.plan-badge,
.featured-img-badge,
.byline-avatar {
  background-color: var(--amber-fill);
}

.plan.featured .plan-btn:hover,
.plan.active .plan-btn:hover,
.filter-tag:hover,
.filter-tag.active,
.network-tab.active {
  background-color: var(--amber-fill);
  border-color: var(--amber-fill);
}

.section-label,
.plan-name,
.toc-title,
.related-cat,
.featured-label,
.read-link,
.featured-body .article-category,
.card-body .article-category,
.timeline-date,
.nicole-title,
.org-type,
.partner-badge,
.also-text .label,
.speedtest-caption a,
.embed-caption a,
.article-body a:not(.btn-cta) {
  color: var(--amber-ink);
}

.article-body a:not(.btn-cta):hover,
.toc ol li a:hover,
.network-tab:hover,
.brand-tab:hover {
  color: var(--amber-ink);
}

.speedtest-caption a,
.embed-caption a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.plan ul li::before {
  color: var(--amber-ink);
}

.partner-badge {
  border-color: var(--amber-ink);
}

.ms-num {
  color: var(--heart-on-dark);
}

.plan:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(59, 32, 16, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .plan:hover,
  .plan:focus-within {
    transform: none;
  }
}
