/* Guide pages on the demo store (class-xt-demo-guide.php). Colours, type and radius come from the
   theme's presets, so a guide follows the starter's style and its light/dark switch. Each section
   reads like the theme's own "heading left, content right" bands. */

.xtd-guide {
	--xtd-ink: var(--wp--preset--color--contrast, #1b1b1b);
	--xtd-paper: var(--wp--preset--color--base, #fff);
	--xtd-surface: var(--wp--preset--color--surface, #f4f2ee);
	--xtd-muted: var(--wp--preset--color--muted, #5f5f5f);
	--xtd-line: var(--wp--preset--color--border, #e3e0da);
	--xtd-line-strong: var(--wp--preset--color--border-strong, #c9c4bb);
	--xtd-r: var(--wp--custom--radius--md, 6px);
	--xtd-r-lg: var(--wp--custom--radius--lg, 10px);
	box-sizing: border-box;
	color: var(--xtd-ink);
}

.xtd-guide *,
.xtd-guide *::before,
.xtd-guide *::after {
	box-sizing: inherit;
}

.xtd-guide__lead {
	max-width: 56ch;
	margin: 0 0 clamp(40px, 6vw, 72px);
	color: var(--xtd-muted);
	font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
	line-height: 1.6;
	text-wrap: pretty;
}

/* One band per section */

.xtd-guide__section {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	gap: 20px clamp(24px, 5vw, 80px);
	padding-block: clamp(28px, 4vw, 48px);
	border-top: 1px solid var(--xtd-line);
}

.xtd-guide__section:last-child {
	border-bottom: 1px solid var(--xtd-line);
}

.xtd-guide__head {
	min-width: 0;
}

.xtd-guide__h2 {
	margin: 0;
	font-size: clamp(1.375rem, 2vw, 1.75rem);
	line-height: 1.15;
	text-wrap: balance;
}

.xtd-guide__text {
	max-width: 36ch;
	margin: 10px 0 0;
	color: var(--xtd-muted);
	font-size: 0.9375rem;
	line-height: 1.55;
	text-wrap: pretty;
}

.xtd-guide__code {
	margin: 14px 0 0;
}

.xtd-guide__code code {
	display: inline-block;
	max-width: 100%;
	padding: 4px 10px;
	border: 1px solid var(--xtd-line);
	border-radius: var(--xtd-r);
	background: var(--xtd-surface);
	color: var(--xtd-ink);
	font-size: 0.8125rem;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.xtd-guide__body {
	min-width: 0;
}

/* The plugin's own output, as it prints it on the store */

.xtd-guide__live {
	padding: clamp(20px, 2.4vw, 28px);
	border: 1px solid var(--xtd-line);
	border-radius: var(--xtd-r-lg);
	background: var(--xtd-paper);
}

.xtd-guide__live > :first-child {
	margin-top: 0;
}

.xtd-guide__live > :last-child {
	margin-bottom: 0;
}

.xtd-guide__live h3 {
	margin: 0 0 8px;
	font-size: 1.0625rem;
}

.xtd-guide__live p {
	margin: 0;
}

.xtd-guide__live table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
}

.xtd-guide__live td,
.xtd-guide__live th {
	padding: 10px 0;
	border: 0;
	border-top: 1px solid var(--xtd-line);
	text-align: start;
}

.xtd-guide__live tr:first-child td,
.xtd-guide__live tr:first-child th {
	border-top: 0;
}

.xtd-guide__empty {
	color: var(--xtd-muted);
	font-size: 0.9375rem;
	line-height: 1.55;
}

/* 'tiles': a list the plugin prints as table rows, one tile per row (ways to earn points) */

.xtd-guide__live--tiles {
	padding: 0;
	border: 0;
	background: none;
}

.xtd-guide__live--tiles table {
	display: block;
}

.xtd-guide__live--tiles tbody {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
	gap: 12px;
}

.xtd-guide__live--tiles tr {
	display: flex;
	border: 1px solid var(--xtd-line);
	border-radius: var(--xtd-r-lg);
	background: var(--xtd-paper);
}

.xtd-guide__live--tiles td,
.xtd-guide__live--tiles tr:first-child td {
	display: block;
	width: 100%;
	padding: 18px 20px 20px;
	border: 0;
	color: var(--xtd-muted);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.xtd-guide__live--tiles td strong:first-of-type {
	display: block;
	margin-bottom: 6px;
	color: var(--xtd-ink);
	font-size: clamp(1.375rem, 2vw, 1.625rem);
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

/* Cards that lead to where a feature shows */

.xtd-guide__cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.xtd-guide__card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 20px;
	border: 1px solid var(--xtd-line);
	border-radius: var(--xtd-r-lg);
	background: var(--xtd-paper);
}

.xtd-guide__h3 {
	margin: 0;
	font-size: 1.0625rem;
	line-height: 1.3;
}

.xtd-guide__card-text {
	flex: 1;
	margin: 0;
	color: var(--xtd-muted);
	font-size: 0.9375rem;
	line-height: 1.55;
}

.xtd-guide__card-link {
	align-self: flex-start;
	display: inline-block;
	padding-block: 12px;
	margin-block: -4px -12px;
	color: var(--xtd-ink);
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
}

.xtd-guide__card-link:hover {
	text-decoration-thickness: 2px;
}

.xtd-guide__card-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 2px;
}

/* A plain list in two columns */

.xtd-guide__list {
	columns: 2 220px;
	column-gap: clamp(24px, 4vw, 48px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.xtd-guide__list li {
	break-inside: avoid;
	padding: 10px 0;
	border-top: 1px solid var(--xtd-line);
	color: var(--xtd-ink);
	font-size: 0.9375rem;
	line-height: 1.5;
}

@media (max-width: 781px) {
	.xtd-guide__section {
		grid-template-columns: minmax(0, 1fr);
	}

	.xtd-guide__cards {
		grid-template-columns: minmax(0, 1fr);
	}

	.xtd-guide__text {
		max-width: 60ch;
	}
}
