/*
Theme Name: United Trust Financial
Theme URI: https://unitedtrustfinancial.com/
Author: Kevin Plumlee
Author URI: https://unitedtrustfinancial.com/
Description: Lightweight block theme for United Trust Financial. Replaces The7 and WPBakery. Header, footer, and the sidebar call-to-action are editable template parts. Page content is native blocks.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: utf
*/

/* Custom CSS. Colors, type, and spacing live in theme.json.
   Fonts are self-hosted via theme.json fontFace (no Google Fonts). */

:focus-visible {
	outline: 2px solid var(--wp--preset--color--navy);
	outline-offset: 3px;
}

.utf-header :focus-visible {
	outline-color: #ffffff;
}

/* Header sits on the blue sunburst / flag banner. */
.utf-header {
	position: relative;
	z-index: 20;
}

/*
 * The banner is a Cover block, and Cover sets overflow: clip.
 * The mobile Navigation overlay is position: fixed inside that cover.
 * On a phone the clip (and the sticky header) keeps the overlay inside the
 * banner, so the lower links cannot be tapped. Let the core overlay paint
 * over the page instead.
 */
.utf-header__banner.wp-block-cover,
.utf-header__banner .wp-block-cover__inner-container {
	overflow: visible;
}

.utf-header__banner .wp-block-cover__background,
.utf-header__banner .wp-block-cover__image-background {
	pointer-events: none;
}

html.has-modal-open .utf-header {
	position: relative;
	z-index: 100000;
	overflow: visible;
}

.utf-header__banner.wp-block-cover {
	min-height: 210px;
	align-items: center;
}

body:not(.home) .utf-header__banner.wp-block-cover {
	min-height: 150px;
}

.utf-header__banner .wp-block-cover__image-background {
	object-position: 68% 42%;
}

.utf-header .wp-block-site-logo {
	line-height: 0;
}

.utf-header .wp-block-site-logo img {
	width: 340px;
	max-width: 78vw;
	height: auto;
}

.utf-header-rule {
	opacity: 1;
	border: 0;
	margin-top: 0.85rem;
	margin-bottom: 0.85rem;
}

.utf-header__bar {
	align-items: center;
	justify-content: center;
	gap: 0.75rem 1.25rem;
}

.utf-header .wp-block-navigation {
	color: #ffffff;
	font-family: var(--wp--preset--font-family--rufina);
	font-weight: 700;
	font-size: 0.875rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.utf-header .wp-block-navigation a {
	color: #ffffff;
	text-decoration: none;
	padding: 0.35rem 0.7rem;
	border-radius: 2px;
	line-height: 1.2;
}

.utf-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.utf-header .wp-block-navigation .wp-block-navigation-item__content:hover,
.utf-header .wp-block-navigation .wp-block-navigation-item__content:focus-visible {
	background: var(--wp--preset--color--red);
	color: #ffffff;
}

.utf-header-call {
	display: none !important;
}

.utf-header.is-compact {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	box-shadow: 0 2px 10px rgba(23, 56, 97, 0.28);
}

.utf-header.is-compact .utf-header__banner.wp-block-cover {
	min-height: 0;
	padding-top: 0.35rem;
	padding-bottom: 0.35rem;
}

.utf-header.is-compact .wp-block-site-logo img {
	width: 180px;
}

.utf-header.is-compact .utf-header-rule {
	display: none;
}

.utf-header.is-compact .utf-header-call {
	display: flex !important;
}

.utf-header.is-compact + .utf-header-spacer,
.utf-header-spacer {
	display: none;
}

body.utf-header-stuck .utf-header-spacer {
	display: block;
}

/* Mobile: the live The7 header is blank (no logo, white-on-white menu). */
@media (max-width: 781px) {
	.utf-header {
		position: sticky;
		top: 0;
	}

	.utf-header__banner.wp-block-cover,
	body:not(.home) .utf-header__banner.wp-block-cover {
		min-height: 0;
		padding-top: 0.65rem;
		padding-bottom: 0.55rem;
	}

	.utf-header__banner .wp-block-cover__inner-container {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: flex-start;
		gap: 0.5rem;
		padding-left: 0;
		padding-right: 0;
	}

	.utf-header__banner .wp-block-cover__inner-container > * {
		margin-block-start: 0;
		margin-block-end: 0;
	}

	.utf-header .wp-block-site-logo {
		flex: 1 1 auto;
		min-width: 0;
		margin: 0;
		text-align: left;
	}

	.utf-header .wp-block-site-logo img,
	.utf-header.is-compact .wp-block-site-logo img {
		width: auto;
		max-width: 100%;
		max-height: 52px;
	}

	.utf-header-rule {
		display: none;
	}

	.utf-header__bar {
		flex: 0 0 auto;
		flex-wrap: nowrap;
		justify-content: flex-end;
		align-items: center;
		gap: 0.5rem;
		margin-left: auto;
		width: auto;
	}

	.utf-header .wp-block-navigation {
		flex: 0 0 auto;
		width: auto;
		order: 2;
	}

	.utf-header-call {
		display: flex !important;
		order: 1;
		margin: 0;
	}

	.utf-header .utf-header-call .wp-block-button__link {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		width: 48px;
		height: 48px;
		min-width: 48px;
		min-height: 48px;
		padding: 0;
		overflow: hidden;
		font-size: 0;
		line-height: 0;
		letter-spacing: 0;
	}

	.utf-header-call .wp-block-button__link::before {
		content: "";
		width: 22px;
		height: 22px;
		background: center / 22px 22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 3.5h2.2l1.4 3.6-1.7 1a12.5 12.5 0 0 0 6.5 6.5l1-1.7 3.6 1.4v2.2c0 .8-.7 1.6-1.6 1.6C9.2 19.1 4.9 14.8 4.9 5.1c0-.9.8-1.6 1.6-1.6z'/%3E%3C/svg%3E");
	}

	.utf-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
		align-items: center;
		justify-content: center;
		color: #ffffff;
		background: transparent;
		border: 1px solid rgba(255, 255, 255, 0.9);
		border-radius: 2px;
		width: 48px;
		height: 48px;
		min-width: 48px;
		min-height: 48px;
		padding: 0;
	}

	.utf-header .wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: none;
	}

	.utf-header .wp-block-navigation__responsive-container.is-menu-open {
		position: fixed;
		inset: 0;
		z-index: 100000;
		display: flex !important;
		width: 100%;
		height: 100dvh;
		max-height: 100dvh;
		overflow: auto;
		background: var(--wp--preset--color--navy);
		padding: 1.25rem;
	}

	.utf-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		font-size: 1.125rem;
		padding: 0.85rem 0.5rem;
		color: #ffffff;
	}

	.utf-header .wp-block-navigation__responsive-container-close {
		color: #ffffff;
		min-width: 48px;
		min-height: 48px;
	}
}

.utf-header-call .wp-block-button__link {
	background: var(--wp--preset--color--red);
	color: #ffffff;
	font-family: var(--wp--preset--font-family--roboto);
	font-weight: 700;
	font-size: 0.8125rem;
	letter-spacing: 0.02em;
	padding: 0.55rem 0.85rem;
	text-decoration: none;
}

/* Cover copy sits on a photo. A shadow keeps white type readable in bright areas. */
.wp-block-cover .wp-block-heading {
	text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

/* The porch band is one box: the photo fills the min-height and the type sits in the middle. */
.utf-porch {
	display: flex;
	align-items: center;
	justify-content: center;
}

.utf-porch .wp-block-cover__image-background {
	object-fit: cover;
	width: 100%;
	height: 100%;
}

.utf-porch .wp-block-heading {
	margin-top: 0.4rem;
	margin-bottom: 0.4rem;
}

.utf-porch .wp-block-heading:first-child {
	margin-top: 0;
}

.utf-porch .wp-block-heading:last-child {
	margin-bottom: 0;
}

/* Page canvas */
.utf-main {
	padding-top: 2.75rem;
	padding-bottom: 3.25rem;
}

.utf-with-sidebar {
	align-items: flex-start;
}

.utf-sidebar {
	border-left: 1px solid var(--wp--preset--color--line);
	padding-left: 1.75rem;
}

.utf-sidebar-cta .wp-block-button,
.utf-sidebar-cta .wp-block-button__link {
	width: 100%;
}

.utf-sidebar-cta .wp-block-button__link {
	background: var(--wp--preset--color--red);
	color: #ffffff;
	text-align: center;
	font-family: var(--wp--preset--font-family--roboto);
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1.35;
	padding: 1rem 0.85rem;
	white-space: normal;
	text-decoration: none;
	border-radius: 2px;
}

.utf-sidebar-cta .wp-block-button__link:hover,
.utf-sidebar-cta .wp-block-button__link:focus-visible {
	background: var(--wp--preset--color--red-dark);
	color: #ffffff;
}

.utf-sidebar-cta .wp-block-separator {
	margin-top: 1.1rem;
	margin-bottom: 1.1rem;
}

.utf-sidebar-phone {
	margin-bottom: 0.35rem;
	font-family: var(--wp--preset--font-family--roboto);
	font-weight: 700;
}

.utf-sidebar-tagline {
	font-family: var(--wp--preset--font-family--roboto);
	font-weight: 700;
	line-height: 1.35;
}

.utf-cta-band {
	margin-top: 0.5rem;
}

.utf-cta-band .wp-block-heading {
	font-family: var(--wp--preset--font-family--noto-serif);
}

.wp-block-button__link,
.wp-element-button {
	text-decoration: none;
}

.wp-block-button__link:hover,
.wp-element-button:hover {
	background-color: var(--wp--preset--color--red-dark);
	color: #ffffff;
}

/* Service and bureau lists */
.utf-check-list {
	padding-left: 1.15rem;
}

.utf-check-list li {
	margin-bottom: 0.35rem;
}

.utf-check-list li::marker {
	color: var(--wp--preset--color--red);
}

.utf-home-video .wp-block-video,
.utf-home-video video {
	width: 100%;
	height: auto;
	background: #111;
}

.utf-home-intro {
	margin-bottom: 0.5rem;
}

/* Footer */
.utf-footer {
	font-family: var(--wp--preset--font-family--roboto);
	font-size: 0.875rem;
	line-height: 1.55;
	color: var(--wp--preset--color--heading);
}

.utf-footer a {
	color: var(--wp--preset--color--navy);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.utf-footer a:hover {
	color: var(--wp--preset--color--red);
}

.utf-footer-label {
	font-family: var(--wp--preset--font-family--roboto);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 0.75rem;
	color: var(--wp--preset--color--navy);
	margin-bottom: 0.35rem;
}

.utf-footer .wp-block-navigation {
	font-family: var(--wp--preset--font-family--roboto);
	font-weight: 400;
	font-size: 0.875rem;
	letter-spacing: 0;
	text-transform: none;
}

.utf-footer .wp-block-navigation__container {
	gap: 0.15rem !important;
	align-items: flex-start;
}

.utf-footer .wp-block-navigation a {
	color: var(--wp--preset--color--heading);
	text-decoration: none;
	padding: 0.15rem 0;
}

.utf-footer .wp-block-navigation a:hover,
.utf-footer .wp-block-navigation a:focus-visible {
	color: var(--wp--preset--color--red);
	background: transparent;
}

.utf-footer-bottom {
	border-top: 1px solid #e6e6e6;
	padding-top: 0.9rem;
	margin-top: 0.4rem;
	font-size: 0.8125rem;
}

.utf-footer-bottom p {
	margin: 0;
}

/* Contact officers */
.utf-officer {
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--white);
	height: auto;
}

.utf-officer strong {
	color: var(--wp--preset--color--heading);
}

/* Gravity Forms, and the local preview stand-in */
.gform_wrapper,
.utf-form-preview {
	font-family: var(--wp--preset--font-family--noto-serif);
	color: var(--wp--preset--color--body);
}

.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="tel"],
.gform_wrapper input[type="number"],
.gform_wrapper select,
.gform_wrapper textarea,
.utf-form-preview input,
.utf-form-preview select,
.utf-form-preview textarea {
	width: 100%;
	border: 1px solid #cccccc;
	border-radius: 2px;
	padding: 0.45rem 0.55rem;
	font: inherit;
	color: var(--wp--preset--color--heading);
	background: #ffffff;
}

.gform_wrapper .gform_footer input[type="submit"],
.gform_wrapper .gform_button,
.utf-form-preview button {
	background: var(--wp--preset--color--red);
	color: #ffffff;
	border: 0;
	border-radius: 2px;
	padding: 0.7rem 1.4rem;
	font-family: var(--wp--preset--font-family--roboto);
	font-weight: 700;
	cursor: pointer;
}

.gform_wrapper .gfield_required,
.utf-form-preview .req {
	color: var(--wp--preset--color--red);
}

.utf-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.85rem 1.25rem;
}

.utf-form-grid .wide {
	grid-column: 1 / -1;
}

.utf-form-grid label {
	display: block;
	font-size: 0.875rem;
	margin-bottom: 0.2rem;
	color: var(--wp--preset--color--heading);
}

@media (max-width: 781px) {
	body {
		line-height: 1.75;
	}

	.utf-main {
		padding-top: 1.5rem;
		padding-bottom: 2rem;
	}

	.utf-sidebar {
		border-left: 0;
		border-top: 1px solid var(--wp--preset--color--line);
		padding-left: 0;
		padding-top: 1.75rem;
		margin-top: 0.5rem;
	}

	.utf-form-grid {
		grid-template-columns: 1fr;
	}

	.utf-footer-bottom {
		flex-direction: column;
		gap: 0.35rem;
	}
}

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

	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}
