/**
 * The house page's "at a glance" row and grouped Amenities — Task 008-10.
 *
 * Drawn by inc/house-glance.php from the house's fields. Kept out of
 * style.css on purpose: other sessions edit that file.
 *
 * Reference: docs/design/kuca-ispod-heroja-reference.html, style A and
 * "Drugi krug" R1 (three or four items; four make 2 × 2 on a phone).
 * Every colour, font and spacing is a theme token; the only literals are
 * the icon boxes (a glyph's size is structural, like a control's width)
 * and the breakpoints.
 *
 * Contrast (computed, WCAG): label `contrast` on `base` 16.6:1; line
 * `muted` on `base` 5.32:1; icons are non-text (3:1) — the house accent
 * `--vm-color-primary` on `base`: Filaus 3.42, Diamond 4.51; Amenities
 * on `surface`: Filaus 3.05, Diamond 4.01.
 */

/* ---------- the glance row ---------- */

.vm-glance {
	container-type: inline-size;
	flex: 1 1 auto; /* not a length: in 008-11's stacked (column) facts section a length basis becomes a HEIGHT (measured 512px). */
	min-width: 0;
	width: 100%;
}

/* The fact-row's own rule makes the wrapper a flex row, which would shrink the list to its content. */
.vm-fact-row.vm-glance { display: block; }

.vm-glance__list {
	list-style: none;
	max-width: 60rem; /* four items read as one calm group, not spread edge to edge (drawing: ~980px at 1440) */
	margin: 0 auto;
	padding: var(--wp--preset--spacing--30) 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	row-gap: var(--wp--preset--spacing--30);
}

.vm-glance--n3 .vm-glance__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vm-glance--n2 .vm-glance__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vm-glance--n1 .vm-glance__list { grid-template-columns: minmax(0, 1fr); }

.vm-glance__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 0 var(--wp--preset--spacing--20);
	border-inline-start: 1px solid var(--wp--preset--color--border);
}

.vm-glance__item:first-child { border-inline-start: 0; }

.vm-glance__icon {
	width: 2.5rem;
	height: 2.5rem;
	stroke-width: 1.05; /* A 24-box glyph drawn at 40px: keeps the line ~1.75px, as the set reads at 24px. */
	color: var(--vm-color-primary);
	margin-bottom: var(--wp--preset--spacing--10);
}

.vm-glance__label {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--intro);
	line-height: 1.2;
	color: var(--wp--preset--color--contrast);
}

.vm-glance__line {
	margin-top: 0.25em;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.35;
	color: var(--wp--preset--color--muted);
}

/* Four in a narrow box (a phone, or beside the date bar): two by two. */
@container (max-width: 34rem) {
	.vm-glance--n4 .vm-glance__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.vm-glance--n4 .vm-glance__item:nth-child(3) { border-inline-start: 0; }
	.vm-glance__icon { width: 2rem; height: 2rem; stroke-width: 1.2; }
}

/* ---------- Amenities, grouped ---------- */

.vm-amenities { box-sizing: border-box; } /* so its padding sits inside the 1210px, like the section heading above it */

.vm-amenities__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	gap: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--border);
	padding-top: var(--wp--preset--spacing--30);
}

.vm-amenities__grid > * { margin-block: 0; } /* the block-gap rule would push columns 2 and 3 down (Task 025's finding) */

.vm-amenities__heading {
	margin: 0 0 var(--wp--preset--spacing--20);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.vm-amenities__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.vm-amenities__item {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--10);
	padding: 0.3em 0;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.3;
	break-inside: avoid;
}

.vm-amenities__icon {
	flex: 0 0 auto;
	width: 1.1rem;
	height: 1.1rem;
	color: var(--vm-color-primary);
}

@media (max-width: 600px) {
	.vm-amenities__list { columns: 2; column-gap: var(--wp--preset--spacing--20); }
}
