/**
 * Site chrome — header/nav, footer. Page/template layout lives in
 * components.css and per-template files.
 */

.site-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background: color-mix(in srgb, var(--white) 92%, transparent);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--border);
}
.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-lg);
	min-height: 68px;
}
.site-logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.site-logo img { height: 36px; width: auto; }

.primary-nav { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.primary-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.primary-nav li { flex-shrink: 0; }
.primary-nav a { color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.primary-nav a:hover { color: var(--accent-strong); }
.primary-nav li.menu-item-has-children { position: relative; }
.primary-nav .sub-menu {
	display: none;
	position: absolute;
	top: calc(100% + 12px);
	left: 0;
	background: var(--white);
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: var(--shadow-lg);
	padding: 10px;
	min-width: 220px;
	list-style: none;
	margin: 0;
}
.primary-nav li.menu-item-has-children:hover .sub-menu,
.primary-nav li.menu-item-has-children:focus-within .sub-menu,
.primary-nav li.menu-item-has-children.is-dropdown-open .sub-menu { display: block; }
.primary-nav .sub-menu li { padding: 0; }
.primary-nav .sub-menu a { display: block; padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.primary-nav .sub-menu a:hover { background: var(--accent-soft); }

.primary-nav li.nav-badge-new > a { display: inline-flex; align-items: center; gap: 6px; }
.primary-nav li.nav-badge-new > a::after {
	content: "New";
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: #fff;
	background: var(--accent-gradient);
	border-radius: var(--radius-pill);
	padding: 2px 7px;
	line-height: 1.4;
}

.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header-actions .btn { white-space: nowrap; }
.header-actions-desktop-dropdowns { display: flex; align-items: center; gap: 12px; }

.signup-dropdown { position: relative; }
.signup-dropdown .sub-menu {
	display: none;
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	background: var(--white);
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: var(--shadow-lg);
	padding: 8px;
	min-width: 200px;
	list-style: none;
	margin: 0;
	z-index: 50;
}
.signup-dropdown:hover .sub-menu,
.signup-dropdown:focus-within .sub-menu,
.signup-dropdown.is-dropdown-open .sub-menu { display: block; }
.signup-dropdown .sub-menu li { padding: 0; }
.signup-dropdown .sub-menu a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; }
.signup-dropdown .sub-menu a:hover { background: var(--accent-soft); color: var(--accent-strong); }

/* Login: lowest priority in the CTA hierarchy, so it's a plain link
   trigger (no button chrome), not a btn like the other two. */
.nav-link-plain {
	background: none;
	border: none;
	padding: 0;
	color: var(--ink);
	font-size: 14.5px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
}
.nav-link-plain:hover { color: var(--accent-strong); }

/* Try Knit Free: secondary in the hierarchy, but needs to read
   clearly as a CTA next to the plain Login link -- darker border
   than the default .btn-secondary used elsewhere on the site. */
.btn-emphasis-border { border-color: var(--navy-300); border-width: 1.5px; }
.btn-emphasis-border:hover { border-color: var(--ink-soft); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }

/* Login/Try Knit Free duplicate here (see header.php) so the collapsed
   mobile header only needs to fit one button + the toggle. Hidden by
   default -- only shown inside the open mobile drawer below. */
.mobile-nav-actions { display: none; }

@media (max-width: 900px) {
	.primary-nav { display: none; }
	.nav-toggle { display: inline-flex; }
	.header-actions-desktop-dropdowns { display: none; }

	.primary-nav.is-open .mobile-nav-actions {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
		margin-top: 14px;
		padding-top: 14px;
		border-top: 1px solid var(--border);
	}

	.primary-nav.is-open {
		display: block;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		max-height: calc(100vh - 68px);
		overflow-y: auto;
		background: var(--white);
		border-bottom: 1px solid var(--border);
		box-shadow: var(--shadow-lg);
		padding: 12px 20px 20px;
	}
	.primary-nav.is-open ul { flex-direction: column; gap: 4px; }
	.primary-nav.is-open li { width: 100%; }
	.primary-nav.is-open a { display: block; padding: 10px 4px; }

	/* No hover on touch — submenus stay expanded inline instead. */
	.primary-nav.is-open li.menu-item-has-children { position: static; }
	.primary-nav.is-open .sub-menu {
		display: block;
		position: static;
		box-shadow: none;
		border: none;
		border-left: 2px solid var(--border);
		border-radius: 0;
		margin: 4px 0 4px 14px;
		padding: 0 0 0 10px;
		min-width: 0;
	}
}

.site-footer { border-top: 1px solid var(--border); background: var(--white); padding: var(--space-2xl) 0 var(--space-lg); margin-top: var(--space-2xl); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-lg); margin-bottom: var(--space-xl); }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin-bottom: var(--space-md); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--ink); text-decoration: none; font-size: 14px; }
.footer-col a:hover { color: var(--accent-strong); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: var(--space-lg); border-top: 1px solid var(--border); font-size: 13px; color: var(--ink-soft); }
