/* ============================================================
   Instroi — prices page (Figma «Ціни ВАР 2» 565:527), on top of content.css.
   1. Intro «Вартість робіт» (two columns: H1 / lead + CTA)
   2. Price cards (.price-group — built by inc/prices.php)
   3. Downloads list spacing
   4. SEO text tail
   ============================================================ */

/* Prices keeps the larger section gap before each H2 (unchanged from before —
   content.css trimmed the default H2 top margin for regular articles). */
.entry-content > h2 { margin-block-start: clamp(48px, 7vw, 88px); }

/* 1. Intro
   ------------------------------------------------------------ */
.entry-content .prices-intro { margin-bottom: 0; }

.entry-content .prices-intro h1 {
	margin: 0;
	color: var(--c-black);
}

.entry-content .prices-intro p {
	margin-bottom: 32px;
	font-size: var(--fs-p2);
	line-height: 1.4;
}

/* 2. Price cards
   ------------------------------------------------------------
   inc/prices.php folds «H2 + (H3.price-table-caption + table)*» into one
   card per group: blue title bar, a single table, the column-header row
   shown once, and the former H3 captions demoted to `.price-group__band`
   rows above their own data rows. */
.entry-content .price-group {
	margin-block: clamp(48px, 7vw, 88px) 0;
	padding-bottom: 12px;          /* the group's trailing breathing room, as in Figma */
	background: var(--c-table-bg);
	overflow: hidden;
}

.entry-content .price-group__title {
	margin: 0;
	padding: 18px 16px;
	background: var(--c-blue-600);
	color: var(--c-white);
	font-size: var(--fs-h3);
	font-weight: 700;
	line-height: 1.4;
}

/* 5 columns need a wider canvas than a phone has; the card scrolls, the page never does. */
.entry-content .price-group__scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.entry-content .price-group__table {
	width: 100%;
	min-width: 700px;
	margin: 0;
	table-layout: fixed;
	border-collapse: collapse;
	font-size: var(--fs-p2);
}

.entry-content .price-group__table th,
.entry-content .price-group__table td {
	padding: 10px 16px;
	text-align: left;
	vertical-align: middle;
	background: none;             /* kill the core zebra inside the card */
	border: 0;
	border-bottom: 1px solid var(--c-table-line);
	font-weight: 400;
	color: var(--c-text);
	line-height: 1.4;
	overflow-wrap: normal;
	word-break: normal;
}

.entry-content .price-group__table thead th {
	color: var(--c-table-head);
}

/* First column (technology / service) is the widest, as in Figma (320/1200). */
.entry-content .price-group__table th:first-child,
.entry-content .price-group__table td:first-child { width: 27%; }

/* Band = the former H3 caption: bold, full width, with the group's breathing room
   above it (12px wrapper + 12px of the previous wrapper + the cell padding). */
.entry-content .price-group__band th {
	padding-top: 34px;
	font-weight: 700;
}

.entry-content .price-group__table tbody tr:first-child th { padding-top: 22px; }

/* Data rows sit one level in from their band. */
.entry-content .price-group__table tbody td:first-child { padding-left: 48px; }

.entry-content .price-group__table tbody tr:last-child > * { border-bottom: 0; }

/* Two-column card («Діагностика, додаткові роботи»): wide bold label, no bands. */
.entry-content .price-group--two .price-group__table { min-width: 560px; }

.entry-content .price-group--two .price-group__table th:first-child,
.entry-content .price-group--two .price-group__table td:first-child { width: 76%; }

.entry-content .price-group--two .price-group__table tbody td:first-child {
	padding-left: 16px;
	font-weight: 700;
}

/* Below the desktop layout five columns no longer fit: rather than let the
   labels break into three-line stacks, the card keeps designed proportions
   and scrolls sideways inside itself (the page never does). */
@media (max-width: 1023px) {
	.entry-content .price-group__title { padding: 14px 12px; }

	.entry-content .price-group__table {
		min-width: 860px;
		font-size: var(--fs-p3);
	}

	.entry-content .price-group__table th,
	.entry-content .price-group__table td { padding: 10px 12px; }

	.entry-content .price-group__table th:first-child,
	.entry-content .price-group__table td:first-child { width: 32%; }

	.entry-content .price-group__table tbody td:first-child { padding-left: 32px; }

	/* Two columns still fit a tablet, and even a phone with a small scroll. */
	.entry-content .price-group--two .price-group__table { min-width: 520px; }

	.entry-content .price-group--two .price-group__table th:first-child,
	.entry-content .price-group--two .price-group__table td:first-child { width: 68%; }

	.entry-content .price-group--two .price-group__table tbody td:first-child { padding-left: 12px; }

	/* The band spans the whole (scrollable) table, so pin its label to the
	   viewport edge — the group stays identifiable while the row scrolls. */
	.entry-content .price-group__band-text {
		position: sticky;
		left: 0;
		display: inline-block;
		max-width: calc(100vw - 24px);
	}
}

/* Legacy fallback — if the transform ever bails out, the raw blocks still read
   as a price list rather than as bare core tables. */
.entry-content .price-table-caption {
	margin: clamp(28px, 4vw, 40px) 0 0;
	padding: 13px 16px;
	background: var(--c-gray-50);
	color: var(--c-text);
	font-size: var(--fs-p3);
	line-height: 1.4;
}

.entry-content .price-table { margin-bottom: 8px; }
.entry-content .price-table table { min-width: 680px; }
.entry-content .price-table tbody tr:nth-child(even) td { background: none; }

/* 3. Downloads block — page-level rhythm (cards styled by the block css)
   ------------------------------------------------------------ */
.entry-content .price-downloads { margin-bottom: 1.25em; }

/* 4. SEO text tail — same rhythm as the homepage .home-seo section
   ------------------------------------------------------------ */
.entry-content .prices-seo { margin-block-start: var(--pad-section); }

.entry-content .prices-seo > h2 { margin: 0 0 40px; }

.entry-content .prices-seo h3 { margin-top: 1.5em; }

.entry-content .prices-seo p {
	margin-bottom: 1.65em;
	font-size: var(--fs-p3);
	line-height: 1.4;
	color: var(--c-text);
}

.entry-content .prices-seo p:last-child { margin-bottom: 0; }
