/*
 * Legacy compatibility: gives Blade-era WPBakery content the Paddock look.
 * Loaded only when the current post contains [vc_row] (body.ms-legacy).
 * Targets stock WPBakery output (Blade's row/column templates are gone) and the
 * Blade Extension grve_* elements still rendered by that plugin.
 */

/* ---------- Layout ---------- */
.ms-legacy .wpb-content-wrapper {
	color: var(--wp--preset--color--body);
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.65;
}
.ms-legacy .wpb-content-wrapper .vc_row { margin-right: -15px; margin-left: -15px; }
.ms-legacy .wpb-content-wrapper img,
.ms-legacy .wpb-content-wrapper iframe,
.ms-legacy .wpb-content-wrapper video { max-width: 100%; }
.ms-legacy .wpb-content-wrapper img { height: auto; }
.ms-legacy .wpb-content-wrapper .wpb_content_element,
.ms-legacy .wpb-content-wrapper .grve-element { margin-bottom: 28px; }
@media (max-width: 767px) {
	.ms-legacy .wpb-content-wrapper .vc_row { margin-right: 0; margin-left: 0; }
	.ms-legacy .wpb-content-wrapper .vc_column_container > .vc_column-inner { padding-right: 0; padding-left: 0; }
	.ms-legacy .wpb-content-wrapper [style*="padding-left: 60px"] { padding-left: 0 !important; }
}

/* WPBakery design options: drop light fills, radii and light borders. */
.ms-legacy .wpb-content-wrapper [class*="vc_custom_"] {
	border-color: var(--wp--preset--color--rule) !important;
	border-radius: 0 !important;
	background-color: transparent !important;
}
.ms-legacy .wpb-content-wrapper .vc_row-has-fill,
.ms-legacy .wpb-content-wrapper .vc_col-has-fill > .vc_column-inner {
	background-color: var(--wp--preset--color--surface) !important;
}

/* Inline colours from the light theme that would vanish on graphite. */
.ms-legacy .wpb-content-wrapper [style*="color: #000000"],
.ms-legacy .wpb-content-wrapper [style*="color:#000000"],
.ms-legacy .wpb-content-wrapper [style*="color: #000;"] { color: var(--wp--preset--color--ink) !important; }
.ms-legacy .wpb-content-wrapper [style*="color: #cc3333"],
.ms-legacy .wpb-content-wrapper [style*="color: #ff2100"],
.ms-legacy .wpb-content-wrapper [style*="color: #ff0000"] { color: var(--wp--preset--color--red) !important; }

/* ---------- Typography ---------- */
.ms-legacy .wpb-content-wrapper h1,
.ms-legacy .wpb-content-wrapper h2,
.ms-legacy .wpb-content-wrapper h3,
.ms-legacy .wpb-content-wrapper h4 {
	margin: 0 0 20px;
	color: var(--wp--preset--color--ink);
	line-height: 1;
}
.ms-legacy .wpb-content-wrapper h1,
.ms-legacy .wpb-content-wrapper h2 { font-size: clamp(30px, 3.4vw, 44px); }
.ms-legacy .wpb-content-wrapper h3 { font-size: clamp(24px, 2.4vw, 32px); }
.ms-legacy .wpb-content-wrapper h4 { font-size: 22px; }
.ms-legacy .wpb-content-wrapper p { margin: 0 0 18px; }
.ms-legacy .wpb-content-wrapper a:not(.grve-btn):not(:has(img)) { color: var(--wp--preset--color--ink); text-decoration: underline; text-decoration-color: var(--wp--preset--color--red); text-underline-offset: 3px; }
.ms-legacy .wpb-content-wrapper a:not(.grve-btn):not(:has(img)):hover { color: var(--wp--preset--color--red); }

/* grve_title: condensed uppercase with the red 44×3 bar beneath. */
.ms-legacy .grve-title {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	letter-spacing: 0;
	text-transform: uppercase;
}
.ms-legacy .grve-title.grve-align-center { text-align: center; }
.ms-legacy .grve-title-line {
	display: block;
	width: 44px !important;
	height: 3px !important;
	margin-top: 14px;
	background: var(--wp--preset--color--red) !important;
}
.ms-legacy .grve-title.grve-align-center .grve-title-line { margin-right: auto; margin-left: auto; }

/* ---------- grve_button ---------- */
.ms-legacy .grve-element.grve-align-center { text-align: center; }
.ms-legacy .grve-btn {
	display: inline-block;
	padding: 14px 22px;
	border: 0;
	border-radius: 0 !important;
	background: var(--wp--preset--color--red) !important;
	color: var(--wp--preset--color--white) !important;
	font-family: var(--wp--preset--font-family--display);
	font-size: 17px;
	font-weight: 600;
	letter-spacing: .12em;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color .15s ease;
}
.ms-legacy .grve-btn.grve-btn-large { padding: 18px 28px; font-size: 18px; }
.ms-legacy .grve-btn:hover { background: #c81f24 !important; color: var(--wp--preset--color--white) !important; }
.ms-legacy .grve-btn:focus-visible { outline: 2px solid var(--wp--preset--color--ink); outline-offset: 2px; }

/* ---------- grve_divider, vc_separator ---------- */
.ms-legacy .grve-line-divider { border-top: 1px solid var(--wp--preset--color--rule); }
.ms-legacy .vc_separator .vc_sep_line { border-color: var(--wp--preset--color--rule) !important; }

/* ---------- Images: grve_single_image, vc_single_image ---------- */
.ms-legacy .grve-image img,
.ms-legacy .vc_single_image-wrapper img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.ms-legacy .vc_single_image-wrapper.vc_box_border,
.ms-legacy .vc_single_image-wrapper.vc_box_rounded { border-radius: 0; background: none; }

/* ---------- grve_video, vc_video ---------- */
.ms-legacy .grve-video iframe,
.ms-legacy .wpb_video_widget iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }

/* ---------- grve_media_box ---------- */
.ms-legacy .grve-box figure { margin: 0 0 16px; overflow: hidden; }
.ms-legacy .grve-box img { display: block; width: 100%; height: auto; transition: transform .4s ease-out; }
.ms-legacy .grve-box a:hover img { transform: scale(1.03); }
.ms-legacy .grve-hover-overlay { display: none; }

/* ---------- grve_gallery (Blade's isotope JS is gone: lay it out as a grid) ---------- */
.ms-legacy .grve-gallery .grve-isotope-container {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	height: auto !important;
}
.ms-legacy .grve-gallery[data-columns="2"] .grve-isotope-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ms-legacy .grve-gallery[data-columns="4"] .grve-isotope-container { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ms-legacy .grve-gallery[data-columns="5"] .grve-isotope-container { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ms-legacy .grve-gallery .grve-isotope-item { position: static !important; width: auto !important; transform: none !important; }
.ms-legacy .grve-gallery figure { margin: 0; overflow: hidden; }
.ms-legacy .grve-gallery img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .4s ease-out; }
.ms-legacy .grve-gallery a:hover img { transform: scale(1.03); }
.ms-legacy .grve-gallery-content { display: none; }
@media (max-width: 899px) {
	.ms-legacy .grve-gallery .grve-isotope-container { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* ---------- WPBakery tabs / accordion ---------- */
.ms-legacy .vc_tta.vc_general .vc_tta-panel-title > a,
.ms-legacy .vc_tta.vc_general .vc_tta-tab > a {
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--display);
	font-size: 22px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.ms-legacy .vc_tta.vc_general .vc_tta-panel-heading,
.ms-legacy .vc_tta.vc_general .vc_tta-panel-body,
.ms-legacy .vc_tta.vc_general .vc_tta-tab > a {
	border-color: var(--wp--preset--color--rule) !important;
	border-radius: 0 !important;
	background: var(--wp--preset--color--surface) !important;
}

/* ---------- Dead social share buttons (Facebook like, Tweetmeme, Google+) ---------- */
.ms-legacy .fb_like,
.ms-legacy .vc_tweetmeme-element,
.ms-legacy .wpb_googleplus { display: none !important; }
