/* =========================================================
 * assets/css/useful-services.css — блок «Корисні сервіси» [wf_useful_services]
 *
 * Сетка: «Найкращі ставки» | «Курс валют» | плитки 2×3.
 * Вкладки — radio + CSS (см. parts/useful-services-shortcode.php):
 * radio идут первыми детьми карточки, поэтому панели и ярлыки
 * достаются через «~».
 * =======================================================*/

.wf-us {
	--wf-us-bg: #f3f5f4;
	--wf-us-card: #ffffff;
	--wf-us-text: #14211c;
	--wf-us-muted: #6b7a74;
	--wf-us-line: #e6ebe8;
	--wf-us-accent: var(--wf-green, #0b5d46);
	--wf-us-bar: #e7f6e4;
	--wf-us-bar-edge: #c9ecc3;
	--wf-us-up: #c0392b;
	--wf-us-down: #1e8e4e;

	/* Ширину задаёт alignwide: в constrained-разметке главной контент
	 * ужат до 768px, блоку нужна wide-size, как у соседних широких блоков. */
	margin-left: auto;
	margin-right: auto;
	color: var(--wf-us-text);
	/* Сетка перестраивается по ширине самого блока, а не окна:
	 * в узкой колонке он сложится сам, на какой странице его ни поставь. */
	container-type: inline-size;
}

/* alignwide вытаскивает блок из 768px, но wide-size (1280px) шире колонки
 * страницы — режем до неё же (--wf-page-max), чтобы края совпали с соседями.
 * Специфичность 0,3,0 — выше, чем у `.is-layout-constrained > .alignwide`. */
.wf-us.wf-us.alignwide {
	max-width: var(--wf-page-max, 1170px);
}

.wf-us__title {
	margin: 0 0 28px;
	text-align: center;
	font-size: clamp(26px, 3.2vw, 36px);
	line-height: 1.15;
	font-weight: 700;
}

.wf-us__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr);
	gap: 20px;
	padding: 24px;
	border-radius: 32px;
	background: var(--wf-us-bg);
}

.wf-us__card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 24px;
	border-radius: 24px;
	background: var(--wf-us-card);
}

.wf-us__head {
	margin-bottom: 16px;
}

.wf-us__h {
	margin: 0;
	font-size: 22px;
	line-height: 1.2;
	font-weight: 700;
}

.wf-us__sub {
	margin: 4px 0 0;
	font-size: 13px;
	color: var(--wf-us-muted);
}

/* --- Вкладки --- */

.wf-us__radio {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.wf-us__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.wf-us__tab {
	padding: 7px 14px;
	border-radius: 10px;
	background: var(--wf-us-bg);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.wf-us__tab:hover {
	background: var(--wf-us-line);
}

.wf-us__radio:nth-of-type(1):checked ~ .wf-us__tabs .wf-us__tab--credits,
.wf-us__radio:nth-of-type(2):checked ~ .wf-us__tabs .wf-us__tab--deposits,
.wf-us__radio:nth-of-type(3):checked ~ .wf-us__tabs .wf-us__tab--cards {
	background: var(--wf-us-accent);
	color: #fff;
}

.wf-us__radio:nth-of-type(1):focus-visible ~ .wf-us__tabs .wf-us__tab--credits,
.wf-us__radio:nth-of-type(2):focus-visible ~ .wf-us__tabs .wf-us__tab--deposits,
.wf-us__radio:nth-of-type(3):focus-visible ~ .wf-us__tabs .wf-us__tab--cards {
	outline: 2px solid var(--wf-us-accent);
	outline-offset: 2px;
}

.wf-us__panel {
	display: none;
	flex: 1;
	flex-direction: column;
}

.wf-us__radio:nth-of-type(1):checked ~ .wf-us__panel--credits,
.wf-us__radio:nth-of-type(2):checked ~ .wf-us__panel--deposits,
.wf-us__radio:nth-of-type(3):checked ~ .wf-us__panel--cards {
	display: flex;
}

.wf-us__note {
	margin: 0 0 10px;
	font-size: 12px;
	color: var(--wf-us-muted);
}

/* --- Строки с полосками --- */

.wf-us__rows {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
}

.wf-us__row {
	margin: 0;
}

.wf-us__link {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 36px;
	color: inherit;
	text-decoration: none;
}

.wf-us__logo {
	position: relative;
	z-index: 1;
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 1px var(--wf-us-line);
	object-fit: contain;
}

.wf-us__logo--empty {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	color: var(--wf-us-accent);
}

/* Имя — только для скринридеров и подсказки: в строке его заменяет логотип. */
.wf-us__name {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.wf-us__bar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	height: 34px;
	margin-left: -18px;
	padding: 0 12px 0 26px;
	border: 1px solid var(--wf-us-bar-edge);
	border-left: 0;
	border-radius: 0 12px 12px 0;
	background: var(--wf-us-bar);
	transition: filter 0.15s;
}

a.wf-us__link:hover .wf-us__bar {
	filter: brightness(0.96);
}

.wf-us__val {
	font-size: 14px;
	font-weight: 600;
	color: var(--wf-us-accent);
	white-space: nowrap;
}

.wf-us__cta {
	align-self: flex-start;
	margin-top: auto;
	padding: 9px 16px;
	border-radius: 10px;
	background: var(--wf-us-bg);
	font-size: 15px;
	font-weight: 600;
	color: var(--wf-us-text);
	text-decoration: none;
	transition: background 0.15s;
}

.wf-us__cta:hover {
	background: var(--wf-us-line);
}

/* --- Курс валют --- */

.wf-us__fx {
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.wf-us__fx-row + .wf-us__fx-row {
	border-top: 1px solid var(--wf-us-line);
}

.wf-us__fx-link {
	display: grid;
	grid-template-columns: 30px auto 1fr auto 16px;
	align-items: baseline;
	gap: 10px;
	padding: 16px 0;
	color: inherit;
	text-decoration: none;
}

.wf-us__flag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--wf-us-bar);
	font-size: 14px;
	font-weight: 700;
	color: var(--wf-us-accent);
	align-self: center;
}

.wf-us__code {
	font-size: 22px;
	font-weight: 700;
}

.wf-us__rate {
	justify-self: end;
	font-size: 20px;
	font-variant-numeric: tabular-nums;
}

.wf-us__delta {
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

/* Для гривни рост курса — это подешевение гривны, поэтому «вверх» красный. */
.wf-us__delta--up {
	color: var(--wf-us-up);
}

.wf-us__delta--down {
	color: var(--wf-us-down);
}

.wf-us__chev {
	grid-column: 5;
	align-self: center;
	font-size: 22px;
	color: var(--wf-us-muted);
	transition: transform 0.15s;
}

.wf-us__fx-link:hover .wf-us__chev {
	transform: translateX(3px);
}

.wf-us__more {
	margin-top: auto;
	font-size: 16px;
	font-weight: 600;
	color: var(--wf-us-accent);
	text-decoration: none;
}

.wf-us__more:hover {
	text-decoration: underline;
}

.wf-us__empty {
	margin: 0 0 16px;
	color: var(--wf-us-muted);
}

/* --- Плитки сервисов --- */

.wf-us__tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-auto-rows: 1fr;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wf-us__tile {
	display: flex;
	min-height: 0;
	margin: 0;
}

.wf-us__tile-link {
	flex: 1;
}

.wf-us__tile-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 128px;
	padding: 18px 12px;
	border-radius: 24px;
	background: var(--wf-us-card);
	color: var(--wf-us-text);
	text-align: center;
	text-decoration: none;
	transition: box-shadow 0.15s, transform 0.15s;
}

.wf-us__tile-link:hover {
	box-shadow: 0 8px 24px rgba(11, 47, 37, 0.1);
	transform: translateY(-2px);
}

.wf-us__tile-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 14px;
	background: var(--wf-us-bar);
	color: var(--wf-us-accent);
}

.wf-us__tile-txt {
	font-size: 14px;
	line-height: 1.3;
	font-weight: 600;
}

/* --- Адаптив --- */

@container (max-width: 1100px) {
	.wf-us__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wf-us__tiles {
		grid-column: 1 / -1;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@container (max-width: 720px) {
	.wf-us__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
		padding: 14px;
		border-radius: 24px;
	}

	.wf-us__card {
		padding: 20px 16px;
	}

	.wf-us__tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px;
	}

	.wf-us__tile-link {
		min-height: 112px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wf-us__tile-link,
	.wf-us__chev {
		transition: none;
	}
}
