/*
 * Article body (blog posts): the core blocks inside the post content of
 * templates/single.html (.ac-post-layout__content), plus the article
 * components: list styles (Checklist, Terms, Two columns), the Comparison
 * table style, the Key takeaways / Pros and cons patterns, the mid-article
 * help card and the author box. The Callout and Steps blocks carry their own
 * styles (accountsconfidant-blocks). Loaded with core/post-content.
 * Values come from the theme tokens and the components already on the site
 * (cards, check icons, the FAQ and service-page lists).
 */

/* ── Section rhythm ──────────────────────────────────────────────────── */

/* A hairline above every section heading after the first. */
.ac-post-layout__content > h2.wp-block-heading:not(:first-child) {
	padding-top: 1.1em;
	border-top: 1px solid var(--wp--preset--color--line);
}

.ac-post-layout__content > h2.wp-block-heading + *,
.ac-post-layout__content > h3.wp-block-heading + * {
	margin-top: 0.7em;
}

/* Steps: the step's own heading sits level with its marker. */
.single-post .ac-post-layout__content .wp-block-accountsconfidant-step > .wp-block-heading:first-child {
	min-height: 0;
	margin-top: 0;
	padding-top: max(0px, calc(var(--ac-step-mid, 18px) - 0.65em));
	line-height: 1.3;
}

.ac-post-layout__content .wp-block-accountsconfidant-step > .wp-block-heading:first-child + * {
	margin-top: 0.6em;
}

.ac-post-layout__content p:empty {
	display: none;
}

/* Links in the running text. */
.ac-post-layout__content :is(p, li, td) a:not(.wp-element-button, .wp-block-button__link, [class*="btn"]) {
	color: var(--wp--preset--color--blue);
	font-weight: var(--wp--custom--font-weight--label);
	text-decoration: underline;
	text-decoration-color: #a5c8ff;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
	transition: text-decoration-color 0.2s;
}

.ac-post-layout__content :is(p, li, td) a:not(.wp-element-button, .wp-block-button__link, [class*="btn"]):hover {
	text-decoration-color: currentcolor;
}

/* ── Lists ───────────────────────────────────────────────────────────── */

/* Default bulleted list: brand-coloured round bullets. */
.ac-post-layout__content ul.wp-block-list:not([class*="is-style-"]) {
	padding-left: 0;
	list-style: none;
}

.ac-post-layout__content ul.wp-block-list:not([class*="is-style-"]) > li {
	position: relative;
	padding-left: 26px;
}

.ac-post-layout__content ul.wp-block-list:not([class*="is-style-"]) > li::before {
	content: "";
	position: absolute;
	top: 0.72em;
	left: 6px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--wp--preset--color--blue);
	box-shadow: 0 0 0 4px var(--wp--preset--color--tint);
}

.ac-post-layout__content ul.wp-block-list > li + li,
.ac-post-layout__content ol.wp-block-list > li + li {
	margin-top: 0.45em;
}

/* Numbered list: numbers in small circles (counter `list-item` keeps the
 * list's start number). */
.ac-post-layout__content ol.wp-block-list:not([class*="is-style-"]) {
	padding-left: 0;
	list-style: none;
}

.ac-post-layout__content ol.wp-block-list:not([class*="is-style-"]) > li {
	position: relative;
	padding-left: 40px;
}

.ac-post-layout__content ol.wp-block-list:not([class*="is-style-"]) > li::before {
	content: counter(list-item) / "";
	position: absolute;
	top: 0.2em;
	left: 0;
	display: grid;
	place-items: center;
	min-width: 26px;
	height: 26px;
	padding: 0 6px;
	border-radius: 13px;
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--blue);
	font-size: var(--wp--preset--font-size--tiny);
	font-weight: var(--wp--custom--font-weight--label);
	line-height: 1;
}

/* Nested lists keep plain markers. */
.ac-post-layout__content li .wp-block-list {
	margin-top: 0.45em;
}

/* Checklist: each item with a check icon (the service pages' check). */
.ac-post-layout__content .wp-block-list.is-style-checklist {
	display: grid;
	gap: 10px;
	padding: 22px 24px;
	border: 1px solid var(--wp--preset--color--line-blue);
	border-radius: var(--wp--preset--border-radius--lg);
	background: var(--wp--preset--color--wash);
	list-style: none;
}

.ac-post-layout__content .wp-block-list.is-style-checklist > li {
	position: relative;
	margin: 0;
	padding-left: 34px;
}

.ac-post-layout__content .wp-block-list.is-style-checklist > li::before {
	content: "";
	position: absolute;
	top: 0.25em;
	left: 0;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 13px no-repeat,
		linear-gradient(135deg, var(--wp--preset--color--blue), var(--wp--preset--color--sky));
}

/* Terms: items that open with a bold label ("Cost: …") as rows with the
 * label on its own line. */
.ac-post-layout__content .wp-block-list.is-style-terms {
	display: grid;
	gap: 10px;
	list-style: none;
}

.ac-post-layout__content .wp-block-list.is-style-terms > li {
	margin: 0;
	padding: 14px 18px;
	border: 1px solid var(--wp--preset--color--line);
	border-left: 3px solid var(--wp--preset--color--blue);
	border-radius: var(--wp--preset--border-radius--sm);
	background: var(--wp--preset--color--white);
}

.ac-post-layout__content .wp-block-list.is-style-terms > li > :is(strong, b):first-child {
	display: block;
	margin-bottom: 2px;
	color: var(--wp--preset--color--ink);
}

/* Two columns: long lists of short items. */
.ac-post-layout__content .wp-block-list.is-style-columns {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px 28px;
	list-style: none;
}

.ac-post-layout__content .wp-block-list.is-style-columns > li {
	position: relative;
	margin: 0;
	padding-left: 26px;
}

.ac-post-layout__content .wp-block-list.is-style-columns > li::before {
	content: "";
	position: absolute;
	top: 0.72em;
	left: 6px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--wp--preset--color--blue);
	box-shadow: 0 0 0 4px var(--wp--preset--color--tint);
}

ol.wp-block-list.is-style-columns {
	counter-reset: list-item;
}

.ac-post-layout__content ol.wp-block-list.is-style-columns > li::before {
	content: counter(list-item) "." / "";
	top: 0;
	left: 0;
	width: auto;
	height: auto;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: var(--wp--preset--color--blue);
	font-weight: var(--wp--custom--font-weight--label);
}

/* ── Tables ──────────────────────────────────────────────────────────── */

.ac-post-layout__content .wp-block-table {
	margin-block: 1.8em;
	overflow-x: auto;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--preset--border-radius--lg);
	background:
		linear-gradient(to right, var(--wp--preset--color--white) 30%, rgb(255 255 255 / 0%)) left / 40px 100% no-repeat local,
		linear-gradient(to left, var(--wp--preset--color--white) 30%, rgb(255 255 255 / 0%)) right / 40px 100% no-repeat local,
		radial-gradient(farthest-side at 0 50%, rgb(19 28 48 / 12%), transparent) left / 12px 100% no-repeat scroll,
		radial-gradient(farthest-side at 100% 50%, rgb(19 28 48 / 12%), transparent) right / 12px 100% no-repeat scroll,
		var(--wp--preset--color--white);
}

.ac-post-layout__content .wp-block-table table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--base);
	line-height: 1.6;
}

.ac-post-layout__content .wp-block-table :is(th, td) {
	padding: 14px 18px;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	text-align: left;
	vertical-align: top;
	overflow-wrap: normal;
	word-break: normal;
	hyphens: manual;
}

.ac-post-layout__content .wp-block-table :is(th, td) + :is(th, td) {
	border-left: 1px solid var(--wp--preset--color--line);
}

.ac-post-layout__content .wp-block-table tbody tr:last-child > * {
	border-bottom: 0;
}

/* Header row: the <thead>, or the first row when the table has none. */
.ac-post-layout__content .wp-block-table thead :is(th, td),
.ac-post-layout__content .wp-block-table table:not(:has(thead)) tbody tr:first-child > * {
	border-bottom: 1px solid var(--wp--preset--color--line-blue);
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--wp--custom--font-weight--label);
}

.ac-post-layout__content .wp-block-table thead {
	border-bottom: 0;
}

.ac-post-layout__content .wp-block-table tbody tr:nth-child(even) > * {
	background-color: rgb(247 250 255 / 60%);
}

.ac-post-layout__content .wp-block-table figcaption {
	margin: 0;
	padding: 10px 18px;
	border-top: 1px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

/* Comparison: the first column names the options. */
.ac-post-layout__content .wp-block-table.is-style-comparison tbody td:first-child {
	color: var(--wp--preset--color--ink);
	font-weight: var(--wp--custom--font-weight--label);
}

.ac-post-layout__content .wp-block-table.is-style-comparison thead :is(th, td),
.ac-post-layout__content .wp-block-table.is-style-comparison table:not(:has(thead)) tbody tr:first-child > * {
	background: var(--wp--preset--gradient--brand, var(--wp--preset--color--blue));
	color: var(--wp--preset--color--white);
}

/* Phones: tables keep readable columns and scroll sideways (with edge
 * shadows) instead of breaking words. */
@media (max-width: 781px) {

	.ac-post-layout__content .wp-block-table table {
		width: max-content;
		min-width: 100%;
		max-width: 720px;
		table-layout: auto;
	}

	.ac-post-layout__content .wp-block-table :is(th, td) {
		min-width: 140px;
		max-width: 260px;
		padding: 12px 14px;
	}
}

/* ── Images and quotes ───────────────────────────────────────────────── */

.ac-post-layout__content .wp-block-image {
	margin-block: 1.8em;
}

.ac-post-layout__content .wp-block-image img {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--preset--border-radius--md);
	box-shadow: 0 14px 32px rgb(64 105 166 / 8%);
}

.ac-post-layout__content .wp-block-image figcaption {
	margin-top: 12px;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	text-align: center;
}

.ac-post-layout__content .wp-block-quote {
	margin-block: 1.8em;
	padding: 20px 24px;
	border: 0;
	border-left: 4px solid var(--wp--preset--color--blue);
	border-radius: 0 var(--wp--preset--border-radius--md) var(--wp--preset--border-radius--md) 0;
	background: var(--wp--preset--color--wash);
	color: var(--wp--preset--color--ink);
}

.ac-post-layout__content .wp-block-quote > :last-child {
	margin-bottom: 0;
}

/* ── Key takeaways and Pros / cons (patterns) ────────────────────────── */

.wp-block-group.ac-takeaways {
	margin-block: 1.8em;
	padding: 24px 26px;
	border: 1px solid var(--wp--preset--color--line-blue);
	border-radius: var(--wp--preset--border-radius--lg);
	background: linear-gradient(160deg, var(--wp--preset--color--tint), var(--wp--preset--color--white) 70%);
}

.wp-block-group.ac-takeaways .ac-takeaways__title {
	margin: 0 0 12px;
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--large);
	font-weight: var(--wp--custom--font-weight--label);
}

.wp-block-group.ac-takeaways .wp-block-list {
	margin: 0;
}

.wp-block-columns.ac-proscons {
	gap: 16px;
	margin-block: 1.8em;
}

.ac-proscons .wp-block-column {
	padding: 20px 22px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--preset--border-radius--lg);
	background: var(--wp--preset--color--white);
}

.ac-proscons .ac-proscons__title {
	margin: 0 0 10px;
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: var(--wp--custom--font-weight--label);
}

.ac-proscons .ac-proscons__cons {
	background: var(--wp--preset--color--wash);
}

/* ── Mid-article help card (synced pattern) ──────────────────────────── */

.wp-block-group.ac-article-help {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 18px 28px;
	margin-block: 2.2em;
	padding: 26px 28px;
	border-radius: var(--wp--preset--border-radius--lg);
	background: var(--wp--preset--gradient--brand, var(--wp--preset--color--blue));
	box-shadow: var(--wp--preset--shadow--button);
	color: var(--wp--preset--color--white);
}

.ac-article-help .ac-article-help__eyebrow {
	margin: 0 0 4px;
	color: rgb(255 255 255 / 80%);
	font-size: var(--wp--preset--font-size--tiny);
	font-weight: var(--wp--custom--font-weight--label);
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.ac-article-help .ac-article-help__title {
	margin: 0;
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 800;
	letter-spacing: var(--wp--custom--letter-spacing--snug);
	line-height: 1.25;
}

.ac-article-help .ac-article-help__text {
	margin: 6px 0 0;
	color: rgb(255 255 255 / 88%);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.6;
}

.ac-article-help .wp-block-buttons {
	flex-wrap: nowrap;
	gap: 10px;
	margin: 0;
}

.ac-article-help .wp-block-button__link {
	white-space: nowrap;
}

.ac-article-help .ac-article-help__call .wp-block-button__link {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--blue);
}

.ac-article-help .ac-article-help__callback .wp-block-button__link {
	border-color: rgb(255 255 255 / 70%);
	background: transparent;
	color: var(--wp--preset--color--white);
}

@media (max-width: 781px) {

	.wp-block-group.ac-article-help {
		grid-template-columns: minmax(0, 1fr);
		padding: 22px 20px;
	}

	.ac-article-help .wp-block-buttons {
		flex-wrap: wrap;
	}
}

/* ── Author box (templates/single.html) ──────────────────────────────── */

.wp-block-group.ac-author-box {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr);
	gap: 20px;
	margin-top: var(--wp--preset--spacing--50);
	margin-bottom: var(--wp--preset--spacing--50);
	padding: 26px 28px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--preset--border-radius--lg);
	background: var(--wp--preset--color--wash);
}

.ac-author-box .wp-block-avatar img {
	display: block;
	border-radius: 50%;
	box-shadow: 0 0 0 4px var(--wp--preset--color--white), 0 0 0 5px var(--wp--preset--color--line-blue);
}

.ac-author-box .ac-author-box__eyebrow {
	margin: 0;
	color: var(--wp--preset--color--label);
	font-size: var(--wp--preset--font-size--tiny);
	font-weight: var(--wp--custom--font-weight--label);
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.ac-author-box .wp-block-post-author-name {
	margin: 2px 0 8px;
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 800;
}

.ac-author-box .wp-block-post-author-name a {
	color: inherit;
	text-decoration: none;
}

.ac-author-box .wp-block-post-author-biography {
	margin: 0;
	color: var(--wp--preset--color--body);
	font-size: var(--wp--preset--font-size--base);
	line-height: 1.75;
}

@media (max-width: 600px) {

	.wp-block-group.ac-author-box {
		grid-template-columns: minmax(0, 1fr);
		padding: 22px 20px;
	}

	.ac-post-layout__content .wp-block-list.is-style-columns {
		grid-template-columns: minmax(0, 1fr);
	}
}
