/* DWL Tokeny fixes: Zephyr 9.4 / WPBakery 9 upgrade. One block per fix, numbered to match the evidence folders. */

/* 01-overflow: horizontal overflow on full-width sections.
   Rows (.g-cols) keep Zephyr's -24px gutter margins even when the section has no side padding,
   so they run 24px past the viewport. Zephyr 5 hid this with overflow-x:hidden on .l-canvas;
   Zephyr 9 dropped that rule. Restore it. 'clip' (not 'hidden') avoids creating a scroll
   container, so position:sticky keeps working; 'hidden' is the fallback for old browsers. */
.l-canvas {
	overflow-x: hidden;
	overflow-x: clip;
}

/* 02-how-it-works (sitewide): column inner wrappers spill out of their column.
   WPBakery 9 sets .vc_column_container>.vc_column-inner{width:100%}; on Zephyr 9's flex grid that
   width ignores the inner's own margins (Design Options margin-left/right: 3em), so the text runs
   96px past the column (and the screen edge). Zephyr 5 sized the inner to its margins. Let the
   flex layout size it instead: it still fills the column when there are no margins. */
.l-section .wpb_column > .vc_column-inner {
	width: auto;
}

/* 04-footer: nav-menu widgets lost their nesting + chevrons (footer "Footer Menu", any widget menu).
   Zephyr 5 styled .widget_nav_menu items with 1em left padding (so sub-menus indent cumulatively)
   and a 50%-opacity "keyboard_arrow_right" Material Icons chevron. Zephyr 9 dropped both and no
   longer loads Material Icons, so the chevron is drawn with borders instead (no font dependency). */
.widget_nav_menu .menu li {
	position: relative;
	padding-left: 1em;
}
.widget_nav_menu .menu li::before {
	content: '';
	position: absolute;
	left: 0.1em;
	top: calc(0.7em - 0.2em);
	width: 0.4em;
	height: 0.4em;
	border-top: 1.5px solid currentColor;
	border-right: 1.5px solid currentColor;
	transform: rotate(45deg);
	opacity: 0.5;
}
.widget_nav_menu .menu .sub-menu {
	margin-top: 8px; /* match the 8px gap between top-level items */
}

/* 05-qa: 404 page lost its compass icon. Zephyr 5 drew the Material Icons "explore" glyph in
   .page-404::before (200px, text colour at low opacity). Zephyr 9 has no such rule and no Material
   Icons font, so draw the same glyph as an SVG mask in the current text colour. */
.page-404::before {
	content: '';
	display: inline-block;
	width: 200px;
	height: 200px;
	margin: 0 0 10px;
	background-color: currentColor;
	opacity: 0.2;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 10.9c-.61 0-1.1.49-1.1 1.1s.49 1.1 1.1 1.1c.61 0 1.1-.49 1.1-1.1s-.49-1.1-1.1-1.1zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm2.19 12.19L6 18l3.81-8.19L18 6l-3.81 8.19z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 10.9c-.61 0-1.1.49-1.1 1.1s.49 1.1 1.1 1.1c.61 0 1.1-.49 1.1-1.1s-.49-1.1-1.1-1.1zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm2.19 12.19L6 18l3.81-8.19L18 6l-3.81 8.19z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.page-404 {
	text-align: center;
}

/* P2-01: category filter bars moved from the deprecated Grid Filter to List Filter.
   The old bar had margin-bottom: calc(gap * 2) (Zephyr grid-filter.css); these grids use a 1rem gap. */
.w-filter.for_list.layout_hor:has(+ .w-grid) {
	margin-bottom: 2rem;
}
/* Old Grid Filter on phones: two buttons per row (Zephyr grid-filter.css, max-width 480px). */
@media screen and (max-width: 480px) {
	.w-filter.for_list.layout_hor .w-filter-item.values_as_btn {
		width: 100%;
	}
	.w-filter.for_list.layout_hor .w-filter-item.values_as_btn .w-filter-item-values {
		justify-content: center !important;
		gap: 0 !important;
	}
	.w-filter.for_list.layout_hor .w-filter-item.values_as_btn .w-filter-item-value {
		font-size: .9rem !important;
		text-align: center;
		justify-content: center;
		margin: 0 !important;
		padding-inline: .6rem !important;
		text-overflow: ellipsis;
		overflow: hidden;
		width: 50%;
	}
}

/* P2-02: embedded HubSpot form (Issuer Support only) picked up Zephyr 9's filled field style.
   Restore the Zephyr 5 look from live: transparent field, thin bottom border, square corners. */
.hbspt-form input[type="text"],
.hbspt-form input[type="email"],
.hbspt-form input[type="tel"],
.hbspt-form input[type="number"],
.hbspt-form select,
.hbspt-form textarea {
	background-color: transparent;
	border: 0;
	border-bottom: 1px solid rgb(243, 245, 247);
	border-radius: 0;
	box-shadow: none;
	padding: 12px 20px;
}
.hbspt-form input[type="text"],
.hbspt-form input[type="email"],
.hbspt-form input[type="tel"],
.hbspt-form input[type="number"],
.hbspt-form select {
	height: 2.8rem !important;
	min-height: 0 !important;
	line-height: 2.8rem;
}

/* P2-03: vertical rhythm. Zephyr 9 changed the theme's spacing scale; these restore Zephyr 5's values
   (taken from live's style.min.css / responsive.min.css 5.4.1). Zephyr 5 padded .l-section-h, Zephyr 9
   pads .l-section, so the values move to .l-section. Sections with their own Design Options padding
   use !important and are unaffected. */
.w-separator.size_large:empty {
	height: 4rem;
}
@media (max-width: 1024px) {
	.l-section.height_large {
		padding-top: 4rem;
		padding-bottom: 4rem;
	}
	.l-section.height_huge {
		padding-top: 6rem;
		padding-bottom: 6rem;
	}
	.w-separator.size_small:empty { height: calc(.4rem + 1vw); }
	.w-separator.size_small.with_line { height: calc(1.4rem + 2vw); }
	.w-separator.size_medium:empty { height: calc(.6rem + 2vw); }
	.w-separator.size_medium.with_line { height: calc(1.6rem + 3vw); }
	.w-separator.size_large:empty { height: calc(.8rem + 3vw); }
	.w-separator.size_large.with_line { height: calc(1.8rem + 4vw); }
	.w-separator.size_huge:empty { height: calc(1rem + 4vw); }
	.w-separator.size_huge.with_line { height: calc(2rem + 5vw); }
}
@media screen and (max-width: 600px) {
	.l-sidebar,
	.l-section.height_small,
	.l-section.height_medium,
	.l-section.height_large,
	.l-section.height_huge {
		padding-top: 1.5rem;
		padding-bottom: 1.5rem;
	}
	p {
		margin-bottom: 1.5rem;
	}
	h1, h2, h3, h4, h5, h6 {
		padding-top: 1.5rem;
	}
}

/* P2-04: WPBakery row "Gap". Zephyr 5 padded every column on all four sides by half the gap
   (.vc_column-gap-N > .vc_column_container). Zephyr 9 only pads left/right; add top/bottom back.
   Pairs with scripts/p2-04-column-gaps.php (gap="35" -> gap="17.5px"). */
.g-cols.via_flex[style*="--additional-gap"] > .vc_column_container {
	padding-top: var(--additional-gap, 0px);
	padding-bottom: var(--additional-gap, 0px);
}

/* P2-05: Zephyr 9's 404 template uses a "large" section (6rem); Zephyr 5 padded it 4rem. */
.l-section:has(> .l-section-h > .page-404) {
	padding-top: 4rem;
	padding-bottom: 4rem;
}

/* Sergey 9 Nov (with scripts/p2-05-empty-images.php): Zephyr 5 rendered a missing image as an empty,
   invisible box. Zephyr 9 draws a grey "mountain and sun" placeholder picture instead (Image and Icon Box
   elements whose media was deleted, posts with no featured image in post lists/carousels). Hide the
   picture; in post lists keep the space, as live does. */
img.g-placeholder {
	visibility: hidden;
}
.w-image img.g-placeholder,
.w-iconbox-icon img.g-placeholder {
	display: none;
}