/**
 * Out-N-Out Image & Text widget.
 * -----------------------------------------------------------------------------
 * Structural layout + token-driven defaults only. Every color/type/spacing
 * default resolves from the global design tokens (--oon-*) defined by the theme
 * (assets/css/tokens.css, handle: oon-tokens). Elementor Style controls override
 * individual properties per-widget via {{WRAPPER}} selectors when the editor
 * sets them; when left empty, these token defaults apply. No JavaScript.
 *
 * Loaded only on pages that use the widget (handle: oon-widget-image-text,
 * declared via get_style_depends()).
 */

.oon-image-text {
	/* Live places these sections in a full-width fluid container. The widget can
	   sit inside a boxed Elementor column, so it breaks out to the viewport edges
	   and re-constrains its content below. width MUST be auto (not 100%): with the
	   negative inline margins, an auto width expands the box to the full viewport,
	   whereas width:100% would keep it column-width and merely shift it left. The
	   section's own background already spans full width, so banded instances stay
	   aligned. The Elementor "Padding"/"Margin" style controls still override. */
	width: auto;
	margin-inline: calc(50% - 50vw);
	padding-block: clamp(30px, 4vw, 60px);
}

/* Content re-constrained to the live fluid container. Live uses
   max-width: calc(1620px content + ~50px padding * 2); with the ~104px column
   gap this yields ~760px columns (matching the live 760px image) on wide
   screens, and scales down fluidly. */
.oon-image-text__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	max-width: var(--oon-it-width, 1720px);
	margin-inline: auto;
	padding-inline: clamp(15px, 4vw, 50px);
	gap: clamp(32px, 6vw, 104px);
}

/* Two even columns by default; media_width control can change the ratio. */
.oon-image-text__media,
.oon-image-text__content {
	flex: 1 1 0;
	min-width: 0; /* allow flex children to shrink below content size */
}

/* Desktop image side. DOM order is media-first; row-reverse flips it visually
   so mobile stacking (image on top) stays correct without markup duplication. */
.oon-image-text--image-right .oon-image-text__inner {
	flex-direction: row-reverse;
}

.oon-image-text--no-image .oon-image-text__content {
	flex-basis: 100%;
}

/* ---- Media --------------------------------------------------------------- */
.oon-image-text__media {
	line-height: 0; /* remove inline image gap */
}

.oon-image-text__media img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
}

/* ---- Content ------------------------------------------------------------- */
.oon-image-text__eyebrow {
	display: inline-block;
	margin-bottom: 12px;
	font-family: var(--oon-font-body);
	font-weight: var(--oon-fw-medium, 500);
	font-size: 0.875rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--oon-color-accent, #9a84c8);
}

.oon-image-text__title {
	margin: 0 0 20px;
	font-family: var(--oon-font-heading);
	font-weight: var(--oon-fw-heading, 500);
	/* Live heading is .h2: 40px desktop → 32px tablet → 28px mobile. The default
	   was unset (rendered too small); Elementor's Heading Typography control
	   still overrides this per-instance when set. */
	font-size: clamp(1.75rem, 1rem + 2.2vw, 2.5rem);
	line-height: 1.238; /* measured live */
	letter-spacing: var(--oon-heading-letter-spacing, 0);
	color: var(--oon-color-heading, #332d55);
}

.oon-image-text__desc {
	font-family: var(--oon-font-body);
	font-weight: var(--oon-fw-regular, 400);
	font-size: 1rem; /* live description .h6 = 16px */
	line-height: var(--oon-body-line-height, 1.6);
	color: var(--oon-color-text-secondary, #666666);
}

.oon-image-text__desc > :last-child {
	margin-bottom: 0;
}

/* ---- Button ----
   Live renders this widget's CTA as an underlined text link (m-button--link)
   across every instance — not a filled button. This is the token-driven default;
   the Elementor Button Style controls (background, padding, radius, typography)
   still override it per-instance for anyone who wants a filled button. */
.oon-image-text__actions {
	margin-top: 28px;
}

.oon-image-text__button {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0 0 4px;
	font-family: var(--oon-font-body);
	font-weight: var(--oon-fw-medium, 500);
	font-size: 1rem;
	line-height: 1.4;
	text-decoration: none;
	color: var(--oon-color-text, #212121);
	background: none;
	border: 0;
	border-bottom: 1.5px solid currentColor;
	border-radius: 0;
	cursor: pointer;
	transition: color var(--oon-transition, 0.25s ease),
		border-color var(--oon-transition, 0.25s ease);
}

.oon-image-text__button:hover,
.oon-image-text__button:focus {
	color: var(--oon-color-accent, #9a84c8);
	border-color: var(--oon-color-accent, #9a84c8);
	background: none;
}

.oon-image-text__button:focus-visible {
	outline: 2px solid var(--oon-color-accent, #9a84c8);
	outline-offset: 3px;
}

/* ---- Responsive: stack on tablet/mobile ---------------------------------- */
/* Verified breakpoint: 768px. Below this the columns stack (image above
   content) regardless of the desktop image side. */
@media (max-width: 768px) {
	/* Stop breaking out to the viewport when stacked: on phones the boxed
	   container is already near-full-width, and the negative-margin bleed can
	   over-extend by a few px and clip text. Stay in normal flow instead; the
	   section's own background still spans full width. */
	.oon-image-text {
		margin-inline: 0;
	}
	.oon-image-text__inner {
		max-width: none;
		padding-inline: 16px; /* symmetric side gutter so text never touches edges */
	}

	.oon-image-text__inner,
	.oon-image-text--image-right .oon-image-text__inner {
		flex-direction: column;
	}

	/* Optional reverse: content above image. */
	.oon-image-text--mobile-reverse .oon-image-text__inner,
	.oon-image-text--image-right.oon-image-text--mobile-reverse .oon-image-text__inner {
		flex-direction: column-reverse;
	}

	.oon-image-text__media,
	.oon-image-text__content {
		flex-basis: auto;
		width: 100%;
	}
}
