/*
 * Електронні сервіси ІТС.
 *
 * An index and sixteen sections on one page. The index is the navigation, so
 * it gets the weight a menu would; the sections are quiet, because nobody
 * reads sixteen of anything and the page is built to be jumped into.
 */

.sx-its {
	--sx-its-gap: 20px;
}

/* ---- Hero ---- */

.sx-its__title {
	margin: 0;
	font-size: var( --sx-title-page );
	line-height: 1.1;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.sx-its__lead {
	margin: 14px 0 0;
	max-width: 68ch;
	font-size: 1.05rem;
	line-height: 1.6;
	color: var( --sx-text-secondary );
}

/* ---- Іконка ----
   The vendor ships white glyphs on transparency, meant for a coloured tile.
   Painted through a mask instead, so they take our colour and the whole set
   reads as one family rather than sixteen borrowed palettes. */

.sx-its__glyph {
	flex: none;
	display: block;
	width: 26px;
	height: 26px;
	background-color: currentColor;
	-webkit-mask-image: var( --sx-its-glyph );
	mask-image: var( --sx-its-glyph );
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
}

/* ---- Перелік ---- */

.sx-its__index {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 28px var( --sx-its-gap );
	margin: var( --wp--preset--spacing--50 ) 0 var( --wp--preset--spacing--60 );
	padding: 28px 30px;
	background: var( --sx-surface );
	border-radius: var( --sx-radius-lg );
}

.sx-its__index-group {
	min-width: 0;
}

.sx-its__index-title {
	margin: 0 0 14px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --sx-text-muted );
}

.sx-its__index ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 4px;
}

.sx-its__index a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 12px;
	border-radius: var( --sx-radius-md );
	color: inherit;
	text-decoration: none;
	transition:
		background-color var( --sx-transition-fast ) var( --sx-ease ),
		color var( --sx-transition-fast ) var( --sx-ease );
}

.sx-its__index a .sx-its__glyph {
	color: var( --sx-brand );
}

@media ( hover: hover ) {
	.sx-its__index a:hover {
		background: var( --sx-white );
		color: var( --sx-brand-text );
	}
}

.sx-its__index a:focus-visible {
	outline: 3px solid var( --sx-brand );
	outline-offset: -3px;
}

.sx-its__index-text {
	min-width: 0;
	display: grid;
	gap: 1px;
}

.sx-its__index-name {
	font-weight: 600;
	line-height: 1.25;
	overflow-wrap: break-word;
}

.sx-its__index-kicker {
	font-size: 0.83rem;
	line-height: 1.3;
	color: var( --sx-text-muted );
	overflow-wrap: break-word;
}

/* ---- Заголовок половини ---- */

.sx-its__group {
	margin: var( --wp--preset--spacing--60 ) 0 var( --wp--preset--spacing--40 );
	padding-bottom: 14px;
	border-bottom: 2px solid var( --sx-brand );
}

.sx-its__group-title {
	margin: 0;
	font-size: var( --sx-title-section );
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.sx-its__group-text {
	margin: 8px 0 0;
	max-width: 68ch;
	color: var( --sx-text-secondary );
}

/* ---- Сервіс ---- */

.sx-its__service {
	padding: 26px 0;
	border-bottom: 1px solid var( --sx-border );
	/* Cleared for the sticky header, or a jump lands with the heading under it. */
	scroll-margin-top: calc( 24px + var( --sx-sticky-top, 0px ) );
}

.sx-its__head {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 12px;
}

.sx-its__head .sx-its__glyph {
	width: 38px;
	height: 38px;
	padding: 0;
	color: var( --sx-brand );
}

.sx-its__headings {
	min-width: 0;
}

.sx-its__kicker {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --sx-brand-text );
}

.sx-its__name {
	margin: 2px 0 0;
	font-size: 1.35rem;
	line-height: 1.2;
	overflow-wrap: break-word;
}

.sx-its__text {
	margin: 0;
	max-width: 72ch;
	color: var( --sx-text-secondary );
	line-height: 1.65;
}

.sx-its__points {
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 7px;
	max-width: 72ch;
}

.sx-its__points li {
	position: relative;
	padding-left: 20px;
	color: var( --sx-text-secondary );
	font-size: 0.95rem;
	line-height: 1.5;
	overflow-wrap: break-word;
}

.sx-its__points li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 0.6em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var( --sx-brand-200 );
}

.sx-its__note {
	margin: 14px 0 0;
	padding: 12px 16px;
	max-width: 72ch;
	border-radius: var( --sx-radius-md );
	background: var( --sx-surface );
	color: var( --sx-text-muted );
	font-size: 0.92rem;
	line-height: 1.5;
}

.sx-its__back {
	margin: 16px 0 0;
	font-size: 0.85rem;
}

.sx-its__back a {
	color: var( --sx-text-muted );
	text-decoration: none;
}

@media ( hover: hover ) {
	.sx-its__back a:hover {
		color: var( --sx-brand-text );
	}
}

@media ( max-width: 780px ) {
	.sx-its__index {
		grid-template-columns: minmax( 0, 1fr );
		padding: 22px 16px;
	}

	.sx-its__head .sx-its__glyph {
		width: 32px;
		height: 32px;
	}

	.sx-its__name {
		font-size: 1.2rem;
	}
}

/* ---- Вартість платного сервісу ----
   A short table, not a card: it sits inside a section that is already a
   description, and a boxed price block there would read as a second offer. */

.sx-its__prices {
	margin: 18px 0 0;
	padding: 16px 20px;
	max-width: 46rem;
	background: var( --sx-surface );
	border-radius: var( --sx-radius-md );
}

.sx-its__prices-title {
	margin: 0 0 10px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --sx-text-muted );
}

.sx-its__prices ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 2px;
}

.sx-its__prices li {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) auto;
	align-items: baseline;
	gap: 10px;
	padding: 7px 0;
	border-bottom: 1px solid var( --sx-border );
}

.sx-its__prices li:last-child {
	border-bottom: 0;
}

.sx-its__price-label {
	min-width: 0;
	font-size: 0.93rem;
	line-height: 1.4;
	color: var( --sx-text-secondary );
	overflow-wrap: break-word;
}

/* Tabular figures, so a column of prices can be compared at a glance. */
.sx-its__price-sum {
	font-weight: 700;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.sx-its__prices-note {
	margin: 10px 0 0;
	font-size: 0.85rem;
	line-height: 1.45;
	color: var( --sx-text-muted );
}

/* Shown where no price is set, rather than a made-up figure. */
.sx-its__ask {
	margin: 16px 0 0;
	font-size: 0.95rem;
	color: var( --sx-text-muted );
}

.sx-its__ask a {
	color: var( --sx-brand-text );
	font-weight: 600;
}

.sx-its__group-text a {
	color: var( --sx-brand-text );
	font-weight: 600;
	white-space: nowrap;
}

/* ---- Матрична таблиця цін (ІТС Галузевий) ----
   Four categories against five periods. Too wide for a phone, so the table
   scrolls inside its own container and the page body never does. */

.sx-its__table-scroll {
	overflow-x: auto;
	overscroll-behavior-x: contain;
	margin: 0 -4px;
	padding: 0 4px;
}

.sx-its__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
	white-space: nowrap;
}

.sx-its__table th,
.sx-its__table td {
	padding: 8px 14px 8px 0;
	text-align: right;
	border-bottom: 1px solid var( --sx-border );
}

.sx-its__table thead th {
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var( --sx-text-muted );
	vertical-align: bottom;
}

/* The category is the label, so it reads left and stays put while the figures
   scroll past it. */
.sx-its__table th:first-child {
	position: sticky;
	left: 0;
	z-index: 1;
	padding-right: 18px;
	text-align: left;
	background: var( --sx-surface );
}

.sx-its__table tbody th {
	font-weight: 600;
}

.sx-its__table td {
	font-variant-numeric: tabular-nums;
}

/* The headline column: the year most people buy. */
.sx-its__table tbody td:first-of-type {
	font-weight: 700;
}

.sx-its__table tbody tr:last-child th,
.sx-its__table tbody tr:last-child td {
	border-bottom: 0;
}

.sx-its__table th:last-child,
.sx-its__table td:last-child {
	padding-right: 0;
}
