/**
 * OptConnect FAQ / disclosure sections (PR 3.12) — `optconnect/faq-list` and
 * `optconnect/faq-log`.
 *
 * `<details>` / `<summary>` is the disclosure control; nothing here reimplements it.
 * No JavaScript, and no HTML `name` either — these panels are independent, so a reader
 * can hold two answers open at once and a page may carry this family beside
 * `optconnect/product-specs` without the two fighting over which panel is open.
 *
 * Two surfaces, one set of mechanics. `.oc-faq--cards` is the banded question list
 * (white cards on `accent-5`); `.oc-faq--rail` is the un-banded dated log (hairlines,
 * no card). The summary row — marker, focus ring, hit target — is shared on
 * `.oc-faq__panel` and neither modifier touches it.
 *
 * ⚠️ **The summary mechanics below deliberately repeat ~25 lines of
 * `product-specs.css` rather than sharing a class with it.** The two families differ in
 * surface, in marker and in exclusivity, so a shared `.oc-disclosure` would arrive
 * carrying two modifiers and the `name` hazard. Extract it when a *third* family needs a
 * disclosure, not before.
 *
 * Same no-margins convention as every other family stylesheet: nothing here declares a
 * `margin`, because core's flow layout emits `.wp-container-… > * + *
 * { margin-block-start: … }` at one-class specificity and this file loads after it. The
 * gap between cards is `blockGap` in the markup; the rail's zero gap is `blockGap: 0`;
 * space under an open panel is padding.
 */

/* --------------------------------------------------------------------------
 * The summary row — shared by both surfaces
 * ---------------------------------------------------------------------- */

/* `list-style: none` kills Firefox's default triangle and the `::-webkit-details-marker`
   rule below kills Safari's — neither browser honours the other's.
   `medium`, not the `large` the spec rail uses: these labels are whole questions running
   past 100 characters and one live section stacks seventeen of them, which at 1.38rem is
   a wall. Weight and family carry the emphasis instead.
   `min-height` is the 48px WCAG 2.5.8 target; the padding alone would not reach it on a
   one-line label. */
.oc-faq__panel > summary {
	align-items: center;
	color: var(--wp--preset--color--contrast, #1d2c38);
	cursor: pointer;
	display: flex;
	font-family: var(--wp--preset--font-family--nunito, Nunito, sans-serif);
	font-size: var(--wp--preset--font-size--medium, 1rem);
	font-weight: 700;
	gap: 1rem;
	justify-content: space-between;
	line-height: 1.4;
	list-style: none;
	min-height: 3rem;
	padding-block: 0.75rem;
}

.oc-faq__panel > summary::-webkit-details-marker {
	display: none;
}

/* `accent-2` (5.77:1), not `accent-1` (4.27:1) — a hover colour clears the same 4.5:1
   floor the resting one does. */
.oc-faq__panel > summary:hover {
	color: var(--wp--preset--color--accent-2, #006ba4);
}

/* Scoped to `> summary` so it cannot reach a `.wp-element-button` inside an open panel:
   a descendant `:focus-visible` rule is (0,2,0) and would silently beat `theme.json`'s
   own `:root :where(.wp-element-button:focus-visible)` at (0,1,0), giving the same
   control a different ring depending on its container. */
.oc-faq__panel > summary:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-1, #0081c2);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
 * The plus / minus marker
 * ---------------------------------------------------------------------- */

/* Two background bars on one box, not a glyph and not one of `assets/images/icons/` —
   those are blue-filled SVGs meant for `core/image` and would need a second file for the
   open state. Collapsing the vertical bar's `background-size` to zero turns the plus
   into a minus, which is one animatable property rather than a rotation. Plus-minus
   rather than a chevron because the chevron is the spec rail's marker.
   `flex: 0 0 auto` keeps it from being squeezed by a long question. */
.oc-faq__panel > summary::after {
	background-image:
		linear-gradient(var(--wp--preset--color--accent-1, #0081c2) 0 0),
		linear-gradient(var(--wp--preset--color--accent-1, #0081c2) 0 0);
	background-position: center;
	background-repeat: no-repeat;
	background-size:
		100% 2px,
		2px 100%;
	content: "";
	flex: 0 0 auto;
	height: 0.75em;
	transition: background-size 150ms ease;
	width: 0.75em;
}

.oc-faq__panel[open] > summary::after {
	background-size:
		100% 2px,
		2px 0;
}

@media (prefers-reduced-motion: reduce) {
	.oc-faq__panel > summary::after {
		transition: none;
	}
}

/* --------------------------------------------------------------------------
 * The open panel
 * ---------------------------------------------------------------------- */

/* A measure on the answer, and the one place this file sets a width instead of
   expressing it in markup: `core/details` declares `layout: { allowEditing: false }`, so
   it has no `contentSize` to set. The panel row itself stays full width. */
.oc-faq__panel > :not(summary) {
	max-width: 68ch;
}

/* --------------------------------------------------------------------------
 * `--cards` — the banded question list
 * ---------------------------------------------------------------------- */

/* The card's fill is `backgroundColor: base` in the markup, so an editor can change it;
   only the geometry lives here. It deliberately does not reuse `.oc-card`: that surface
   lifts on `:hover` because every card wearing it is a link target, and a `<summary>` is
   a control, not a destination. */
.oc-faq--cards .oc-faq__panel {
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(29, 44, 56, 0.08);
	overflow: hidden;
}

/* The radius is here for the focus ring, not for a fill — the summary has no background.
   An outline follows its own element's radius, so without it the ring is a sharp
   rectangle inside a rounded card. Written out rather than `inherit`, which Chrome
   computes to `0px` on `border-radius` even from a parent that has one. */
.oc-faq--cards .oc-faq__panel > summary {
	border-radius: 12px;
	padding-block: 1rem;
	padding-inline: var(--wp--preset--spacing--40, 30px);
}

/* `:focus`, not `:focus-visible`. The parent theme ships
   `:where(.wp-site-blocks :focus) { outline-style: solid; outline-width: 2px }` — a
   *plain* `:focus` — so a mouse click on a summary draws a ring at the browser default
   `outline-offset: 0`, which straddles the card edge and is cut in half by the
   `overflow: hidden` above. Pulling it inside covers the click case and the keyboard
   case in one rule; at (0,3,1) it outranks the base `:focus-visible` offset at (0,2,1). */
.oc-faq--cards .oc-faq__panel > summary:focus {
	outline-offset: -2px;
}

.oc-faq--cards .oc-faq__panel > :not(summary) {
	padding-inline: var(--wp--preset--spacing--40, 30px);
}

/* On `[open]` so a closed card adds no height. Padding rather than margin, per the
   convention above. */
.oc-faq--cards .oc-faq__panel[open] {
	padding-bottom: var(--wp--preset--spacing--40, 30px);
}

/* --------------------------------------------------------------------------
 * `--rail` — the un-banded dated log
 * ---------------------------------------------------------------------- */

/* `border-top` on each panel plus `border-bottom` on the last survives an editor
   deleting an entry, which an `+ *` rule would not. `rgba()` on the brand ink because
   there is still no hairline token — adding one is a palette decision, not a pattern's. */
.oc-faq--rail .oc-faq__panel {
	border-top: 1px solid rgba(29, 44, 56, 0.14);
}

.oc-faq--rail .oc-faq__panel:last-child {
	border-bottom: 1px solid rgba(29, 44, 56, 0.14);
}

.oc-faq--rail .oc-faq__panel[open] {
	padding-bottom: var(--wp--preset--spacing--40, 30px);
}

/* --------------------------------------------------------------------------
 * Benefits (`/careers/`, PR 6.1) — the FAQ's cards, holding a photo beside copy
 *
 * The answer's 68ch measure is for a paragraph; a benefit is two columns, so it takes
 * the panel's width.
 * ---------------------------------------------------------------------- */
.oc-faq__panel.oc-benefit > :not(summary) {
	max-width: none;
}
