/*
 * EHF 2026: site styles.
 *
 * A sibling of the sawyer-2026 theme (same palette, faces, header, buttons, footer and focus) set
 * smaller and quieter: Ben, 2026-10-04, twice, that the text was "way too big", and "The header
 * text is bigger than the actual name of the website". The wordmark is always smaller than the
 * page H1, and no heading on any page passes 42px.
 *
 * Type scale (desktop, then phone): H1 42 / 32, section H2 30 / 26, card H3 24 / 21, lede 18 / 17,
 * body 17 / 16, wordmark 28 / 22, small labels 12.5. Sizes between run on clamp().
 *
 * Colour: the sawyer-2026 palette, with no lilac or lavender fills (Ben, 2026-10-01: "dropping
 * the lilac except for lines"). #e2d1e2 appears only as 1px lines. Plum is for the Retain button
 * and small accents.
 *
 * Grid: one 1200px content width with a fluid gutter (--pad). Three columns with a 40px gap carry
 * the Home cards and the Credentials list (heading in column one, list across two and three). The
 * area pages run on two columns: text, then a column as wide as the area's square picture (--art),
 * which holds the picture in the hero and the practice-area list below it.
 *
 * Area pictures are Ben's square illustrations (flat drawings in a rounded window on white; his
 * art, so its lilac stays), always shown whole in a square box, never cropped.
 */

:root {
	--navy: #142f6e;
	--blue: #2672ae;
	--plum: #923e8e;
	--hair: #e2d1e2;
	--meta: #555555;
	--ink: #111111;
	--soft: #333333;
	--footer: #2b2b2b;
	--footer-text: #c4c4c4;
	--sub: #a6a6a6;
	--white: #ffffff;
	--serif: "Cormorant", Georgia, serif;
	--sans: "Hanken Grotesk", system-ui, sans-serif;
	/* Side gutter: 120px at 1440, centred 1200px content above that. Percent = containing block. */
	--pad: max(clamp(24px, 8.333vw, 120px), calc((100% - 1200px) / 2));
	--gap: 40px;
	/* Text column: no paragraph runs wider. */
	--measure: 640px;
	/* Area pages: the picture column and the gap before it. */
	--art: clamp(240px, 30vw, 400px);
	--art-gap: clamp(40px, 5.5vw, 88px);

	--fs-mark: clamp(22px, calc(16px + 0.85vw), 28px);
	--fs-h1: clamp(32px, calc(22px + 1.4vw), 42px);
	--fs-h2: clamp(26px, calc(21px + 0.65vw), 30px);
	--fs-h3: clamp(21px, calc(18px + 0.42vw), 24px);
	--fs-lede: clamp(17px, calc(16px + 0.14vw), 18px);
	--fs-body: clamp(16px, calc(15px + 0.14vw), 17px);
	--fs-small: 15px;
	--fs-label: 12.5px;
	--section: clamp(48px, 6vw, 88px);
}

/* Base */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--white);
	color: var(--ink);
	font-family: var(--sans);
	font-size: var(--fs-body);
	line-height: 1.6;
	overflow-wrap: break-word;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
.wp-site-blocks { min-height: 100vh; display: flex; flex-direction: column; padding: 0; }
.wp-site-blocks > * { margin-block: 0; }
.wp-site-blocks > .site-footer { margin-top: auto; }
main { display: flex; flex-direction: column; }
img { max-width: 100%; }
a { color: var(--navy); text-underline-offset: 3px; text-decoration-thickness: 1px; }
p, li { text-wrap: pretty; }
a:hover { color: var(--blue); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--navy); line-height: 1.15; letter-spacing: 0; }
button { font: inherit; }

/* Focus: always visible for keyboard users */
:focus-visible { outline: 3px solid var(--plum); outline-offset: 2px; }
.site-footer :focus-visible { outline-color: var(--white); }
:focus:not(:focus-visible) { outline: none; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; width: 1px; word-wrap: normal !important;
}
.skip-link {
	position: absolute; left: 8px; top: -100px; z-index: 100;
	padding: 12px 16px; background: var(--white); color: var(--navy);
	border: 2px solid var(--navy); border-radius: 6px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* Small capitals label: the area pages' link back to the practice areas, and list headings. */
.eyebrow {
	margin: 0; font-family: var(--sans); font-size: var(--fs-label); font-weight: 600; line-height: 1.4;
	letter-spacing: 0.14em; text-transform: uppercase; color: var(--plum);
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--navy); text-decoration: underline; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 24px;
	box-sizing: border-box; border-radius: 6px; font-family: var(--sans); font-size: var(--fs-small); font-weight: 600;
	line-height: 1.2; letter-spacing: 0.01em; text-decoration: none; cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn--plum { background: var(--plum); color: var(--white); border: 1px solid var(--plum); }
.btn--plum:hover { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* Header */
.site-header { position: relative; z-index: 40; background: var(--white); }
.site-header__bar {
	display: flex; justify-content: space-between; align-items: center; gap: 24px;
	padding: 22px var(--pad); border-bottom: 1px solid var(--hair); background: var(--white);
	box-sizing: border-box;
}
.site-name {
	margin: 0; font-family: var(--serif); font-weight: 600; font-size: var(--fs-mark); line-height: 1.1;
	letter-spacing: 0.005em; color: var(--navy); text-decoration: none; white-space: nowrap;
}
a.site-name:hover { color: var(--navy); }
.site-nav { display: flex; align-items: center; gap: 32px; font-size: var(--fs-small); }
.site-nav a { color: var(--ink); text-decoration: none; padding: 10px 0; }
.site-nav a:hover { color: var(--blue); }
.site-nav a.nav-retain {
	display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; box-sizing: border-box;
	border: 1px solid var(--plum); border-radius: 6px; background: var(--plum); color: var(--white);
	font-weight: 600; transition: background-color 0.15s ease, border-color 0.15s ease;
}
.site-nav a.nav-retain:hover { background: var(--navy); border-color: var(--navy); color: var(--white); }
.menu-toggle { display: none; }
.menu-toggle .icon-close { display: none; }

/* Scrolling (desktop, site.js): the bar is fixed from the start and shrinks smoothly to a 60px bar
   over the first 160px of scroll; it never leaves the screen. --hdr-full is the measured full
   height (the wrapper keeps it as a spacer), --hdr-p runs 0 to 1. */
.site-header.is-fixed { height: var(--hdr-full); }
.site-header.is-fixed .site-header__bar {
	position: fixed; top: var(--wp-admin--admin-bar--height, 0px); left: 0; right: 0;
	height: calc(var(--hdr-full) - (var(--hdr-full) - 60px) * var(--hdr-p, 0)); padding: 0 var(--pad);
}
.site-header.is-fixed .site-name { font-size: calc(var(--fs-mark) * (1 - var(--hdr-p, 0)) + 23px * var(--hdr-p, 0)); }
.site-header.is-fixed .site-nav a.nav-retain { min-height: calc(40px - 4px * var(--hdr-p, 0)); }
@media (min-width: 960px) { html { scroll-padding-top: 84px; } }

/* Area pictures: the illustration whole in a square (contain, never cover), or the line plate
   (ehf_plate) in the same square where an illustration is missing, and on the not-found page. */
.has-photo, .has-plate { aspect-ratio: 1 / 1; }
.has-photo img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.plate { display: block; width: 100%; height: 100%; }
.plate .pt, .plate .pa { stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.plate .pt { stroke: #c9cdf6; stroke-opacity: 0.55; }
.plate .pa { stroke: #eaa8dd; stroke-opacity: 0.95; }

/* Home: hero. Text beside the headshot, the headshot centred on the text and held inside the
   hero; a full-width rule closes the hero. */
.hero {
	display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
	column-gap: clamp(48px, 7vw, 112px);
	padding: var(--section) var(--pad) calc(var(--section) + 8px) var(--pad); border-bottom: 1px solid var(--hair);
}
.hero__text { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; max-width: 700px; }
.hero__text h1 { margin: 0; font-size: var(--fs-h1); line-height: 1.12; text-wrap: balance; }
.hero__lede { max-width: 620px; margin: 0; font-size: var(--fs-lede); line-height: 1.65; color: var(--ink); }
.hero__cta { display: flex; margin-top: 6px; }
.hero__portrait { width: clamp(220px, 22vw, 300px); }
.hero__img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 30%; }

/* Section headings on Home */
.credentials h2, .areas > h2 { margin: 0; font-size: var(--fs-h2); line-height: 1.15; }

/* Home: Credentials. Heading in the first column, the list across the other two. */
.credentials {
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gap); align-items: start;
	padding: var(--section) var(--pad);
}
.credentials h2 { grid-column: 1; margin-top: -4px; }
.credentials ul { grid-column: 2 / span 2; margin: 0; padding: 0; list-style: none; max-width: 720px; border-top: 1px solid var(--hair); }
.credentials li { padding: 14px 0; border-bottom: 1px solid var(--hair); font-size: var(--fs-small); line-height: 1.55; color: var(--ink); }

/* Home: Practice areas. Six cards; each card is one link (its heading, stretched over the card). */
.areas { display: flex; flex-direction: column; gap: 36px; padding: var(--section) var(--pad) calc(var(--section) + 16px) var(--pad); border-top: 1px solid var(--hair); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px var(--gap); }
.card { position: relative; display: flex; flex-direction: column; }
.card__media { margin-bottom: 18px; }
.card h3 { margin: 0 0 10px 0; font-size: var(--fs-h3); line-height: 1.18; text-wrap: balance; }
.card h3 a { color: var(--navy); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card h3 a:focus-visible { outline: none; }
.card h3 a:focus-visible::after { outline: 3px solid var(--plum); outline-offset: 6px; }
.card__text { margin: 0 0 14px 0; font-size: var(--fs-small); line-height: 1.6; color: var(--soft); }
.card__foot { margin: auto 0 0 0; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--navy); }
.card__foot::after { content: "\2192"; display: inline-block; margin-left: 6px; transition: transform 0.15s ease; }
.card:hover h3 a { color: var(--blue); }
.card:hover .card__foot { color: var(--blue); }
.card:hover .card__foot::after { transform: translateX(3px); }

/* Area pages: hero (link back, H1, standfirst) beside the square picture, a rule, then the text
   beside the practice-area list, which sits under the picture in a column of the same width. */
.area-hero {
	display: grid; grid-template-columns: minmax(0, 1fr) var(--art); column-gap: var(--art-gap); align-items: center;
	padding: clamp(36px, 4.5vw, 64px) var(--pad) clamp(40px, 5vw, 72px) var(--pad); border-bottom: 1px solid var(--hair);
}
.area-hero__text { max-width: var(--measure); }
.area-hero .eyebrow { margin: 0 0 14px 0; }
.area-hero h1 { margin: 0; font-size: var(--fs-h1); line-height: 1.12; text-wrap: balance; }
.area-hero__lede { max-width: 36em; margin: 20px 0 0 0; font-size: var(--fs-lede); line-height: 1.6; color: var(--soft); }

.area-body {
	display: grid; grid-template-columns: minmax(0, 1fr) var(--art); column-gap: var(--art-gap); align-items: start;
	padding: clamp(40px, 4.5vw, 64px) var(--pad) clamp(64px, 8vw, 112px) var(--pad);
}
.entry { grid-column: 1; max-width: var(--measure); }
.entry p { margin: 0 0 1.15em 0; font-size: var(--fs-body); line-height: 1.7; }
.entry p.lede { font-size: var(--fs-lede); line-height: 1.65; }
.entry__cta { display: flex; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--hair); }
.pubs { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--hair); }
.pubs .eyebrow { margin: 0 0 16px 0; color: var(--meta); }
.pubs ul { margin: 0; padding: 0; list-style: none; }
.pubs li { margin: 0 0 12px 0; padding-left: 1.5em; text-indent: -1.5em; font-size: var(--fs-small); line-height: 1.55; color: var(--soft); }
.pubs cite { font-style: italic; }

.area-nav { grid-column: 2; position: sticky; top: 100px; }
.area-nav .eyebrow { margin: 4px 0 12px 0; color: var(--meta); }
.area-nav ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hair); }
.area-nav li { border-bottom: 1px solid var(--hair); }
.area-nav a {
	display: block; padding: 11px 0 11px 14px; border-left: 2px solid transparent;
	font-size: 14.5px; line-height: 1.4; color: var(--soft); text-decoration: none;
}
.area-nav a:hover { color: var(--blue); }
.area-nav a[aria-current="page"] { border-left-color: var(--plum); color: var(--navy); font-weight: 600; }

/* Not-found page: the area hero, with a line of text in place of the link back. */
.not-found .area-hero { padding-bottom: clamp(64px, 8vw, 112px); border-bottom: 0; }
.not-found .area-hero__lede { color: var(--ink); }

/* Footer */
.site-footer {
	background: var(--footer); color: var(--footer-text);
	padding: 64px var(--pad) 36px var(--pad); display: flex; flex-direction: column; gap: 48px;
}
.site-footer a { color: var(--white); text-decoration-color: rgba(255, 255, 255, 0.35); }
.site-footer a:hover { color: var(--white); text-decoration-color: var(--white); }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gap); align-items: start; }
.footer-col--brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.footer-name { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.15; color: var(--white); }
.footer-retain { font-size: var(--fs-small); }
.footer-col--areas { grid-column: 2 / span 2; }
.footer-col--areas h2 {
	margin: 0 0 14px 0; font-family: var(--sans); font-size: var(--fs-label); font-weight: 600; line-height: 1.4;
	letter-spacing: 0.14em; text-transform: uppercase; color: var(--sub);
}
.footer-col--areas ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: var(--gap); }
.footer-col--areas li { break-inside: avoid; margin: 0 0 10px 0; font-size: var(--fs-small); line-height: 1.45; }
.copyright { margin: 0; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 13px; color: var(--sub); }

/* Narrow desktop and tablet */
@media (max-width: 1023px) {
	.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 32px; }
	.credentials { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
	.credentials h2, .credentials ul { grid-column: 1; }
	.area-body { grid-template-columns: minmax(0, 1fr); }
	.entry { grid-column: 1; }
	.area-nav { display: none; }
	.footer-cols { display: flex; flex-direction: column; gap: 36px; }
}

/* Phone menu */
@media (max-width: 959px) {
	.site-header__bar { flex-wrap: wrap; padding: 10px max(16px, calc(var(--pad) - 8px)) 10px var(--pad); }
	.site-name { font-size: min(var(--fs-mark), calc((100vw - 96px) / 9.4)); }
	.menu-toggle {
		display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
		background: var(--white); border: 1px solid var(--hair); border-radius: 6px; color: var(--navy); cursor: pointer;
	}
	.site-nav { display: none; }
	.site-header.is-open .site-nav {
		display: flex; flex-direction: column; align-items: stretch; gap: 0; flex: 0 0 100%; order: 3;
		margin: 10px 0 -10px 0; border-top: 1px solid var(--hair); font-size: 16px;
	}
	.site-header.is-open .site-nav a,
	.site-header.is-open .site-nav a.nav-retain {
		display: flex; align-items: center; min-height: 50px; padding: 0 0 0 14px; border: 0;
		border-bottom: 1px solid var(--hair); border-left: 2px solid transparent; border-radius: 0;
		background: transparent; color: var(--ink); font-size: 16px; font-weight: 400;
	}
	.site-header.is-open .site-nav a.nav-retain { color: var(--plum); font-weight: 600; border-left-color: var(--plum); }
	.site-header.is-open .site-nav a:hover { color: var(--blue); }
	.site-header.is-open .site-nav a:last-child { border-bottom: 0; }
	.site-header.is-open .menu-toggle .icon-open { display: none; }
	.site-header.is-open .menu-toggle .icon-close { display: block; }
}

/* Phone */
@media (max-width: 699px) {
	:root { --pad: 24px; --gap: 24px; --section: 44px; }
	.site-header__bar { padding: 10px 14px 10px 24px; }

	.hero { grid-template-columns: minmax(0, 1fr); row-gap: 36px; padding-top: 32px; padding-bottom: 48px; }
	.hero__text { gap: 18px; }
	.hero__portrait { grid-row: 1; width: 168px; }
	.hero__cta { margin-top: 4px; align-self: stretch; }
	.hero__cta .btn, .entry__cta .btn { flex: 1 1 auto; }

	.cards { grid-template-columns: minmax(0, 1fr); gap: 44px; }
	.card__media { width: min(240px, 100%); margin-bottom: 16px; }
	.card h3 { margin-bottom: 8px; }

	.area-hero { grid-template-columns: minmax(0, 1fr); row-gap: 28px; padding-top: 32px; padding-bottom: 36px; }
	.area-hero__lede { margin-top: 16px; }
	.area-hero__media { width: min(360px, 100%); }
	.area-body { padding-top: 32px; }
	.entry__cta { margin-top: 32px; padding-top: 28px; }

	.site-footer { padding: 44px 24px 28px 24px; gap: 36px; }
	.footer-cols { display: flex; flex-direction: column; gap: 32px; }
	.footer-col--areas ul { columns: 1; }
	.footer-col--areas li { margin-bottom: 0; }
	.footer-col--areas a, .footer-retain { display: inline-block; padding: 6px 0; }
	.copyright { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
	.btn, .site-nav a.nav-retain, .card__foot::after { transition: none; }
}

@media print {
	.site-header, .site-footer, .area-nav { display: none !important; }
}
