/*
Theme Name: Union Protect Insurance
Author: Mark Duwe
Theme URI: https://unionprotect.com
Description: Custom WordPress theme for Union Protect Insurance.
Version: 1.0.5
Text Domain: uis
Requires at least: 6.3
Tested up to: 6.3
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: full-site-editing
*/

/*--------------------------------------------------------------
  Global Resets & Box Sizing
--------------------------------------------------------------*/
*, *:before, *:after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

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

body {
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, p, ul, ol {
	margin-top: 0;
	margin-bottom: 1rem;
}

p:last-child {
	margin-bottom: 0;
}

a {
	word-break: break-word;
	text-decoration: none;
}
a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--primary);
}

.wp-block-navigation__responsive-container-open svg {
	display: none !important;
}

/* 2. Add your custom icon */
.wp-block-navigation__responsive-container-open {
	display: block;
	width: 32px;  /* Adjust size as needed */
	height: 32px;
	background-image: url("data:image/svg+xml;base64,PHN2ZyBhcmlhLWhpZGRlbj0idHJ1ZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2Utd2lkdGg9IjIiIGQ9Ik01IDdoMTRNNSAxMmgxNE01IDE3aDE0Ij48L3BhdGg+PC9zdmc+");
	background-repeat: no-repeat;
	background-size: contain;
	background-position: center;
}

/*--------------------------------------------------------------
  Site Layout & Wrappers
--------------------------------------------------------------*/
.wp-site-blocks {
	padding: 0 !important;
}

main > .entry-content {
	padding-top: 0 !important;
	margin-block-start: 0 !important;
}

/*--------------------------------------------------------------
  Typography & Headings
--------------------------------------------------------------*/
h2.has-background {
	padding: var(--wp--preset--spacing--50) !important;
}

/* Screen reader only */
.sr-only {
	clip: rect(0,0,0,0);
	white-space: nowrap;
	border-width: 0;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	position: absolute;
	overflow: hidden;
}
.alignfull {
	width:  100vw;
	max-width:  100vw;
	margin-left: calc(50% - 50vw) !important;
	z-index: 102;
}
/*--------------------------------------------------------------
  Navigation Styling
--------------------------------------------------------------*/
.wp-block-navigation li.wp-block-navigation-item {
	font-weight: 700;
}

header .wp-block-navigation-item:hover,
header .wp-block-navigation-item:hover > a,
header .current-menu-ancestor,
header .current-menu-item {
	background: var(--wp--preset--color--grey-10) !important;
	color: var(--wp--preset--color--contrast) !important;
}
header .wp-block-navigation-item.has-child {
	padding-right: 0.4rem !important;
}
header .wp-block-navigation-item {
	background: var(--wp--preset--color--primary);
}
header .wp-block-navigation-item .wp-block-navigation-submenu {
	background: var(--wp--preset--color--primary);
	border-radius: 0 0 0.5rem 0.5rem;
	box-shadow: 0 2px 4px var(--wp--preset--color--overlay-primary-more);
	overflow: hidden !important;
}
header .wp-block-navigation .wp-block-navigation-item.has-child > a.wp-block-navigation-item__content {
	padding-right: 0.15rem !important;
}

/* Responsive navigation */
.wp-block-navigation__responsive-container.has-modal-open.is-menu-open {
	width: 100dvw !important;
	height: 100dvh !important;
	top: 0;
	left: 0;
}

.has-modal-open.is-menu-open .wp-block-navigation__container .wp-block-navigation-item {
	width: 100% !important;
	font-size: var(--wp--preset--font-size--default) !important;
}

.has-modal-open.is-menu-open .wp-block-navigation__container .wp-block-navigation-item a {
	display: block !important;
	padding: 0.75rem 0.5rem !important;
	width: 100% !important;
}
.has-modal-open.is-menu-open .wp-block-navigation-item.current-menu-ancester,
.has-modal-open.is-menu-open .wp-block-navigation-item.current-menu-item,
.has-modal-open.is-menu-open .wp-block-navigation-item.current-menu-ancester:hover,
.has-modal-open.is-menu-open .wp-block-navigation-item.current-menu-item:hover {
	color: var(--wp--preset--color--contrast) !important;
	background: var(--wp--preset--color--primary) !important;
}

.wp-block-button__link.is-disabled {
	opacity: 0.5;
	pointer-events: none; /* Prevents clicks */
	cursor: not-allowed;
	filter: grayscale(1);
}

/* Details */
details {
	border-top: 2px solid #D9D9D9;
	margin: 0.5rem auto !important;
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}
details p {
	padding: 0.75rem;
	margin: 0.75rem 0;
}
details p:last-child {
	margin-bottom: 0;
}
details summary {
	list-style: none !important;
	font-size: 1.25rem;
	padding: 0.5rem 2rem 0.5rem 0.5rem ;
	cursor: pointer;
}
details summary:-webkit-details-marker,
details summary:marker {
	content: "" !important;
	display: none !important;
}
details summary {
	position: relative;
}
details summary:before {
	content: '';
	width: 4rem;
	height: 2px;
	background: red;
	position: absolute;
	display: block;
	bottom: -0.5rem;
}
details summary:after {
	content: '';
	width: 1rem;
	height: 1rem;
	border-top: 2px solid red;
	border-right: 2px solid red;
	position: absolute;
	display: block;
	top: 40%;
	right: 0.5rem;
	transform: translateY(-50%) rotate(135deg)
}
details[open] summary:after {
	top: 60%;
	transform: translateY(-50%) rotate(-45deg)
}
details sumamry:focus {
	outline: none;
}

/* Footer navigation */
footer .wp-block-navigation__container {
	gap: 0.5rem !important;
}
footer nav .wp-block-navigation-item a {
	display: block;
	padding: .5em 1em;
	color: var(--wp--preset--color--contrast) !important;
}

footer .wp-block-navigation li.wp-block-navigation-item:hover,
footer .wp-block-navigation li.wp-block-navigation-item a:hover,
footer .wp-block-navigation li.wp-block-navigation-item.current-menu-item a {
	text-decoration: underline !important;
	text-underline-offset: 5px !important;
	background: var(--wp--preset--color--transparent) !important;
	color: var(--wp--preset--color--contrast) !important;
}

header .wp-block-group.has-primary-background-color .wp-block-group p strong a {
	display: flex;
	align-items: center;
}

/*--------------------------------------------------------------
  Block Styles
--------------------------------------------------------------*/
.wp-block-list {
	padding-left: 26px;
}

.wp-block-query-pagination {
	display: flex;
	flex-flow: row nowrap;
	justify-content: space-between;
	align-items: center;
}

.wp-block-query-pagination-numbers {
	display: flex;
	gap: 0.5rem;
	flex: 1 1 auto;
	justify-content: center;
}

.page-numbers {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	border-radius: 0.5rem;
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	text-decoration: none;
	border: 1px solid var(--wp--preset--color--transparent);
	transition: background-color 0.25s linear;
}

.page-numbers.current {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
}

a.page-numbers:hover {
	background-color: var(--wp--preset--color--secondary);
}

.columnQuery .wp-block-post-featured-image img {
	border: 2px solid var(--wp--preset--color--primary);
	border-radius: 0.5rem;
}
.columnQuery ul {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.5rem;
}
.columnQuery ul li {
	border: 1px solid var(--wp--preset--color--borders);
	border-radius: 0.5rem;
	padding: 1rem;
	margin: 0 !important;
}
.columnQuery ul li .wp-block-post-excerpt {
	margin-bottom: 0 !important;
}
.columnQuery ul li .wp-block-post-excerpt .wp-block-post-excerpt__excerpt {
	min-height: 100px;
}
.columnQuery ul li .wp-block-post-excerpt .wp-block-post-excerpt__more-text {
	margin-top: 0 !important;
}
.columnQuery ul li .wp-block-post-excerpt .wp-block-post-excerpt__more-link {
	margin: 1rem auto 0 auto !important;
	display: inline-block;
	padding: 0.75rem 1.25rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: bold;
	border-radius: 0.5rem;
	border: 1px solid var(--wp--preset--color--borders);
	text-decoration: none;
	background-color: var(--wp--preset--color--primary) !important;
	color: var(--wp--preset--color--base) !important;
	transition: color 0.25s linear, background-color 0.25s linear, box-shadow 0.25s linear;
}
.columnQuery ul li .wp-block-post-excerpt .wp-block-post-excerpt__more-link:hover {
	background-color: var(--wp--preset--color--secondary) !important;
	box-shadow: 0 0 6px color-mix(in srgb, var(--wp--preset--color--borders), transparent 25%);
	transition: color 0.25s linear, background-color 0.25s linear, box-shadow 0.25s linear;
}

.productChoices li {
	margin: 2px 0 0 0 !important;
}
.productChoices a {
	display: block;
	padding: 1rem;
	background: var(--wp--preset--color--grey-20);
}

.error {
	color: var(--wp--preset--color--error);
	display: none;
}

.wp-block-button__link {
	border-color: var(--wp--preset--color--primary) !important;
	transition: background 0.25s linear, box-shadow 0.25s linear;
}
.wp-block-button__link:hover {
	background-color: var(--wp--preset--color--secondary) !important;
	box-shadow: 0 0 6px color-mix(in srgb, var(--wp--preset--color--borders), transparent 25%);
	transition: background 0.25s linear, box-shadow 0.25s linear;
}

/*--------------------------------------------------------------
  Forms & Inputs
--------------------------------------------------------------*/
.formColumn {
	border-radius: 0.5rem;
	border: 1px solid var(--wp--preset--color--primary);
	background: var(--wp--preset--color--grey-10);
	padding: 0;
}

.formColumn .hs-form-html {
	padding: 0 1rem 1rem;
}

#survey {
	width: 100vw;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

#form, #form_paginate, .foform, #steps {
	width: 100%;
	max-width: 600px !important;
	margin: 0 auto !important;
}

.form_section {
	padding: 0.5rem;
}

label {
	font-weight: bold;
}

.form_section > label {
	margin-bottom: 1.5rem;
}

.form_section p {
	font-size: var(--wp--preset--font-size--default) !important;
}

.help {
	margin-top: 0.5rem;
}

.help p {
	font-size: var(--wp--preset--font-size--tiny) !important;
}

/* Inputs */
.forminator-response-message.forminator-show {
	background: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--default);
	font-weight: bold;
	padding: 1rem;
	border: 1px solid var(--wp--preset--color--primary);
	border-radius: 0.5rem;
}

#survey input[type="text"],
#survey input[type="email"],
#survey input[type="tel"],
#survey input[type="date"],
textarea,
select,
input.forminator-input,
textarea.forminator-textarea {
	font-size: var(--wp--preset--font-size--default) !important;
	font-family: var(--wp--preset--font-family--inter) !important;
	border: 1px solid var(--wp--preset--color--borders);
	padding: 0.75rem 0.5rem;
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	border-radius: 5px;
	width: 100%;
}

/* Radio & Checkbox custom styles */
input[type="radio"],
input[type="checkbox"] {
	display: none;
}

input[type="radio"] + label,
input[type="checkbox"] + label {
	display: flex;
	align-items: center;
	cursor: pointer;
	position: relative;
}

/* Radio valid/invalid */
input[type="radio"].valid_true:checked + label:after {
	content: "✓";
	background-color: var(--wp--preset--color--button);
	color: var(--wp--preset--color--base);
}
input[type="radio"].valid_false:checked + label:after {
	content: "✕";
	background-color: var(--wp--preset--color--error);
	color: var(--wp--preset--color--contrast);
}

/* Checkbox checkmark */
input[type="checkbox"]:checked + label:before {
	content: "✓";
	background: var(--wp--preset--color--button);
	border-color: var(--wp--preset--color--button);
	color: var(--wp--preset--color--base);
}

/* Select styling */
select {
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2.5 5L8 10.5L13.5 5'/%3E%3C/svg%3E");
	background-position: right 0.75rem center; /* Moves 0.75rem from the right edge */
	background-repeat: no-repeat;
	background-size: 16px 16px;
	width: 100%;
	height: 2.5rem;
	padding-right: 2.5rem;
	padding-left: 0.75rem;
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
	border: 1px solid var(--wp--preset--color--borders);
	border-radius: 5px;
	cursor: pointer;
}

/* Form buttons */
button.forminator-button.forminator-button-submit,
#nextbutton {
	border: none;
	background-color: var(--wp--preset--color--hs-button);
	color: var(--wp--preset--color--base);
	padding: 0.75rem 1.5rem;
	font-weight: 700;
	cursor: pointer;
	border-radius: 0.5rem;
	font-size: var(--wp--preset--font-size--medium);
	font-family: var(--wp--preset--font-family--inter);
}
#nextbutton:hover,
button.forminator-button.forminator-button-submit:hover {
	background-color: var(--wp--preset--color--hs-button-hover);
	box-shadow: 0 0 6px color-mix(in srgb, var(--wp--preset--color--borders), transparent 25%);
	transition: background 0.25s linear, box-shadow 0.25s linear;
}


/*--------------------------------------------------------------
  Stepper Component
--------------------------------------------------------------*/
.c-stepper {
	display: flex;
	flex-wrap: wrap;
	margin: 0 auto 2rem;
	padding: 0;
}

.c-stepper__item {
	flex: 1;
	display: flex;
	flex-direction: column;
	text-align: center;
	position: relative;
}

.c-stepper__item h3 {
	margin: 0 !important;
	color: var(--wp--preset--color--grey);
}

.c-stepper__item.active h3 {
	color: var(--wp--preset--color--base);
}

.c-stepper__item p {
	margin: 0 !important;
	font-size: var(--wp--preset--font-size--minute);
	font-weight: bold;
	color: var(--wp--preset--color--grey);
}

.c-stepper__item.active p {
	color: var(--wp--preset--color--contrast);
}

.c-stepper__item:before {
	content: "";
	display: block;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	margin: 1rem auto 0;
	border: 2px solid var(--wp--preset--color--grey);
	background: var(--wp--preset--color--grey-50);
}

.c-stepper__item.active:before {
	border-color: var(--wp--preset--color--button);
	background: var(--wp--preset--color--button);
}

/*--------------------------------------------------------------
  Tables
--------------------------------------------------------------*/
table {
	table-layout: auto;
	margin-bottom: 0.75rem;
}

table tr td,
table tr th {
	padding: 0.25rem 0.5rem;
	border-bottom: 1px solid var(--wp--preset--color--grey-70);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast);
}

table tr:nth-child(odd) td {
	background: var(--wp--preset--color--grey-10);
}

table tr th {
	background: var(--wp--preset--color--grey-30);
	text-align: left;
}

/*--------------------------------------------------------------
  Search
--------------------------------------------------------------*/

.wp-search-cols {
	display: flex;
	flex-flow: row;
	gap: 2rem;
	margin: 1rem auto;
}
.wp-search-column img {
	width: 100%;
	height: auto;
}

/*--------------------------------------------------------------
  Miscellaneous / Utilities
--------------------------------------------------------------*/
.hidden { display: none; }
:disabled { opacity: 0.75; cursor: not-allowed !important; }
.fade-in { animation: fadeIn 0.5s ease forwards; }
.loading-spinner {
	display: inline-block;
	width: 1em;
	height: 1em;
	border: 2px solid #ccc;
	border-top-color: #000;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
	margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

.desktopHide {
	display: none;
}
.mobileHide {
	display: block;
}

.table-benefits {
	width: 100%;
	margin: 2rem 0;
	overflow-x: auto; /* Enable horizontal scroll */
	-webkit-overflow-scrolling: touch; /* Smooth scroll for iOS */
	border: 1px solid var(--wp--preset--color--grey-70, #D9D9D9);
	border-radius: 8px;
}

.table-benefits table {
	width: 100%;
	min-width: 700px; /* Forces enough width to prevent text squishing */
	border-collapse: separate; /* Required for sticky positioning */
	border-spacing: 0;
}

.table-benefits table th.title {
	background: var(--wp--preset--color--grey-30, #eee);
	text-align: left;
	padding: 1rem;
	font-weight: bold;
	text-transform: uppercase;
	font-size: 0.85rem;
	letter-spacing: 0.05em;
	border-bottom: 2px solid var(--wp--preset--color--grey-70, #D9D9D9);
	max-width: 300px;
}

.table-benefits table td {
	padding: 1rem;
	border-bottom: 1px solid var(--wp--preset--color--grey-70, #D9D9D9);
	vertical-align: top;
	font-size: 0.9rem;
}

/* Handle the rowspan cell ("90 days") */
.table-benefits table td[rowspan] {
	background: #fff; 
	font-weight: bold;
	color: var(--wp--preset--color--primary);
	text-align: center;
	vertical-align: middle;
}

/* Highlight the Total Rows */
.table-benefits table tr:last-child td,
.table-benefits table td[colspan] {
	background: var(--wp--preset--color--grey-10, #f9f9f9);
	font-weight: bold;
}

/*--------------------------------------------------------------
  Media Queries
--------------------------------------------------------------*/
@media screen and (max-width: 1024px) {
	/* Target the logo image specifically */
	.wp-block-site-logo img { 
		max-width: 120px !important; 
		height: auto !important; 
	}

	/* Force the toggle of visibility classes */
	.mobileHide { 
		display: none !important; 
	}
	.desktopHide { 
		display: block !important; 
	}

	/* Column Query Overrides */
	.columnQuery ul { 
		grid-template-columns: 1fr !important; 
		display: flex !important;
		flex-direction: column !important;
	}

	/* Ensure search columns stack */
	.wp-search-cols {
		flex-direction: column !important;
		gap: 1rem !important;
	}

	.columnQuery ul li .wp-block-post-excerpt .wp-block-post-excerpt__excerpt {
		min-height: auto !important;
	}
	/* Pin the first column */
	.table-benefits table tr th:first-child,
	.table-benefits table tr td:first-child {
		position: -webkit-sticky;
		position: sticky;
		left: 0;
		z-index: 10;
		background-color: #ffffff; /* Must have a solid background */
		border-right: 2px solid var(--wp--preset--color--grey-70, #D9D9D9);
		box-shadow: 2px 0 5px rgba(0,0,0,0.1);
		max-width: 300px;
		padding: 0.5rem;
	}

	/* Keep the header background dark even when sticky */
	.table-benefits table tr th.title:first-child {
		background-color: var(--wp--preset--color--grey-30, #eee);
	}
	
	/* Ensure odd rows maintain their background when sticky */
	.table-benefits table tr:nth-child(odd) td:first-child {
		background-color: var(--wp--preset--color--grey-10, #f9f9f9);
	}
	
	[data-hsfc-id=Renderer] .hsfc-CheckboxFieldGroup__Options label {
		flex-flow: column !important;
	}
	
	.hsfc-RadioFieldGroup__Options, .hsfc-CheckboxFieldGroup__Options {
		justify-content: space-around !important;
	}
	.has-modal-open.is-menu-open .wp-block-navigation-item.current-menu-item,
	.has-modal-open.is-menu-open .wp-block-navigation-item.current-menu-item a {
		color: var(--wp--preset--color--base) !important;
	}
	.has-modal-open.is-menu-open .wp-block-navigation-item.current-menu-item a.wp-block-navigation-item__content[aria-current="page"],
	.has-modal-open.is-menu-open .wp-block-navigation-item.current-menu-item a:hover {
		background-color: var(--wp--preset--color--base) !important;
		color: var(--wp--preset--color--primary) !important;
	}
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child .wp-block-navigation__submenu-container {
		padding: 0 0 0 2rem !important;
		border-radius: 0 !important;
	}
	header .wp-block-navigation-item.has-child {
		padding-right: 0 !important;
	}
	
}