/*
	Main menu dropdown height + Areas We Serve / state hub page components,
	including the State Locations page-builder section.

	Hand-written on top of the compiled bundle (its PostCSS sources are not in
	this repo) and loaded right after it. The first part was moved here from
	Additional CSS and the WPCode snippet "CLX Hub page hover styles (Varney)".
*/

/* ---------- Main menu: dropdown height ---------- */

/*
	Long dropdowns (e.g. Services) scroll past 340px. A dropdown that holds
	a second-level flyout is never capped, otherwise its overflow would clip
	the flyout. Desktop only: the mobile menu panel scrolls on its own.
*/
@media (min-width: 1025px) {
	header .site-header nav .container-menu .sub .nav-menu li.menu-item-has-children > ul.sub-menu:not(:has(ul.sub-menu)) {
		max-height: 340px;
		overflow-x: hidden;
		overflow-y: auto;
	}
}

/* ---------- Hub + Areas We Serve cards: hover lift ---------- */

.richtext-entry .vd-area-card {
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.richtext-entry .vd-area-card:hover {
	border-color: #af2013 !important;
	box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
	transform: translateY(-2px);
}

.richtext-entry .vd-area-card a:hover,
.richtext-entry .vd-area-card a:focus {
	color: #1f2933 !important;
	text-decoration-color: #1f2933 !important;
}

/* ---------- Hub town lists: hover colour ---------- */

.richtext-entry .vd-towns a {
	transition: color .15s ease;
}

.richtext-entry .vd-towns a:hover,
.richtext-entry .vd-towns a:focus {
	color: #1f2933 !important;
	text-decoration-color: #1f2933 !important;
}

/* ---------- Areas We Serve: state cards that open to show every town ---------- */

.richtext-entry .vd-state > summary {
	list-style: none;
}

.richtext-entry .vd-state > summary::-webkit-details-marker {
	display: none;
}

.richtext-entry .vd-state > summary:focus-visible {
	outline: 2px solid #af2013;
	outline-offset: 4px;
	border-radius: 6px;
}

.richtext-entry .vd-state[open] {
	grid-column: 1 / -1;
	border-color: #af2013 !important;
}

.richtext-entry .vd-state[open]:hover {
	transform: none;
}

.richtext-entry .vd-state .vd-opened,
.richtext-entry .vd-state[open] .vd-closed {
	display: none;
}

.richtext-entry .vd-state[open] .vd-opened {
	display: inline;
}

/* ---------- State Locations section (fragments/sections/section-state-locations.php) ---------- */

/*
	Same look as the hand-built hub markup above (which carries inline
	styles); the section renders classes only, so its layout lives here.
*/
.section-state-locations {
	padding: 40px 0;
}

.section-state-locations .vd-states {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 20px;
	margin: 28px 0;
	align-items: start;
}

.section-state-locations .vd-area-card {
	border: 1px solid #e3e3e3;
	border-radius: 10px;
	padding: 22px;
	background: #fff;
}

.section-state-locations .vd-state > summary {
	cursor: pointer;
}

.section-state-locations .vd-state__title {
	display: block;
	margin-bottom: 12px;
	font-size: 24px;
	line-height: 1.3;
	font-weight: 700;
	color: #af2013;
}

.section-state-locations .vd-state__summary {
	display: block;
	margin-bottom: 16px;
}

.section-state-locations .vd-state__toggle {
	display: block;
	font-weight: 600;
	color: #af2013;
}

.section-state-locations .vd-state__body {
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px solid #e3e3e3;
}

.section-state-locations .vd-state__link {
	margin: 0 0 14px;
}

.section-state-locations .vd-state__link a {
	font-weight: 700;
	text-decoration: none;
	color: #af2013;
}

.section-state-locations .vd-towns + .vd-towns {
	margin-top: 28px;
}

.section-state-locations .vd-towns__list > ul {
	margin: 0;
	columns: 13em;
	column-gap: 2em;
}

/* Keep a town and its bullet in the same column */
.section-state-locations .vd-towns__list li {
	break-inside: avoid;
}

@media (min-width: 1025px) {
	.section-state-locations {
		padding: 60px 0;
	}
}
