/* ==========================================================================
   Unified Automation — visual polish v3
   Selectors verified against the live DOM:
     main#tp_content > #primary.content-area > article.post > .box-content
     headings are .wp-block-heading, buttons are .wp-block-button__link
     header[role="banner"], nav#site-navigation.main-navigation
   Additive only. No content is hidden, moved or replaced.
   ========================================================================== */

:root {
	--ua-navy: #16294a;
	--ua-navy-deep: #1a1a2e;
	--ua-blue: #2e75b6;
	--ua-blue-mid: #2a4a82;
	--ua-blue-pale: #d9e1f2;
	--ua-blue-wash: #f2f5fb;
	--ua-steel: #c5cee0;
	--ua-white: #ffffff;

	--ua-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--ua-fast: 0.18s;
	--ua-med: 0.32s;
	--ua-slow: 0.55s;

	--ua-shadow-sm: 0 1px 2px rgba(22, 41, 74, 0.06), 0 2px 8px rgba(22, 41, 74, 0.05);
	--ua-shadow-md: 0 6px 18px rgba(22, 41, 74, 0.10), 0 2px 6px rgba(22, 41, 74, 0.06);
	--ua-shadow-lg: 0 18px 40px rgba(22, 41, 74, 0.14), 0 4px 12px rgba(22, 41, 74, 0.08);
	--ua-shadow-xl: 0 28px 60px rgba(22, 41, 74, 0.18), 0 8px 20px rgba(22, 41, 74, 0.10);

	--ua-radius: 6px;
	--ua-radius-lg: 10px;
}

/* --------------------------------------------------------------------------
   1. Article typography — .box-content is the real wrapper
   -------------------------------------------------------------------------- */

body article .box-content p,
body .content-area .box-content p,
body .wp-block-paragraph {
	line-height: 1.78;
	letter-spacing: 0.005em;
}

body article .box-content h2,
body .wp-block-heading:not(.screen-reader-text),
body .content-area h2 {
	line-height: 1.22;
	letter-spacing: -0.014em;
	text-wrap: balance;
	color: var(--ua-navy);
	margin-top: 1.9em;
	margin-bottom: 0.7em;
	padding-bottom: 0.3em;
}

/* Signature accent rule under every section heading */
body article .box-content h2::after,
body .wp-block-heading:not(.screen-reader-text)::after {
	content: "";
	display: block;
	width: 56px;
	height: 3px;
	margin-top: 0.42em;
	border-radius: 3px;
	background: linear-gradient(90deg, var(--ua-blue) 0%, var(--ua-blue-mid) 100%);
	transition: width var(--ua-slow) var(--ua-ease);
}

body article .box-content h2:hover::after,
body .wp-block-heading:not(.screen-reader-text):hover::after {
	width: 104px;
}

body article .box-content h3,
body .content-area h3:not(.screen-reader-text) {
	color: var(--ua-blue-mid);
	line-height: 1.28;
	margin-top: 1.7em;
	margin-bottom: 0.5em;
}

/* Lead paragraph on single posts */
body.single-post article .box-content > p:first-of-type {
	font-size: 1.1em;
	line-height: 1.7;
	color: var(--ua-navy);
}

/* Readable measure for long-form text */
body.single-post article .box-content > p,
body.single-post article .box-content > ul,
body.single-post article .box-content > ol {
	max-width: 74ch;
}

body article .box-content li {
	line-height: 1.72;
	margin-bottom: 0.42em;
}

body article .box-content strong {
	color: var(--ua-navy);
	font-weight: 600;
}

/* Brand-blue list markers */
body article .box-content ul {
	list-style: none;
	padding-left: 1.45em;
}

body article .box-content ul > li {
	position: relative;
}

body article .box-content ul > li::before {
	content: "";
	position: absolute;
	left: -1.1em;
	top: 0.62em;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--ua-blue);
	opacity: 0.8;
}

/* Body links */
body article .box-content a:not(.wp-block-button__link) {
	color: var(--ua-blue);
	text-decoration-color: rgba(46, 117, 182, 0.35);
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
	transition: color var(--ua-fast) var(--ua-ease),
		text-decoration-color var(--ua-fast) var(--ua-ease),
		text-decoration-thickness var(--ua-fast) var(--ua-ease);
}

body article .box-content a:not(.wp-block-button__link):hover {
	color: var(--ua-blue-mid);
	text-decoration-color: currentColor;
	text-decoration-thickness: 2px;
}

/* --------------------------------------------------------------------------
   2. Post cards — article.post is the real card
   -------------------------------------------------------------------------- */

body .content-area article.post {
	border-radius: var(--ua-radius-lg);
	transition: transform var(--ua-med) var(--ua-ease),
		box-shadow var(--ua-med) var(--ua-ease);
}

body:not(.single) .content-area article.post:hover {
	transform: translateY(-4px);
	box-shadow: var(--ua-shadow-lg);
}

/* --------------------------------------------------------------------------
   3. Navigation — #site-navigation.main-navigation
   -------------------------------------------------------------------------- */

#site-navigation .menu-item > a {
	position: relative;
	transition: color var(--ua-med) var(--ua-ease), opacity var(--ua-med) var(--ua-ease);
}

#site-navigation .menu-item > a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -5px;
	height: 2px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left center;
	opacity: 0.9;
	transition: transform var(--ua-med) var(--ua-ease);
}

#site-navigation .menu-item > a:hover::after,
#site-navigation .menu-item.current-menu-item > a::after {
	transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   4. Header elevation on scroll
   -------------------------------------------------------------------------- */

body.ua-scrolled header[role="banner"] {
	box-shadow: var(--ua-shadow-md);
	transition: box-shadow var(--ua-med) var(--ua-ease);
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */

.wp-block-button__link,
.wp-element-button,
input[type="submit"],
.wpcf7-submit,
button.wp-block-search__button {
	border-radius: var(--ua-radius);
	transition: transform var(--ua-med) var(--ua-ease),
		box-shadow var(--ua-med) var(--ua-ease),
		background-color var(--ua-med) var(--ua-ease),
		filter var(--ua-med) var(--ua-ease);
	will-change: transform;
}

.wp-block-button__link:hover,
.wp-element-button:hover,
input[type="submit"]:hover,
.wpcf7-submit:hover,
button.wp-block-search__button:hover {
	transform: translateY(-2px);
	box-shadow: var(--ua-shadow-md);
	filter: saturate(1.08) brightness(1.03);
}

.wp-block-button__link:active,
.wp-element-button:active,
input[type="submit"]:active,
.wpcf7-submit:active {
	transform: translateY(0);
	box-shadow: var(--ua-shadow-sm);
}

/* --------------------------------------------------------------------------
   6. Article furniture
   -------------------------------------------------------------------------- */

body article .box-content blockquote,
body .wp-block-quote {
	border-left: 3px solid var(--ua-blue);
	background: var(--ua-blue-wash);
	padding: 1.1em 1.5em;
	border-radius: 0 var(--ua-radius) var(--ua-radius) 0;
	box-shadow: var(--ua-shadow-sm);
}

body article .box-content table,
body .wp-block-table table {
	border-radius: var(--ua-radius);
	overflow: hidden;
	box-shadow: var(--ua-shadow-sm);
}

body article .box-content table th,
body .wp-block-table th {
	background: var(--ua-navy);
	color: var(--ua-white);
	font-weight: 600;
	letter-spacing: 0.01em;
}

body article .box-content table tr:hover td,
body .wp-block-table tr:hover td {
	background: rgba(217, 225, 242, 0.4);
	transition: background var(--ua-fast) var(--ua-ease);
}

body article .box-content img,
body .wp-block-image img {
	border-radius: var(--ua-radius);
	box-shadow: var(--ua-shadow-sm);
	transition: transform var(--ua-slow) var(--ua-ease), box-shadow var(--ua-slow) var(--ua-ease);
}

body article .box-content img:hover,
body .wp-block-image img:hover {
	box-shadow: var(--ua-shadow-lg);
}

body article .box-content hr,
body .wp-block-separator {
	border: none;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--ua-steel) 20%, var(--ua-steel) 80%, transparent);
	margin: 2.6em 0;
}

/* --------------------------------------------------------------------------
   7. Widgets in the sidebar / footer
   -------------------------------------------------------------------------- */

.widget_block .wp-block-heading,
.widget .widget-title {
	color: var(--ua-navy);
}

/* --------------------------------------------------------------------------
   8. Reading progress
   -------------------------------------------------------------------------- */

.ua-progress {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	width: 0;
	z-index: 99999;
	background: linear-gradient(90deg, var(--ua-blue) 0%, var(--ua-blue-mid) 60%, var(--ua-navy) 100%);
	box-shadow: 0 0 12px rgba(46, 117, 182, 0.5);
	transition: width 0.1s linear;
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   9. Scroll reveal
   -------------------------------------------------------------------------- */

.ua-reveal {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.75s var(--ua-ease), transform 0.75s var(--ua-ease);
}

.ua-reveal.ua-in {
	opacity: 1;
	transform: none;
}

/* --------------------------------------------------------------------------
   10. Accessibility
   -------------------------------------------------------------------------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: 2px solid var(--ua-blue);
	outline-offset: 3px;
	border-radius: 2px;
}

/* --------------------------------------------------------------------------
   11. Forms
   -------------------------------------------------------------------------- */

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea,
.wpforms-field input,
.wpforms-field textarea,
.wpforms-field select,
.search-field {
	border-radius: var(--ua-radius);
	transition: border-color var(--ua-fast) var(--ua-ease),
		box-shadow var(--ua-fast) var(--ua-ease);
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 textarea:focus,
.wpforms-field input:focus,
.wpforms-field textarea:focus,
.wpforms-field select:focus,
.search-field:focus {
	border-color: var(--ua-blue);
	box-shadow: 0 0 0 3px rgba(46, 117, 182, 0.16);
	outline: none;
}

/* --------------------------------------------------------------------------
   12. Selection and smooth scroll
   -------------------------------------------------------------------------- */

::selection {
	background: rgba(46, 117, 182, 0.22);
	color: var(--ua-navy-deep);
}

html {
	scroll-behavior: smooth;
}

/* --------------------------------------------------------------------------
   13. Back to top
   -------------------------------------------------------------------------- */

.ua-top {
	position: fixed;
	right: 22px;
	bottom: 22px;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: var(--ua-navy);
	color: var(--ua-white);
	font-size: 18px;
	line-height: 44px;
	text-align: center;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	box-shadow: var(--ua-shadow-md);
	transition: opacity var(--ua-med) var(--ua-ease),
		transform var(--ua-med) var(--ua-ease),
		visibility var(--ua-med) var(--ua-ease),
		background-color var(--ua-med) var(--ua-ease);
	z-index: 9998;
}

.ua-top.ua-show {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.ua-top:hover {
	background: var(--ua-blue);
	transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   14. Print
   -------------------------------------------------------------------------- */

@media print {
	.ua-progress,
	.ua-top {
		display: none !important;
	}
}

/* --------------------------------------------------------------------------
   15. Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.ua-reveal {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}

	.wp-block-button__link,
	.wp-element-button,
	body .content-area article.post,
	body article .box-content img,
	.ua-top,
	.ua-progress,
	body article .box-content h2::after,
	body .wp-block-heading::after,
	#site-navigation .menu-item > a::after {
		transition: none !important;
	}

	.wp-block-button__link:hover,
	.wp-element-button:hover,
	body:not(.single) .content-area article.post:hover,
	.ua-top:hover {
		transform: none !important;
	}
}

/* ==========================================================================
   16. PAGE BANNERS — .ua-banner / .ua-banner-title
   Markup exists in page content but no stylesheet ever defined it.
   ========================================================================== */

.ua-banner {
	position: relative;
	margin: 0 0 2.4rem;
	padding: 3.2rem 2rem;
	border-radius: var(--ua-radius-lg);
	background:
		linear-gradient(135deg, var(--ua-navy) 0%, var(--ua-blue-mid) 55%, var(--ua-blue) 130%);
	box-shadow: var(--ua-shadow-lg);
	overflow: hidden;
	text-align: center;
}

/* Subtle engineered grid texture */
.ua-banner::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
	background-size: 44px 44px;
	pointer-events: none;
	opacity: 0.7;
}

/* Soft corner glow */
.ua-banner::after {
	content: "";
	position: absolute;
	top: -40%;
	right: -10%;
	width: 46%;
	height: 180%;
	background: radial-gradient(closest-side, rgba(46, 117, 182, 0.45), transparent);
	pointer-events: none;
}

.ua-banner > * {
	position: relative;
	z-index: 1;
}

.ua-banner-title {
	margin: 0 0 0.45em;
	color: var(--ua-white);
	font-weight: 700;
	font-size: clamp(1.7rem, 3.4vw, 2.6rem);
	line-height: 1.16;
	letter-spacing: -0.02em;
	text-wrap: balance;
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
}

.ua-banner-title::after {
	content: "";
	display: block;
	width: 64px;
	height: 3px;
	margin: 0.5em auto 0;
	border-radius: 3px;
	background: linear-gradient(90deg, var(--ua-blue-pale), var(--ua-white));
	opacity: 0.9;
}

.ua-banner p,
.ua-banner .ua-banner-sub {
	margin: 0 auto;
	max-width: 62ch;
	color: var(--ua-blue-pale);
	font-size: 1.04rem;
	line-height: 1.65;
}

/* ==========================================================================
   17. CLIENT / PARTNER CARDS — .ua-pcards
   ========================================================================== */

.ua-pcards-intro {
	max-width: 68ch;
	margin: 0 auto 2.2rem;
	text-align: center;
	font-size: 1.1rem;
	line-height: 1.7;
	color: var(--ua-navy);
}

.ua-pcards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
	gap: 1.6rem;
	margin: 0 0 2.5rem;
	padding: 0;
	list-style: none;
}

.ua-pcard {
	display: flex;
	flex-direction: column;
	background: var(--ua-white);
	border: 1px solid var(--ua-steel);
	border-radius: var(--ua-radius-lg);
	overflow: hidden;
	box-shadow: var(--ua-shadow-sm);
	transition: transform var(--ua-med) var(--ua-ease),
		box-shadow var(--ua-med) var(--ua-ease),
		border-color var(--ua-med) var(--ua-ease);
}

.ua-pcard:hover {
	transform: translateY(-5px);
	box-shadow: var(--ua-shadow-xl);
	border-color: var(--ua-blue);
}

/* Logo plate — fixed height so mismatched logo files align perfectly */
.ua-pcard-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 124px;
	padding: 1.25rem 1.5rem;
	background: var(--ua-blue-wash);
	border-bottom: 1px solid var(--ua-blue-pale);
}

.ua-pcard-logo img {
	max-width: 82%;
	max-height: 76px;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 0;
	box-shadow: none;
	filter: none;
	opacity: 1;
	transition: filter var(--ua-med) var(--ua-ease),
		opacity var(--ua-med) var(--ua-ease),
		transform var(--ua-med) var(--ua-ease);
}

.ua-pcard:hover .ua-pcard-logo img {
	filter: grayscale(0);
	opacity: 1;
	transform: scale(1.04);
}

.ua-pcard-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 1.3rem 1.4rem 1.4rem;
}

.ua-pcard-tag {
	display: inline-block;
	align-self: flex-start;
	margin-bottom: 0.7rem;
	padding: 0.28em 0.75em;
	border-radius: 999px;
	background: var(--ua-blue-pale);
	color: var(--ua-navy);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.4;
}

.ua-pcard-name {
	margin: 0 0 0.5rem;
	color: var(--ua-navy);
	font-size: 1.12rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.3;
}

.ua-pcard-name::after {
	content: none;
}

.ua-pcard-desc {
	flex: 1 1 auto;
	margin: 0 0 1.1rem;
	color: #4a5568;
	font-size: 0.94rem;
	line-height: 1.62;
}

.ua-pcard-link {
	align-self: flex-start;
	color: var(--ua-blue);
	font-weight: 600;
	font-size: 0.92rem;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	padding-bottom: 1px;
	transition: color var(--ua-fast) var(--ua-ease),
		border-color var(--ua-fast) var(--ua-ease),
		padding-left var(--ua-fast) var(--ua-ease);
}

.ua-pcard-link:hover {
	color: var(--ua-blue-mid);
	border-bottom-color: currentColor;
	padding-left: 3px;
}

@media (max-width: 480px) {
	.ua-pcards {
		grid-template-columns: 1fr;
		gap: 1.2rem;
	}

	.ua-banner {
		padding: 2.3rem 1.2rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ua-pcard,
	.ua-pcard-logo img,
	.ua-pcard-link {
		transition: none !important;
	}

	.ua-pcard:hover,
	.ua-pcard:hover .ua-pcard-logo img {
		transform: none !important;
	}
}
