/**
 * SGF Blocks Companion - front-end styles.
 *
 * The attorney drawer was originally transcribed from JetPopup as a
 * 548px-wide, full-height panel pinned to the right edge (matching
 * production). It's since been reworked into a centered lightbox modal by
 * request — see the .sgf-drawer rules below.
 */

/* =========================================================================
 * Offices
 * ====================================================================== */

.sgf-offices {
	display: grid;
	grid-template-columns: repeat(var(--sgf-offices-columns, 5), minmax(0, 1fr));
	column-gap: 30px;
	row-gap: 40px;
}

.sgf-office__location {
	font-family: var(--wp--preset--font-family--heading, inherit);
	font-size: 18px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0;
	line-height: 1;
	margin: 0 0 0.35em;
	color: var(--wp--preset--color--secondary, #F9F9F9);
}

.sgf-office__address,
.sgf-office__phone {
	font-family: var(--wp--preset--font-family--heading, inherit);
	font-size: 16px;
	font-weight: 400;
	text-transform: capitalize;
	line-height: 1.5;
	margin: 0 0 0.35em;
	max-width: 82%;
	color: var(--wp--preset--color--secondary, #F9F9F9);
	opacity: 0.83;
}

.sgf-office__phone a {
	color: inherit;
	text-decoration: none;
}

.sgf-office__phone a:hover {
	text-decoration: underline;
}

@media (max-width: 1024px) {
	.sgf-offices {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.sgf-offices {
		grid-template-columns: 1fr;
	}

	.sgf-office__address,
	.sgf-office__phone {
		max-width: 100%;
	}
}

/* =========================================================================
 * Attorneys
 * ====================================================================== */

.sgf-attorney {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	gap: 0;
	margin-bottom: 40px;
}

.sgf-attorney.is-reversed .sgf-attorney__media {
	order: 2;
}

.sgf-attorney__img {
	display: block;
	width: 100%;
	height: 600px;
	object-fit: cover;
	object-position: center;
}

.sgf-attorney__body {
	padding: 40px;
}

.sgf-attorney__name {
	margin: 0 0 0.15em;
}

.sgf-attorney__role {
	font-family: var(--wp--preset--font-family--heading, inherit);
	text-transform: uppercase;
	margin: 0 0 1em;
	opacity: 0.85;
}

.sgf-attorney__intro p:last-child {
	margin-bottom: 0;
}

.sgf-attorney__more {
	margin-top: 1.5rem;
}

/* The CTA button, matching the original .sgf-cta treatment. */
.sgf-cta {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 21px;
	border: 0;
	cursor: pointer;
	background-color: var(--wp--preset--color--primary, #FF0000);
	color: var(--wp--preset--color--secondary, #F9F9F9);
	font-family: var(--wp--preset--font-family--body, inherit);
	font-weight: 600;
	text-transform: uppercase;
	font-size: 15px;
	padding: 14px 28px;
	border-radius: 0;
	line-height: 1.2;
}

.sgf-cta::after {
	content: "";
	height: 10px;
	width: 90%;
	position: absolute;
	bottom: -6px;
	left: 0;
	right: 0;
	margin: 0 auto;
	z-index: -10;
	background-color: var(--wp--preset--color--accent, #F18805);
}

.sgf-cta.mustard::after {
	background-color: var(--wp--preset--color--text, #222222);
}

.sgf-cta:hover,
.sgf-cta:focus-visible {
	background-color: var(--wp--preset--color--text, #222222);
	color: #fff;
}

.sgf-cta__icon {
	font-size: 1.4em;
	line-height: 1;
}

@media (max-width: 800px) {
	.sgf-attorney {
		grid-template-columns: 1fr;
	}

	.sgf-attorney.is-reversed .sgf-attorney__media {
		order: 0;
	}

	.sgf-attorney__img {
		height: 380px;
	}

	.sgf-attorney__body {
		padding: 24px 0;
	}

	.sgf-attorney__more {
		width: 80%;
		justify-content: center;
	}
}

/* =========================================================================
 * Attorney drawer  (replaces JetPopup)
 * ====================================================================== */

.sgf-drawer {
	/* Reworked from an edge-anchored slide-out drawer into a proper centered
	 * lightbox: a fixed-size modal box, centered in the viewport, with the
	 * dark overlay visible on every side rather than the panel filling the
	 * full viewport height flush to one edge. */
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.sgf-drawer[hidden] {
	display: none;
}

.sgf-drawer__overlay {
	position: absolute;
	inset: 0;
	background-color: #000000C2;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.sgf-drawer.is-open .sgf-drawer__overlay {
	opacity: 1;
}

.sgf-drawer__panel {
	position: relative;
	width: 100%;
	max-width: 900px;
	max-height: 85vh;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	outline: none;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	/* Fade + scale in, like a lightbox, instead of sliding in from an edge. */
	opacity: 0;
	transform: scale(0.95);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.sgf-drawer.is-open .sgf-drawer__panel {
	opacity: 1;
	transform: scale(1);
}

.sgf-drawer__scroll {
	display: flex;
	flex: 1;
	min-height: 0;
}

.sgf-drawer__media {
	flex: 0 0 360px;
	height: 100%;
}

.sgf-drawer__close {
	position: absolute;
	top: 9px;
	right: 9px;
	z-index: 2;
	width: 38px;
	height: 38px;
	font-size: 14px;
	line-height: 1;
	border: 0;
	cursor: pointer;
	border-radius: 3px;
	background: #fff;
	color: var(--wp--preset--color--primary, #FF0000);
}

.sgf-drawer__close:hover,
.sgf-drawer__close:focus-visible {
	background: var(--wp--preset--color--primary, #FF0000);
	color: #fff;
}

.sgf-drawer__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.sgf-drawer__content {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 32px;
	color: var(--wp--preset--color--text, #222222);
}

.sgf-drawer__name {
	margin: 0 0 0.15em;
}

.sgf-drawer__role {
	font-family: var(--wp--preset--font-family--heading, inherit);
	text-transform: uppercase;
	margin: 0 0 1.25em;
	opacity: 0.85;
}

/* Bio headings inside the drawer sit tighter than page headings. */
.attorney-content h3,
.attorney-content h4,
.attorney-content h5 {
	letter-spacing: 0;
	font-size: 1.05rem;
	margin-top: 1.5em;
	margin-bottom: 0.5em;
}

.attorney-content ul {
	padding-left: 1.2em;
}

.attorney-content li {
	margin-bottom: 0.4em;
}

@media (max-width: 767px) {
	.sgf-drawer {
		padding: 0;
	}

	.sgf-drawer__panel {
		max-width: 100%;
		max-height: 100%;
		height: 100%;
		border-radius: 0;
	}

	/* Fixed-width side-image + independently-scrolling content only works
	 * with room to spare; on narrow screens go back to a single stacked
	 * column (image on top, content below) that scrolls as one piece. */
	.sgf-drawer__scroll {
		flex-direction: column;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.sgf-drawer__media {
		flex: 0 0 auto;
		height: 280px;
	}

	.sgf-drawer__content {
		overflow-y: visible;
		flex: 1 1 auto;
		padding: 24px;
	}

	.sgf-drawer__close {
		top: 5px;
		right: 5px;
	}
}

/* =========================================================================
 * Results
 * ====================================================================== */

.sgf-results__grid {
	display: grid;
	grid-template-columns: repeat(var(--sgf-results-columns, 3), minmax(0, 1fr));
	gap: 30px;
}

.sgf-result.is-hidden {
	display: none;
}

/* Each result is a red gradient panel with a raised charcoal label
   overlapping its top edge carrying the settlement figure. */
.sgf-result {
	position: relative;
	/* Live: linear-gradient(190deg, #FF0000 0%, #222222 100%) — pure red into
	 * dark charcoal, not the lighter pink-red gradient this had before. */
	background: linear-gradient(190deg, #FF0000 0%, #222222 100%);
	padding: 62px 26px 30px;
	margin-top: 30px;
	color: var(--wp--preset--color--white);
}

.sgf-result__value {
	position: absolute;
	top: -30px;
	left: 26px;
	right: 26px;
	margin: 0;
	background: var(--wp--preset--color--text, #222222);
	/* !important: the render function also puts a second, unrelated class
	 * (sgf-result-value, hyphenated) on this element, which collides with a
	 * genuinely different .sgf-result-value rule elsewhere in this file
	 * (red inline numbers in body text) and was turning this badge's text
	 * red instead of white. */
	color: var(--wp--preset--color--white) !important;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 40px;
	font-weight: 500;
	line-height: 1;
	text-transform: uppercase;
	text-align: center;
	padding: 20px 12px;
}

.sgf-result__desc {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 16px;
	line-height: 1.45;
	text-transform: uppercase;
	color: var(--wp--preset--color--white);
}

.sgf-results__more {
	display: flex;
	justify-content: center;
	margin-top: 40px;
}

@media (max-width: 1024px) {
	.sgf-results__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.sgf-results__grid {
		grid-template-columns: 1fr;
	}
}

/* =========================================================================
 * Testimonials
 * ====================================================================== */

.sgf-testimonials__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc(
		(100% - (var(--sgf-testimonials-per-view, 2) - 1) * 30px) /
			var(--sgf-testimonials-per-view, 2)
	);
	/* grid-auto-flow:column puts every card in one single implicit row, and
	 * that row's own height is set by its tallest item's content regardless
	 * of align-items — align-items only controls where a shorter item sits
	 * *within* that already-tall row, not the row's height. So align-items
	 * alone can't fix an oversized row; the quote's line-clamp below caps
	 * how tall any one card's content can get, and stretch (restored here)
	 * then makes every card match that now-reasonable height cleanly. */
	align-items: stretch;
	gap: 30px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding-bottom: 4px;
}

.sgf-testimonials__track::-webkit-scrollbar {
	display: none;
}

.sgf-testimonial {
	scroll-snap-align: start;
	margin: 0;
	padding: 34px 30px;
	background: var(--wp--preset--color--white, #fff);
	color: var(--wp--preset--color--text, #222);
}

.sgf-testimonial__quote {
	margin: 0 0 1.5em;
	padding: 0;
	border: 0;
	font-size: 15px;
	line-height: 1.7;
	color: #555;
	text-transform: none;
	/* One testimonial runs far longer than the rest (roughly 2.5x); without
	 * a cap it was setting the height every other card had to stretch to
	 * match. Clamping keeps every card's footprint reasonable and close to
	 * live's, matching the site's original approach of showing a preview
	 * rather than the full text for its longest reviews. */
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 9;
	overflow: hidden;
}

.sgf-testimonial__quote p:last-child {
	margin-bottom: 0;
}

.sgf-testimonial__author {
	font-family: var(--wp--preset--font-family--heading, inherit);
	text-transform: uppercase;
	font-size: 18px;
	color: var(--wp--preset--color--text, #222);
	display: flex;
	align-items: center;
	gap: 8px;
}

/* The original showed a speech-bubble glyph after the author name. */
.sgf-testimonial__author::after {
	content: "\1F5E8";
	font-size: 0.85em;
	opacity: 0.6;
}

.sgf-testimonials__dots {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 24px;
}

.sgf-dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	background: rgba(34, 34, 34, 0.25);
	transition: background 0.2s ease;
}

.sgf-dot.is-active {
	background: var(--wp--preset--color--primary, #FF0000);
}

@media (max-width: 767px) {
	.sgf-testimonials__track {
		grid-auto-columns: 100%;
	}
}
