/* ==========================================================================
   Blok "Tegels" — template-parts/blocks/tegels.php
   --------------------------------------------------------------------------
   Figma: Home 435:19712 › "Oplossingen voor iedere branche" (y 1494–1904):
   H2 435:19769, intro 435:19770, tegels 435:19756/19767/19768/19793, iconen
   435:19758/19771/19804/19795, labels 435:19779/19780/19781/19794.
   Mobiel (≤ 767): Home 381:12827…12859 (2×2-raster 156×188).
   Staande tablet (768–1023): dat raster breder en × 1,2; 1024–1919: de desktoprij
   van 4, evenredig verkleind (--d, main.css).
   Alleen geladen op pagina's die dit blok gebruiken (inc/page-blocks.php).
   ========================================================================== */

/* 0. Donkere band — Figma "Group 5" 435:19753 ------------------------------
   Verloop "Rectangle 9" (435:19754) + textuur op 30 % (435:19755, cover vanaf de
   bovenkant: 1920 breed → 1280 hoog, onderaan valt de rest weg). Staat op de
   omhullende .gack-band van een reeks donkere blokken of op een los donker blok
   (template-parts/blocks/_band.php). Deze regels staan identiek in
   tekst_beeld.css: elk blok kan los op een pagina staan en moet de band dan zelf
   meebrengen (blok-CSS wordt alleen geladen voor gebruikte blokken). */
.gack-band {
	position: relative;
	isolation: isolate;
	background: var(--gack-gradient);
}

.gack-band::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: url("../../img/blocks/band/textuur.webp") 50% 0 / cover no-repeat;
	opacity: 0.3;
	pointer-events: none;
}

/* 1. Sectie ------------------------------------------------------------------
   Band-top 1494 → H2 1580 (+86); tegels eindigen op 1904, het volgende blok in de
   band begint met zijn foto op 1974 (+70). */
.gack-tegels {
	padding: calc(86 * var(--d)) 0 calc(70 * var(--d));
	color: var(--gack-navy);
}

.gack-tegels--dark {
	color: var(--gack-white);
}

.gack-tegels.gack-band__part--follow {
	padding-top: 0;
}

.gack-tegels__inner {
	width: min(calc(1140 * var(--d)), calc(100% - 2 * var(--gack-gutter)));
	margin-inline: auto;
	text-align: center;
}

/* H2: Sora Bold 40 / 50, gecentreerd (435:19769). */
.gack-tegels__title {
	font-family: var(--gack-font);
	font-size: max(14px, calc(40 * var(--d)));
	font-weight: 700;
	line-height: max(17.5px, calc(50 * var(--d)));
}

/* Intro: Sora Light 16 / 20 op 1652 = 22 onder de kop (435:19770). */
.gack-tegels__intro {
	margin-top: calc(22 * var(--d));
	font-size: max(14px, calc(16 * var(--d)));
	font-weight: 300;
	line-height: max(17.5px, calc(20 * var(--d)));
}

/* 2. Tegels ------------------------------------------------------------------
   Rij van 4 × 264 = 1140 gecentreerd (390–1530). Het design heeft tussenruimtes
   29/27/27 en een tegel van 265; gelijkgetrokken naar 28 (afwijking ≤ 1 px). */
.gack-tegels__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: calc(28 * var(--d));
	margin: calc(44 * var(--d)) 0 0;
	padding: 0;
	list-style: none;
}

.gack-tegels__item {
	flex: 0 0 calc(264 * var(--d));
}

/* Tegel 264×188, radius 20, #121939; hover = #ED1C24 (notitie "{hover}" 435:19757). */
.gack-tegels__tile {
	position: relative;
	display: block;
	height: calc(188 * var(--d));
	border-radius: var(--gack-radius);
	background-color: var(--gack-navy);
	color: var(--gack-white);
	text-decoration: none;
	transition: background-color var(--gack-hover-dur) var(--gack-hover-ease);
}

a.gack-tegels__tile:hover,
a.gack-tegels__tile:focus-visible {
	background-color: var(--gack-red);
}

/* Icoon: horizontaal gecentreerd, onderkant op tegel-y + 120 (bottom 68), de
   onderkant van het reuzenrad-frame (435:19758) en het arcade-icoon (435:19771).
   Maat en verschuiving per tegel uit de fijnafstelling (--tg-*). */
.gack-tegels__icon {
	position: absolute;
	left: 50%;
	bottom: calc(68 * var(--d));
	width: var(--tg-w, calc(88 * var(--d)));
	max-width: none;
	height: auto;
	transform: translate(calc(-50% + var(--tg-x, 0px)), var(--tg-y, 0px));
	pointer-events: none;
}

/* Label: Orbitron Bold 16 / 20 wit, gecentreerd op tegel-y + 136, 32 boven de onderrand.
   Tekstondergrens 14, behalve waar de tegel daarvoor te smal wordt (< ±1148 px viewport):
   dan krimpt het label mee tot het langste designlabel ("Indoor speeltuinen", 164 bij 16 px)
   nog op één regel in de tegel past (240 × d binnen de marges → 23,4 × d), nooit onder 12.
   Twee regels zouden over het icoon lopen (het label groeit naar boven). */
.gack-tegels__label {
	position: absolute;
	right: calc(12 * var(--d));
	bottom: calc(32 * var(--d));
	left: calc(12 * var(--d));
	font-family: var(--gack-font-display);
	font-size: max(12px, min(max(14px, calc(16 * var(--d))), calc(23.4 * var(--d))));
	font-weight: 700;
	line-height: max(17.5px, calc(20 * var(--d)));
	text-align: center;
}

.gack-tegels__label-text {
	display: block;
	text-wrap: balance;
}

/* 3. (vervallen 12-11) De laag 1024–1199 (rij van 4 die mag krimpen) is weg: de desktop
   schaalt nu evenredig mee (--d), de rij van 4 × 264 + 3 × 28 = 1140 dus ook. */

/* 4. Mobiel — Home 381:12827…12859 ---------------------------------------------
   Band 1286 → H2 1347 (+61) · H2 30/38 (2 regels) · 14 · intro 16/20 · 50 ·
   tegels 2×2 van 156×188 met tussenruimte 20 · 55 · volgende blok.
   Kolom 35–367 (332 breed, --gack-m-gutter). Geldt ook op de staande tablet (laag 5). */
@media (max-width: 1023px) {
	.gack-band::before {
		/* Mobiel rekt Figma de textuur uit tot 100 % × 116,51 % van de band (381:12826). */
		background-position: 0 0;
		background-size: 100% 116.51%;
	}

	.gack-tegels {
		padding: 61px 0 55px;
	}

	.gack-tegels__inner {
		width: auto;
		margin-inline: var(--gack-m-gutter);
	}

	.gack-tegels__title {
		font-size: 30px;
		line-height: 38px;
	}

	.gack-tegels__intro {
		margin-top: 14px;
	}

	/* Twee gelijke kolommen over de kolom (2 × 156 + 20 = 332 op 402). */
	.gack-tegels__list {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		max-width: none;
		gap: 20px;
		margin-top: 50px;
	}

	/* Icoonvak eindigt op tegel-y + 113 (reuzenrad, arcade, indoor). */
	.gack-tegels__icon {
		bottom: 75px;
		width: var(--tg-wm, 75px);
		transform: translate(calc(-50% + var(--tg-xm, 0px)), var(--tg-ym, 0px));
	}

	/* Label: 1 regel op +133…153, 2 regels op +116…156 (381:12840/12841). Een vak
	   van +116 tot +153 met de tekst onderaan; past de tekst niet (2 regels), dan
	   laat "safe" hem vanaf de bovenkant lopen — precies de twee designstanden. */
	.gack-tegels__label {
		top: 116px;
		right: 4px;
		bottom: auto;
		left: 4px;
		display: flex;
		align-items: safe flex-end;
		justify-content: center;
		height: 37px;
	}
}

/* 5. Staande tablet (768–1023) — het mobiele raster breder en × 1,2 ------------
   Zelfde opbouw (kop, intro, 2 × 2 tegels). Op 402 vullen de twee tegels samen de
   kolom (2 × 156 + 20 = 332); hier ook: twee gelijke kolommen over de tabletkolom
   (op 768: 2 × 308), hoogte, icoon en label × 1,2. */
@media (min-width: 768px) and (max-width: 1023px) {
	.gack-tegels {
		padding: calc(61px * var(--gack-tab-scale)) 0 calc(55px * var(--gack-tab-scale));
	}

	.gack-tegels__inner {
		width: auto;
		margin-inline: var(--gack-tab-gutter);
	}

	.gack-tegels__title {
		font-size: calc(30px * var(--gack-tab-scale));
		line-height: calc(38px * var(--gack-tab-scale));
	}

	.gack-tegels__intro {
		margin-top: calc(14px * var(--gack-tab-scale));
		font-size: calc(16px * var(--gack-tab-scale));
		line-height: calc(20px * var(--gack-tab-scale));
	}

	.gack-tegels__list {
		gap: calc(20px * var(--gack-tab-scale));
		margin-top: calc(50px * var(--gack-tab-scale));
	}

	.gack-tegels__tile {
		height: calc(188px * var(--gack-tab-scale));
	}

	.gack-tegels__icon {
		bottom: calc(75px * var(--gack-tab-scale));
		width: calc(var(--tg-wm, 75px) * var(--gack-tab-scale));
		transform: translate(calc(-50% + var(--tg-xm, 0px) * var(--gack-tab-scale)), calc(var(--tg-ym, 0px) * var(--gack-tab-scale)));
	}

	.gack-tegels__label {
		top: calc(116px * var(--gack-tab-scale));
		right: calc(4px * var(--gack-tab-scale));
		left: calc(4px * var(--gack-tab-scale));
		height: calc(37px * var(--gack-tab-scale));
		font-size: calc(16px * var(--gack-tab-scale));
		line-height: calc(20px * var(--gack-tab-scale));
	}
}
