/*
Theme Name:        TF Matlakala
Theme URI:         https://www.tfmlaw.co.za
Author:            GM IT Solutions
Description:       Block theme for TF Matlakala Inc Attorneys, Pretoria. Soft white page, rounded surfaces, pill buttons and light Poppins headings, in the firm's logo colours: navy, gold and white.
Version:           1.1.0
Requires at least: 6.5
Requires PHP:      7.4
License:           GNU General Public License v2 or later
Text Domain:       tfm-law
*/

/* ==========================================================================
   Tokens. Colours, fonts and sizes come from theme.json; these are aliases
   and the few values theme.json cannot hold.
   Shape system: cards and panels 17px, images 12px, form fields 12px, buttons pill.
   ========================================================================== */
:root {
	--navy: var(--wp--preset--color--navy);
	--navy-deep: var(--wp--preset--color--navy-deep);
	--gold: var(--wp--preset--color--gold);
	--gold-ink: var(--wp--preset--color--gold-ink);
	--paper: var(--wp--preset--color--paper);
	--white: var(--wp--preset--color--white);
	--tint: var(--wp--preset--color--tint);
	--line: var(--wp--preset--color--line);
	--text: var(--wp--preset--color--text);
	--muted: var(--wp--preset--color--muted);
	--danger: var(--wp--preset--color--danger);
	--display: var(--wp--preset--font-family--display);
	--body: var(--wp--preset--font-family--body);

	--r-card: 17px;
	--r-img: 12px;
	--r-field: 12px;
	--pill: 70px;
	--header-h: 4.75rem;
	--gutter: clamp(1.25rem, 4vw, 2.5rem);
	--section-y: clamp(3.5rem, 2rem + 5vw, 6.5rem);

	/* Motion: strong ease-out for entrances and presses. Nothing here uses ease-in. */
	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--t-fast: 160ms;
	--t-base: 220ms;

	--arrow-long: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 38 12' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 6h35M31 1l5 5-5 5'/%3E%3C/svg%3E");
	--select-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%23182C58'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Base
   ========================================================================== */
html {
	-webkit-text-size-adjust: 100%;
	scrollbar-color: #8a94b4 var(--paper);
	scrollbar-width: thin;
}
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-wrap: break-word;
}
::selection { background: var(--gold); color: var(--navy-deep); }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 4px; }
a { text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
img { height: auto; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
address { font-style: normal; }
.screen-reader-text {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.admin-bar .tfm-header { top: var(--wp-admin--admin-bar--height, 32px); }
.skip-link.screen-reader-text:focus {
	background: var(--white); color: var(--navy); clip: auto; clip-path: none; width: auto; height: auto;
	padding: 0.85rem 1.25rem; z-index: 100; left: 0.75rem; top: 0.75rem; margin: 0; font-weight: 600; text-decoration: none;
	border-radius: var(--pill); box-shadow: 0 0 0 3px var(--navy);
}
.tfm-main { display: block; }
.tfm-main > * { margin-block: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }

/* Small tracked label above a heading, as on the sites this layout follows */
.tfm-eyebrow {
	margin: 0 0 0.75rem; font-family: var(--body); font-size: 0.8125rem; font-weight: 500; line-height: 1.4;
	letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-ink);
}
.tfm-sub { font-size: var(--wp--preset--font-size--lead); line-height: 1.65; max-width: 44rem; margin-block: 0 0.75rem; }

/* Short gold bar under a heading */
.tfm-rule { border: 0 !important; height: 4px; width: 6.25rem; max-width: 6.25rem; background: var(--gold) !important; margin-block: 1.5rem !important; opacity: 1; }

/* Constrained children with their own max-width would centre; keep them on the container's left edge */
.tfm-section:not(.tfm-center) > .tfm-sub,
.tfm-section:not(.tfm-center) > .tfm-rule,
.tfm-pagehead > * {
	margin-inline-start: max(0px, calc((100% - 75rem) / 2)) !important;
	margin-inline-end: auto !important;
}
.tfm-center { text-align: center; }
.tfm-center .tfm-rule { margin-inline: auto !important; }
.tfm-center .tfm-sub { margin-inline: auto !important; }

/* ==========================================================================
   Buttons: pills. Gold with navy text (5.9:1); navy with white; white on dark cards.
   ========================================================================== */
.wp-block-button__link,
.tfm-submit {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem;
	min-height: 3rem; padding: 0.8rem 1.6rem;
	background: var(--gold); color: var(--navy);
	font-family: var(--body); font-weight: 500; font-size: 0.9375rem; line-height: 1.2;
	border: 0; border-radius: var(--pill);
	text-decoration: none; white-space: nowrap; cursor: pointer;
	transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.wp-block-button__link::after {
	content: ""; flex: none; width: 2.4rem; height: 0.75rem; background: currentColor;
	-webkit-mask: var(--arrow-long) center / contain no-repeat; mask: var(--arrow-long) center / contain no-repeat;
	transition: transform var(--t-base) var(--ease-out);
}
.tfm-header__cta .wp-block-button__link::after { display: none; }
.wp-block-button__link:active, .tfm-submit:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
	.wp-block-button__link:hover, .tfm-submit:hover { background: #c78d0b; color: var(--navy-deep); }
	.wp-block-button__link:hover::after { transform: translateX(4px); }
}
.wp-block-button.is-style-navy .wp-block-button__link { background: var(--navy); color: #fff; }
.wp-block-button.is-style-white .wp-block-button__link { background: #fff; color: var(--navy); }
@media (hover: hover) and (pointer: fine) {
	.wp-block-button.is-style-navy .wp-block-button__link:hover { background: var(--navy-deep); color: #fff; }
	.wp-block-button.is-style-white .wp-block-button__link:hover { background: var(--tint); color: var(--navy-deep); }
}
.wp-block-button.is-style-navy .wp-block-button__link:focus-visible { outline-color: var(--navy-deep); }

/* Text link with arrow ("Read more") */
.wp-block-button.is-style-text-arrow .wp-block-button__link { background: transparent; color: var(--navy); padding: 0.8rem 0.25rem; }
@media (hover: hover) and (pointer: fine) {
	.wp-block-button.is-style-text-arrow .wp-block-button__link:hover { background: transparent; color: var(--navy-deep); }
}
.wp-block-button.is-style-text-arrow .wp-block-button__link:active { transform: none; opacity: 0.8; }
.wp-block-button.tfm-on-dark .wp-block-button__link { color: #fff; }
.wp-block-button.tfm-on-dark .wp-block-button__link:focus-visible { outline-color: #fff; }
@media (hover: hover) and (pointer: fine) {
	.wp-block-button.tfm-on-dark .wp-block-button__link:hover { color: #fff; }
}
.wp-block-buttons { gap: 0.5rem 1.25rem; align-items: center; }

.tfm-link { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 500; }
.tfm-arrow { flex: none; width: 2.4rem; height: 0.75rem; transition: transform var(--t-base) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .tfm-link:hover .tfm-arrow { transform: translateX(4px); } }

/* ==========================================================================
   Header: on the page colour, one line, logo left, pill on the right.
   ========================================================================== */
.tfm-header { position: sticky; top: 0; z-index: 50; background: var(--paper); }
.tfm-header__bar { min-height: var(--header-h); gap: 1.5rem; }
.tfm-header .tfm-logo { margin: 0; flex: none; line-height: 0; }
.tfm-header .tfm-logo img { width: auto; height: 3.5rem; max-width: none; }
.tfm-nav { margin-inline-start: auto; }
.tfm-nav .wp-block-navigation-item__content {
	position: relative; padding: 0.5rem 0.15rem; color: var(--navy); text-decoration: none; font-family: var(--body); font-weight: 400;
	background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 3px no-repeat;
	transition: background-size var(--t-base) var(--ease-out);
}
.tfm-nav .wp-block-navigation__container { gap: clamp(1rem, 2.2vw, 2.25rem); }
@media (hover: hover) and (pointer: fine) { .tfm-nav .wp-block-navigation-item__content:hover { background-size: 100% 3px; } }
.tfm-nav .wp-block-navigation-item__content[aria-current="page"] { background-size: 100% 3px; }
.tfm-header__actions { gap: 1.25rem; flex: none; }
.tfm-header__cta .wp-block-button__link { background: var(--navy); color: #fff; padding-block: 0.7rem; min-height: 2.75rem; }
@media (hover: hover) and (pointer: fine) { .tfm-header__cta .wp-block-button__link:hover { background: var(--navy-deep); color: #fff; } }
.tfm-call { display: inline-flex; gap: 0.4rem; color: var(--navy); font-weight: 500; text-decoration: none; white-space: nowrap; min-height: 2.75rem; align-items: center; }
.tfm-call__lead { font-weight: 400; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .tfm-call:hover .tfm-call__num { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 0.25em; } }

@media (max-width: 1099px) {
	.tfm-header .tfm-call__num { display: none; }
	.tfm-header .tfm-call__lead { color: var(--navy); font-weight: 500; }
}
@media (max-width: 899px) {
	.tfm-header { --header-h: 4rem; }
	.tfm-header .tfm-logo img { height: 2.9rem; }
	.tfm-header .tfm-header__cta { display: none; }
	.tfm-header__bar { gap: 0.75rem; }
	.tfm-nav { margin-inline-start: 0; order: 3; }
	.tfm-header__actions { margin-inline-start: auto; order: 2; }
	.tfm-header .tfm-call { padding-inline: 1.1rem; border: 1px solid var(--navy); border-radius: var(--pill); }
}
.wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close { color: var(--navy); padding: 0.625rem; min-width: 2.75rem; min-height: 2.75rem; align-items: center; justify-content: center; }
.wp-block-navigation__responsive-container.is-menu-open { background: var(--paper) !important; color: var(--navy) !important; padding: 1.25rem var(--gutter) 2rem; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-family: var(--display); font-size: 1.75rem; font-weight: 400; padding: 0.55rem 0; color: var(--navy); }
@media (prefers-reduced-motion: no-preference) {
	.wp-block-navigation__responsive-container.is-menu-open { animation: tfm-fade var(--t-base) var(--ease-out); }
	@keyframes tfm-fade { from { opacity: 0; } }
	@supports (animation-timeline: scroll()) {
		.tfm-header { animation: tfm-header-lift linear both; animation-timeline: scroll(); animation-range: 0 64px; }
		@keyframes tfm-header-lift { to { box-shadow: 0 10px 24px -16px rgb(24 44 88 / 0.35); } }
	}
}

/* ==========================================================================
   Home: hero card. Photograph under a navy wash so the white headline is readable.
   ========================================================================== */
.tfm-hero { padding-block: clamp(0.25rem, 1vw, 1rem) var(--section-y); }
.tfm-hero__card {
	position: relative; overflow: hidden; border-radius: var(--r-card);
	min-height: clamp(26rem, 44vw, 34rem); display: flex; align-items: center;
	padding: clamp(2rem, 5vw, 5rem);
	background:
		linear-gradient(90deg, rgb(24 44 88 / 0.9) 0%, rgb(24 44 88 / 0.74) 40%, rgb(24 44 88 / 0.08) 78%),
		url("assets/images/hero-wide.jpg") 72% 60% / cover no-repeat;
	background-color: var(--navy);
}
.tfm-hero__copy { max-width: 40rem; }
.tfm-hero__copy > * { margin-block: 0; }
.tfm-hero .tfm-hero__title { color: #fff; line-height: 1.2; font-weight: 400; }
.tfm-hero__lead { margin-block-start: 1.5rem !important; max-width: 32rem; color: rgb(255 255 255 / 0.94); line-height: 1.65; }
.tfm-hero__actions { margin-block-start: 2rem !important; }
@media (max-width: 899px) {
	.tfm-hero__card { background: linear-gradient(180deg, rgb(24 44 88 / 0.8), rgb(24 44 88 / 0.68)), url("assets/images/hero-wide.jpg") 70% 60% / cover no-repeat; background-color: var(--navy); align-items: flex-end; min-height: 28rem; }
}

/* ==========================================================================
   Sections and outlined cards
   ========================================================================== */
.tfm-section { padding-block: 0 var(--section-y); }
.tfm-section__title { margin-block: 0 clamp(1rem, 0.75rem + 1vw, 1.5rem) !important; }
.tfm-section__title--spaced { margin-block-start: clamp(3rem, 2rem + 4vw, 5rem) !important; }
.tfm-mark { font-family: var(--body); font-variant-numeric: tabular-nums; color: var(--gold-ink); font-weight: 500; }

.tfm-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.25rem, 2.5vw, 2.25rem); }
.tfm-card { margin: 0; display: flex; }
.tfm-card__link {
	display: flex; flex-direction: column; gap: 1.5rem; flex: 1; min-width: 0;
	padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); color: inherit; text-decoration: none;
	border: 1px solid var(--line); border-radius: var(--r-card);
	transition: background-color var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.tfm-card__head { display: flex; align-items: center; gap: 1.1rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.tfm-card__icon {
	flex: none; display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%;
	background: var(--gold); color: var(--navy); font-family: var(--display); font-weight: 500; font-size: 1.25rem;
}
.tfm-card__title { font-family: var(--display); font-weight: 400; font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.55rem); line-height: 1.25; color: var(--navy); }
.tfm-card__body { flex: 1; color: var(--text); line-height: 1.7; }
.tfm-card__more { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--navy); font-weight: 500; }
.tfm-card__more .tfm-arrow { width: 2.4rem; }
@media (hover: hover) and (pointer: fine) {
	.tfm-card__link:hover { background: var(--white); border-color: var(--navy); }
	.tfm-card__link:hover .tfm-arrow { transform: translateX(6px); }
}
.tfm-card__link:active { transform: scale(0.99); }
@media (max-width: 799px) { .tfm-cards { grid-template-columns: 1fr; } }

/* Schedule rows and compact lists */
.tfm-schedule { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--navy); }
.tfm-schedule__item + .tfm-schedule__item { border-top: 1px solid var(--line); }
.tfm-row { display: grid; grid-template-columns: 3.25rem minmax(0, 1.05fr) minmax(0, 1fr) 2.4rem; align-items: baseline; gap: 0.5rem 2rem; padding: 1.5rem 0.75rem; color: inherit; text-decoration: none; }
.tfm-row__title { font-family: var(--display); color: var(--navy); font-size: 1.5rem; line-height: 1.25; }
.tfm-row__summary { color: var(--muted); }

.tfm-plist__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(1.5rem, 4vw, 4rem); }
.tfm-plist__link {
	display: grid; grid-template-columns: 2.6rem 1fr; align-items: baseline; padding: 0.9rem 0.25rem;
	color: var(--navy); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line);
}
@media (hover: hover) and (pointer: fine) {
	.tfm-plist__link:hover span:last-child { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
}
.tfm-plist__link[aria-current="page"] span:last-child { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 3px; text-underline-offset: 0.2em; }
@media (max-width: 699px) { .tfm-plist__list { grid-template-columns: 1fr; } }

/* ==========================================================================
   Split panel: Section 34 beside a photograph and a contact prompt
   ========================================================================== */
.tfm-clause { padding-block: 0 var(--section-y); }
.tfm-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-radius: var(--r-card); overflow: hidden; background: var(--tint); }
.tfm-panel__copy { padding: clamp(2rem, 1rem + 4vw, 4.5rem); align-self: center; }
.tfm-panel__copy > * { margin-block: 0; }
.tfm-clause__quote { margin: 0 0 2rem; padding: 0; border: 0; }
.tfm-clause__quote p { font-family: var(--display); font-weight: 300; color: var(--navy); font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem); line-height: 1.55; margin: 0; }
.tfm-clause__quote cite { display: block; margin-top: 1.25rem; font-style: normal; font-size: 0.9375rem; color: var(--muted); }
.tfm-panel__media {
	display: grid; align-items: center; padding: clamp(1.5rem, 1rem + 3vw, 3rem); min-height: 22rem;
	background: linear-gradient(rgb(24 44 88 / 0.08), rgb(24 44 88 / 0.08)), url("assets/images/court.jpg") 50% 40% / cover no-repeat;
	background-color: var(--navy);
}
.tfm-panel__card { background: rgb(24 44 88 / 0.88); color: #fff; border-radius: var(--r-card); padding: clamp(1.5rem, 1rem + 2vw, 2.25rem); }
.tfm-panel__card > * { margin-block: 0; }
.tfm-panel__card p { font-size: var(--wp--preset--font-size--lead); line-height: 1.55; margin-bottom: 1.5rem; }
@media (max-width: 899px) { .tfm-panel { grid-template-columns: 1fr; } .tfm-panel__media { order: -1; min-height: 18rem; } }

/* ==========================================================================
   People: centred portrait, name, role and a pill
   ========================================================================== */
.tfm-section--team { padding-top: 0; }
.tfm-people { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; gap: clamp(2rem, 4vw, 3rem) 1.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: center; }
@media (min-width: 640px) { .tfm-people { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tfm-people { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tfm-people--strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5rem; }
.tfm-people--strip .tfm-people__item { width: min(100%, 15rem); }
.tfm-people__item { margin: 0; width: 100%; display: flex; }
.tfm-person { display: flex; flex-direction: column; align-items: center; text-align: center; color: inherit; text-decoration: none; flex: 1; min-width: 0; }
.tfm-person__photo { display: block; width: 100%; max-width: 15rem; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--r-img); background: var(--tint); }
.tfm-person__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
.tfm-person__initials { display: grid; place-items: center; height: 100%; font-family: var(--display); font-weight: 500; font-size: 2.5rem; color: var(--navy); }
.tfm-person__name { margin-top: 1.1rem; font-family: var(--display); font-weight: 500; font-size: 1.2rem; line-height: 1.3; color: var(--navy); }
.tfm-person__role { margin-top: 0.15rem; font-size: 0.9375rem; color: var(--muted); line-height: 1.4; }
.tfm-person__cta {
	margin-top: auto; padding: 0.65rem 1.3rem; border-radius: var(--pill); background: var(--navy); color: #fff; font-size: 0.875rem; font-weight: 500;
	transition: background-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.tfm-person__role + .tfm-person__cta { margin-top: 1.1rem; }
.tfm-person:active .tfm-person__cta { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
	.tfm-person:hover .tfm-person__photo img { transform: scale(1.04); }
	.tfm-person:hover .tfm-person__cta { background: var(--navy-deep); }
}
.tfm-section--team .wp-block-buttons { margin-top: 2rem; }

/* Written "About" feature: portrait beside name, role, biography and key facts */
.tfm-feature {
	display: grid; grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
	margin-top: 2.5rem; padding: clamp(1.5rem, 1rem + 2.5vw, 3rem); text-align: left;
	background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card);
}
.tfm-feature__photo { border-radius: var(--r-img); overflow: hidden; aspect-ratio: 4 / 5; background: var(--tint); }
.tfm-feature__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.tfm-feature__title { margin: 0; font-size: clamp(1.5rem, 1.25rem + 1vw, 2.125rem); }
.tfm-feature__role { margin: 0.4rem 0 0; font-family: var(--display); font-weight: 500; color: var(--gold-ink); }
.tfm-feature__text { margin-top: 1.25rem; }
.tfm-feature__text p { margin: 0 0 1rem; max-width: 40rem; }
.tfm-feature__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.5rem; margin: 1.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.tfm-feature__fact { display: grid; gap: 0.15rem; align-content: start; }
.tfm-feature__fact dt { font-size: 0.875rem; color: var(--muted); }
.tfm-feature__fact dd { margin: 0; color: var(--navy); font-weight: 500; line-height: 1.4; }
.tfm-feature__link { margin-top: 1.5rem; }
.tfm-feature + .wp-block-buttons { margin-top: 2rem; }
@media (max-width: 899px) {
	.tfm-feature { grid-template-columns: 1fr; }
	.tfm-feature__photo { max-width: 22rem; }
	.tfm-feature__facts { grid-template-columns: 1fr; }
}
.tfm-people-attorneys { margin: 0; }

/* Other practice areas panel */
.tfm-other-wrap { padding-block: 0 var(--section-y); }
.wp-block-group.is-style-tint { background: var(--tint); }
.tfm-other { border-radius: var(--r-card); padding: clamp(1.75rem, 1rem + 3vw, 3.5rem); }
.tfm-other > * { margin-block: 0; }
.tfm-other .tfm-section__title { margin-block-end: 1.5rem !important; }
.tfm-other .tfm-plist__link { border-color: #cfd5e5; }

/* Gold contact card */
.tfm-band-wrap { padding-block: 0 var(--section-y); }
.wp-block-group.is-style-gold-band { background: var(--gold); color: var(--navy-deep); }
.tfm-band { border-radius: var(--r-card); padding: clamp(2rem, 1rem + 4vw, 4.5rem); }
.tfm-band__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.tfm-band__lead > *, .tfm-band__details > * { margin-block: 0; }
.tfm-band__title { color: var(--navy-deep); }
.tfm-band__lead p { margin-top: 1rem; max-width: 30rem; font-size: var(--wp--preset--font-size--lead); line-height: 1.55; color: var(--navy-deep); }
.tfm-band__lead .wp-block-buttons { margin-top: 1.75rem; }
.tfm-band__details { display: grid; gap: 1.25rem; }
.tfm-band a { color: var(--navy-deep); }
.tfm-band :focus-visible { outline-color: var(--navy-deep); }
.tfm-band .tfm-firm-stack { display: grid; gap: 0.15rem; }
.tfm-band .tfm-firm { font-weight: 500; font-size: 1.125rem; }
.tfm-band .tfm-address { font-size: 1.125rem; }
@media (max-width: 799px) { .tfm-band__grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Inner page header
   ========================================================================== */
.tfm-pagehead { padding-block: clamp(2rem, 1.25rem + 3vw, 4rem) clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.tfm-pagehead > * { margin-block: 0; }
.tfm-pagehead h1 { max-width: 22ch; }
.tfm-crumb { font-size: 0.9375rem; color: var(--muted); margin-block-end: 1rem !important; }
.tfm-crumb a { color: var(--muted); }
.tfm-lead, .tfm-pagehead .wp-block-post-excerpt { font-size: var(--wp--preset--font-size--lead); line-height: 1.65; max-width: 44rem; color: var(--text); }
.tfm-pagehead .wp-block-post-excerpt__excerpt { margin: 0; }
.tfm-person-role { font-family: var(--display); color: var(--gold-ink); font-weight: 500; margin-block-start: 0.75rem !important; }

/* ==========================================================================
   Detail pages (practice area, person)
   ========================================================================== */
.tfm-detail { padding-block: 0 var(--section-y); }
.tfm-detail__grid { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.tfm-detail__grid--person { grid-template-columns: 15rem minmax(0, 1fr); }
.tfm-detail__grid--person .tfm-aside { order: -1; }
.tfm-detail__main { max-width: 46rem; min-width: 0; }
.tfm-aside { position: sticky; top: calc(var(--header-h) + 1.5rem); display: grid; gap: 1.25rem; }
.tfm-aside > * { margin-block: 0; }
.tfm-detail__grid:not(.tfm-detail__grid--person) .tfm-aside { padding: clamp(1.5rem, 1rem + 1.5vw, 2rem); border: 1px solid var(--line); border-radius: var(--r-card); }
.tfm-aside__title, .tfm-footer__title { font-size: 1.25rem !important; font-weight: 500 !important; }
.tfm-aside__title--spaced { margin-block-start: 1rem !important; }
.tfm-aside .tfm-plist__list { grid-template-columns: 1fr; }
.tfm-aside .tfm-call { justify-self: start; }
@media (max-width: 959px) {
	.tfm-detail__grid, .tfm-detail__grid--person { grid-template-columns: minmax(0, 1fr); }
	.tfm-aside { position: static; }
	.tfm-detail__grid--person .tfm-aside { order: 0; }
}

.tfm-prose { font-size: var(--wp--preset--font-size--base); }
.tfm-prose > * + * { margin-block-start: 1.15rem; }
.tfm-prose h2 { margin-block: clamp(2.5rem, 2rem + 2vw, 3.5rem) 0.75rem !important; font-size: clamp(1.5rem, 1.25rem + 0.9vw, 2rem); }
.tfm-prose h2:first-child { margin-block-start: 0 !important; }
.tfm-prose h3 { margin-block: 2rem 0.5rem !important; font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem); }
.tfm-prose p { max-width: 42rem; }

/* Clause lists: (a) (b) (c), as in legal drafting. Long lists split into two columns. */
.wp-block-list.is-style-clauses { list-style: none; padding: 0; margin-block: 1.15rem; counter-reset: clause; }
.wp-block-list.is-style-clauses > li { counter-increment: clause; position: relative; padding: 0.4rem 0 0.4rem 3rem; margin: 0; break-inside: avoid; }
.wp-block-list.is-style-clauses > li::before {
	content: "(" counter(clause, lower-alpha) ")"; position: absolute; left: 0; top: 0.4rem; width: 2.6rem;
	font-variant-numeric: tabular-nums; color: var(--gold-ink); font-weight: 500;
}
@media (min-width: 720px) { .wp-block-list.is-style-clauses.is-cols { columns: 2 17rem; column-gap: 2.5rem; } }
.tfm-prose .wp-block-list.is-style-clauses.is-cols { max-width: none; }

.tfm-facts { margin: 0; display: grid; gap: 1rem; }
.tfm-facts__row { display: grid; gap: 0.1rem; }
.tfm-facts dt { font-size: 0.875rem; color: var(--muted); }
.tfm-facts dd { margin: 0; color: var(--navy); font-weight: 500; line-height: 1.4; }
.tfm-portrait { margin: 0; }
.tfm-portrait img { display: block; width: 100%; max-width: 15rem; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-img); }

.tfm-head { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 2.4rem; gap: 1rem; align-items: center; color: inherit; text-decoration: none; padding: 0.25rem 0; }
.tfm-head__photo { display: block; width: 4.5rem; aspect-ratio: 1; overflow: hidden; border-radius: 50%; background: var(--tint); }
.tfm-head__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.tfm-head__text { display: grid; gap: 0.1rem; }
.tfm-head__name { font-family: var(--display); font-weight: 500; color: var(--navy); line-height: 1.3; }
.tfm-head__role { font-size: 0.9375rem; color: var(--muted); line-height: 1.35; }
@media (hover: hover) and (pointer: fine) {
	.tfm-head:hover .tfm-head__name { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
	.tfm-head:hover .tfm-arrow { transform: translateX(4px); }
}

/* ==========================================================================
   Contact page and form
   ========================================================================== */
.tfm-contact { padding-block: 0 var(--section-y); }
.tfm-contact__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.tfm-contact__form > * + * { margin-top: 1.5rem; }
.tfm-contact__form .wp-block-post-content > p:first-child { font-size: var(--wp--preset--font-size--lead); line-height: 1.6; max-width: 36rem; }
.tfm-contact__details { display: grid; gap: 0.9rem; padding: clamp(1.5rem, 1rem + 1.5vw, 2rem); border: 1px solid var(--line); border-radius: var(--r-card); }
.tfm-contact__details > * { margin-block: 0; }
.tfm-contact__details .tfm-aside__title { margin-block-start: 0.9rem !important; }
.tfm-contact__details .tfm-aside__title:first-child { margin-block-start: 0 !important; }
.tfm-firm-stack { display: grid; gap: 0.15rem; }
.tfm-firm, .tfm-address { line-height: 1.55; }
.tfm-address { display: grid; }
@media (max-width: 899px) { .tfm-contact__grid { grid-template-columns: 1fr; } }

.tfm-form { display: grid; gap: 1.4rem; max-width: 40rem; }
.tfm-form[hidden], .tfm-form-wrap [hidden] { display: none !important; }
.tfm-form *, .tfm-form *::before, .tfm-form *::after { box-sizing: border-box; }
.tfm-field { display: grid; gap: 0.45rem; align-content: start; min-width: 0; }
.tfm-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; align-items: start; }
@media (max-width: 639px) { .tfm-field-row { grid-template-columns: 1fr; } }
.tfm-form label { font-weight: 500; color: var(--navy); line-height: 1.35; }
.tfm-req { font-weight: 400; color: var(--muted); font-size: 0.9375rem; }
.tfm-form input[type="text"], .tfm-form input[type="tel"], .tfm-form input[type="email"], .tfm-form select, .tfm-form textarea {
	width: 100%; font: inherit; font-size: 1rem; color: var(--navy-deep); background: #fff;
	border: 1px solid #7b86a6; border-radius: var(--r-field); padding: 0.8rem 1rem; min-height: 3rem;
	transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.tfm-form textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
.tfm-form select { appearance: none; background: #fff var(--select-caret) right 1rem center / 0.9rem no-repeat; padding-right: 2.5rem; }
.tfm-form input:focus, .tfm-form select:focus, .tfm-form textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--gold); }
.tfm-form [aria-invalid="true"] { border-color: var(--danger); border-width: 2px; padding: calc(0.8rem - 1px) calc(1rem - 1px); }
.tfm-hint { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.tfm-error { margin: 0; font-size: 0.9375rem; font-weight: 500; color: var(--danger); }
.tfm-error[hidden] { display: none; }
.tfm-field--check { grid-template-columns: 1.5rem minmax(0, 1fr); column-gap: 0.85rem; align-items: start; }
.tfm-field--check input { width: 1.4rem; height: 1.4rem; margin: 0.15rem 0 0; accent-color: var(--navy); }
.tfm-field--check label { font-weight: 400; color: var(--text); }
.tfm-field--check .tfm-error { grid-column: 2; }
.tfm-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.tfm-submit { justify-self: start; min-height: 3.25rem; padding-inline: 2rem; }
.tfm-submit[disabled] { opacity: 0.7; cursor: progress; }
.tfm-form__status:focus { outline: none; }
.tfm-form__done { padding: 1.75rem; border: 1px solid var(--gold); border-radius: var(--r-card); max-width: 36rem; background: #fff; }
.tfm-form__done h3 { margin: 0 0 0.5rem; }
.tfm-form__done p { margin: 0; }
.tfm-form__alert { padding: 0.9rem 1rem; border: 2px solid var(--danger); border-radius: var(--r-field); color: var(--danger); font-weight: 500; margin-bottom: 1.25rem; }

/* ==========================================================================
   Footer: navy, two halves, logo on a white plate so the navy mark stays legible
   ========================================================================== */
.tfm-footer { margin-top: 0; }
.tfm-footer > * { margin-block: 0 !important; }
.tfm-footer__main { background: var(--navy); color: rgb(255 255 255 / 0.86); padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.tfm-footer__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); }
.tfm-footer__grid > * > * { margin-block: 0; }
.tfm-footer__brand { display: grid; gap: 0.85rem; align-content: start; }
.tfm-footer__brand > * { margin-block: 0; }
.tfm-footer .tfm-logo { line-height: 0; }
.tfm-footer .tfm-logo img { display: block; width: 9.5rem; height: auto; background: #fff; padding: 0.85rem 1rem; border-radius: var(--r-img); }
.tfm-footer__motto { max-width: 30rem; margin-block: 0.5rem 0.75rem !important; color: rgb(255 255 255 / 0.86); }
.tfm-footer__title { margin-block: 0.5rem 0.25rem !important; color: #fff; font-family: var(--display); }
.tfm-footer a { color: #fff; text-decoration-color: rgb(255 255 255 / 0.4); }
.tfm-footer :focus-visible { outline-color: #fff; }
.tfm-footer .tfm-firm-stack { display: grid; gap: 0.15rem; }
.tfm-footer__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; padding-inline-start: clamp(1.5rem, 4vw, 4rem); border-inline-start: 1px solid rgb(255 255 255 / 0.2); align-content: start; }
.tfm-footer__col { display: grid; gap: 0.5rem; align-content: start; }
.tfm-footer__col > * { margin-block: 0; }
.tfm-flinks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.tfm-flinks a, .tfm-footer__nav .wp-block-navigation-item__content { display: inline-block; padding: 0.3rem 0; color: rgb(255 255 255 / 0.86); text-decoration: none; font-weight: 400; }
@media (hover: hover) and (pointer: fine) {
	.tfm-flinks a:hover, .tfm-footer__nav .wp-block-navigation-item__content:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 0.25em; }
}
.tfm-footer__nav .wp-block-navigation__container { gap: 0.35rem; }
.tfm-social { margin-top: 0.5rem; }
.tfm-social .wp-block-social-link { background: transparent; }
.tfm-social .wp-block-social-link a, .tfm-social .wp-block-social-link-anchor { padding: 0.625rem; min-width: 2.75rem; min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; }
.tfm-social .wp-block-social-link svg { width: 1.5rem; height: 1.5rem; fill: #fff; }
.tfm-social .wp-block-social-links { gap: 0.25rem; }
.tfm-footer__legal { background: var(--navy-deep); color: rgb(255 255 255 / 0.86); padding-block: 1.1rem; font-size: 0.9375rem; }
.tfm-footer__legal .tfm-firm { color: rgb(255 255 255 / 0.86); margin: 0; }
@media (max-width: 899px) { .tfm-footer__grid { grid-template-columns: 1fr; } .tfm-footer__links { padding-inline-start: 0; border-inline-start: 0; padding-top: 1.5rem; border-top: 1px solid rgb(255 255 255 / 0.2); } }

/* ==========================================================================
   Hero entrance: one authored moment on first paint. Content is visible if animation is unavailable.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
	@keyframes tfm-rise { from { opacity: 0; transform: translateY(16px); } }
	.tfm-hero__title, .tfm-hero__lead, .tfm-hero__actions { animation: tfm-rise 700ms var(--ease-out) both; }
	.tfm-hero__lead { animation-delay: 80ms; }
	.tfm-hero__actions { animation-delay: 160ms; }
}

@media print {
	.tfm-header, .tfm-footer .tfm-social, .tfm-band .wp-block-buttons, .tfm-aside .wp-block-buttons { display: none !important; }
	body { color: #000; }
	a { color: #000; text-decoration: none; }
}

/* Touch targets: links a stressed visitor taps with a thumb are at least 44px tall */
@media (pointer: coarse), (max-width: 899px) {
	.tfm-firm, .tfm-flinks a, .tfm-footer__nav .wp-block-navigation-item__content, .tfm-plist__link, .tfm-link { display: inline-flex; align-items: center; min-height: 2.75rem; }
	.tfm-firm-stack { gap: 0; }
	.tfm-footer__nav .wp-block-navigation__container, .tfm-flinks { gap: 0; }
	.tfm-plist__link { display: grid; }
}
