/* TPF-166 universal public header. All selectors are scoped, except optional body scroll lock. */
.tpf-skip-link {
  position: fixed; top: 8px; left: 12px; z-index: 1205;
  transform: translateY(-180%); padding: 11px 16px;
  background: #123e32; border-radius: 8px; color: white !important;
  font: 700 14px/1.4 system-ui, sans-serif;
}
.tpf-skip-link:focus { transform: translateY(0); }
.tpf-header {
  /* Token values are provisional until TPF-159 is finalized. */
  --tpf-forest: #173d35;
  --tpf-green: #27594b;
  --tpf-ink: #193d35;
  --tpf-secondary: #58665f;
  --tpf-gold: #e9b05b;
  --tpf-gold-hover: #f4c071;
  --tpf-border: #e8ede8;
  --tpf-focus: #b77719;
  --tpf-surface: #ffffff;
  --tpf-pale: #f5f8f4;
  position: sticky; top: 0; z-index: 1000; width: 100%;
  background: var(--tpf-surface); color: var(--tpf-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.tpf-header, .tpf-header *, .tpf-header *::before, .tpf-header *::after { box-sizing: border-box; }
.tpf-header [hidden] { display: none !important; }
.tpf-header a { color: inherit; text-decoration: none; }
.tpf-header button, .tpf-header input { font: inherit; }
.tpf-header button { cursor: pointer; }
.tpf-header svg { display: block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tpf-header a:focus-visible, .tpf-header button:focus-visible, .tpf-header input:focus-visible {
  outline: 3px solid var(--tpf-focus); outline-offset: 3px;
}
.tpf-header__bar {
  background: #fff; border-bottom: 1px solid var(--tpf-border);
  transition: box-shadow .2s ease;
}
.tpf-header.is-compact .tpf-header__bar { box-shadow: 0 8px 25px rgba(18, 49, 39, .10); }
.tpf-header__inner {
  width: min(100% - 56px, 1400px); margin-inline: auto; min-height: 88px;
  display: flex; align-items: center; justify-content: space-between; gap: clamp(14px, 1.4vw, 24px);
  transition: min-height .2s ease;
}
.tpf-header.is-compact .tpf-header__inner { min-height: 72px; }
.tpf-header__brand {
  display: inline-flex; align-items: center; flex-shrink: 0; gap: 11px;
  min-width: 224px; max-width: 260px;
}
.tpf-header__logo { display: block; width: 52px; height: 52px; object-fit: contain; flex: 0 0 auto; transition: width .2s, height .2s; }
.tpf-header__monogram {
  display: grid; flex: 0 0 auto; place-items: center;
  width: 52px; height: 52px; border-radius: 15px 4px 15px 4px;
  background: var(--tpf-forest); color: white;
  font: 700 24px/1 Georgia, serif; letter-spacing: -.09em; padding-right: 3px;
  box-shadow: inset -8px -8px 0 rgba(232, 176, 91, .15);
  transition: width .2s, height .2s;
}
.tpf-header.is-compact .tpf-header__monogram { width: 45px; height: 45px; }
.tpf-header.is-compact .tpf-header__logo { width: 45px; height: 45px; }
.tpf-header__brand-type { display: flex; flex-direction: column; white-space: nowrap; line-height: 1.18; gap: 5px; }
.tpf-header__brand-type strong { font-size: 15px; letter-spacing: .065em; font-weight: 800; }
.tpf-header__brand-type > span { font-size: 10px; letter-spacing: .29em; color: #9b753a; font-weight: 750; }
.tpf-header__navigation-panel { flex: 1 1 auto; min-width: 0; }
.tpf-header__nav { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 1vw, 20px); }
.tpf-header__nav-item { position: relative; flex: 0 0 auto; }
.tpf-header__nav-row { display: flex; align-items: center; min-height: 48px; }
.tpf-header__nav-link {
  display: inline-flex; align-items: center; position: relative;
  min-height: 48px; white-space: nowrap; padding: 10px 0;
  font-size: 12.5px; font-weight: 650; color: #263e35 !important;
  transition: color .15s ease;
}
.tpf-header__nav-item:hover > .tpf-header__nav-row .tpf-header__nav-link,
.tpf-header__nav-item.is-active > .tpf-header__nav-row .tpf-header__nav-link {
  color: #a96f20 !important;
}
.tpf-header__nav-item.is-active > .tpf-header__nav-row .tpf-header__nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 7px; height: 2px; border-radius: 3px;
  background: #c48a37;
}
.tpf-header__submenu-trigger {
  display: inline-grid; place-items: center; margin-left: 0;
  border: 0; border-radius: 6px; background: transparent;
  padding: 7px 3px; color: #435a50;
}
.tpf-header__submenu-trigger svg { width: 15px; height: 15px; transition: transform .18s ease; }
.tpf-header__submenu-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.tpf-header__submenu {
  position: absolute; z-index: 1010; top: calc(100% + 13px); left: -28px;
  min-width: 245px; max-width: 310px; padding: 11px;
  background: var(--tpf-surface); border: 1px solid var(--tpf-border);
  border-radius: 13px; box-shadow: 0 20px 42px rgba(18, 49, 39, .17);
}
.tpf-header__submenu::before {
  content: ""; position: absolute; height: 13px; top: -14px; left: 0; right: 0;
}
.tpf-header__submenu-link { display: block; border-radius: 8px; padding: 9px 12px; color: #32483e !important; font-size: 13px; font-weight: 600; }
.tpf-header__submenu-link:hover, .tpf-header__submenu-link[aria-current="page"] { background: var(--tpf-pale); color: #99621c !important; }
.tpf-header__actions { display: flex; align-items: center; justify-content: flex-end; flex: 0 0 auto; gap: 8px; }
.tpf-header__icon-button {
  display: inline-grid; place-items: center; width: 43px; height: 43px;
  border: 1px solid transparent; background: transparent; border-radius: 9px; color: var(--tpf-forest) !important;
}
.tpf-header__icon-button:hover, .tpf-header__icon-button[aria-expanded="true"] { background: var(--tpf-pale); }
.tpf-header__donate, .tpf-header__drawer-donate {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 45px; padding: 11px 16px; border-radius: 9px;
  background: var(--tpf-gold); color: #2f341f !important;
  font-weight: 800; font-size: 13px; white-space: nowrap;
  box-shadow: 0 3px 0 #cc9440; transition: background .16s ease, transform .16s ease;
}
.tpf-header__donate:hover, .tpf-header__drawer-donate:hover { background: var(--tpf-gold-hover); transform: translateY(-1px); }
.tpf-header__donate svg { width: 17px; height: 17px; }
.tpf-header__donate-arrow { font-size: 18px; line-height: 1; }
.tpf-header__menu-button, .tpf-header__drawer-title, .tpf-header__mobile-utilities, .tpf-header__drawer-backdrop { display: none; }
.tpf-header__menu-button, .tpf-header__drawer-close {
  align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 9px; border: 1px solid #dce5df; background: white; color: var(--tpf-forest);
}
.tpf-header__search-panel {
  position: absolute; top: 100%; right: max(28px, calc((100% - 1400px) / 2));
  width: min(460px, calc(100vw - 28px)); padding: 19px 20px 22px;
  background: #fff; border: 1px solid var(--tpf-border); border-radius: 0 0 15px 15px;
  box-shadow: 0 18px 40px rgba(18, 49, 39, .16);
}
.tpf-header__search-form label, .tpf-header__mobile-search label { display: block; font-weight: 750; margin-bottom: 9px; }
.tpf-header__field-row { display: flex; align-items: stretch; gap: 8px; }
.tpf-header__field-row input { display: block; width: 100%; min-width: 0; border: 1px solid #cddad1; border-radius: 9px; padding: 11px 12px; background: #fff; color: #142c22; }
.tpf-header__field-row button { background: var(--tpf-forest); color: #fff; border: none; padding: 0 15px; border-radius: 9px; font-weight: 700; }
.tpf-header__field-row button:hover { background: var(--tpf-green); }
.tpf-header__language-picker { position: relative; }
.tpf-header__language-list {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 1010; min-width: 145px;
  display: flex; flex-direction: column; padding: 6px; background: white;
  border: 1px solid var(--tpf-border); border-radius: 10px;
  box-shadow: 0 18px 35px rgba(18, 49, 39, .13);
}
.tpf-header__language-list a { display: block; border-radius: 7px; padding: 10px; white-space: nowrap; }
.tpf-header__language-list a:hover { background: var(--tpf-pale); }
@media (min-width: 1200px) and (max-width: 1290px) {
  .tpf-header__inner { width: calc(100% - 32px); gap: 10px; }
  .tpf-header__brand { min-width: 203px; gap: 9px; }
  .tpf-header__nav { gap: 9px; }
  .tpf-header__nav-link { font-size: 12px; }
  .tpf-header__actions { gap: 3px; }
  .tpf-header__donate { padding-inline: 12px; }
}
@media (max-width: 1199px) {
  .tpf-header__inner { width: min(100% - 38px, 1200px); min-height: 72px; }
  .tpf-header.is-compact .tpf-header__inner { min-height: 64px; }
  .tpf-header__brand { min-width: 0; }
  .tpf-header__monogram { width: 46px; height: 46px; font-size: 22px; }
  .tpf-header__logo { width: 46px; height: 46px; }
  .tpf-header__menu-button { display: inline-flex; }
  .tpf-header__account, .tpf-header__language-picker { display: none; }
  .tpf-header__navigation-panel {
    position: fixed; z-index: 1101; top: 0; right: 0; bottom: 0;
    width: min(86vw, 410px); max-height: 100dvh; overflow-y: auto;
    padding: 23px 22px 28px; overscroll-behavior: contain;
    background: #fff; box-shadow: -20px 0 50px rgba(12, 45, 33, .22);
    transform: translateX(102%); visibility: hidden; pointer-events: none;
    transition: transform .22s ease, visibility 0s linear .22s;
  }
  .tpf-header__navigation-panel.is-open { transform: translateX(0); visibility: visible; pointer-events: auto; transition: transform .22s ease, visibility 0s linear 0s; }
  .tpf-header__drawer-backdrop:not([hidden]) { display: block; position: fixed; z-index: 1100; inset: 0; background: rgba(13, 31, 25, .48); }
  .tpf-header__drawer-title { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 800; padding-bottom: 20px; border-bottom: 1px solid var(--tpf-border); }
  .tpf-header__drawer-close { display: inline-flex; }
  .tpf-header__nav { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 13px 0; }
  .tpf-header__nav-item { border-bottom: 1px solid var(--tpf-border); }
  .tpf-header__nav-row { display: flex; min-height: 54px; justify-content: space-between; }
  .tpf-header__nav-link { width: 100%; min-height: 54px; padding: 15px 2px; font-size: 15px; }
  .tpf-header__nav-item.is-active > .tpf-header__nav-row .tpf-header__nav-link::after { right: auto; width: 40px; bottom: 5px; }
  .tpf-header__submenu-trigger { width: 44px; height: 44px; flex-shrink: 0; padding: 12px; }
  .tpf-header__submenu-trigger svg { width: 18px; height: 18px; }
  .tpf-header__submenu { position: static; min-width: 0; max-width: none; padding: 4px 7px 12px; border: 0; border-radius: 0; box-shadow: none; background: var(--tpf-pale); }
  .tpf-header__submenu::before { display: none; }
  .tpf-header__submenu-link { font-size: 14px; padding: 11px 12px; }
  .tpf-header__mobile-utilities { display: flex; flex-direction: column; gap: 17px; padding-top: 18px; }
  .tpf-header__utility-link { font-weight: 700; padding: 10px 0; }
  .tpf-header__drawer-donate { width: 100%; min-height: 50px; }
  .tpf-header__mobile-languages { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; }
  .tpf-header__mobile-languages > span { font-weight: 750; width: 100%; }
  .tpf-header__mobile-languages a { display: inline-block; padding: 8px 11px; background: var(--tpf-pale); border-radius: 7px; }
}
@media (max-width: 767px) {
  .tpf-header__inner { width: calc(100% - 28px); min-height: 64px; gap: 8px; }
  .tpf-header.is-compact .tpf-header__inner { min-height: 60px; }
  .tpf-header__brand { gap: 9px; }
  .tpf-header__monogram { width: 42px; height: 42px; font-size: 20px; }
  .tpf-header__logo { width: 42px; height: 42px; }
  .tpf-header__brand-type strong { font-size: 12px; letter-spacing: .04em; }
  .tpf-header__brand-type > span { font-size: 9px; letter-spacing: .23em; }
  .tpf-header__actions { gap: 7px; }
  .tpf-header__search-toggle { display: none; }
  .tpf-header__donate { min-height: 43px; padding: 8px 10px; gap: 5px; font-size: 12px; }
  .tpf-header__donate svg, .tpf-header__donate-arrow { display: none; }
  .tpf-header__menu-button { width: 43px; height: 43px; }
}
@media (max-width: 370px) {
  .tpf-header__inner { width: calc(100% - 18px); gap: 4px; }
  .tpf-header__brand { gap: 6px; }
  .tpf-header__monogram, .tpf-header__logo { width: 38px; height: 38px; }
  .tpf-header__brand-type strong { font-size: 11px; }
  .tpf-header__brand-type > span { font-size: 8px; }
  .tpf-header__actions { gap: 5px; }
  .tpf-header__donate { font-size: 11px; padding-inline: 8px; }
  .tpf-header__menu-button { width: 40px; height: 40px; }
}
body.tpf-header-menu-open { overflow: hidden !important; }
@media (prefers-reduced-motion: reduce) {
  .tpf-header *, .tpf-header *::before, .tpf-header *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Release tokens (override from global design system TPF-159 when adopted). */
:root {
  --tpf-color-primary: #173d35;
  --tpf-color-primary-hover: #27594b;
  --tpf-color-accent: #e9b05b;
  --tpf-color-focus: #a96f20;
  --tpf-header-layer: 1000;
}
.tpf-header {
  --tpf-forest: var(--tpf-color-primary);
  --tpf-green: var(--tpf-color-primary-hover);
  --tpf-gold: var(--tpf-color-accent);
  --tpf-focus: var(--tpf-color-focus);
  z-index: var(--tpf-header-layer);
}
/* Properly offset anchor navigation under a sticky header. */
html { scroll-padding-top: 108px; }
.tpf-header__submenu { max-height: min(65vh, 500px); overflow: auto; }
.tpf-header__submenu-link { min-height: 40px; display: flex; align-items: center; }
.tpf-header__language-list a[aria-current="true"],
.tpf-header__mobile-languages a[aria-current="true"] { background: #e8f1e9; color: #173d35; font-weight: 800; }
/* When script is disabled, present the shared navigation on smaller screens. */
@media (max-width: 1199px) {
  .tpf-header__navigation-panel:not(.is-open) { overscroll-behavior: contain; }
  .tpf-header__navigation-panel { scrollbar-gutter: stable; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
