/*
 * ConnectLaw global styles. Design-neutral foundation: tokens get their real
 * values once the homepage concept (v1 or v2) is approved.
 */

/* Tokens */
:root {
	--color-bg: #fff;
	--color-text: #1f2328;
	--color-muted: #57606a;
	--color-accent: #1d3557;
	--color-border: #d8dee4;
	--color-focus: #1d63ed;

	--font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--font-heading: var(--font-body);

	--step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.938rem);
	--step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
	--step-1: clamp(1.25rem, 1.17rem + 0.4vw, 1.5rem);
	--step-2: clamp(1.5rem, 1.35rem + 0.75vw, 2rem);
	--step-3: clamp(1.875rem, 1.6rem + 1.35vw, 2.75rem);

	--space-xs: 0.5rem;
	--space-s: 1rem;
	--space-m: 1.5rem;
	--space-l: 2.5rem;
	--space-xl: 4rem;

	--container: 72rem;
	--gutter: 1rem;
	--radius: 4px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; }
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl { margin-block: 0; }
img, svg, video, iframe { display: block; max-width: 100%; }
img, video { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Base */
body {
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--step-0);
	line-height: 1.6;
}
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
a { color: var(--color-accent); text-underline-offset: 0.15em; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.site-main:focus { outline: none; }

/* Utilities */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.visually-hidden, .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: var(--gutter); top: -100%; z-index: 100; padding: var(--space-xs) var(--space-s); background: var(--color-bg); }
.skip-link:focus { top: var(--space-xs); }

/* Prose (editor content) */
.prose > * + * { margin-top: 1em; }
.prose > :is(h2, h3, h4) { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.35em; }
.prose img { border-radius: var(--radius); }
.prose .alignleft { float: left; margin: 0 var(--space-m) var(--space-s) 0; }
.prose .alignright { float: right; margin: 0 0 var(--space-s) var(--space-m); }
.prose .aligncenter { margin-inline: auto; }
.wp-caption-text { font-size: var(--step--1); color: var(--color-muted); }

/* Header + navigation */
.site-header { border-bottom: 1px solid var(--color-border); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-m); min-height: 4.5rem; flex-wrap: wrap; }
.site-brand { font-weight: 700; font-size: var(--step-1); text-decoration: none; color: var(--color-text); }
.custom-logo { max-height: 3.5rem; width: auto; }
.primary-nav__list, .footer-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-s) var(--space-m); }
.primary-nav a { text-decoration: none; color: var(--color-text); }
.primary-nav a:hover, .primary-nav .current-menu-item > a { color: var(--color-accent); }
.primary-nav .sub-menu { list-style: none; padding-left: var(--space-s); }
.nav-toggle { display: none; }

@media (max-width: 63.99em) {
	.js .nav-toggle {
		display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem;
		background: none; border: 1px solid var(--color-border); border-radius: var(--radius); cursor: pointer;
	}
	.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
		display: block; width: 1.25rem; height: 2px; background: currentColor; content: ''; position: relative;
	}
	.nav-toggle__bar::before { position: absolute; top: -6px; }
	.nav-toggle__bar::after { position: absolute; top: 6px; }
	.primary-nav { flex-basis: 100%; }
	.js .primary-nav:not(.is-open) { display: none; }
	.primary-nav__list { flex-direction: column; padding-bottom: var(--space-s); }
}
@media (min-width: 64em) {
	.primary-nav .menu-item-has-children { position: relative; }
	.primary-nav .sub-menu {
		position: absolute; top: 100%; left: 0; min-width: 14rem; padding: var(--space-xs) 0; z-index: 10;
		background: var(--color-bg); border: 1px solid var(--color-border); display: none;
	}
	.primary-nav .sub-menu a { display: block; padding: var(--space-xs) var(--space-s); }
	.primary-nav .menu-item-has-children:is(:hover, :focus-within) > .sub-menu { display: block; }
}

/* Content layouts */
.site-main { display: block; padding-block: var(--space-l) var(--space-xl); }
.entry { max-width: 48rem; }
.entry__header, .listing__header { margin-bottom: var(--space-m); }
.entry__meta, .card__meta { color: var(--color-muted); font-size: var(--step--1); margin-top: var(--space-xs); }
.rank-math-breadcrumb { font-size: var(--step--1); color: var(--color-muted); margin-bottom: var(--space-s); }
.card-list { display: grid; gap: var(--space-l); grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.card__image { border-radius: var(--radius); margin-bottom: var(--space-s); aspect-ratio: 3 / 2; object-fit: cover; }
.card__title { font-size: var(--step-1); }
.card__title a { text-decoration: none; color: var(--color-text); }
.card__excerpt { margin-top: var(--space-xs); }
.pagination { margin-top: var(--space-l); }
.nav-links { display: flex; gap: var(--space-s); flex-wrap: wrap; }

/* Footer */
.site-footer { border-top: 1px solid var(--color-border); padding-block: var(--space-l); font-size: var(--step--1); color: var(--color-muted); }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-m); }

/* Footer "Our offices" block (connectlaw_locations_list) */
.cl-offices { flex-basis: 100%; }
.cl-offices__heading { margin-bottom: var(--space-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.cl-offices__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--space-s) var(--space-m); margin: 0; padding: 0; list-style: none; }
.cl-offices__name { display: block; font-weight: 600; color: inherit; }
.cl-offices .cl-address { margin: 2px 0; font-style: normal; }
.cl-offices__phone { color: inherit; }

/* Forms (ConnectLaw Forms mu-plugin) */
.cl-form { display: grid; gap: var(--space-s); max-width: 36rem; }
.cl-form__field { display: grid; gap: 0.25rem; }
.cl-form label { font-weight: 600; font-size: var(--step--1); }
.cl-form input:not([type="hidden"]), .cl-form textarea {
	width: 100%; padding: 0.65rem 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg);
}
.cl-form textarea { resize: vertical; }
.cl-form__required { color: var(--color-muted); }
.cl-form__submit {
	justify-self: start; padding: 0.75rem 1.5rem; border: 0; border-radius: var(--radius);
	background: var(--color-accent); color: #fff; font-weight: 600; cursor: pointer;
}
.cl-form__submit:disabled { opacity: 0.6; cursor: progress; }
.cl-form__message { padding: var(--space-xs) var(--space-s); border-radius: var(--radius); }
.cl-form__message--success { background: #e7f5ec; color: #14532d; }
.cl-form__message--error { background: #fdecec; color: #7f1d1d; }
.cl-form__recaptcha { font-size: var(--step--1); color: var(--color-muted); }
/* The badge may be hidden because the form shows Google's required notice (.cl-form__recaptcha). */
.grecaptcha-badge { visibility: hidden; }

/* Connect page: Acuity booking, then the enquiry form */
.entry--connect { max-width: var(--container); }
.cl-booking iframe { display: block; width: 100%; min-height: 800px; border: 0; }
.cl-enquiry { margin-top: var(--space-xl); max-width: 36rem; }
.cl-enquiry h2 { margin-bottom: var(--space-m); }
