/* Veg Knowledge shared components (both child themes). */
:root {
	--vk-green: #1e932d;
	--vk-green-dark: #135e1d;
	--vk-tint: #eef7ef;
	--vk-tint-2: #f7faf7;
	--vk-text: #1d261d;
	--vk-muted: #5b665b;
	--vk-border: #d6e2d6;
	--vk-red: #b3261e;
	--vk-amber: #8a5a00;
	--vk-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Reading comfort */
.single-post .entry-content {
	font-size: 1.125rem;
	line-height: 1.7;
	color: var(--vk-text);
}
.single-post .entry-content h2 {
	margin-top: 2em;
	scroll-margin-top: 1.5em;
}
.single-post .entry-content figure {
	margin-top: 1.25em;
	margin-bottom: 1.25em;
}
.single-post .entry-content figure img {
	border-radius: 6px;
}
.single-post .entry-content figcaption {
	font-size: 0.85rem;
	color: var(--vk-muted);
	margin-top: 0.4em;
}
.entry-content a {
	color: var(--vk-green-dark);
	text-underline-offset: 2px;
}

/* Quick answer box */
.is-style-vk-quick-answer {
	background: var(--vk-tint);
	border-left: 5px solid var(--vk-green);
	border-radius: 6px;
	padding: 1.1em 1.3em;
	margin: 1.5em 0;
}
.is-style-vk-quick-answer > :first-child {
	margin-top: 0;
}
.is-style-vk-quick-answer > :last-child {
	margin-bottom: 0;
}
.is-style-vk-quick-answer h2,
.is-style-vk-quick-answer h3 {
	font-size: 0.95rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--vk-green-dark);
	margin: 0 0 0.4em;
}

/* Menu / ingredient table */
.wp-block-table.is-style-vk-menu-table {
	overflow-x: auto;
	margin: 1.5em 0;
}
.wp-block-table.is-style-vk-menu-table table {
	border-collapse: collapse;
	width: 100%;
	font-size: 0.98rem;
	line-height: 1.45;
}
.wp-block-table.is-style-vk-menu-table th {
	background: var(--vk-green-dark);
	color: #fff;
	text-align: left;
	font-weight: 600;
}
.wp-block-table.is-style-vk-menu-table th,
.wp-block-table.is-style-vk-menu-table td {
	padding: 0.65em 0.8em;
	border: 0;
	border-bottom: 1px solid var(--vk-border);
	vertical-align: top;
}
.wp-block-table.is-style-vk-menu-table tbody tr:nth-child(even) td {
	background: var(--vk-tint-2);
}
.wp-block-table.is-style-vk-menu-table figcaption {
	font-size: 0.85rem;
	color: var(--vk-muted);
}

/* Status badges for table cells: <mark class="vk-badge vk-yes">Vegan</mark> */
.vk-badge {
	display: inline-block;
	padding: 0.1em 0.55em;
	border-radius: 999px;
	font-size: 0.85em;
	font-weight: 600;
	white-space: nowrap;
	background: #eee;
	color: var(--vk-text);
}
.vk-badge.vk-yes {
	background: #dff1e1;
	color: var(--vk-green-dark);
}
.vk-badge.vk-no {
	background: #fbe3e1;
	color: var(--vk-red);
}
.vk-badge.vk-ask {
	background: #fdf0d5;
	color: var(--vk-amber);
}
.vk-badge.vk-veg {
	background: #e4edf9;
	color: #1f4e8c;
}

/* Source strength dots in a table's Source column:
   <span class="vk-src vk-src-3" role="img" aria-label="Source strength: 3 of 3">●●●</span> */
.vk-src {
	display: inline-block;
	margin-right: 0.3em;
	font-size: 0.8em;
	letter-spacing: 0.08em;
	white-space: nowrap;
	vertical-align: 0.05em;
}
.wp-block-table.is-style-vk-menu-table td:has(.vk-src) {
	min-width: 8.5em;
}
.vk-src-3 {
	color: var(--vk-green);
}
.vk-src-2 {
	color: var(--vk-amber);
}
.vk-src-1 {
	color: var(--vk-muted);
}

/* Citation superscripts: brand sources link out, others jump to References */
sup .vk-cite {
	padding: 0 0.1em;
	font-weight: 600;
	text-decoration: none;
	color: var(--vk-green-dark);
}
sup .vk-cite:hover,
sup .vk-cite:focus {
	text-decoration: underline;
}
.is-style-vk-sources li[id] {
	scroll-margin-top: 1.5em;
	border-radius: 4px;
}
.is-style-vk-sources li:target {
	background: var(--vk-tint);
	outline: 4px solid var(--vk-tint);
	color: var(--vk-text);
}

/* Photo still to find (drafts and previews only) */
.vk-photo-tbd {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 180px;
	max-width: 500px;
	margin: 1.25em auto;
	padding: 1em;
	border: 2px dashed var(--vk-border);
	border-radius: 8px;
	background: var(--vk-tint-2);
	color: var(--vk-muted);
	font-size: 0.95rem;
	text-align: center;
}
.vk-photo-tbd p {
	margin: 0;
}

/* Sources list */
.is-style-vk-sources {
	border-top: 2px solid var(--vk-border);
	margin-top: 2.5em;
	padding-top: 1em;
	font-size: 0.92rem;
	color: var(--vk-muted);
}
.is-style-vk-sources h2,
.is-style-vk-sources h3 {
	font-size: 1rem;
	margin: 0 0 0.5em;
	color: var(--vk-text);
}
.is-style-vk-sources ol {
	padding-left: 1.3em;
	margin: 0;
}
.is-style-vk-sources li {
	margin: 0.3em 0;
	overflow-wrap: anywhere;
}
/* References: one per line, each starting with its superscript number */
.is-style-vk-sources ul.vk-ref-list {
	list-style: none;
	padding-left: 0;
	margin: 0;
}
.vk-ref-list li > sup:first-child {
	margin-right: 0.15em;
	font-weight: 600;
	color: var(--vk-text);
}

/* ⚑ note under a status badge (e.g. "⚑ shellac") */
.vk-flag {
	display: inline-block;
	margin-top: 0.25em;
	font-size: 0.8em;
	line-height: 1.3;
	color: var(--vk-muted);
}

/* Source column: one line per reference, then the source strength */
.vk-src-score {
	display: inline-block;
	margin-top: 0.15em;
	font-size: 0.88em;
	color: var(--vk-muted);
	white-space: nowrap;
}

/* In this guide (jump box) */
.vk-jump {
	border: 1px solid var(--vk-border);
	border-radius: 6px;
	padding: 0.9em 1.2em;
	margin: 1.5em 0;
	background: #fff;
	font-size: 0.98rem;
}
.vk-jump__title {
	font-weight: 700;
	margin: 0 0 0.4em !important;
	color: var(--vk-green-dark);
}
.vk-jump ol {
	margin: 0;
	padding-left: 1.3em;
}
.vk-jump li {
	margin: 0.2em 0;
}

/* Related posts */
.vk-related {
	margin: 2.5em 0 1em;
}
.vk-related__title {
	font-size: 1.3rem;
	margin: 0 0 0.8em;
}
.vk-related__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
}
.vk-related__item a {
	display: block;
	text-decoration: none;
	color: var(--vk-text);
	font-weight: 600;
	line-height: 1.35;
}
.vk-related__item img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 6px;
	margin-bottom: 0.4em;
	display: block;
}
.vk-related__item a:hover span {
	color: var(--vk-green-dark);
	text-decoration: underline;
}
@media (max-width: 640px) {
	.vk-related__list {
		grid-template-columns: 1fr;
	}
	.single-post .entry-content {
		font-size: 1.06rem;
	}
}

/* Section headings inside posts */
.single-post .entry-content h2 {
	font-weight: 700;
	font-size: 1.6rem;
	line-height: 1.25;
}
.single-post .entry-content h3 {
	font-weight: 700;
}

/* Classic themes wrap group blocks in an inner container */
.is-style-vk-quick-answer > .wp-block-group__inner-container > :first-child,
.is-style-vk-sources > .wp-block-group__inner-container > :first-child,
.single-post .entry-content .is-style-vk-quick-answer h2,
.single-post .entry-content .is-style-vk-sources h2 {
	margin-top: 0;
}
.is-style-vk-quick-answer > .wp-block-group__inner-container > :last-child,
.is-style-vk-sources > .wp-block-group__inner-container > :last-child {
	margin-bottom: 0;
}
.single-post .entry-content .is-style-vk-quick-answer h2 {
	font-size: 0.95rem;
	margin-bottom: 0.4em;
}
.single-post .entry-content .is-style-vk-sources h2 {
	font-size: 1.05rem;
	margin-bottom: 0.5em;
}
.wp-block-group.is-style-vk-quick-answer,
.wp-block-group.is-style-vk-sources {
	padding-left: 1.3em;
	padding-right: 1.3em;
}
.wp-block-group.is-style-vk-sources {
	padding: 1em 0 0;
}

/* Tables on phones: fixed column widths so the last column doesn't squeeze */
@media (max-width: 640px) {
	.wp-block-table.is-style-vk-menu-table table {
		table-layout: fixed;
		font-size: 0.9rem;
	}
	.wp-block-table.is-style-vk-menu-table th:nth-child(1),
	.wp-block-table.is-style-vk-menu-table td:nth-child(1) {
		width: 30%;
	}
	.wp-block-table.is-style-vk-menu-table th:nth-child(2),
	.wp-block-table.is-style-vk-menu-table td:nth-child(2) {
		width: 27%;
	}
	.wp-block-table.is-style-vk-menu-table th,
	.wp-block-table.is-style-vk-menu-table td {
		padding: 0.55em 0.5em;
	}
	.vk-badge {
		white-space: normal;
		text-align: center;
	}
}

/* Same box padding in every theme */
.entry-content .wp-block-group.is-style-vk-quick-answer {
	padding: 1em 1.2em !important;
}
.entry-content .is-style-vk-quick-answer > .wp-block-group__inner-container,
.entry-content .is-style-vk-sources > .wp-block-group__inner-container {
	padding: 0 !important;
	margin: 0 !important;
	max-width: none !important;
}

/* Menu tables on phones: each row becomes a small card; every value is labeled
   with its column heading (data-label, added at render time in vk-components.php). */
@media (max-width: 600px) {
	.wp-block-table.is-style-vk-menu-table table,
	.wp-block-table.is-style-vk-menu-table tbody,
	.wp-block-table.is-style-vk-menu-table tr,
	.wp-block-table.is-style-vk-menu-table td {
		display: block;
		width: 100%;
	}
	.wp-block-table.is-style-vk-menu-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}
	.wp-block-table.is-style-vk-menu-table tr {
		margin: 0 0 0.75em;
		padding: 0.6em 0.85em;
		border: 1px solid var(--vk-border);
		border-left: 4px solid var(--vk-green);
		border-radius: 6px;
		background: #fff;
	}
	.wp-block-table.is-style-vk-menu-table tbody tr:nth-child(even) td,
	.wp-block-table.is-style-vk-menu-table td {
		background: transparent;
		padding: 0.2em 0;
		border: 0;
	}
	.wp-block-table.is-style-vk-menu-table td:first-child {
		font-weight: 700;
		padding-bottom: 0.3em;
	}
	.wp-block-table.is-style-vk-menu-table td[data-label]:not(:first-child)::before {
		content: attr(data-label) ": ";
		color: var(--vk-muted);
		font-size: 0.88em;
	}
	.wp-block-table.is-style-vk-menu-table td:has(.vk-src) {
		min-width: 0;
	}
	.wp-block-table.is-style-vk-menu-table table {
		border: 0;
	}
	/* Undo the column widths set for the 640px table layout above. */
	.wp-block-table.is-style-vk-menu-table tr td:nth-child(n) {
		width: 100%;
	}
}

/* "How we rate sources" legend: dots in a fixed column, text aligned after them */
.vk-src-legend {
	margin: 0.25em 0 1.5em;
	padding: 0;
	list-style: none;
}
.vk-src-legend li {
	display: grid;
	grid-template-columns: 3em 1fr;
	align-items: baseline;
	margin: 0.35em 0;
}
.vk-src-legend .vk-src {
	margin-right: 0;
}
p:has(+ .vk-src-legend) {
	margin-bottom: 0.25em;
}

/* Rewritten posts show their updated date (see vk-generatepress functions.php) */
.entry-meta .updated-date::before {
	content: "Updated ";
}
