/* ==========================================================================
 * ACF Tabs Widget for Elementor — front-end styles
 * All theme-able values are CSS custom properties; the Elementor controls
 * override them per-instance via `{{WRAPPER}} .acft-widget`.
 * ========================================================================== */

.acft-widget {
	--acft-sidebar-bg-solid: #c8512f;
	--acft-sidebar-bg-1: #d35a31;
	--acft-sidebar-bg-2: #9c3f24;
	--acft-sidebar-grad-angle: 180deg;

	--acft-content-bg-solid: #5d6f74;
	--acft-content-bg-1: #6d8087;
	--acft-content-bg-2: #4a5a5f;
	--acft-content-grad-angle: 135deg;

	--acft-indicator-color: #ffffff;
	--acft-indicator-thickness: 2px;
	--acft-indicator-offset: 4px;

	/* Block-title gradient rule */
	--acft-block-rule-c1: #c8512f;
	--acft-block-rule-c2: rgba(200, 81, 47, 0.1);
	--acft-block-rule-angle: 90deg;
	--acft-block-rule-width: 100%;
	--acft-block-rule-thickness: 2px;
	--acft-block-rule-offset: 8px;

	/* Accordion (mobile) tokens */
	--acft-acc-tab-bg: #e07a55;
	--acft-acc-tab-bg-active: #c8512f;
	--acft-acc-tab-color: #ffffff;
	--acft-acc-tab-color-active: #ffffff;
	--acft-acc-divider-color: rgba(255, 255, 255, 0.25);
	--acft-acc-divider-width: 1px;
	--acft-acc-gap: 0px;
	--acft-acc-item-radius: 0px;
	--acft-acc-chevron-color: #ffffff;
	--acft-acc-chevron-size: 14px;
	--acft-acc-panel-bg: #ffffff;
	--acft-acc-panel-color: #0f2a35;

	--acft-sidebar-w: 22%;
	--acft-breakpoint: 1024px;

	box-sizing: border-box;
	width: 100%;
	color: #0f2a35;
}

.acft-widget *,
.acft-widget *::before,
.acft-widget *::after {
	box-sizing: inherit;
}

.acft-inner {
	display: flex;
	align-items: stretch;
	border-radius: 18px;
	overflow: hidden;
	background: var(--acft-content-bg-solid);
}

/* --------------------------------------------------------------------------
 * Sidebar — desktop tab list
 * -------------------------------------------------------------------------- */
.acft-sidebar {
	flex: 0 0 var(--acft-sidebar-w);
	padding: 32px 28px;
	color: rgba(255, 255, 255, 0.8);
}

.acft-widget.acft-sidebar-solid .acft-sidebar {
	background: var(--acft-sidebar-bg-solid);
}

.acft-widget.acft-sidebar-gradient .acft-sidebar {
	background: linear-gradient(
		var(--acft-sidebar-grad-angle),
		var(--acft-sidebar-bg-1) 0%,
		var(--acft-sidebar-bg-2) 100%
	);
}

/* --------------------------------------------------------------------------
 * Heading
 * -------------------------------------------------------------------------- */
.acft-heading {
	color: #ffffff;
	margin: 0 0 28px;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2;
}

.acft-heading-inner {
	display: inline-block;
}

.acft-widget.acft-has-head-rule .acft-heading-inner {
	border-bottom: 2px solid #ffffff;
	padding-bottom: 6px;
}

/* --------------------------------------------------------------------------
 * Tab list (desktop)
 * -------------------------------------------------------------------------- */
.acft-tablist {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.acft-tab {
	appearance: none;
	background: transparent;
	border: 0;
	margin: 0;
	padding: 6px 4px;
	color: inherit;
	text-align: left;
	font: inherit;
	line-height: 1.35;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	position: relative;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.acft-tab:focus-visible {
	outline: 2px solid #ffd166;
	outline-offset: 4px;
	border-radius: 2px;
}

.acft-tab-label {
	display: inline-block;
}

.acft-tab-chevron {
	display: none;
	flex: 0 0 auto;
	color: var(--acft-acc-chevron-color);
	width: var(--acft-acc-chevron-size);
	height: calc(var(--acft-acc-chevron-size) * 0.7);
	transition: transform 0.25s ease;
}

.acft-widget.acft-indicator-underline .acft-tab.is-active .acft-tab-label {
	border-bottom: var(--acft-indicator-thickness) solid var(--acft-indicator-color);
	padding-bottom: var(--acft-indicator-offset);
}

.acft-widget.acft-indicator-bar-left .acft-tab {
	padding-left: 14px;
}
.acft-widget.acft-indicator-bar-left .acft-tab.is-active::before {
	content: "";
	position: absolute;
	left: 0;
	top: 6px;
	bottom: 6px;
	width: var(--acft-indicator-thickness);
	background: var(--acft-indicator-color);
	border-radius: 2px;
}

.acft-widget.acft-indicator-pill .acft-tab {
	padding: 8px 12px;
}

/* --------------------------------------------------------------------------
 * Content area (desktop)
 * -------------------------------------------------------------------------- */
.acft-content {
	flex: 1 1 auto;
	min-width: 0;
	padding: 40px 48px;
}

.acft-widget.acft-content-solid .acft-content {
	background: var(--acft-content-bg-solid);
}

.acft-widget.acft-content-gradient .acft-content {
	background: linear-gradient(
		var(--acft-content-grad-angle),
		var(--acft-content-bg-1) 0%,
		var(--acft-content-bg-2) 100%
	);
}

.acft-panel {
	display: block;
}

.acft-panel[hidden] {
	display: none;
}

.acft-panel:focus-visible {
	outline: 2px solid #ffd166;
	outline-offset: 4px;
	border-radius: 4px;
}

/* --------------------------------------------------------------------------
 * Intro (max-width set inline by Elementor)
 * -------------------------------------------------------------------------- */
.acft-intro {
	color: #0f2a35;
	margin: 0 0 28px;
	font-size: 1.0625rem;
	line-height: 1.55;
}

.acft-intro :where(p):last-child {
	margin-bottom: 0;
}

.acft-intro :where(strong, b) {
	font-weight: 700;
}

/* --------------------------------------------------------------------------
 * Grid of blocks
 * -------------------------------------------------------------------------- */
.acft-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 48px;
	row-gap: 36px;
}

.acft-grid[data-blocks="1"] {
	grid-template-columns: 1fr;
}

.acft-block {
	min-width: 0;
}

/* --------------------------------------------------------------------------
 * Block title + gradient rule (pseudo-element so it can be a gradient)
 * -------------------------------------------------------------------------- */
.acft-block-title {
	color: #c8512f;
	font-size: 1.125rem;
	font-weight: 700;
	margin: 0 0 14px;
	line-height: 1.25;
}

.acft-widget.acft-has-block-rule .acft-block-title::after {
	content: "";
	display: block;
	height: var(--acft-block-rule-thickness);
	width: var(--acft-block-rule-width);
	max-width: 100%;
	background: linear-gradient(
		var(--acft-block-rule-angle),
		var(--acft-block-rule-c1) 0%,
		var(--acft-block-rule-c2) 100%
	);
	margin-top: var(--acft-block-rule-offset);
	border-radius: calc(var(--acft-block-rule-thickness) / 2);
}

/* --------------------------------------------------------------------------
 * Block body
 * -------------------------------------------------------------------------- */
.acft-block-body {
	color: #0f2a35;
	font-size: 0.9375rem;
	line-height: 1.6;
}

.acft-block-body :where(p, ul, ol) {
	margin: 0 0 0.75rem;
}

.acft-block-body :where(p, ul, ol):last-child {
	margin-bottom: 0;
}

.acft-block-body :where(ul, ol) {
	padding-left: 1.25rem;
}

.acft-block-body li + li {
	margin-top: 0.25em;
}

.acft-block-body a {
	color: #c8512f;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.acft-block-body a:hover {
	color: #a04528;
}

/* ==========================================================================
 * Accordion mode
 * ========================================================================== */
.acft-widget.is-accordion .acft-inner {
	flex-direction: column;
	background: transparent;
	border-radius: 0;
	min-height: 0;
	gap: var(--acft-acc-gap);
}

.acft-widget.is-accordion .acft-sidebar,
.acft-widget.is-accordion .acft-content {
	display: contents;
}

/* When in accordion, neutralize the desktop content backgrounds */
.acft-widget.is-accordion.acft-content-solid .acft-content,
.acft-widget.is-accordion.acft-content-gradient .acft-content {
	background: transparent;
}

.acft-widget.is-accordion .acft-heading {
	order: -1;
	color: var(--acft-acc-tab-bg-active);
	margin: 0 0 12px;
}

.acft-widget.is-accordion .acft-tablist {
	display: contents;
}

.acft-widget.is-accordion .acft-tab {
	order: calc(var(--acft-i, 0) * 2 + 1);
	background: var(--acft-acc-tab-bg);
	color: var(--acft-acc-tab-color);
	padding: 16px 20px;
	font-weight: 700;
	border-radius: var(--acft-acc-item-radius);
	border-top: var(--acft-acc-divider-width) solid var(--acft-acc-divider-color);
}

.acft-widget.is-accordion .acft-tab:first-of-type,
.acft-widget.is-accordion .acft-tab[style*="--acft-i:0"] {
	border-top: 0;
}

.acft-widget.is-accordion .acft-tab.is-active {
	background: var(--acft-acc-tab-bg-active);
	color: var(--acft-acc-tab-color-active);
}

.acft-widget.is-accordion .acft-tab-label {
	border: 0 !important;
	padding: 0 !important;
}

.acft-widget.is-accordion .acft-tab-chevron {
	display: inline-flex;
}

.acft-widget.is-accordion .acft-tab[aria-expanded="true"] .acft-tab-chevron {
	transform: rotate(180deg);
}

.acft-widget.is-accordion .acft-panel {
	order: calc(var(--acft-i, 0) * 2 + 2);
	padding: 20px 20px 24px;
	background: var(--acft-acc-panel-bg);
	color: var(--acft-acc-panel-color);
	border-radius: 0 0 var(--acft-acc-item-radius) var(--acft-acc-item-radius);
}

.acft-widget.is-accordion .acft-intro {
	color: var(--acft-acc-panel-color);
	margin-bottom: 20px;
}

.acft-widget.is-accordion .acft-grid {
	grid-template-columns: 1fr;
	column-gap: 0;
	row-gap: 24px;
}

/* Mobile rule visibility:
 * - Default: hide block-title rule in accordion (cleaner mobile look)
 * - Opt in via `acft-has-block-rule-mobile`
 */
.acft-widget.acft-has-block-rule.acft-no-block-rule-mobile.is-accordion .acft-block-title::after {
	display: none;
}

.acft-widget.acft-has-block-rule-mobile.is-accordion .acft-block-title::after {
	display: block;
}

.acft-widget.is-accordion .acft-tab::before {
	content: none !important;
}

/* --------------------------------------------------------------------------
 * No-JS / pre-hydration fallback
 * -------------------------------------------------------------------------- */
@media (max-width: 1023.98px) {
	.acft-widget:not(.is-accordion) .acft-inner {
		flex-direction: column;
	}
	.acft-widget:not(.is-accordion) .acft-sidebar {
		flex: 0 0 auto;
	}
	.acft-widget:not(.is-accordion) .acft-grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.acft-tab,
	.acft-tab-chevron {
		transition: none;
	}
}

@media (prefers-contrast: more) {
	.acft-tab:focus-visible,
	.acft-panel:focus-visible {
		outline: 3px solid CanvasText;
		outline-offset: 4px;
	}
}

.acft-empty {
	padding: 16px;
	background: #fff7f3;
	border: 1px dashed #c8512f;
	color: #6b2a14;
	border-radius: 8px;
	font-size: 14px;
}
