/*
 * Learn guides: content blocks of the guide pipeline (GUIDE-2, worldcrypt-data WCD_Text_Guide_Write::render_html).
 * Short answer box, scrollable data tables, warning callouts, checklists, pros and cons. The key takeaways, steps,
 * notes and lists use the design's own components (parts/snip/guide.php). Loaded on guide pages only (the plugin's
 * text loader). Colours are the theme's tokens, so the blocks follow the dark and light themes:
 * --t1P7HTr card, --tyYjSY6 raised row, --tZYQMwj strong text, --tBRrhmH body text, --tRVw0a9 accent,
 * --tfsdAxk red, --t6omCql green. No animation.
 */

.wc-answer,
.wc-tbl,
.wc-callout,
.wc-checklist,
.wc-proscons {
	margin: 6px 0;
}

/* short answer: the direct answer to the query, first on the page */
.wc-answer {
	padding: clamp(18px, 2vw, 24px) clamp(18px, 2.2vw, 28px);
	border-radius: 22px;
	background: var(--t1P7HTr, #1d1d1f);
	box-shadow: inset 4px 0 0 var(--tRVw0a9, #d4ff3f);
}

.wc-answer__label,
.wc-checklist__title,
.wc-proscons__head {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--tRVw0a9, #d4ff3f);
}

.wc-answer__text {
	margin: 0;
	font-size: clamp(17px, 1.6vw, 19px);
	line-height: 1.55;
	font-weight: 600;
	color: var(--tZYQMwj, #f5f5f7);
	text-wrap: pretty;
}

/* at a glance: the guide's key facts as a definition list (label | value), one column on phones */
.wc-glance {
	margin: 6px 0;
	padding: clamp(18px, 2vw, 24px) clamp(18px, 2.2vw, 28px);
	border-radius: 22px;
	background: var(--t1P7HTr, #1d1d1f);
}

.wc-glance__title {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--tRVw0a9, #d4ff3f);
}

.wc-glance__list {
	margin: 0;
	display: grid;
}

.wc-glance__row {
	display: grid;
	grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
	gap: 16px;
	padding: 12px 0;
	border-top: 1px solid rgba(127, 127, 127, 0.2);
}

.wc-glance__row:first-child {
	border-top: 0;
}

.wc-glance dt {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--tT6XaDa, #86868b);
	padding-top: 2px;
}

.wc-glance dd {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	font-weight: 600;
	color: var(--tZYQMwj, #f5f5f7);
}

@media (max-width: 480px) {
	.wc-glance__row {
		grid-template-columns: 1fr;
		gap: 4px;
	}
}

/* tables: real <table> with thead and row headers; scroll sideways on phones */
.wc-tbl {
	border-radius: 22px;
	background: var(--t1P7HTr, #1d1d1f);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
}

.wc-tbl:focus-visible {
	outline: 2px solid var(--tRVw0a9, #d4ff3f);
	outline-offset: 2px;
}

.wc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
	line-height: 1.45;
	color: var(--tBRrhmH, #d1d1d6);
}

.wc-table:has(thead th:nth-child(3)) {
	min-width: 540px;
}

.wc-table caption {
	caption-side: top;
	text-align: left;
	padding: 16px 20px 6px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--tRVw0a9, #d4ff3f);
}

.wc-table th,
.wc-table td {
	padding: 13px 20px;
	text-align: left;
	vertical-align: top;
}

.wc-table thead th {
	background: var(--tyYjSY6, #2c2c2e);
	color: var(--tZYQMwj, #f5f5f7);
	font-size: 13px;
	font-weight: 700;
}

.wc-table tbody th {
	color: var(--tZYQMwj, #f5f5f7);
	font-weight: 600;
	min-width: 120px;
}

.wc-table tbody tr + tr th,
.wc-table tbody tr + tr td {
	border-top: 1px solid rgba(127, 127, 127, 0.2);
}

/* warning callout (tips and notes use the design's note) */
.wc-callout {
	display: grid;
	gap: 6px;
	padding: clamp(18px, 2vw, 24px) clamp(18px, 2.2vw, 28px);
	border-radius: 22px;
	background: var(--t1P7HTr, #1d1d1f);
	box-shadow: inset 4px 0 0 var(--tfsdAxk, #ff453a);
}

.wc-callout__head {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 16px;
	font-weight: 700;
	color: var(--tZYQMwj, #f5f5f7);
}

.wc-callout__head::before {
	content: "!";
	flex: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 13px;
	font-weight: 800;
	color: #fff;
	background: var(--tfsdAxk, #ff453a);
}

.wc-callout__text {
	margin: 0;
	font-size: 16px;
	line-height: 1.55;
	color: var(--tBRrhmH, #d1d1d6);
}

/* checklist */
.wc-checklist {
	padding: clamp(18px, 2vw, 24px) clamp(18px, 2.2vw, 28px);
	border-radius: 22px;
	background: var(--t1P7HTr, #1d1d1f);
}

.wc-checklist ul,
.wc-proscons ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.wc-checklist li,
.wc-proscons li {
	position: relative;
	padding-left: 32px;
	font-size: 16px;
	line-height: 1.55;
	color: var(--tBRrhmH, #d1d1d6);
}

.wc-checklist li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 2px;
	width: 20px;
	height: 20px;
	border-radius: 6px;
	box-shadow: inset 0 0 0 2px var(--tRVw0a9, #d4ff3f);
}

.wc-checklist li::after {
	content: "";
	position: absolute;
	left: 7px;
	top: 5px;
	width: 6px;
	height: 11px;
	border: solid var(--tRVw0a9, #d4ff3f);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* pros and cons */
.wc-proscons {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.wc-proscons__col {
	padding: clamp(18px, 2vw, 24px);
	border-radius: 22px;
	background: var(--t1P7HTr, #1d1d1f);
}

.wc-proscons__col.is-pro .wc-proscons__head {
	color: var(--t6omCql, #30d158);
}

.wc-proscons__col.is-con .wc-proscons__head {
	color: var(--tfsdAxk, #ff453a);
}

.wc-proscons li::before {
	position: absolute;
	left: 2px;
	top: 0;
	font-weight: 800;
	font-size: 17px;
}

.wc-proscons .is-pro li::before {
	content: "+";
	color: var(--t6omCql, #30d158);
}

.wc-proscons .is-con li::before {
	content: "\2212";
	color: var(--tfsdAxk, #ff453a);
}

@media (max-width: 640px) {
	.wc-proscons {
		grid-template-columns: 1fr;
	}

	.wc-table {
		font-size: 14px;
	}

	.wc-table th,
	.wc-table td {
		padding: 12px 14px;
	}
}

/* a table wider than its box (assets/js/p/learn-guide.js wraps it): "Scroll for more" above it and a fade over the
   right edge while columns are hidden there */
.wc-tbl-wrap {
	display: grid;
	gap: 8px;
	min-width: 0;
}

.wc-tbl-box {
	position: relative;
	min-width: 0;
}

.wc-tbl-box > .wc-tbl {
	margin: 0;
}

.wc-tbl-fade {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 56px;
	border-radius: 0 22px 22px 0;
	background: linear-gradient(to right, transparent, var(--t1P7HTr, #1d1d1f) 85%);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.wc-tbl-wrap.is-over:not(.at-end) .wc-tbl-fade {
	opacity: 1;
}

.wc-tbl-hint {
	display: none;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--tBRrhmH, #d1d1d6);
}

.wc-tbl-wrap.is-over .wc-tbl-hint {
	display: flex;
}

@media (prefers-reduced-motion: reduce) {
	.wc-tbl-fade {
		transition: none;
	}
}

/* a two-column table (an item and its value, or two equal sides): the row header has the cells' weight, so the left
   side does not look more important than the right; the header row stays bold */
.wc-table:not(:has(thead th:nth-child(3))) tbody th {
	font-weight: 400;
	color: var(--tBRrhmH, #d1d1d6);
}
