/**
 * ITmees site chrome — header bar, cross-strip, footer (front-end + editor).
 *
 * The structural chrome that lives in the FSE template parts (header.html /
 * footer.html). The NAV itself (.mainnav/.mega/.drawer/.acc) is styled by the
 * itm/mega-nav block; this file owns the bar (.hdr), the cross-strip (.xstrip)
 * and the footer (.ftr). Ported from design/atomic-components header.css + the
 * itm-footer / itm-cross-strip specs; tokens → Token Contract presets. White
 * uses the `base` preset (#fff) to keep zero raw hex; scrim/overlay tints use
 * color-mix. Enqueued front + editor by the theme.
 */

:root {
	--hdr-h: 76px;
	--hdr-gap: var(--wp--preset--spacing--50);
	--wrap-max: 1440px;
	--wrap-gutter: clamp(16px, 4vw, 64px);
	--xstrip-h: 34px;
	--hdr-nav-fs: 1rem;   /* 16px — header nav links + phone */
	--lead-accent: var(--wp--preset--color--secondary);
}

/* ---- Shared content wrap (header bar, cross-strip, footer use ONE box) -
   Single source of truth so the header/navbar and footer are guaranteed the
   same width — capped at --wrap-max, centred, with the fluid side gutter. */
.hdr__wrap, .xstrip__wrap, .ftr__inner {
	width: 100%;
	max-width: var(--wrap-max);
	margin-inline: auto;
	padding-inline: var(--wrap-gutter);
	box-sizing: border-box;
}

/* ---- Header bar -------------------------------------------------------- */
.hdr { position: sticky; top: 0; z-index: 1100; background: var(--wp--preset--color--base); border-bottom: 1px solid var(--wp--custom--border--soft); }
.hdr__wrap {
	height: var(--hdr-h); display: flex; align-items: center; gap: var(--hdr-gap);
}
/* Kill the flow-layout block-gap margins WP adds to 2nd+ group children, which
   would offset the nav / phone / CTA vertically inside this flex row.
   .hdr itself is a flow-layout group too, and its own two children (the strip
   and this bar) were NOT covered — so WP's --wp--style--block-gap put a 19px
   white seam between the blue strip and the header on every viewport.
   position/z-index: .hdr__wrap is the mega-panel's containing block (the panel
   is `left:0;right:0;top:100%`), and z-1000 puts both header children ABOVE the
   z-999 nav-scrim so an open panel dims the page, not the header. */
.hdr > * { margin-block: 0; position: relative; z-index: 1000; }
.hdr__wrap > * { margin-block: 0; }
.hdr__logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.hdr__logo img, .hdr__logo .custom-logo { height: 38px; width: auto; display: block; }
.hdr__phone { display: inline-flex; align-items: center; gap: var(--wp--preset--spacing--20); font-family: var(--wp--preset--font-family--heading); font-weight: 500; font-size: var(--hdr-nav-fs, 1rem); color: var(--wp--preset--color--contrast); white-space: nowrap; text-decoration: none; flex: 0 0 auto; }
.hdr__phone .icon { width: 18px; height: 18px; color: var(--wp--preset--color--secondary); display: inline-flex; }
.hdr__phone .icon svg { width: 100%; height: 100%; display: block; }
.hdr__phone:hover { color: var(--wp--preset--color--primary); }
.hdr__cta { flex: 0 0 auto; }
.hdr__burger { display: none; margin-inline-start: auto; }   /* shown < 1040; pushed to the right */

@media (max-width: 1040px) {
	.hdr__phone { display: none; }
	.hdr__burger { display: inline-flex; }
	.xstrip { display: none; }   /* see the cross-strip block below */
}

/* ---- Cross-install strip ----------------------------------------------
   DESKTOP-ONLY since 0.6.0. On a 390px viewport the strip wrapped to two rows
   (50px, with a dangling leading "·" because the separator is a ::before that
   lands at line-start on wrap) — 50 of the header's 147px for the least urgent
   navigation on the page. Hidden below the 1040px nav breakpoint it costs 34px
   on desktop and nothing on mobile, where the drawer carries the same links. */
.xstrip { background: var(--wp--preset--color--secondary-alt); }
.xstrip__wrap {
	min-height: var(--xstrip-h); display: flex; align-items: center; gap: var(--wp--preset--spacing--30);
	font-size: var(--wp--preset--font-size--xs); flex-wrap: wrap;
}
/* .75, not .7: white at .70 on #2b5797 measures 4.47:1 — under the 4.5:1 AA
   floor for 12px text. */
.xstrip__lead { font-family: var(--wp--preset--font-family--heading); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wp--preset--color--base); opacity: 0.75; }
.xstrip__link { color: var(--wp--preset--color--base); opacity: 0.82; text-decoration: none; font-family: var(--wp--preset--font-family--heading); }
.xstrip__link:hover { opacity: 1; text-decoration: underline; }
.xstrip__link.is-current { opacity: 1; font-weight: 700; }
/* "·" separators between links */
.xstrip__link + .xstrip__link::before { content: "·"; margin-inline-end: var(--wp--preset--spacing--30); opacity: 0.5; }

/* Utility pills, right-aligned. 26px tall, so they fit the existing 34px bar
   without growing it, and clear the WCAG 2.5.8 24x24 target floor. White
   outline on this blue is 7.21:1; accent orange as text/outline would be
   2.36:1 and fails, so it is deliberately not used here. */
.xstrip__utils { margin-inline-start: auto; display: inline-flex; align-items: center; gap: var(--wp--preset--spacing--20); }
.xstrip__pill { display: inline-flex; align-items: center; gap: var(--wp--preset--spacing--10); min-height: 26px; padding: 0 var(--wp--preset--spacing--30); border: 1px solid color-mix(in srgb, var(--wp--preset--color--base) 55%, transparent); border-radius: var(--wp--custom--radius--pill); color: var(--wp--preset--color--base); text-decoration: none; font-family: var(--wp--preset--font-family--heading); font-weight: 500; white-space: nowrap; }
.xstrip__pill:hover { background: color-mix(in srgb, var(--wp--preset--color--base) 15%, transparent); border-color: var(--wp--preset--color--base); text-decoration: none; }
.xstrip__pill:focus-visible { outline: 2px solid var(--wp--preset--color--base); outline-offset: 2px; }
.xstrip__pill .icon { width: 14px; height: 14px; display: inline-flex; }
.xstrip__pill .icon svg { width: 100%; height: 100%; display: block; }

/* ---- Footer ------------------------------------------------------------ */
.ftr { background: var(--wp--preset--color--surface-2); border-top: 1px solid var(--wp--custom--border--soft); margin-top: var(--wp--preset--spacing--90); }
/* .ftr__inner sizing comes from the shared wrap rule above. */
.ftr__cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--wp--preset--spacing--60); padding: var(--wp--preset--spacing--80) 0 var(--wp--preset--spacing--70); }
.ftr__col h4 { font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: var(--wp--preset--font-size--md); margin: 0 0 var(--wp--preset--spacing--40); color: var(--wp--preset--color--contrast); }
.ftr__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--wp--preset--spacing--10); }
.ftr__col a { color: var(--wp--preset--color--contrast-2); text-decoration: none; font-size: var(--wp--preset--font-size--md); }
.ftr__col a:hover { color: var(--wp--preset--color--primary); }
.ftr__nap { font-size: var(--wp--preset--font-size--md); color: var(--wp--preset--color--contrast-2); display: flex; flex-direction: column; gap: var(--wp--preset--spacing--20); }
.ftr__nap strong { color: var(--wp--preset--color--contrast); font-family: var(--wp--preset--font-family--heading); }
.ftr__nap a { color: var(--wp--preset--color--contrast-2); }
.ftr__nap a:hover { color: var(--wp--preset--color--primary); }
.ftr__bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--wp--preset--spacing--40); border-top: 1px solid var(--wp--custom--border--soft); padding: var(--wp--preset--spacing--50) 0; font-size: var(--wp--preset--font-size--xs); color: var(--wp--preset--color--contrast-3); }
.ftr__bar a { color: var(--wp--preset--color--contrast-2); text-decoration: none; }
.ftr__bar a:hover { color: var(--wp--preset--color--primary); }
.ftr__certs { display: inline-flex; gap: var(--wp--preset--spacing--20); flex-wrap: wrap; }
.cert { display: inline-flex; align-items: center; padding: 4px 10px; border: 1px solid var(--wp--custom--border--muted); border-radius: var(--wp--custom--radius--pill); font-family: var(--wp--preset--font-family--heading); font-weight: 500; font-size: var(--wp--preset--font-size--xs); color: var(--wp--preset--color--contrast-2); }

@media (max-width: 768px) {
	.ftr__cols { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.ftr__cols { grid-template-columns: 1fr; }
	.ftr__bar { flex-direction: column; align-items: flex-start; }
}

/* --- Task 5 templates ---------------------------------------------------- */
/* The CPT templates render query-loop cards using tnk-blocks' .tnk-card-grid /
   .card vocabulary rather than re-implementing ~40 lines of card CSS here
   (rulebook §4: reuse before writing custom CSS). The only thing that shape
   cannot inherit is the grid child: core's post-template puts each post in an
   <li>, so the .card inside keeps its auto height and a row of cards ends
   ragged. One declaration, no design values. */
.tnk-card-grid > li { display: flex; }
