/* =====================================================================
   PTE Annual Report — sticky report header
   Burger (left) · logo (centre) · lang + Donate (right), white bar.
   ===================================================================== */

.pte-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: var(--pte-white, #fff);
	box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .05);
}

/* When the WordPress admin bar is present (logged-in editors), it is a 32px
   fixed bar at top:0. Stick the report header below it so it doesn't slide
   under the admin bar and read as "not sticky" / leave a gap (tickets #144, #145).
   Only affects body.admin-bar, so anonymous visitors are unchanged. */
body.admin-bar .pte-header { top: 32px; }
@media screen and (max-width: 782px) {
	body.admin-bar .pte-header { top: 46px; }
}

/* The custom header is position:sticky (it occupies space in normal flow), so the
   body padding-top the parent reserves for its FIXED header leaves an empty gap
   at the very top of the page. Neutralise it (beats the parent's inline estimate
   and the JS-set inline style, which are both non-important). */
body.menu-sticky-header,
body {
	padding-top: 0 !important;
}

.pte-header__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;   /* burger | logo | actions */
	align-items: center;
	gap: 16px;
	max-width: 1440px;
	margin: 0 auto;
	padding: 14px 40px;
}

/* --- Hamburger (left) --- */
.pte-header__burger {
	justify-self: start;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
}
/* Burger strokes are drawn inside ONE svg so both rects rasterize identically
   at any browser zoom / devicePixelRatio (two separate CSS boxes can round to
   different pixel heights — ticket #59). */
.pte-burger-lines { display: block; width: 28px; height: 13px; }
.pte-burger-lines rect {
	fill: var(--pte-ink, #251e20);
	transition: fill .2s ease;
}
.pte-header__burger:hover .pte-burger-lines rect,
.pte-header__burger:focus-visible .pte-burger-lines rect { fill: var(--pte-green, #00a576); }
.pte-header__burger:focus-visible { outline: 3px solid var(--pte-blue, #006db9); outline-offset: 2px; }

/* --- Logo (centre) --- */
.pte-header__logo { justify-self: center; display: inline-flex; line-height: 0; }
.pte-header__logo img { height: 56px; width: auto; display: block; }

/* --- Actions (right) --- */
.pte-header__actions {
	justify-self: end;
	display: inline-flex;
	align-items: center;
	gap: 18px;
}
.pte-header__lang { display: flex; align-items: center; }
.pte-header__lang-btn {
	font-family: var(--pte-font, inherit);
	font-size: 14px;
	font-weight: 700;
	color: #005474;
	text-decoration: none;
	letter-spacing: 0.5px;
	border: 2px solid #005474;
	border-radius: 4px;
	padding: 2px 8px;
	transition: background .15s, color .15s;
}
.pte-header__lang-btn:hover { background: #005474; color: #fff; }

.pte-header__donate {
	display: inline-flex;
	align-items: center;
	background: var(--pte-blue-dark, #005474);
	color: #fff !important;
	font-weight: 700;
	font-size: 1rem;
	line-height: 1;
	padding: 15px 30px;
	border-radius: 999px;
	text-decoration: none;
	transition: background-color .2s ease, transform .2s ease;
}
.pte-header__donate:hover,
.pte-header__donate:focus-visible {
	background: #c3df6c;
	color: #005474 !important;
}
.pte-header__donate:focus-visible { outline: 3px solid var(--pte-blue, #006db9); outline-offset: 2px; }

/* --- Nav overlay — left-side panel, drops below nav bar (matches Figma node 2060:10402) --- */
.pte-nav-backdrop {
	position: fixed; inset: 0;
	top: 84px; /* start below the sticky header so the open menu reads as attached to the top bar, no dimmed "gap" strip above it (ticket #52) */
	background: rgba(0,0,0,.3);
	opacity: 0; visibility: hidden;
	transition: opacity .22s, visibility .22s;
	z-index: 998;
}
.pte-nav-backdrop.open { opacity: 1; visibility: visible; }

.pte-nav-panel {
	position: fixed;
	top: 80px;   /* tucks 4px under the header (z beneath it) so zoom rounding never shows a slit */
	left: 0;
	width: 558px;
	max-width: 100vw;
	height: auto;
	max-height: calc(100vh - 84px);
	background: #e8edf0;
	transform: translateY(calc(-100% - 84px)); /* push the panel bottom edge above y=0 so it doesn't bleed into the header */
	transition: transform .28s cubic-bezier(.4,0,.2,1);
	z-index: 999;
	pointer-events: none; /* hidden panel must not swallow clicks on the header beneath it */
	display: flex; flex-direction: column; overflow-y: auto;
	font-family: var(--pte-font, 'altivo', system-ui, sans-serif);
}
.pte-nav-panel.open { transform: translateY(0); pointer-events: auto; }

/* Logged-in: WP admin bar shifts the header 32px down; keep the panel below the
   header so its top edge never slices across the logo (ticket #55). */
body.admin-bar .pte-nav-panel { top: 112px; max-height: calc(100vh - 112px); }
body.admin-bar .pte-nav-backdrop { top: 116px; }

.pte-nav-links {
	list-style: none; margin: 0; padding: 0;
}
.pte-nav-links > li { border-bottom: 1px solid rgba(0,0,0,.12); }
.pte-nav-links > li > a {
	display: flex; justify-content: space-between; align-items: center;
	padding: 22px 32px; font-size: 22px; font-weight: 500; /* default = medium; bold is the hover state (ticket #52) */
	color: #0a2233; text-decoration: none; line-height: 1.2;
}
.pte-nav-links > li > a:hover { color: #006db9; font-weight: 700; }
.pte-nav-arrow { font-size: 18px; flex-shrink: 0; margin-left: 8px; transition: transform .2s ease; }
.pte-nav-links > li > a:hover .pte-nav-arrow { transform: translateX(5px); } /* arrow nudges right on hover (ticket #52) */

/* Sub-items: dark teal box matching Figma */
.pte-nav-sub {
	list-style: none; margin: 0; padding: 0; display: none;
	background: #005474;
}
.pte-nav-sub.open { display: block; }
.pte-nav-sub li a {
	display: flex; justify-content: space-between; align-items: center;
	padding: 18px 32px; font-size: 18px; font-weight: 400; color: #fff;
	text-decoration: none; border-top: 1px solid rgba(255,255,255,.15);
}
.pte-nav-sub li:first-child a { border-top: 0; }
.pte-nav-sub li a:hover { background: rgba(255,255,255,.1); }

.pte-nav-foot {
	padding: 28px 32px 40px;
	display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.pte-nav-tagline { font-size: 22px; font-weight: 700; color: #0a2233; text-align: center; margin: 0; } /* #235: bumped 2 sizes (18 -> 22) */
.pte-nav-donate {
	display: block; width: 100%; text-align: center;
	background: #005474; color: #fff; font-size: 18px; font-weight: 700;
	border-radius: 100px; padding: 14px 24px 18px; text-decoration: none; /* #239: label nudged up 2px */
	transition: opacity .15s;
}
.pte-nav-donate:hover { background: #c3df6c; color: #005474; }

/* --- Responsive --- */
@media (max-width: 900px) {
	.pte-header__inner { padding: 10px 20px; }
	.pte-header__logo img { height: 44px; }
	.pte-header__donate { padding: 12px 20px; font-size: .9rem; }
	/* header is ~64px here (10+44+10), not 84px — retune the open-menu offsets so the
	   panel sits flush under the bar instead of leaving a see-through gap strip */
	.pte-nav-panel { top: 60px; max-height: calc(100vh - 64px); }
	.pte-nav-backdrop { top: 64px; }
}
@media (max-width: 560px) {
	.pte-header__donate { padding: 10px 16px; }
}
/* Mobile Figma nav (2655:18635 et al): logo LEFT, then EN/FR toggle + hamburger RIGHT.
   Client Sept-10: French was unreachable on mobile (actions were hidden), so keep the
   language toggle on the sticky bar to the LEFT of the hamburger; the Donate pill still
   lives only in the nav overlay + footer on mobile. */
@media (max-width: 768px) {
	.pte-header__inner { grid-template-columns: 1fr auto auto; }  /* logo | lang | burger */
	.pte-header__logo { order: 1; justify-self: start; }
	.pte-header__actions { display: inline-flex; order: 2; justify-self: end; gap: 0; }
	.pte-header__lang { display: flex; }        /* re-show the EN/FR toggle on mobile */
	.pte-header__donate { display: none; }      /* Donate stays in the overlay/footer on mobile */
	.pte-header__burger { order: 3; justify-self: end; }
}
