/**
 * AdepaTrade — components.
 * Buttons (all variations + states) · labels · frames · lists · separators ·
 * core block refinements (search, pagination, breadcrumbs, cover, table, quote).
 */

/* =========================================================
 * Buttons
 * Primary = theme.json `elements.button` (red fill, uppercase, 0.06em, 2px radius).
 * Here: geometry/touch target, transitions, variations and demo states.
 * ========================================================= */
.wp-element-button,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.625em;
	min-height: 48px;
	min-width: var(--wp--custom--touch-target);
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color var(--wp--custom--motion--fast) linear,
		border-color var(--wp--custom--motion--fast) linear,
		color var(--wp--custom--motion--fast) linear;
}
.wp-block-button__link:active,
.wp-element-button:active { transform: translateY(1px); }

/* Secondary — charcoal outline */
.wp-block-button.is-style-secondary .wp-block-button__link {
	background-color: transparent;
	color: var(--wp--preset--color--charcoal);
	border: 1px solid var(--wp--preset--color--charcoal);
}
.wp-block-button.is-style-secondary .wp-block-button__link:is(:hover, :focus-visible),
.wp-block-button.is-style-secondary.is-demo-hover .wp-block-button__link,
.wp-block-button.is-style-secondary.is-demo-focus .wp-block-button__link {
	background-color: var(--wp--preset--color--charcoal);
	border-color: var(--wp--preset--color--charcoal);
	color: var(--wp--preset--color--white);
}
.wp-block-button.is-style-secondary .wp-block-button__link:active,
.wp-block-button.is-style-secondary.is-demo-active .wp-block-button__link {
	background-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
}

/* On dark — white outline on charcoal surfaces */
.wp-block-button.is-style-on-dark .wp-block-button__link {
	background-color: transparent;
	color: var(--wp--preset--color--white);
	border: 1px solid rgba(255, 255, 255, 0.6);
}
.wp-block-button.is-style-on-dark .wp-block-button__link:is(:hover, :focus-visible),
.wp-block-button.is-style-on-dark.is-demo-hover .wp-block-button__link,
.wp-block-button.is-style-on-dark.is-demo-focus .wp-block-button__link {
	background-color: var(--wp--preset--color--white);
	border-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--charcoal);
}
.wp-block-button.is-style-on-dark .wp-block-button__link:active,
.wp-block-button.is-style-on-dark.is-demo-active .wp-block-button__link {
	background-color: var(--wp--preset--color--grey-200);
	color: var(--wp--preset--color--charcoal);
}

/* Text link — directional, no box */
.wp-block-button.is-style-text-link .wp-block-button__link {
	background: none;
	border: 0;
	border-bottom: 1px solid currentColor;
	border-radius: 0;
	padding: 0.25rem 0;
	min-height: var(--wp--custom--touch-target);
	color: var(--wp--preset--color--ink);
	gap: 0.75em;
}
.wp-block-button.is-style-text-link .wp-block-button__link::after {
	content: "";
	flex: none;
	width: 1.125em;
	height: 0.75em;
	background-color: var(--wp--preset--color--brand-red);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Cpath d='M0 5.25h15.1L10.9 1.06 11.96 0 18 6l-6.04 6-1.06-1.06 4.2-4.19H0z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Cpath d='M0 5.25h15.1L10.9 1.06 11.96 0 18 6l-6.04 6-1.06-1.06 4.2-4.19H0z'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform var(--wp--custom--motion--base) var(--adepa-ease);
}
.wp-block-button.is-style-text-link .wp-block-button__link:is(:hover, :focus-visible),
.wp-block-button.is-style-text-link.is-demo-hover .wp-block-button__link {
	background: none;
	color: var(--wp--preset--color--brand-red);
	border-color: var(--wp--preset--color--brand-red);
}
.wp-block-button.is-style-text-link .wp-block-button__link:is(:hover, :focus-visible)::after,
.wp-block-button.is-style-text-link.is-demo-hover .wp-block-button__link::after {
	transform: translateX(4px);
}
:is(.is-style-dark-section, .adepa-footer, .adepa-overlay) .wp-block-button.is-style-text-link .wp-block-button__link {
	color: var(--wp--preset--color--white);
}
:is(.is-style-dark-section, .adepa-footer, .adepa-overlay) .wp-block-button.is-style-text-link .wp-block-button__link::after {
	background-color: var(--wp--preset--color--brand-red-bright);
}

/* Primary — static demo state modifiers for the Style Guide (mirror theme.json states) */
.wp-block-button.is-demo-hover:not([class*="is-style-"]) .wp-block-button__link {
	background-color: var(--wp--preset--color--brand-red-dark);
	border-color: var(--wp--preset--color--brand-red-dark);
}
.wp-block-button.is-demo-focus .wp-block-button__link {
	outline: var(--wp--custom--focus--width) solid var(--adepa-focus-color);
	outline-offset: var(--wp--custom--focus--offset);
}
.wp-block-button.is-demo-active:not([class*="is-style-"]) .wp-block-button__link {
	background-color: var(--wp--preset--color--charcoal);
	border-color: var(--wp--preset--color--charcoal);
}

/* Disabled (aria-disabled for links, [disabled] for buttons) */
.wp-block-button.is-demo-disabled .wp-block-button__link,
.wp-block-button__link[aria-disabled="true"],
.wp-element-button:disabled {
	background-color: var(--wp--preset--color--grey-200) !important;
	border-color: var(--wp--preset--color--grey-200) !important;
	color: var(--wp--preset--color--grey-500) !important;
	cursor: not-allowed;
	transform: none;
	pointer-events: none;
}

/* Text-link disabled: no box */
.wp-block-button.is-style-text-link.is-demo-disabled .wp-block-button__link {
	background: none !important;
	border-color: var(--wp--preset--color--grey-300) !important;
}
.wp-block-button.is-style-text-link.is-demo-disabled .wp-block-button__link::after { background-color: var(--wp--preset--color--grey-300); }

/* Planned link (0.4.0) — a text-link CTA whose destination page is not built yet. The Button block
   has NO url, so it renders <a> without href: not a link for assistive technology, no focus stop.
   Visually distinct from an active text link: muted, no underline, no arrow, a hollow node in front
   (the "not yet connected" mark), default cursor. Activate by adding the URL and removing the
   `adepa-link-planned` class (W2-R1-v040-NOTES.md). Contrast: grey-500 on white 5.93:1, on warm
   grey 5.21:1; grey-300 on charcoal 10.75:1 (AA). */
.wp-block-button.adepa-link-planned .wp-block-button__link,
.wp-block-button.adepa-link-planned .wp-block-button__link:hover {
	gap: 0.6em;
	border-bottom: 0;
	color: var(--wp--preset--color--grey-500);
	cursor: default;
	pointer-events: none;
}
.wp-block-button.adepa-link-planned .wp-block-button__link::after { content: none; }
.wp-block-button.adepa-link-planned .wp-block-button__link::before {
	content: "";
	flex: none;
	order: -1;
	width: 9px;
	height: 9px;
	box-sizing: border-box;
	border-radius: 50%;
	border: 1.5px solid currentColor;
}
:is(.is-style-dark-section, .adepa-footer, .adepa-overlay) .wp-block-button.adepa-link-planned .wp-block-button__link { color: var(--wp--preset--color--grey-300); }
.adepa-link-planned:not(.wp-block-button) { cursor: default; }

/* CTA label shortening: full label ≥1024px, "Send requirement" below (accessible name unchanged). */
@media (max-width: 1023.98px) {
	.adepa-cta-optional {
		position: absolute !important;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

/* =========================================================
 * Labels
 * ========================================================= */
/* Eyebrow variation (JSON) — optional red node modifier */
.is-style-eyebrow { margin-block-end: 0; }
.is-style-eyebrow.adepa-has-node,
.adepa-technical-label {
	display: inline-flex;
	align-items: center;
	gap: 0.625em;
}
.is-style-eyebrow.adepa-has-node::before,
.adepa-technical-label::before {
	content: "";
	flex: none;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--wp--preset--color--brand-red);
	box-shadow: 0 0 0 3px var(--wp--preset--color--brand-red-tint);
}
:is(.is-style-dark-section, .is-style-raised-dark, .adepa-footer, .adepa-overlay) .is-style-eyebrow {
	color: var(--wp--preset--color--grey-300);
}
:is(.is-style-dark-section, .is-style-raised-dark, .adepa-footer, .adepa-overlay) :is(.is-style-eyebrow.adepa-has-node, .adepa-technical-label)::before {
	background: var(--wp--preset--color--brand-red-bright);
	box-shadow: 0 0 0 3px rgba(234, 51, 69, 0.18);
}

/* Technical label: node • code — scope */
.adepa-technical-label {
	font-size: var(--wp--preset--font-size--label);
	font-weight: 700;
	letter-spacing: var(--wp--custom--letter-spacing--label);
	text-transform: uppercase;
	color: var(--wp--preset--color--grey-700);
	line-height: 1.4;
}
.adepa-technical-label strong { color: var(--wp--preset--color--brand-red); font-weight: 700; }

/* System label (tag) — profile "UP TO 36 kV" block */
.adepa-system-label {
	display: inline-block;
	width: fit-content;
	padding: 0.5em 0.875em;
	font-size: var(--wp--preset--font-size--label);
	font-weight: 700;
	letter-spacing: var(--wp--custom--letter-spacing--label);
	text-transform: uppercase;
	line-height: 1.2;
	border: 1px solid var(--wp--preset--color--brand-red);
	border-radius: var(--wp--custom--radius--none);
	color: var(--wp--preset--color--brand-red);
	background: var(--wp--preset--color--white);
}
/* 0.3.0: labels carrying a unit are written in capitals and not transformed, so "kV" stays "kV" */
.adepa-system-label.is-verbatim { text-transform: none; }
.adepa-system-label.is-solid {
	background: var(--wp--preset--color--brand-red);
	color: var(--wp--preset--color--white);
}
.adepa-system-label.is-large {
	padding: 0.85em 1.4em;
	font-size: var(--wp--preset--font-size--small);
}
.adepa-system-label.is-neutral {
	border-color: var(--wp--preset--color--grey-300);
	color: var(--wp--preset--color--grey-700);
}
.adepa-label-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
}

/* =========================================================
 * Technical frame image (JSON variation adds border + 6px inset)
 * Corner ticks drawn with two background gradients-free pseudo elements.
 * ========================================================= */
.wp-block-image.is-style-technical-frame,
.wp-block-post-featured-image.is-style-technical-frame {
	position: relative;
	background: var(--wp--preset--color--white);
}
.wp-block-image.is-style-technical-frame::before,
.wp-block-image.is-style-technical-frame::after,
.wp-block-post-featured-image.is-style-technical-frame::before,
.wp-block-post-featured-image.is-style-technical-frame::after {
	content: "";
	position: absolute;
	width: 14px;
	height: 14px;
	pointer-events: none;
	border-color: var(--wp--preset--color--brand-red);
	border-style: solid;
	z-index: 1;
}
.wp-block-image.is-style-technical-frame::before,
.wp-block-post-featured-image.is-style-technical-frame::before {
	top: -1px;
	left: -1px;
	border-width: 2px 0 0 2px;
}
.wp-block-image.is-style-technical-frame::after,
.wp-block-post-featured-image.is-style-technical-frame::after {
	right: -1px;
	bottom: -1px;
	border-width: 0 2px 2px 0;
}
.wp-block-image.is-style-technical-frame:has(figcaption)::after { bottom: auto; top: calc(100% - 14px - 2.6em); }
.wp-block-image.is-style-technical-frame figcaption { padding-inline: 2px; }

/* =========================================================
 * Lists
 * ========================================================= */
.wp-block-list.is-style-plain,
.is-style-plain {
	list-style: none;
	padding-left: 0;
}
.wp-block-list.is-style-technical {
	list-style: none;
	border-top: var(--adepa-rule);
}
.wp-block-list.is-style-technical > li {
	position: relative;
	padding: 0.75rem 0 0.75rem 1.5rem;
	border-bottom: var(--adepa-rule);
	margin: 0;
}
.wp-block-list.is-style-technical > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: calc(0.75rem + 0.55em);
	width: 7px;
	height: 7px;
	background: var(--wp--preset--color--brand-red);
}
:is(.is-style-dark-section, .adepa-footer) .wp-block-list.is-style-technical,
:is(.is-style-dark-section, .adepa-footer) .wp-block-list.is-style-technical > li {
	border-color: var(--wp--preset--color--charcoal-2);
}
:is(.is-style-dark-section, .adepa-footer) .wp-block-list.is-style-technical > li::before {
	background: var(--wp--preset--color--brand-red-bright);
}
/* Bullet-separated inline scope lines ("Switchgear • RMU • …") */
.adepa-scope { color: var(--wp--preset--color--grey-500); }

/* =========================================================
 * Separators
 * ========================================================= */
.wp-block-separator {
	border: 0;
	border-top: 1px solid currentColor;
	opacity: 1;
	margin-block: var(--wp--preset--spacing--50);
}
.wp-block-separator.is-style-hairline { border-top-width: 1px; }
.wp-block-separator.adepa-rule-red {
	color: var(--wp--preset--color--brand-red);
	border-top-width: 2px;
	width: 96px;
	max-width: 96px;
	margin-left: 0 !important;
}
:is(.is-style-dark-section, .adepa-footer, .wp-block-cover) .wp-block-separator.adepa-rule-red { color: var(--wp--preset--color--brand-red-bright); }

/* =========================================================
 * Core refinements
 * ========================================================= */
/* Quote */
.wp-block-quote { margin-inline: 0; }
.wp-block-quote cite { display: block; margin-top: var(--wp--preset--spacing--30); }

/* Table */
.wp-block-table table { border-collapse: collapse; width: 100%; }
.wp-block-table :is(th, td) {
	border: 0;
	border-bottom: var(--adepa-rule);
	padding: 0.75rem 1rem 0.75rem 0;
	text-align: left;
	vertical-align: top;
}
.wp-block-table thead th {
	font-size: var(--wp--preset--font-size--label);
	letter-spacing: var(--wp--custom--letter-spacing--label);
	text-transform: uppercase;
	color: var(--wp--preset--color--grey-500);
	border-bottom: 1px solid var(--wp--preset--color--ink);
}

/* Search */
.wp-block-search__inside-wrapper { gap: 0; }
.wp-block-search__input {
	border-radius: var(--wp--custom--radius--sm) 0 0 var(--wp--custom--radius--sm) !important;
	min-height: 48px;
}
.wp-block-search__button {
	margin-left: 0 !important;
	border-radius: 0 var(--wp--custom--radius--sm) var(--wp--custom--radius--sm) 0 !important;
}
.wp-block-search__label {
	font-size: var(--wp--preset--font-size--label);
	font-weight: 700;
	letter-spacing: var(--wp--custom--letter-spacing--label);
	text-transform: uppercase;
	color: var(--wp--preset--color--grey-700);
}

/* Query pagination */
.wp-block-query-pagination {
	gap: var(--wp--preset--spacing--20);
	border-top: var(--adepa-rule);
	padding-top: var(--wp--preset--spacing--50);
}
.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--wp--custom--touch-target);
	min-height: var(--wp--custom--touch-target);
	padding: 0 0.75rem;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	border: 1px solid transparent;
	border-radius: var(--wp--custom--radius--sm);
}
.wp-block-query-pagination a:hover { border-color: var(--wp--preset--color--grey-300); color: var(--wp--preset--color--brand-red); }
.wp-block-query-pagination .page-numbers.current {
	background: var(--wp--preset--color--charcoal);
	color: var(--wp--preset--color--white);
}
.wp-block-query-pagination-numbers { display: inline-flex; gap: 0.25rem; }

/* Breadcrumbs (core/breadcrumbs, WP 7.0+) */
.wp-block-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; padding: 0; margin: 0; list-style: none; }
.wp-block-breadcrumbs a { text-decoration: none; }
.wp-block-breadcrumbs a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.wp-block-breadcrumbs [aria-current="page"] { color: var(--wp--preset--color--grey-500); }
/* 0.4.36 (W10-R2, WCAG 1.4.3): breadcrumbs inside dark sections (Contact hero). grey-500 on charcoal was 2.93:1;
   grey-300 #CFCBC4 gives 10.75:1 on charcoal #151B1F and 8.37:1 on charcoal-2 #2A2F33. Links stay white (17.38:1). Light pages unchanged. */
:is(.is-style-dark-section, .is-style-raised-dark) .wp-block-breadcrumbs,
:is(.is-style-dark-section, .is-style-raised-dark) .wp-block-breadcrumbs [aria-current="page"] { color: var(--wp--preset--color--grey-300); }
:is(.is-style-dark-section, .is-style-raised-dark) .wp-block-breadcrumbs a { color: var(--wp--preset--color--white); }

/* Cover: overlay sits on charcoal, never gradients */
.wp-block-cover { border-radius: 0; }
.wp-block-cover .wp-block-cover__inner-container { color: var(--wp--preset--color--white); }

/* Post navigation */
.wp-block-post-navigation-link a { text-decoration: none; }
.wp-block-post-navigation-link a:hover { color: var(--wp--preset--color--brand-red); }

/* Featured image placeholder fill */
.wp-block-post-featured-image img { background: var(--wp--preset--color--grey-100); }

/* Details */
.wp-block-details { border-top: var(--adepa-rule); border-bottom: var(--adepa-rule); padding-block: var(--wp--preset--spacing--30); }
.wp-block-details summary { cursor: pointer; font-weight: 600; min-height: var(--wp--custom--touch-target); display: flex; align-items: center; }
