/**
 * listocom-tabs - the site's ONE tab component.
 *
 * Chrome only. Both halves live in page content as ordinary blocks:
 *   triggers  a wp:html <nav class="listocom-tabs"> of <button data-tab="<name>">
 *   panels    wp:group blocks classed `listocom-tabs__panel is-<name>`
 * `data-tab="<name>"` <-> `is-<name>` is the entire binding. The nav and its
 * panels must be siblings; behaviour comes from tabs.js.
 *
 * The default trigger AND default panel ship `is-active` in the saved markup.
 * That is load-bearing twice over: it stops every panel flashing before tabs.js
 * runs, and it leaves one panel readable if the script never arrives. The
 * <noscript> beside the nav reveals the rest. (The previous legal-tabs.css hid
 * panels unconditionally, so with JS off the entire legal text vanished.)
 *
 * Visual reference is the My Account tab row. Triggers are raw <button>, not
 * core/button, so none of theme.json's styles.elements.button reaches them -
 * every value below is restated on purpose, measured off the rendered account
 * page rather than read out of theme.json (the two disagree: global styles post
 * 2847 overrides the button radius to 50px).
 */

.listocom-tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px 8px; /* row gap / column gap, as on /account/ */
	margin: 0 0 28px;
	padding: 0;
}

.listocom-tabs__tab {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin: 0;
	padding: 12px 24px;
	border: 0;
	border-radius: 50px;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: -0.1px;
	/* overlay-1 is color-mix(currentColor 20%, transparent), so the resting
	   tint is derived from the text colour on this very element. */
	color: var(--wp--preset--color--primary);
	background-color: var(--wp--preset--color--overlay-1);
	transition: background-color .15s ease-in-out, color .15s ease-in-out;
}

.listocom-tabs__tab:hover {
	background-color: color-mix(in srgb, currentColor 32%, transparent);
}

.listocom-tabs__tab:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

.listocom-tabs__tab.is-active {
	color: var(--wp--preset--color--base);
	background-color: var(--wp--preset--color--primary);
}

/* The active pill is a destination, not a target - don't invite a re-click. */
.listocom-tabs__tab.is-active:hover {
	background-color: var(--wp--preset--color--primary);
}

.listocom-tabs__tab svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* Panel card: same shape as the /account/ panel (12px radius, 24px padding,
   10% green tint). Text colour is deliberately NOT set here - /account/ paints
   its panels #c6e1df to match the EDD tables, which is wrong for long prose. */
.listocom-tabs__panel {
	padding: 24px;
	border-radius: 12px;
	background-color: rgba(93, 202, 157, .1);
}

.listocom-tabs__panel:not(.is-active) {
	display: none;
}

/* Opt out of the card where a panel already supplies its own container. */
.listocom-tabs__panel--bare {
	padding: 0;
	border-radius: 0;
	background-color: transparent;
}

@media (max-width: 640px) {
	.listocom-tabs { gap: 8px 6px; }
	.listocom-tabs__tab { padding: 10px 16px; }
	.listocom-tabs__panel { padding: 20px 16px; }
}
