/**
 * The OTA Tabs widget: a tab row, an ochre underline, panels beneath.
 *
 * The same drawing as the Elementor Tabs skin in ota-elementor-widgets.css
 * (Page Content, "Everything you need to apply"), on this widget's own
 * classes. The two must move together: a designer changing the tabs changes
 * both. The values are copied rather than shared as variables because the
 * skin's tokens are scoped to `.elementor-widget-tabs`, and pulling this
 * widget under that class would put it inside the theme's id-anchored tab
 * rules, which is the one thing having its own markup avoids.
 *
 * The tokens are literal, not colour theme roles, for the reason the skin
 * gives: the Ash and Teal frames draw these tabs identically, so they are
 * fixed brand furniture rather than something that follows the page theme.
 *
 * Layout in words: labels 17px, medium weight in the muted colour, bold in
 * the text colour when active, 28px apart, no padding anywhere (the 32px box
 * and the underline anchored to its bottom reproduce the frame's 18px label
 * and 11px gap without it). One 1.5px hairline under the whole row, and the
 * active label's 3px pill underline sits ON that hairline, covering it for
 * the label's width. 32px of air before the panel, no borders around it.
 * Below 769px the row goes and each panel gets a title above it instead, the
 * active one marked with an inset ochre bar, so the widget reads as an
 * accordion. 768.98 rather than 768 for the same reason as the skin: the kit's
 * mobile breakpoint is 768 and a fractional zoomed viewport must not fall
 * between the two blocks.
 */

.ota-tabs {
	--otb-line: rgba(0, 48, 56, 0.14);
	--otb-text: #003038;
	--otb-muted: #5a6b6e;
	--otb-underline: #f04c3a;
}

/* --- The row ---------------------------------------------------------------- */

.ota-tabs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 28px;
	margin: 0;
	padding: 0;
	border-block-end: 1.5px solid var(--otb-line);
}

/*
 * A button reset first, because the theme dresses every button in its
 * content area as a pill (background, padding, radius). Everything the frame
 * draws for a label is then set explicitly, so nothing depends on what a
 * button inherits.
 */
.ota-tabs__tab,
.ota-tabs__mobile-tab {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	font-family: inherit;
	text-align: start;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

.ota-tabs__tab {
	position: relative;
	display: flex;
	align-items: flex-start;
	min-block-size: 32px;
	font-size: 17px;
	font-weight: 500;
	line-height: 1;
	color: var(--otb-muted);
	transition: color 150ms ease;
}

.ota-tabs__tab:hover {
	color: var(--otb-text);
}

.ota-tabs__tab.is-active {
	font-weight: 700;
	color: var(--otb-text);
}

/* The underline: a pill sitting on the row's hairline, so it covers it. */
.ota-tabs__tab.is-active::after {
	content: "";
	display: block;
	position: absolute;
	inset-inline: 0;
	inset-block-end: -1.5px;
	block-size: 3px;
	border-radius: 999px;
	background-color: var(--otb-underline);
}

/*
 * Keyboard focus as an outline, not a border: the resting label has no border,
 * so a focus border would nudge the row. Same ring as the skin.
 */
.ota-tabs__tab:focus-visible,
.ota-tabs__mobile-tab:focus-visible {
	outline: 2px solid var(--otb-text);
	outline-offset: 2px;
}

/* --- The panels ------------------------------------------------------------- */

.ota-tabs__panel {
	padding-block-start: 32px;
}

.ota-tabs__panel[hidden] {
	display: none;
}

.ota-tabs__panel > :first-child {
	margin-block-start: 0;
}

.ota-tabs__panel > :last-child {
	margin-block-end: 0;
}

/*
 * The per-panel titles exist for the accordion view only. Above tablet width
 * the row does that job, so they are out of the layout and out of the
 * accessibility tree.
 */
@media (min-width: 769px) {
	.ota-tabs__mobile-tab {
		display: none;
	}
}

/* --- Accordion below tablet width ------------------------------------------- */

@media (max-width: 768.98px) {
	.ota-tabs__list {
		display: none;
	}

	.ota-tabs__panels {
		border-block-end: 1px solid var(--otb-line);
	}

	.ota-tabs__mobile-tab {
		display: block;
		inline-size: 100%;
		padding: 18px 0;
		border-block-start: 1px solid var(--otb-line);
		font-size: 17px;
		font-weight: 700;
		line-height: 1.2;
		color: var(--otb-text);
	}

	/*
	 * The open row is marked with an inset bar rather than by colouring the
	 * label: ochre text at this size fails the contrast floor, and an inset
	 * shadow does not change the row's height, so opening a panel never
	 * nudges the stack. Copied from the skin, where it is flagged as invented
	 * pending a mobile design pass.
	 */
	.ota-tabs__mobile-tab.is-active {
		box-shadow: inset 0 3px 0 0 var(--otb-underline);
	}

	.ota-tabs__panel {
		padding-block: 0 18px;
	}
}
