/*
 * AuthorFox Bridge: the article elements the hub writes as core blocks with
 * an ap- class: the table (ap-table), the fact box kinds (ap-factoid), the
 * titled boxes (ap-box), the FAQ (ap-faq), steps, glossary, pros and cons,
 * the pull quote and series navigation. Theme-neutral: no font, no colour
 * of its own. Every line and tint is the text colour at a low strength, so
 * all of them take the site's type and ink. The plain rgba line before each
 * color-mix line is the fallback for browsers without color-mix().
 */

/* The table: a rounded hairline container; a wide table scrolls sideways on a phone instead of breaking the layout. */
.wp-block-table.ap-table {
	margin: 1.5em 0;
	overflow-x: auto;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
	border-radius: 8px;
	background: transparent;
}

.wp-block-table.ap-table table {
	/* Columns take their content's width; on a phone the table keeps at least 480px and the figure scrolls, so words are never broken to fit. */
	table-layout: auto;
	width: 100%;
	min-width: 480px;
	border-collapse: collapse;
	margin: 0;
	font-size: 0.95em;
}

/* Hairline row dividers, no vertical rules: core's cell borders are overridden. */
.wp-block-table.ap-table th,
.wp-block-table.ap-table td {
	padding: 0.6em 0.9em;
	text-align: left;
	vertical-align: top;
	overflow-wrap: normal;
	word-break: normal;
	hyphens: manual;
	border: 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
	border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

/* A small-letter header row on a faint fill. */
.wp-block-table.ap-table thead th {
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: rgba(0, 0, 0, 0.05);
	background: color-mix(in srgb, currentColor 5%, transparent);
	border-bottom: 2px solid rgba(0, 0, 0, 0.25);
	border-bottom: 2px solid color-mix(in srgb, currentColor 25%, transparent);
}

.wp-block-table.ap-table tbody tr:last-child td {
	border-bottom: 0;
}

.wp-block-table.ap-table figcaption {
	margin: 0.5em 0 0;
	font-size: 0.85em;
	opacity: 0.75;
	text-align: left;
}

/* The fact box: a 1px border, a thicker left edge and a faint fill from the text colour. */
.wp-block-group.ap-factoid {
	margin: 1.5em 0;
	padding: 1.1em 1.3em;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	border-left-width: 4px;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.05);
	background: color-mix(in srgb, currentColor 5%, transparent);
}

.wp-block-group.ap-factoid > p {
	margin: 0;
}

.wp-block-group.ap-factoid > p + p {
	margin-top: 0.5em;
}

/* The title: small and spaced, never a heading. */
.wp-block-group.ap-factoid .ap-factoid__title {
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.8;
}

/* The fact box kinds (1.5.0): a sign before the title of a warning or a tip; the stat's big figure. */
.wp-block-group.ap-factoid--warning .ap-factoid__title::before {
	content: "\26A0\FE0F ";
}

.wp-block-group.ap-factoid--tip .ap-factoid__title::before {
	content: "\270D\FE0F ";
}

.wp-block-group.ap-factoid .ap-factoid__figure {
	font-size: 2.2em;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.01em;
	margin: 0 0 0.3em;
}

/* The titled box (takeaways, checklist, table of contents, a titled list): a hairline frame on a faint fill. */
.wp-block-group.ap-box {
	margin: 1.5em 0;
	padding: 1.1em 1.3em;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.05);
	background: color-mix(in srgb, currentColor 5%, transparent);
}

/* The title of a box, a FAQ, steps, a glossary or pros and cons: small and spaced, never a heading. */
.ap-box__title {
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.8;
	margin: 0 0 0.5em;
}

.ap-box__list {
	margin: 0;
	padding-left: 1.2em;
}

/* The checklist: a ballot box before each item instead of a bullet. */
.ap-box--checklist .ap-box__list {
	list-style: none;
	padding-left: 0;
}

.ap-box--checklist .ap-box__list li::before {
	content: "\2610";
	margin-right: 0.5em;
}

.ap-box--toc .ap-toc li {
	margin: 0.25em 0;
}

/* The pull quote: a line above and below, centred, no colour of its own. */
.wp-block-pullquote.ap-pullquote {
	margin: 2em 0;
	padding: 1em 0;
	border-top: 2px solid rgba(0, 0, 0, 0.25);
	border-top: 2px solid color-mix(in srgb, currentColor 25%, transparent);
	border-bottom: 2px solid rgba(0, 0, 0, 0.25);
	border-bottom: 2px solid color-mix(in srgb, currentColor 25%, transparent);
	text-align: center;
}

.wp-block-pullquote.ap-pullquote p {
	font-size: 1.35em;
	line-height: 1.35;
	margin: 0;
}

.wp-block-pullquote.ap-pullquote cite {
	display: block;
	margin-top: 0.6em;
	font-size: 0.8em;
	font-style: normal;
	opacity: 0.75;
}

/* The FAQ: one hairline under each question; the question is the clickable summary. */
.wp-block-group.ap-faq details {
	padding: 0.6em 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
	border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.wp-block-group.ap-faq summary {
	cursor: pointer;
	font-weight: 600;
	padding: 0.2em 0;
}

.wp-block-group.ap-faq details > p {
	margin: 0.5em 0 0;
}

/* The steps: a numbered list, each step's name on its own line. */
.wp-block-group.ap-steps .ap-steps__list {
	padding-left: 1.4em;
}

.wp-block-group.ap-steps .ap-steps__list li {
	margin: 0.5em 0;
}

.wp-block-group.ap-steps .ap-steps__list li strong {
	display: block;
}

/* The glossary: the term in a fixed-width column before its definition. */
.wp-block-group.ap-glossary p {
	margin: 0.5em 0;
}

.wp-block-group.ap-glossary p strong {
	display: inline-block;
	min-width: 8em;
}

/* Pros and cons: two framed columns from 600px, one under the other on a phone. */
.wp-block-group.ap-pros-cons {
	margin: 1.5em 0;
}

.wp-block-group.ap-pros-cons .ap-pros-cons__col {
	padding: 0.8em 1em;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
	border-radius: 8px;
}

.wp-block-group.ap-pros-cons .ap-pros-cons__label {
	font-weight: 600;
	margin: 0 0 0.4em;
}

.wp-block-group.ap-pros-cons .ap-pros-cons__col ul,
.wp-block-group.ap-pros-cons .ap-pros-cons__col ol {
	margin: 0;
	padding-left: 1.2em;
}

@media (min-width: 600px) {
	.wp-block-group.ap-pros-cons {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 1em;
	}

	.wp-block-group.ap-pros-cons > .ap-box__title {
		grid-column: 1 / -1;
	}
}

/* Series navigation: a quiet line of small text. */
.ap-series-nav {
	font-size: 0.9em;
	opacity: 0.85;
	margin: 1em 0;
}
