/**
 * CV Compatibility Centre: what the plugin draws on the hub and the guides.
 *
 * Values from the Figma single (8660:17771) and its type scale:
 * Display md 36/1.1/-6%, Display xs 24/1.3/-4%, Text xl 20/1.4/-2%,
 * Text md 16/1.5/-2%, Text sm 14/1.4/-2%, labels 12/1.6/+5% uppercase.
 * The page layout is GenerateBlocks; this file styles the plugin's output:
 * the article ([cg_guide]), the index, the list of guides and the hub logos.
 */

/* ── "In short": the grey summary box (Figma: 24 padding, 16 radius) ── */
.cg-short {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 32px 0 0;
	padding: 24px;
	border-radius: 16px;
	background: var(--cg-gray-100);
}

.cg-short ul {
	margin: 0;
	padding-left: 24px;
}

.cg-short li {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	letter-spacing: -.02em;
	color: var(--cg-gray-600);
}

.cg-short .cg-label {
	color: var(--cg-gray-600); /* 12px on grey: gray-500 falls short of AA */
}

.cg-short strong {
	font-weight: 600;
	color: inherit;
}

/* ── headings the plugin prints (table, sections) ────────── */
.cg-h2 {
	margin: 64px 0 0;
	font-size: 24px;
	line-height: 1.3;
	letter-spacing: -.04em;
	font-weight: 500;
	color: var(--cg-gray-950);
	scroll-margin-top: 32px; /* = CG_Guide_Toc::OFFSET, for jumps without the script */
}

/* ── section text: 16/1.5, 16 between paragraphs, 12 under an H2 ── */
.cg-text p,
.cg-text li {
	font-size: 16px;
	line-height: 1.5;
	letter-spacing: -.02em;
	color: var(--cg-gray-600);
}

.cg-text p {
	margin: 16px 0 0;
}

.cg-h2 + .cg-text > :first-child {
	margin-top: 12px;
}

.cg-text h3 {
	margin: 32px 0 0;
	font-size: 20px;
	line-height: 1.4;
	letter-spacing: -.02em;
	font-weight: 500;
	color: var(--cg-gray-950);
}

.cg-text ul,
.cg-text ol {
	margin: 16px 0 0;
	padding-left: 24px;
}

.cg-h2 + .cg-text > ul:first-child,
.cg-h2 + .cg-text > ol:first-child {
	margin-top: 12px;
}

.cg-text li {
	margin: 0;
}

.cg-text strong {
	font-weight: 600;
	color: inherit;
}

.cg-text a,
.cg-table a {
	color: var(--cg-brand);
	font-weight: 400;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ── tables: the generated one and the editorial ones, one component ──
   Wide enough (a full column): a table with fixed shares per column, from
   the Figma (608 wide). Narrow (tablet beside the rail, phones): a list,
   each row a title with a grey detail line.
   The switch reads the table's own width, not the screen's, so it holds
   whatever the template does around it. */
.cg-table-wrap {
	margin: 16px 0 0;
	container-type: inline-size;
}

.cg-table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	table-layout: fixed;
	font-size: 16px;
}

.cg-table th,
.cg-table td {
	padding: 12px 24px 12px 0;
	border: 0;
	border-bottom: 1px solid var(--cg-gray-200);
	background: none;
	text-align: left;
	vertical-align: top;
	overflow-wrap: break-word;
}

.cg-table th {
	font-size: 12px;
	font-weight: 500;
	line-height: 1.6;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--cg-gray-500);
}

.cg-table td {
	line-height: 1.5;
	letter-spacing: -.02em;
	color: var(--cg-gray-600);
}

.cg-table th:last-child,
.cg-table td:last-child {
	padding-right: 0;
}

/* the first cell of a row is its header (th scope="row"): it reads as the
   row's name, not as a column label */
.cg-table tbody th {
	font-size: 16px;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: -.02em;
	text-transform: none;
	color: var(--cg-gray-800);
}

/* a product name moves to the next line whole when it does not fit;
   only one longer than the whole column wraps inside, never past it */
.cg-table a {
	display: inline-block;
}

/* each column's share of the Figma widths (gap included) */
.cg-table--fits th:nth-child(1) { width: 32%; }
.cg-table--fits th:nth-child(2) { width: 28%; }
.cg-table--families th:nth-child(1) { width: 25%; }
.cg-table--families th:nth-child(2) { width: 49%; }
.cg-table--resistance th:nth-child(1) { width: 20%; }
.cg-table--resistance th:nth-child(2) { width: 40%; }

@container (max-width: 480px) {
	/* a list, as apps list compatible devices: the first cell is the
	   title, the others one grey line under it ("GPP pods · Pod with
	   built-in coil"). A family's description reads as its own line. */
	.cg-table,
	.cg-table tbody,
	.cg-table tr {
		display: block;
		width: auto;
	}

	/* the column headings stay for screen readers */
	.cg-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.cg-table tr {
		padding: 12px 0;
		border-bottom: 1px solid var(--cg-gray-200);
	}

	.cg-table tr:first-child {
		border-top: 1px solid var(--cg-gray-200);
	}

	.cg-table td,
	.cg-table td:last-child {
		display: inline;
		padding: 0;
		border: 0;
		font-size: 14px;
		line-height: 1.4;
		color: var(--cg-gray-500);
	}

	.cg-table td + td::before {
		content: "·";
		margin: 0 6px;
		color: var(--cg-gray-400);
	}

	/* [scope] outranks the column widths (.cg-table--fits th:nth-child) */
	.cg-table tbody th[scope] {
		display: block;
		width: auto;
		margin-bottom: 2px;
		padding: 0;
		border: 0;
	}

	.cg-table--families td,
	.cg-table--families td:last-child {
		display: block;
	}

	.cg-table--families td + td {
		margin-top: 2px;
	}

	.cg-table--families td + td::before {
		content: none;
	}
}

/* ── image, caption, note ────────────────────────────────── */
.cg-figure {
	margin: 32px 0 0;
}

.cg-figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 16px;
	background: var(--cg-gray-100);
}

.cg-caption {
	margin: 12px 0 0;
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: -.02em;
	color: var(--cg-gray-500);
}

.cg-note {
	margin: 32px 0 0;
	padding: 16px 20px;
	border-radius: 16px;
	background: var(--cg-gray-100);
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: -.02em;
	color: var(--cg-gray-600);
}

/* ── the index ───────────────────────────────────────────── */
.cg-toc {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cg-toc ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cg-toc a {
	text-decoration: none;
	font-weight: 400;
}

.cg-toc--side {
	position: sticky;
	top: 104px;
}

.cg-toc--side a {
	display: block;
	padding: 6px 0 6px 12px;
	border-left: 2px solid var(--cg-gray-200);
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: -.02em;
	color: var(--cg-gray-500);
	transition: color 200ms var(--cg-ease), border-color 200ms var(--cg-ease);
}

.cg-toc--side a:hover {
	color: var(--cg-gray-800);
}

.cg-toc--side a.is-current {
	border-color: var(--cg-brand);
	color: var(--cg-gray-800);
	font-weight: 500;
}

.cg-toc--inline {
	margin: 32px 0 0;
}

.cg-toc--inline ul {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cg-toc--inline a {
	font-size: 16px;
	line-height: 1.5;
	color: var(--cg-gray-600);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cg-toc--inline a:hover {
	color: var(--cg-gray-950);
}

/* ── the list of guides ──────────────────────────────────── */
.cg-nav__group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cg-nav__list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.cg-nav__list a {
	display: block;
	padding: 6px 12px;
	border-radius: 12px;
	font-size: 16px;
	line-height: 1.5;
	font-weight: 400;
	color: var(--cg-gray-600);
	text-decoration: none;
	transition: background 200ms var(--cg-ease), color 200ms var(--cg-ease);
}

.cg-nav__list a:hover {
	background: var(--cg-gray-100);
	color: var(--cg-gray-950);
}

.cg-nav__list a.is-current {
	background: var(--cg-gray-100);
	color: var(--cg-gray-800);
	font-weight: 500;
}

/* ── [cg_guide]: the article column (Figma single 8660:17771) ── */
/* clears the theme's paragraph margin without outranking the section
   rules (.cg-text p keeps its 16 between paragraphs) */
.cg-guide :where(p) {
	margin: 0;
}

.cg-crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: -.02em;
	color: var(--cg-gray-500);
}

.cg-crumbs a {
	color: var(--cg-gray-500);
	font-weight: 400;
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color 200ms var(--cg-ease);
}

.cg-crumbs a:hover {
	color: var(--cg-brand);
}

.cg-title {
	margin: 32px 0 0;
	font-size: 36px;
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -.06em;
	color: var(--cg-gray-950);
}

.cg-guide .cg-meta {
	margin-top: 16px;
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: -.02em;
	color: var(--cg-gray-500);
}

.cg-guide .cg-overview {
	margin-top: 32px;
	font-size: 16px;
	line-height: 1.5;
	letter-spacing: -.02em;
	color: var(--cg-gray-600);
}

.cg-rule {
	height: 0;
	margin: 64px 0 0;
	border: 0;
	border-top: 1px solid var(--cg-gray-200);
	background: none;
}

.cg-cta {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 32px 0 0;
	padding: 16px 20px;
	border-radius: 16px;
	background: var(--cg-gray-100);
}

.cg-cta__tx {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cg-guide .cg-cta__title {
	font-size: 16px;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: -.02em;
	color: var(--cg-gray-950);
}

.cg-guide .cg-cta__sub {
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: -.02em;
	color: var(--cg-gray-600); /* on grey: gray-500 falls short of AA */
}

.cg-cta__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	border-radius: 9999px;
	background: var(--cg-brand);
	color: var(--cg-white);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: -.02em;
	text-decoration: none;
	white-space: nowrap;
	transition: background 200ms var(--cg-ease);
}

.cg-cta__btn:hover,
.cg-cta__btn:focus-visible {
	background: var(--cg-brand-600);
	color: var(--cg-white);
}

/* notes under the table sit 32 below the call to action, like a block */
.cg-cta + .cg-body > .cg-text:first-child > :first-child {
	margin-top: 32px;
}

/* questions: the archive's GenerateBlocks Pro accordion, same markup and
   script. The collapse rules are here too, so answers never flash open
   while the accordion stylesheet loads in the footer. */
.cg-faq {
	margin: 16px 0 0;
	border: 1px solid var(--cg-gray-200);
	border-radius: 16px;
	overflow: hidden;
}

.cg-faq__item {
	border-bottom: 1px solid var(--cg-gray-200);
	transition: background-color .2s ease;
}

.cg-faq__item:last-child {
	border-bottom-width: 0;
}

.cg-faq__item:is(:hover, :focus),
.cg-faq__item.gb-accordion__item-open {
	background: var(--cg-gray-100);
}

.cg-faq__q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px;
	cursor: pointer;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: -.02em;
	color: var(--cg-gray-950);
}

.cg-faq__icon svg {
	display: block;
	width: 1em;
	height: 1em;
	font-size: 20px;
	color: var(--cg-gray-400);
}

.cg-faq .gb-accordion__content {
	max-height: 0;
	overflow: hidden;
	visibility: hidden;
	transition: max-height .25s ease;
	will-change: max-height;
}

.cg-faq .gb-accordion__item-open > .gb-accordion__content {
	max-height: inherit;
	visibility: visible;
}

.cg-faq__item:not(.gb-accordion__item-open) .gb-accordion__toggle-icon-close,
.cg-faq__item.gb-accordion__item-open .gb-accordion__toggle-icon-open {
	display: none;
}

.cg-faq__a {
	padding: 0 64px 16px 16px;
}

.cg-guide .cg-faq__a p {
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: -.02em;
	color: var(--cg-gray-600);
}

.cg-guide .cg-help-text {
	margin-top: 12px;
	font-size: 16px;
	line-height: 1.5;
	letter-spacing: -.02em;
	color: var(--cg-gray-600);
}

.cg-help-text a {
	color: var(--cg-brand);
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cg-crumbs a:focus-visible,
.cg-cta__btn:focus-visible {
	outline: 2px solid var(--cg-brand);
	outline-offset: 2px;
}

/* ── breakpoints: the site's own, 1024 (tablet) and 767 (phone) ──
   Type steps down once, at tablet, and holds on phones, as on the archive
   (H2 30 → 24, H3 20 → 18): here H1 36 → 30, H2 24 → 20, H3 20 → 18.
   The space above a heading follows its size: 64 → 48, 32 → 24. */
@media (max-width: 1024px) {
	.cg-toc--side {
		display: none;
	}

	.cg-title {
		margin-top: 24px;
		font-size: 30px;
		line-height: 1.2;
	}

	.cg-h2 {
		margin-top: 48px;
		font-size: 20px;
		line-height: 1.4;
		letter-spacing: -.02em;
	}

	.cg-rule {
		margin-top: 48px;
	}

	.cg-text h3 {
		margin-top: 24px;
		font-size: 18px;
		line-height: 1.5;
	}

	.cg-faq__icon svg {
		font-size: 16px;
	}

	.cg-faq__a {
		padding-right: 32px;
	}
}

@media (min-width: 1025px) {
	.cg-toc--inline {
		display: none;
	}
}

@media (max-width: 767px) {
	.cg-cta {
		flex-direction: column;
		align-items: stretch;
	}

	.cg-faq__a {
		padding-right: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cg-toc a,
	.cg-nav__list a,
	.cg-cta__btn,
	.cg-crumbs a,
	.cg-faq__item,
	.cg-faq .gb-accordion__content {
		transition: none;
	}
}
