/**
 * Header, footer, and section vertical-rhythm rules.
 *
 * Ported from Version 1.0, using the values shared by seven of the nine
 * pages (the practice pages, About, and Contact) as the default —
 * 900px chrome width, 760px content width, 700px nav-collapse breakpoint.
 * Home's uniquely wider, uniform 980px/780px treatment is a documented
 * page-specific override (docs/ARCHITECTURE.md §7's "pages/" layer),
 * built in docs/IMPLEMENTATION_ROADMAP.md Phase 4.1, not here.
 *
 * See docs/ARCHITECTURE.md §5 (header/footer as parameterized template
 * parts) and §7.
 */

.wrap {
	max-width: var(--width-content);
	margin: 0 auto;
	padding: 0 28px;
}

/* ---------- Header / primary navigation ---------- */

header.site {
	position: sticky;
	top: 0;
	z-index: 80;
	background: color-mix(in srgb, var(--paper) 88%, transparent);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}

.nav-inner {
	max-width: var(--width-chrome);
	margin: 0 auto;
	padding: 18px 28px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	position: relative;
}

.mark {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
	text-decoration: none;
	color: inherit;
}

.mark .name {
	font-size: 16px;
	font-weight: 700;
}

.mark .desc {
	font-size: 9.5px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--ink-soft);
	margin-top: 3px;
}

nav.links {
	display: flex;
	gap: 24px;
	align-items: center;
}

nav.links a.navlink {
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	color: var(--ink-soft);
}

nav.links a.navlink:hover {
	color: var(--oxblood);
}

/* "Matters We Handle" dropdown — see template-parts/header/site-header.php
   for why it's rendered directly from `practice_areas` rather than as a
   WP menu item. Desktop: an absolutely-positioned panel below the toggle,
   shown/hidden via a JS-managed `.open` class on the submenu (see
   initNavDropdowns() in assets/js/navigation.js) rather than :hover, so
   it's operable by keyboard and touch, not just a mouse. */
.nav-dropdown {
	position: relative;
}

button.navlink.navlink--toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	padding: 0;
	font-family: inherit;
	cursor: pointer;
}

button.navlink.navlink--toggle:hover,
button.navlink.navlink--toggle[aria-expanded="true"] {
	color: var(--oxblood);
}

.nav-dropdown__chevron {
	width: 6px;
	height: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	transition: transform .15s ease;
	margin-top: -3px;
}

button.navlink.navlink--toggle[aria-expanded="true"] .nav-dropdown__chevron {
	transform: rotate(-135deg);
	margin-top: 3px;
}

.submenu {
	list-style: none;
	margin: 0;
	padding: 8px;
	display: none;
	position: absolute;
	top: calc(100% + 14px);
	left: 50%;
	transform: translateX(-50%);
	min-width: 300px;
	background: var(--paper-raised);
	border: 1px solid var(--line);
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(30, 26, 22, .14);
	z-index: 90;
}

.submenu.open {
	display: block;
}

.submenu li + li {
	border-top: 1px solid var(--line);
}

.submenu a.sublink {
	display: block;
	padding: 10px 12px;
	font-size: 13px;
	font-weight: 600;
	color: var(--ink-soft);
	text-decoration: none;
	border-radius: 6px;
}

.submenu a.sublink:hover {
	color: var(--oxblood);
	background: var(--paper);
}

/* Mobile nav toggle. aria-expanded drives the icon's open/closed state —
   see assets/js/navigation.js. docs/PRODUCTION_READINESS.md §5. */
.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 4px;
	width: 36px;
	height: 36px;
	background: none;
	border: 1px solid var(--line);
	border-radius: 6px;
	cursor: pointer;
	padding: 4px;
}

.nav-toggle span {
	display: block;
	width: 16px;
	height: 2px;
	background: var(--ink);
	border-radius: 2px;
	transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
	opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

.nav-backdrop {
	display: none;
}

@media (max-width: 700px) {
	.nav-toggle {
		display: flex;
	}

	nav.links {
		position: fixed;
		top: 0;
		right: 0;
		height: 100vh;
		width: min(300px, 82vw);
		background: var(--paper);
		border-left: 1px solid var(--line);
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		padding: 96px 28px 28px;
		gap: 20px;
		transform: translateX(100%);
		transition: transform .25s ease;
		z-index: 150;
		box-shadow: -12px 0 32px rgba(30, 26, 22, .12);
	}

	nav.links.open {
		transform: translateX(0);
	}

	nav.links a.navlink {
		display: block;
		font-size: 15px;
	}

	/* The dropdown becomes an inline accordion inside the slide-in drawer
	   on mobile, rather than a floating panel — there's no room to float
	   it, and an accordion is the standard, low-complexity mobile pattern
	   for this (matches this file's existing preference for simple,
	   ported-behavior interactions over anything more elaborate). */
	.nav-dropdown {
		width: 100%;
	}

	button.navlink.navlink--toggle {
		display: flex;
		width: 100%;
		justify-content: space-between;
		font-size: 15px;
	}

	.submenu {
		position: static;
		transform: none;
		min-width: 0;
		width: 100%;
		margin-top: 10px;
		padding: 0 0 0 14px;
		border: none;
		border-left: 2px solid var(--line);
		border-radius: 0;
		box-shadow: none;
	}

	.submenu a.sublink {
		padding: 10px 4px;
		font-size: 14px;
	}

	nav.links .btn {
		width: 100%;
		justify-content: center;
		margin-top: 4px;
	}

	.nav-backdrop.open {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(30, 26, 22, .35);
		z-index: 140;
	}
}

/* ---------- Buttons ---------- */
/* Defined here (not in a component file) because both the header CTA
   slot (template-parts/header/site-header.php) and the cta-band
   component depend on it, and layout.css already loads before the
   components layer in the enqueue chain. */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--oxblood);
	color: #fff !important;
	text-decoration: none;
	font-size: 13.5px;
	font-weight: 600;
	padding: 11px 20px;
	border-radius: 6px;
	border: 1px solid var(--oxblood);
	transition: background .15s ease, transform .15s ease;
}

.btn:hover {
	background: var(--oxblood-deep);
	transform: translateY(-1px);
}

.btn:active {
	transform: translateY(0);
}

.btn.small {
	padding: 9px 16px;
	font-size: 13px;
}

.btn.quiet {
	background: transparent;
	color: var(--ink-soft) !important;
	border-color: var(--line);
}

.btn.quiet:hover {
	border-color: var(--oxblood);
	color: var(--oxblood) !important;
	transform: none;
}

/* ---------- Section rhythm ---------- */

section {
	padding: 72px 0;
	border-top: 1px solid var(--line);
}

section:first-of-type {
	border-top: none;
	padding-top: 48px;
}

/* ---------- Footer ---------- */
/*
 * Three real footer patterns exist on the live site — not the two
 * ("full" | "minimal") docs/ARCHITECTURE.md §5 originally assumed.
 * Verified directly against all nine pages during this phase:
 *   - "full"     — Home only: four-column grid (mark/description,
 *                  Navigate list, Matters We Handle list, two foot-bottom
 *                  bars).
 *   - "minimal"  — About only: a single centered line, no practice links.
 *   - "standard" — the six practice pages and Contact: the same centered
 *                  line as "minimal", plus a .foot-links row (the six
 *                  practice areas; Contact's row additionally includes
 *                  About).
 * This is a confirmed correction to dockument, not an invention — see
 * this phase's completion summary. template-parts/footer/site-footer.php
 * implements all three.
 */

footer {
	padding: 40px 0;
	border-top: 1px solid var(--line);
	text-align: center;
	font-size: 12.5px;
	color: var(--slate);
}

footer a {
	color: var(--slate);
	text-decoration: none;
}

footer a:hover {
	color: var(--oxblood);
}

.foot-links {
	margin-top: 10px;
	font-size: 12.5px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 14px;
}

/* Home's full four-column footer. */
footer.full {
	padding: 56px 0 40px;
	text-align: left;
}

footer.full .foot-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr;
	gap: 36px;
}

@media (max-width: 700px) {
	footer.full .foot-grid {
		grid-template-columns: 1fr 1fr;
	}
}

/* h3, not h4: bumped Milestone 3 (heading-hierarchy accessibility
   review) — was skipping a level after the main content's last H2 on
   every page. Visual size is unaffected; this only changes the
   semantic level, not the styling. */
footer.full h3 {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--slate);
	margin-bottom: 14px;
	font-weight: 700;
}

footer.full p.foot-desc {
	font-size: 13px;
	line-height: 1.7;
	margin-top: 14px;
	max-width: 30ch;
	color: var(--slate);
}

footer.full ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

footer.full a {
	text-decoration: none;
	font-size: 13px;
	color: var(--ink-soft);
}

footer.full a:hover {
	color: var(--oxblood);
}

.foot-bottom {
	margin-top: 40px;
	padding-top: 22px;
	border-top: 1px solid var(--line);
	display: flex;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	font-size: 12px;
	color: var(--slate);
}
