/* Utility classes Marble does not have yet (decisions D58, D60).
   Only single z-* class rules (D60), in Marble's own cascade layer and naming style, so each one
   can be moved into the Marble theme unchanged. Every class is listed in tasks/new-demo/utility-gaps.md
   with the gap it closes; DemoSourceRulesTest accepts these classes and rejects anything else here.
   Porting them into Marble is ZK-6266.
   Loaded on every page through <theme-uri> in WEB-INF/zk.xml. */

@layer zk-utilities {

/* G1: centred page column, 1160px of content between the side paddings; not z-container, which is
   Marble's container-query utility (container-type: inline-size) */
.z-page-container {
	box-sizing: border-box;
	width: 100%;
	max-width: calc(1160px + 2 * var(--zk-spacing-6, 24px));
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--zk-spacing-6, 24px);
	padding-right: var(--zk-spacing-6, 24px);
}

/* G2: letter spacing, the positive side of --zk-typescale-tracking-tight / -tighter */
.z-tracking-wide { letter-spacing: 0.05em; }
.z-tracking-widest { letter-spacing: 0.2em; }

/* G3: a fixed-ratio media frame (the Home card covers, all 16:10) */
.z-aspect-16-10 { aspect-ratio: 16 / 10; }

/* G11: cut a text block after two lines with an ellipsis (a Home card summary that carries search
   keywords); the full text stays in the DOM */
.z-line-clamp-2 {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

/* G12: a value that just changed starts in the primary colour and fades back to its own colour over
   1 s; the fade plays when the element is rendered, so re-render it (invalidate) on each update.
   Under reduced motion the value just changes, with no colour */
.z-fade-from-primary { transition: color 1s ease-out; }
@starting-style {
	.z-fade-from-primary { color: var(--zk-color-primary, #0093f9); }
}
@media (prefers-reduced-motion: reduce) {
	.z-fade-from-primary { transition: none; }
}

/* G9: responsive spacing; Marble's breakpoint utilities cover only display (md = 768px) */
@media (min-width: 768px) {
	.z-p-md-12 { padding: var(--zk-spacing-12, 48px); }
}

/* G13: a scroll frame whose padding keeps the focus ring and the shadow of an edge widget clear of the
   clip; the equal negative margin cancels the padding, so the content does not move */
.z-m-n4 { margin: calc(-1 * var(--zk-spacing-4, 16px)); }

/* G14: the fixed width of a side panel from lg up (the Playground's Controls); below lg it is a block
   and takes the full width. Marble's z-w-* are percentages, so the name is not a number */
@media (min-width: 992px) {
	.z-w-lg-sidebar { width: 320px; }
}

/* G17: the inverse surface's accent and container colours: the label, links and prompt mark on a dark
   (inverse) band, and a card raised on it. The accent is Marble's --zk-color-inverse-primary, which has no
   utility yet (its formula is the fallback for a theme without the token); the container mixes a little of
   the band's text colour into the band, as Marble's surface-container steps do on a light surface */
.z-text-inverse-primary { color: var(--zk-color-inverse-primary, oklch(from var(--zk-color-primary) .81 calc(c * .58) h)); }
.z-bg-inverse-surface-container { background-color: color-mix(in oklab, var(--zk-color-inverse-surface), var(--zk-color-inverse-on-surface) 8%); }
}
