/**
 * Promptoogle AEO — answer, takeaways, and FAQ presentation.
 *
 * Every value falls back to a plain default but prefers a --po-* custom
 * property when one exists. On the Promptoogle theme that means these blocks
 * inherit the site's accent, radii, and surfaces and look native; on any
 * other theme the fallbacks apply and they still look deliberate.
 *
 * These blocks sit inside the article's prose, which on this theme is set in
 * a serif at a generous measure. That is right for reading and wrong for
 * scanning, so the summary blocks deliberately switch to the sans face at a
 * tighter size — they are reference material, not prose, and should look
 * like it.
 */

.po-aeo-answer,
.po-aeo-takeaways,
.po-aeo-faq {
	margin-block: 2em;
	font-family: var(--po-font-sans, inherit);
}

/* ------------------------------------------------------------ answer -- */

.po-aeo-answer {
	position: relative;
	overflow: hidden;
	padding: 1.3em 1.5em 1.4em;
	border-radius: var(--po-radius, 10px);
	border: 1px solid color-mix(in srgb, var(--po-accent, #4f46e5) 22%, transparent);
	background: color-mix(in srgb, var(--po-accent, #4f46e5) 5%, transparent);
}

/*
 * A spectral rail down the leading edge. This block is what an answer engine
 * lifts and what a reader looks for first, so it is marked as extracted
 * rather than left as another tinted callout.
 *
 * --po-spectrum comes from the Promptoogle theme; the fallback keeps the
 * rail correct under any other theme, which is the whole point of this
 * plugin being theme-independent.
 */
.po-aeo-answer::before {
	content: "";
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	inline-size: 3px;
	background: var(--po-spectrum, linear-gradient(180deg, #4f46e5, #8b5cf6 48%, #06b6d4));
	pointer-events: none;
}

.po-aeo-answer__label,
.po-aeo-takeaways__label,
.po-aeo-faq__eyebrow {
	margin: 0 0 0.5em;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--po-accent, #4f46e5);
}

.po-aeo-answer__body {
	margin: 0;
	font-size: 1.02rem;
	line-height: 1.6;
	text-wrap: pretty;
}

/* --------------------------------------------------------- takeaways -- */

.po-aeo-takeaways {
	padding: 1.35rem 1.5rem 1.4rem;
	border: 1px solid var(--po-border, rgba(0, 0, 0, 0.12));
	border-radius: var(--po-radius-lg, 14px);
	background: var(--po-surface, #fff);
}

.po-aeo-takeaways__label {
	margin-bottom: 0.9rem;
	padding-bottom: 0.85rem;
	border-bottom: 1px solid var(--po-border, rgba(0, 0, 0, 0.1));
}

/*
 * One bordered panel holding a numbered list, rather than a card per point.
 * As separate cards the grid forced every card to the height of the tallest
 * in its row, so a one-line takeaway sitting beside a four-line one carried
 * a visible block of empty space beneath it. A single panel has no rows to
 * equalise: each point takes exactly the height it needs.
 */
.po-aeo-takeaways__list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: po-aeo-takeaway;
}

.po-aeo-takeaways__list li {
	counter-increment: po-aeo-takeaway;
	display: flex;
	gap: 0.85rem;
	margin: 0;
	padding-block: 0.75rem;
	font-size: 0.95rem;
	line-height: 1.55;
	text-wrap: pretty;
}

/* Hairlines separate the points without boxing each one in. */
.po-aeo-takeaways__list li + li {
	border-block-start: 1px solid color-mix(in srgb, var(--po-border, rgba(0, 0, 0, 0.1)) 60%, transparent);
}

.po-aeo-takeaways__list li:first-child {
	padding-block-start: 0;
}

.po-aeo-takeaways__list li:last-child {
	padding-block-end: 0;
}

.po-aeo-takeaways__list li::before {
	content: counter(po-aeo-takeaway);
	/*
	 * flex-start, not centre: the marker belongs beside the first line of
	 * the point, and centring drifts it down the block on a long takeaway.
	 */
	align-self: flex-start;
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 1.55rem;
	height: 1.55rem;
	margin-block-start: 0.06rem;
	border-radius: 50%;
	background: color-mix(in srgb, var(--po-accent, #4f46e5) 11%, transparent);
	font-size: 0.75rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	color: var(--po-accent, #4f46e5);
}

/* --------------------------------------------------------------- FAQ -- */

.po-aeo-faq {
	padding-block-start: 1.75em;
	border-block-start: 1px solid var(--po-border, rgba(0, 0, 0, 0.12));
}

.po-aeo-faq__title {
	margin: 0 0 0.9em;
	font-family: var(--po-font-display, var(--po-font-sans, inherit));
	font-size: 1.35rem;
	line-height: 1.25;
}

.po-aeo-faq__list {
	display: grid;
	gap: 0.6rem;
}

.po-aeo-faq__item {
	border: 1px solid var(--po-border, rgba(0, 0, 0, 0.1));
	border-radius: var(--po-radius, 10px);
	background: var(--po-surface, #fff);
	overflow: hidden;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

.po-aeo-faq__item[open] {
	border-color: color-mix(in srgb, var(--po-accent, #4f46e5) 35%, transparent);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.po-aeo-faq__item:hover {
	border-color: color-mix(in srgb, var(--po-accent, #4f46e5) 30%, transparent);
}

.po-aeo-faq__q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.95rem 1.15rem;
	cursor: pointer;
	font-size: 0.98rem;
	font-weight: 600;
	line-height: 1.4;
	list-style: none;
}

/* The default disclosure triangle would sit alongside the custom icon. */
.po-aeo-faq__q::-webkit-details-marker {
	display: none;
}

.po-aeo-faq__q::marker {
	content: "";
}

.po-aeo-faq__q:focus-visible {
	outline: 2px solid var(--po-accent, #4f46e5);
	outline-offset: -2px;
}

.po-aeo-faq__q-text {
	min-width: 0;
}

/*
 * A plus drawn from two rules, rotated to an x when open — one element, no
 * icon font, and it stays legible at any text size because it is sized in em.
 */
.po-aeo-faq__icon {
	position: relative;
	flex: 0 0 auto;
	width: 1.4em;
	height: 1.4em;
	border-radius: 50%;
	background: color-mix(in srgb, var(--po-accent, #4f46e5) 10%, transparent);
	transition: transform 200ms ease, background-color 200ms ease;
}

.po-aeo-faq__icon::before,
.po-aeo-faq__icon::after {
	content: "";
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	width: 0.62em;
	height: 2px;
	border-radius: 2px;
	background: var(--po-accent, #4f46e5);
	transform: translate(-50%, -50%);
}

.po-aeo-faq__icon::after {
	transform: translate(-50%, -50%) rotate(90deg);
	transition: opacity 200ms ease;
}

.po-aeo-faq__item[open] .po-aeo-faq__icon {
	transform: rotate(135deg);
}

.po-aeo-faq__a {
	padding: 0 1.15rem 1.1rem;
	font-size: 0.94rem;
	line-height: 1.6;
	color: var(--po-text-2, inherit);
}

.po-aeo-faq__a p {
	margin: 0;
	text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
	.po-aeo-takeaways__list li,
	.po-aeo-faq__item,
	.po-aeo-faq__icon {
		transition: none;
	}
}

/* ---------------------------------------------------------- fallback -- */

/*
 * color-mix is widely supported but not universal. Where it is missing the
 * accent tints collapse to transparent, which would leave the answer with no
 * background and the number badges invisible — so restate the essentials in
 * plain colours for browsers that skip it.
 */
@supports not (background: color-mix(in srgb, red 5%, transparent)) {
	.po-aeo-answer {
		border-color: rgba(0, 0, 0, 0.12);
		background: rgba(0, 0, 0, 0.03);
	}

	.po-aeo-takeaways__list li::before,
	.po-aeo-faq__icon {
		background: rgba(0, 0, 0, 0.06);
	}
}

@media (prefers-color-scheme: dark) {
	@supports not (background: color-mix(in srgb, red 5%, transparent)) {
		.po-aeo-answer {
			border-color: rgba(255, 255, 255, 0.16);
			background: rgba(255, 255, 255, 0.05);
		}

		.po-aeo-takeaways__list li::before,
		.po-aeo-faq__icon {
			background: rgba(255, 255, 255, 0.1);
		}
	}
}

/* ------------------------------------------- archive introduction --- */

/*
 * The generated paragraph at the top of a category or tag archive. Kept
 * deliberately plain: it sits inside whatever the active theme renders
 * around the loop, so anything opinionated here would fight the theme
 * rather than fit it. Colour is inherited, not set.
 */
.po-aeo-archive-intro {
	margin: 0 0 1.75rem;
	padding: 0 0 0 1rem;
	border-inline-start: 3px solid currentColor;
	opacity: 0.85;
}

.po-aeo-archive-intro p {
	margin: 0;
	max-width: 68ch;
	font-size: 1.02em;
	line-height: 1.65;
}
