/* Navigation v2 (0.5.7): desktop mega panels + full-screen compact menu.
   A layer over the live 0.5.6 header: same markup contract (tp-shell.js keeps every behaviour), plus a thumb per
   guide, a group intro in the kicker row and a featured "free printable plan" card. Paper card, ink hairline,
   offset paper shadow, as the 0.5.4 panels. */

.tp-site-header { --nv-ink: #211D19; --nv-muted: #57504A; --nv-green: #1F6F5C; --nv-green-d: #15503F; --nv-tint: #E7F2EE;
	--nv-paper: #FFFDF9; --nv-cream: #FAF6F0; --nv-deep: #F3EDE3; --nv-rule: #D8CFC1; --nv-rust: #9A3412; --nv-shadow: #E6DCCB;
	--nv-ease: cubic-bezier(0.23, 1, 0.32, 1); --nv-spring: cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Shared pieces ---------------------------------------------------------------------------------------- */
.tp-site-header .tp-sub-link { grid-template-columns: 48px minmax(0, 1fr); column-gap: 14px; align-items: center; }
.tp-site-header .tp-sub-thumb { grid-row: 1 / span 2; display: block; width: 48px; height: 48px; border-radius: 12px; overflow: hidden; background: var(--nv-deep); box-shadow: inset 0 0 0 1px rgba(33, 29, 25, 0.08); transition: transform 300ms var(--nv-spring); }
.tp-site-header .tp-sub-thumb img, .tp-site-header .tp-sub-thumb svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.tp-site-header .tp-sub-title, .tp-site-header .tp-sub-desc { grid-column: 2; }
.tp-site-header .tp-sub-link:hover .tp-sub-thumb, .tp-site-header .tp-sub-link:focus-visible .tp-sub-thumb { transform: rotate(-4deg) scale(1.06); }
.tp-site-header .tp-sub-k { display: block; color: var(--nv-rust); font: 600 13px/1.3 var(--tp-sans); }
.tp-site-header .tp-sub-group, .tp-site-header .tp-sub-intro, .tp-site-header .tp-sub-count { display: none; }

.tp-site-header .tp-feature { position: relative; display: flex; flex-direction: column; height: 100%; padding: 18px 18px 16px; border-radius: 14px; background: var(--nv-green); color: #fff; text-decoration: none; overflow: hidden; isolation: isolate; transition: transform 200ms var(--nv-ease); }
.tp-site-header .tp-feature:hover { transform: translateY(-2px); }
.tp-site-header .tp-feature:focus-visible { outline: 3px solid var(--nv-ink); outline-offset: 3px; }
.tp-site-header .tp-feature-k { font: 700 11.5px/1 var(--tp-sans); letter-spacing: 0.14em; text-transform: uppercase; color: #E3F4EF; }
.tp-site-header .tp-feature-t { margin-top: 8px; font: 560 21px/1.12 var(--tp-display); color: #fff; max-width: 13ch; }
.tp-site-header .tp-feature-d { margin-top: 6px; font: 400 13.5px/1.4 var(--tp-sans); color: #DCEFEA; max-width: 22ch; }
.tp-site-header .tp-feature-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 14px; font: 700 14px/1 var(--tp-sans); color: #fff; }
.tp-site-header .tp-feature-cta i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); font-style: normal; transition: transform 300ms var(--nv-spring); }
.tp-site-header .tp-feature:hover .tp-feature-cta i { transform: translateX(3px); }
.tp-site-header .tp-feature-art { position: absolute; z-index: -1; right: -18px; bottom: -26px; width: 128px; height: 150px; }
.tp-site-header .tp-feature-art img { position: absolute; right: 8px; bottom: 0; width: 104px; height: auto; border-radius: 4px; transform: rotate(8deg); box-shadow: 0 14px 26px -12px rgba(0, 0, 0, 0.55); transition: transform 500ms var(--nv-ease); }
.tp-site-header .tp-feature-art svg { position: absolute; left: -16px; top: -6px; width: 74px; transform: rotate(-8deg); transform-origin: 50% 85%; }
.tp-site-header .tp-feature:hover .tp-feature-art img { transform: rotate(4deg) translateY(-6px); }
.tp-site-header .tp-nav-extra { display: none; }

/* Desktop (>= 1024px): one wide panel under the header ------------------------------------------------- */
@media (min-width: 1024px) {
	.tp-site-header .tp-header-inner { position: relative; }
	.tp-site-header .tp-nav-item.tp-nav-group { position: static; }
	.tp-nav-ready .tp-site-header .tp-sub,
	.tp-nav-ready .tp-site-header .tp-nav-item:last-child .tp-sub {
		left: var(--tp-gutter); right: var(--tp-gutter); top: calc(100% + 8px);
		width: auto; max-width: none;
		display: grid; grid-template-columns: 220px repeat(2, minmax(0, 1fr)) 262px; grid-auto-rows: min-content;
		column-gap: 8px; row-gap: 2px; padding: 22px 22px 22px 26px; border-radius: 20px;
	}
	.tp-nav-ready .tp-site-header .tp-sub[hidden] { display: none; }
	.tp-nav-ready .tp-site-header .tp-sub .tp-sub-kicker { grid-column: 1; grid-row: 1 / span 3; padding: 4px 18px 0 0; margin-right: 10px; border-right: 1px solid var(--nv-rule); }
	.tp-nav-ready .tp-site-header .tp-sub-group { display: block; margin-top: 10px; font: 560 26px/1.05 var(--tp-display); color: var(--nv-ink); letter-spacing: -0.01em; }
	.tp-nav-ready .tp-site-header .tp-sub-intro { display: block; margin-top: 10px; font: 400 14.5px/1.45 var(--tp-sans); color: var(--nv-muted); }
	.tp-nav-ready .tp-site-header .tp-sub-count { display: inline-block; margin-top: 16px; padding: 5px 10px; border-radius: 999px; background: var(--nv-tint); color: var(--nv-green-d); font: 700 12.5px/1 var(--tp-sans); }
	.tp-nav-ready .tp-site-header .tp-sub-feature { grid-column: 4; grid-row: 1 / span 3; margin-left: 10px; min-height: 236px; }
	.tp-nav-ready .tp-site-header .tp-sub-link { padding: 11px 12px; }

	/* 1024-1199: the intro becomes a top row, so the guides keep two readable columns */
	@media (max-width: 1199px) {
		.tp-nav-ready .tp-site-header .tp-sub, .tp-nav-ready .tp-site-header .tp-nav-item:last-child .tp-sub { grid-template-columns: repeat(2, minmax(0, 1fr)) 236px; padding: 18px 18px 18px 20px; }
		.tp-nav-ready .tp-site-header .tp-sub .tp-sub-kicker { grid-column: 1 / span 2; grid-row: auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 8px; padding: 0 12px 12px; border-right: 0; border-bottom: 1px solid var(--nv-rule); }
		.tp-nav-ready .tp-site-header .tp-sub-group { margin: 0; font-size: 22px; order: -1; }
		.tp-nav-ready .tp-site-header .tp-sub-k { flex-basis: 100%; order: -2; }
		.tp-nav-ready .tp-site-header .tp-sub-intro { margin: 0; flex: 1; }
		.tp-nav-ready .tp-site-header .tp-sub-count { margin: 0; }
		.tp-nav-ready .tp-site-header .tp-sub-feature { grid-column: 3; grid-row: 1 / span 4; }
	}
	/* the page dims a little under an open panel */
	html.tp-mega-open body::after { content: ""; position: fixed; inset: 0; z-index: 40; background: rgba(33, 29, 25, 0.16); pointer-events: none; animation: tp-nv-fade 200ms var(--nv-ease) both; }
}

/* Compact (<= 1023px): the menu becomes a full-screen sheet ------------------------------------------- */
@media (max-width: 1023px) {
	html.tp-menu-lock, html.tp-menu-lock body { overflow: hidden; }
	.tp-js .tp-site-header .tp-primary-nav.tp-open {
		position: fixed; top: calc(var(--tp-header-h) + var(--tp-admin, 0px)); right: 0; bottom: 0; left: 0;
		max-height: none; padding: 20px var(--tp-gutter) 0; overflow-y: auto; overscroll-behavior: contain;
		background: var(--nv-cream); border-bottom: 0; display: flex; flex-direction: column;
	}
	.tp-site-header .tp-primary-nav .tp-nav-list { flex: none; }
	.tp-site-header .tp-nav-item { border-bottom: 1.5px solid var(--nv-ink); }
	.tp-site-header .tp-nav-item:first-child { border-top: 1.5px solid var(--nv-ink); }
	.tp-site-header .tp-nav-item:last-child { border-bottom: 1.5px solid var(--nv-ink); }
	.tp-site-header .tp-primary-nav .tp-nav-item > .tp-link,
	.tp-site-header .tp-primary-nav .tp-nav-button,
	.tp-site-header .tp-primary-nav .tp-nav-button:hover,
	.tp-site-header .tp-primary-nav .tp-nav-button:focus {
		min-height: 68px; margin: 0; padding: 0 2px; background: transparent;
		font: 560 clamp(26px, 5vw + 8px, 36px)/1.05 var(--tp-display); letter-spacing: -0.015em; color: var(--nv-ink);
	}
	.tp-site-header .tp-primary-nav .tp-link[aria-current="page"] { background: transparent; color: var(--nv-green); }
	.tp-site-header .tp-primary-nav .tp-nav-button .tp-chevron { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: var(--nv-deep); box-sizing: border-box; transition: transform 300ms var(--nv-spring), background-color 200ms var(--nv-ease); }
	.tp-site-header .tp-primary-nav .tp-nav-button[aria-expanded="true"] .tp-chevron { background: var(--nv-green); color: #fff; }
	.tp-site-header .tp-sub, .tp-site-header .tp-nav-item:last-child .tp-sub { padding: 0 0 14px; }
	.tp-site-header .tp-sub .tp-sub-kicker { padding: 0 2px 8px; }
	.tp-site-header .tp-sub-k::after { content: " \00B7  " attr(data-count); color: var(--nv-muted); font-weight: 500; }
	.tp-site-header .tp-sub-link { padding: 10px 2px; border-radius: 12px; }
	.tp-site-header .tp-sub-title { font-size: 18px; }
	.tp-site-header .tp-sub-thumb { width: 52px; height: 52px; }
	.tp-site-header .tp-sub-link { grid-template-columns: 52px minmax(0, 1fr); }
	.tp-site-header .tp-sub-feature { display: none; }

	.tp-site-header .tp-nav-extra { display: block; position: relative; flex: none; margin: 26px calc(-1 * var(--tp-gutter)) 0; padding: 0 var(--tp-gutter) 28px; }
	.tp-site-header .tp-nav-extra .tp-feature { height: auto; min-height: 168px; padding: 20px 150px 18px 20px; border-radius: 20px; }
	.tp-site-header .tp-nav-extra .tp-feature-art { right: -6px; bottom: -22px; width: 150px; height: 170px; }
	.tp-site-header .tp-nav-extra .tp-feature-art img { width: 112px; }
	.tp-site-header .tp-nav-extra .tp-feature-art svg { width: 84px; left: -10px; top: -14px; }
	.tp-site-header .tp-nav-note { margin: 16px 2px 0; font: 400 14px/1.45 var(--tp-sans); color: var(--nv-muted); }
	.tp-js .tp-site-header .tp-scrim.tp-open { display: none; }
}

/* Motion ------------------------------------------------------------------------------------------------ */
@keyframes tp-nv-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tp-nv-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes tp-nv-peek { 0% { transform: translateY(30px) rotate(-8deg); opacity: 0; } 100% { transform: translateY(0) rotate(-8deg); opacity: 1; } }
@keyframes tp-nv-tilt { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(6deg); } }
@media (prefers-reduced-motion: no-preference) {
	@media (min-width: 1024px) {
		.tp-nav-ready .tp-site-header .tp-sub:not([hidden]) { animation: tp-nv-fade 160ms var(--nv-ease) both; }
		.tp-nav-ready .tp-site-header .tp-sub:not([hidden]) > li { animation: tp-nv-up 420ms var(--nv-ease) both; }
		.tp-nav-ready .tp-site-header .tp-sub:not([hidden]) > li:nth-child(2) { animation-delay: 30ms; }
		.tp-nav-ready .tp-site-header .tp-sub:not([hidden]) > li:nth-child(3) { animation-delay: 60ms; }
		.tp-nav-ready .tp-site-header .tp-sub:not([hidden]) > li:nth-child(4) { animation-delay: 90ms; }
		.tp-nav-ready .tp-site-header .tp-sub:not([hidden]) > li:nth-child(5) { animation-delay: 120ms; }
		.tp-nav-ready .tp-site-header .tp-sub:not([hidden]) > li:nth-child(6) { animation-delay: 150ms; }
		.tp-nav-ready .tp-site-header .tp-sub:not([hidden]) > li.tp-sub-feature { animation-delay: 110ms; }
	}
	.tp-site-header .tp-sub:not([hidden]) .tp-feature-art svg,
	.tp-site-header .tp-primary-nav.tp-open .tp-nav-extra .tp-feature-art svg { animation: tp-nv-peek 700ms 220ms var(--nv-spring) both, tp-nv-tilt 1.4s 1s ease-in-out 2; }
	.tp-site-header .tp-feature:hover .tp-feature-art svg { animation: tp-nv-tilt 1.2s ease-in-out infinite; opacity: 1; }
	@media (max-width: 1023px) {
		.tp-js .tp-site-header .tp-primary-nav.tp-open { animation: tp-nv-fade 220ms var(--nv-ease) both; }
		.tp-site-header .tp-primary-nav.tp-open .tp-nav-item, .tp-site-header .tp-primary-nav.tp-open .tp-nav-extra { animation: tp-nv-up 520ms var(--nv-ease) both; }
		.tp-site-header .tp-primary-nav.tp-open .tp-nav-item:nth-child(2) { animation-delay: 50ms; }
		.tp-site-header .tp-primary-nav.tp-open .tp-nav-item:nth-child(3) { animation-delay: 100ms; }
		.tp-site-header .tp-primary-nav.tp-open .tp-nav-item:nth-child(4) { animation-delay: 150ms; }
		.tp-site-header .tp-primary-nav.tp-open .tp-nav-extra { animation-delay: 210ms; }
		.tp-site-header .tp-sub:not([hidden]) > li { animation: tp-nv-up 380ms var(--nv-ease) both; }
		.tp-site-header .tp-sub:not([hidden]) > li:nth-child(3) { animation-delay: 40ms; }
		.tp-site-header .tp-sub:not([hidden]) > li:nth-child(4) { animation-delay: 80ms; }
		.tp-site-header .tp-sub:not([hidden]) > li:nth-child(5) { animation-delay: 120ms; }
		.tp-site-header .tp-sub:not([hidden]) > li:nth-child(6) { animation-delay: 160ms; }
		.tp-site-header .tp-sub:not([hidden]) > li:nth-child(7) { animation-delay: 200ms; }
	}
}
@media (forced-colors: active) {
	.tp-site-header .tp-feature { border: 2px solid CanvasText; }
}
/* Without the script: panels stay in flow (live fallback); the featured card and extras stay out of the way. */
html:not(.tp-js) .tp-site-header .tp-sub-feature, html:not(.tp-js) .tp-site-header .tp-nav-extra { display: none; }

/* Hover: one thin underline under the guide title only (the base .tp-link:hover underlines title and sentence). */
.tp-site-header .tp-sub-link:hover, .tp-site-header .tp-sub-link:focus { text-decoration: none; }
.tp-site-header .tp-sub-link:hover, .tp-site-header .tp-sub-link:focus-visible { background: var(--nv-tint); }
.tp-site-header .tp-sub-link:hover .tp-sub-title, .tp-site-header .tp-sub-link:focus-visible .tp-sub-title { text-decoration: underline; text-decoration-color: #D96B45; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.tp-site-header .tp-sub-link:hover .tp-sub-desc, .tp-site-header .tp-sub-link:focus-visible .tp-sub-desc { text-decoration: none; }
