/* BKA Advocates — theme styles. Mobile first; layout and colours come from theme.json. */

:root {
	--bka-radius: 12px;
	--bka-shadow: 0 10px 30px -14px rgba(1, 56, 74, 0.28);
	--bka-header-h: 72px;
}

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: calc(var(--bka-header-h) + 12px); }
img { height: auto; }

/* ---------- Header ---------- */
.bka-site-header {
	--bka-topbar-h: 0px;
	--bka-adminbar: 0px;
	position: sticky;
	top: calc(var(--bka-adminbar) - var(--bka-topbar-h)); /* desktop top bar scrolls away; logo bar stays */
	z-index: 50;
	background: var(--wp--preset--color--base);
	box-shadow: 0 6px 18px -14px rgba(1, 56, 74, 0.45);
}
.admin-bar .bka-site-header { --bka-adminbar: 46px; }
@media (max-width: 600px) { .admin-bar .bka-site-header { --bka-adminbar: 0px; } }

/* Top bar: desktop only (phones get call/WhatsApp icons in the header instead). */
.bka-topbar { display: none; padding-top: 0 !important; padding-bottom: 0 !important; }
.bka-topbar p { margin: 0; white-space: nowrap; }
.bka-topbar a { text-decoration: none; }
.bka-topbar a:hover { text-decoration: underline; }

.bka-header .bka-logo { flex: none; }
.bka-header .bka-logo img { width: 150px !important; }
.bka-header-cta { display: none !important; }

@media (min-width: 782px) {
	.bka-site-header { --bka-topbar-h: 40px; }
	.admin-bar .bka-site-header { --bka-adminbar: 32px; }
	.bka-topbar { display: block; }
	.bka-topbar > .wp-block-group { height: var(--bka-topbar-h); align-items: center; flex-wrap: nowrap !important; }
	.bka-header .bka-logo img { width: 190px !important; }
	.bka-header-cta { display: flex !important; }
	.bka-contact-icons { display: none !important; }
}

/* Phone header actions: call + WhatsApp (from the bka-forms plugin), then the menu button. */
.bka-contact-icons { display: flex; align-items: center; gap: 2px; }
.bka-contact-icons a {
	display: grid; place-items: center;
	width: 44px; height: 44px;
	border-radius: 999px;
	color: var(--wp--preset--color--accent-3);
}
.bka-contact-icons a:hover { background: var(--wp--preset--color--accent-5); }

.bka-nav .wp-block-navigation-item__content { text-decoration: none; padding: 0.35rem 0; font-weight: 500; }
.bka-nav .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--accent-2); }
.bka-nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
	place-items: center;
	width: 44px; height: 44px;
	border-radius: 999px;
	background: var(--wp--preset--color--accent-3);
	color: var(--wp--preset--color--base);
}
.bka-nav .wp-block-navigation__responsive-container-open svg { width: 24px; height: 24px; }
/* Phones and small tablets (up to 781px) use the overlay menu; core switches at 600px, which is too early for 7 links. */
@media (max-width: 781px) {
	.bka-nav .wp-block-navigation__responsive-container-open { display: grid !important; }
	.bka-nav .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
}
.bka-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 2rem;
	font-size: 1.35rem;
}
.bka-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 1.1rem; }
.bka-header-cta .wp-block-button__link { white-space: nowrap; }

/* ---------- Buttons ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1.5px solid currentColor;
	background: transparent;
	color: var(--wp--preset--color--accent-3);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--accent-3);
	border-color: var(--wp--preset--color--accent-3);
	color: var(--wp--preset--color--base) !important;
}
.bka-on-dark .wp-block-button.is-style-outline > .wp-block-button__link { color: var(--wp--preset--color--base); border-color: rgba(255,255,255,0.7); }
.bka-on-dark .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--base);
	border-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--accent-3) !important;
}
@media (max-width: 599px) {
	.bka-stack-mobile.wp-block-buttons { flex-direction: column; align-items: stretch; }
	.bka-stack-mobile .wp-block-button { width: 100%; }
	.bka-stack-mobile .wp-block-button__link { width: 100%; }
}
.wp-element-button { transition: background-color .15s ease, color .15s ease, transform .15s ease; }
.wp-element-button:active { transform: translateY(1px); }

/* ---------- Small pieces ---------- */
.bka-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-weight: 600;
	margin: 0;
}
.bka-page-hero h1 { text-wrap: balance; }
.bka-page-hero .wp-block-post-title { margin-bottom: 0; }

.bka-card { box-shadow: var(--bka-shadow); }
@media (min-width: 782px) {
	.bka-sticky { position: sticky; top: calc(var(--bka-header-h) + 20px); }
}

.bka-prose > * + h2 { margin-top: 2.2rem; }
.bka-prose h2 { font-size: var(--wp--preset--font-size--x-large); }
.bka-prose h3 { margin-top: 1.6rem; }
.bka-prose > .wp-block-details { margin-top: 0.75rem; }
.bka-prose ul li::marker { color: var(--wp--preset--color--accent-2); }

/* Key facts strip */
.bka-fact {
	height: 100%;
	border-top: 3px solid var(--wp--preset--color--accent-1);
	border-radius: 10px;
}
.bka-fact p { margin: 0; }
.bka-fact .bka-fact__num { font-size: clamp(1.6rem, 4vw, 2rem); font-weight: 700; line-height: 1; color: var(--wp--preset--color--accent-3); }
.bka-fact .bka-fact__label { margin-top: 0.4rem !important; font-size: 0.9rem; line-height: 1.4; color: var(--wp--preset--color--accent-4); }

/* Value list with icons */
.bka-values p { margin: 0; }
.bka-value { align-items: center !important; }
.bka-value .bka-value__dot {
	flex: none; display: grid; place-items: center;
	width: 36px; height: 36px; border-radius: 999px;
	background: var(--wp--preset--color--accent-5); color: var(--wp--preset--color--accent-2);
	font-weight: 700;
}

/* Practice area cards on teal */
.bka-area {
	height: 100%;
	border-radius: 10px;
	transition: transform .15s ease;
}
.bka-area:hover { transform: translateY(-2px); }
.bka-area h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.bka-area h3 a { color: inherit; text-decoration: none; }
.bka-area p { margin: 0; font-size: 0.92rem; line-height: 1.45; color: #CFDDE2; }
@media (min-width: 782px) {
	.bka-area h3 { font-size: 1.3rem; }
	.bka-area p { font-size: 1rem; }
}

/* Consultancy tiles */
.bka-tile { border: 1px solid var(--wp--preset--color--accent-6); border-radius: 10px; height: 100%; }
.bka-tile h3 { margin: 0; font-size: 1.05rem; color: var(--wp--preset--color--accent-3); }
.bka-tile p { margin: 0.35rem 0 0; font-size: 0.95rem; color: var(--wp--preset--color--accent-4); }
@media (max-width: 599px) { .bka-tile p { display: none; } }

/* People */
.bka-person img { aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 10px; width: 100%; }
.bka-person p { margin: 0; }
.bka-person .bka-person__name { font-weight: 600; line-height: 1.3; margin-top: 0.5rem; }
.bka-person .bka-person__role { font-size: 0.9rem; color: var(--wp--preset--color--accent-4); line-height: 1.35; }

/* Team page profiles */
.bka-profile { height: 100%; border: 1px solid var(--wp--preset--color--accent-6); border-radius: var(--bka-radius); overflow: hidden; background: var(--wp--preset--color--base); }
.bka-profile .wp-block-image { margin: 0; }
.bka-profile .wp-block-image img { aspect-ratio: 4 / 5; object-fit: cover; object-position: top; width: 100%; border-radius: 0; }
.bka-profile .wp-block-details { border: 0 !important; padding: 0 !important; background: transparent; }
.bka-profile .wp-block-details summary { font-size: 0.95rem; color: var(--wp--preset--color--accent-2); }
.bka-profile .wp-block-details p { font-size: 0.95rem; }

/* Hero cover */
.bka-hero.wp-block-cover { min-height: min(88vh, 620px) !important; align-items: flex-end; }
/* Gradient overlay: photo visible at the top, text readable at the bottom (phones). */
.bka-hero .wp-block-cover__background {
	opacity: 1 !important;
	background: linear-gradient(180deg, rgba(1,56,74,0.2) 0%, rgba(1,56,74,0.72) 42%, rgba(1,56,74,0.96) 100%) !important;
}
@media (min-width: 782px) {
	.bka-hero .wp-block-cover__background {
		background: linear-gradient(90deg, rgba(1,56,74,0.97) 0%, rgba(1,56,74,0.85) 42%, rgba(1,56,74,0.25) 100%) !important;
	}
}
@media (min-width: 782px) { .bka-hero.wp-block-cover { align-items: center; } }
.bka-hero .wp-block-cover__inner-container > h1,
.bka-hero .wp-block-cover__inner-container > p,
.bka-hero .wp-block-cover__inner-container > .wp-block-buttons {
	/* Keep narrow text left-aligned with the 1200px content edge instead of centring it. */
	margin-left: max(0px, calc((100% - 1200px) / 2)) !important;
	margin-right: auto !important;
}
.bka-hero h1 { max-width: 17ch; text-wrap: balance; }
.bka-hero .wp-block-cover__inner-container > p:not(.bka-eyebrow) { max-width: 34rem; }
.bka-hero .wp-block-cover__inner-container { width: 100% !important; }

/* Recent articles list (home) */
.bka-article-list .wp-block-post { border-bottom: 1px solid var(--wp--preset--color--accent-6); padding-bottom: 1rem; }
.bka-article-list .wp-block-post-title a { text-decoration: none; color: var(--wp--preset--color--contrast); }
.bka-article-list .wp-block-post-title a:hover { color: var(--wp--preset--color--accent-2); }
.bka-article-list .wp-block-post-featured-image img { border-radius: 8px; }
@media (max-width: 599px) {
	.bka-article-list .wp-block-post > .wp-block-group { display: grid !important; grid-template-columns: 104px 1fr; gap: 0 14px; align-items: start; }
	.bka-article-list .wp-block-post-featured-image { grid-row: 1 / span 2; margin: 0 !important; }
	.bka-article-list .wp-block-post-featured-image img { width: 104px; height: 78px; aspect-ratio: auto !important; }
	.bka-article-list .wp-block-post-title { font-size: 1rem !important; margin: 0 !important; }
	.bka-article-list .wp-block-post-date { margin: 0 !important; }
}

/* Accordions (practice areas, fees) */
.wp-block-details { background: var(--wp--preset--color--base); }
.wp-block-details + .wp-block-details { margin-top: 0.75rem; }
.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 1.08rem;
	color: var(--wp--preset--color--accent-3);
	list-style: none;
	position: relative;
	padding-right: 2rem;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
	content: "+";
	position: absolute; right: 0; top: 50%;
	transform: translateY(-50%);
	font-size: 1.4rem; line-height: 1;
	color: var(--wp--preset--color--accent-2);
}
.wp-block-details[open] summary::after { content: "–"; }
.wp-block-details[open] summary { margin-bottom: 0.8rem; }

/* Post cards (Insights) */
.bka-post-card {
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--accent-6);
	transition: box-shadow .2s ease;
}
.bka-post-card:hover { box-shadow: var(--bka-shadow); }
.bka-post-card .wp-block-post-featured-image { margin-top: 0; }
.bka-post-card .wp-block-post-featured-image img { border-radius: 0; }
.bka-post-card .wp-block-post-title a { text-decoration: none; color: var(--wp--preset--color--accent-3); }
.bka-post-card .wp-block-post-title a:hover { color: var(--wp--preset--color--accent-2); }
.bka-post-card .wp-block-post-excerpt__more-text { display: none; }

/* Contact details with icons (phone, email, address, hours).
   Give any paragraph the classes "bka-ci bka-ci--phone" (or --mail, --pin, --clock) to show an icon on its left. */
:root {
	--bka-i-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 5-5.5 10.2-7.4 11.8a1 1 0 0 1-1.2 0C9.5 20.2 4 15 4 10a8 8 0 0 1 16 0'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
	--bka-i-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8.1 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E");
	--bka-i-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-9 5.7a2 2 0 0 1-2 0L2 7'/%3E%3C/svg%3E");
	--bka-i-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
}
.bka-ci { position: relative; padding-left: 1.75em; }
.bka-ci::before {
	content: ""; position: absolute; left: 0; top: 0.3em; width: 1.1em; height: 1.1em;
	background-color: var(--bka-ci-color, var(--wp--preset--color--accent-1));
	-webkit-mask: var(--bka-ci-icon) center / contain no-repeat; mask: var(--bka-ci-icon) center / contain no-repeat;
}
.bka-ci--pin { --bka-ci-icon: var(--bka-i-pin); }
.bka-ci--phone { --bka-ci-icon: var(--bka-i-phone); }
.bka-ci--mail { --bka-ci-icon: var(--bka-i-mail); }
.bka-ci--clock { --bka-ci-icon: var(--bka-i-clock); }
.bka-ci-list > * { margin-block: 0 !important; }
.bka-ci-list > * + * { margin-block-start: 0.6rem !important; }
.bka-topbar { --bka-ci-color: var(--wp--preset--color--sand); }
.bka-topbar .bka-ci { padding-left: 1.5em; }
.bka-topbar .bka-ci::before { top: 50%; transform: translateY(-50%); width: 1em; height: 1em; }
.bka-footer .bka-ci { --bka-ci-color: var(--wp--preset--color--sand); }

/* Call / email buttons get the matching icon. */
.wp-block-button__link[href^="tel:"], .wp-block-button__link[href^="mailto:"] { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; }
.wp-block-button__link[href^="tel:"]::before, .wp-block-button__link[href^="mailto:"]::before {
	content: ""; flex: none; width: 1.05em; height: 1.05em; background-color: currentColor;
	-webkit-mask: var(--bka-i-phone) center / contain no-repeat; mask: var(--bka-i-phone) center / contain no-repeat;
}
.wp-block-button__link[href^="mailto:"]::before { -webkit-mask-image: var(--bka-i-mail); mask-image: var(--bka-i-mail); }

/* Office hours table */
.bka-hours table { border-collapse: collapse; width: 100%; }
.bka-hours table, .bka-hours td, .bka-hours th { border: 0 !important; }
.bka-hours td { padding: 0.45rem 0; border-bottom: 1px solid var(--wp--preset--color--accent-6) !important; }
.bka-hours td:last-child { text-align: right; }

/* Map */
.bka-map iframe { width: 100%; min-height: 320px; border: 0; border-radius: var(--bka-radius); }

/* Footer */
@media (max-width: 781px) {
	/* Two link lists side by side on phones. */
	.bka-footer > .wp-block-columns { display: grid !important; grid-template-columns: 1fr 1fr; gap: 2rem 1.25rem; }
	.bka-footer > .wp-block-columns > .wp-block-column:first-child,
	.bka-footer > .wp-block-columns > .wp-block-column:last-child { grid-column: 1 / -1; }
}
.bka-footer .bka-footer-list { list-style: none; padding: 0; }
.bka-footer .bka-footer-list li { margin-bottom: 0.45rem; }
.bka-footer a { text-decoration: none; }
.bka-footer a:hover { text-decoration: underline; }
.bka-footer p { margin-top: 0.6rem; }
.bka-footer .bka-footer-logo { margin: 0; }
.bka-copyright { line-height: 1.8; }
@media (max-width: 781px) { .bka-footer { padding-bottom: 96px !important; } } /* clear of the floating WhatsApp button */

/* Accessibility */
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent-1);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}

/* Full-width sections sit flush — no white strips between coloured bands, or above the footer. */
.wp-site-blocks > * + * { margin-block-start: 0; }
.wp-block-post-content > .alignfull,
.wp-block-post-content > .alignfull + * { margin-block-start: 0; }
.wp-block-post-content > .alignfull:last-child { margin-block-end: 0; }
.wp-site-blocks main > * + * { margin-block-start: 0; }
