/*
 * Hardware scenes (inc/hardware-scenes.php and inc/hardware-scenes/). Loaded only while the hardware_hub switch is on.
 *
 * The drawings for the hardware procurement page: laptops, workstations, networking, desk phones, headsets, video, accessories,
 * security and the three-step process strip. One language with the Home and Resource Centre diagrams: thin neutral lines, raised
 * shapes with a hairline, flat lit and shaded faces (one tone each, no gradient), and orange for the one active detail of a scene.
 * Square line ends and corners. No glow, no filter, no motion. Tokens only (tokens.css).
 *
 * A scene is drawn on a 240 x 160 grid and fits its box (preserveAspectRatio meet), so the frame decides the size and the drawing
 * never crops. Hairlines keep one weight at any size (non-scaling stroke): the drawing reads like a diagram when it is small and
 * shows its fine detail when it is large. It is drawn for a dark ground (the canvas or raised token).
 */

/* ------------------------------------------------------------ the drawing box */

.cc-hws__draw {
	display: block;
	width: 100%;
	height: 100%;
	max-height: 100%;
	overflow: visible;
}

/* The process strip is a wide band (960 x 160) that sits above three equal text columns. It keeps its shape and is left out
   below the width where the three columns stack, because at phone width it would be a thin ribbon of unreadable detail. */
.cc-hws--strip {
	height: auto;
	max-height: none;
	aspect-ratio: 6 / 1;
}

@media (max-width: 47.99em) {
	.cc-hws--strip {
		display: none;
	}
}

/* The column version of the strip (key process-stack, 240 x 440): the same three stages one above the other, for the width where the
   three text columns stack. It is the narrow counterpart of the strip, so it is shown only where the strip is left out, and it keeps
   a width a drawing of this height can carry. */
.cc-hws--stack {
	height: auto;
	max-height: none;
	max-width: 15rem;
	margin-inline: auto;
	aspect-ratio: 240 / 440;
}

@media (min-width: 48em) {
	.cc-hws--stack {
		display: none;
	}
}

/* The sheets of the process drawings stand on their edge, so their thickness is a narrow parallelogram. A sharp corner of it would
   miter into a spike past the corner; bevel anything under about 60 degrees (right angles stay square). */
.cc-hws--strip .cc-hws__node,
.cc-hws--stack .cc-hws__node {
	stroke-miterlimit: 2;
}

/* ------------------------------------------------------------ lines */

.cc-hws__line,
.cc-hws__soft,
.cc-hws__faint,
.cc-hws__accent {
	fill: none;
	stroke-linecap: square;
	stroke-linejoin: miter;
	vector-effect: non-scaling-stroke;
}

.cc-hws__line {
	stroke: var(--cc-color-line-strong);
	stroke-width: 1.5;
}

/* quiet detail: keys, vents, text bars, cable ribs */
.cc-hws__soft {
	stroke: var(--cc-color-line-strong);
	stroke-width: 1;
	opacity: 0.75;
}

/* the darkest line: what is behind, or far away */
.cc-hws__faint {
	stroke: var(--cc-color-line);
	stroke-width: 1;
}

.cc-hws__dash {
	stroke-dasharray: 4 5;
}

/* the one orange line of a scene */
.cc-hws__accent {
	stroke: var(--cc-color-action);
	stroke-width: 1.5;
}

.cc-hws__dot {
	fill: var(--cc-color-action);
	stroke: none;
}

/* ------------------------------------------------------------ shapes */

/* A raised shape: its front face is the raised token. The top face catches the light and the right face falls into shade, one flat
   tone each. */
.cc-hws__node {
	fill: var(--cc-color-raised);
	stroke: var(--cc-color-line-strong);
	stroke-width: 1;
	stroke-linejoin: miter;
	vector-effect: non-scaling-stroke;
}

.cc-hws__node--top {
	fill: color-mix(in srgb, var(--cc-color-white) 9%, var(--cc-color-raised));
}

.cc-hws__node--side {
	fill: color-mix(in srgb, var(--cc-color-canvas) 55%, var(--cc-color-raised));
}

/* a screen that is on: lighter than its bezel */
.cc-hws__lit {
	fill: color-mix(in srgb, var(--cc-color-white) 13%, var(--cc-color-raised));
	stroke: var(--cc-color-line);
	stroke-width: 1;
	stroke-linejoin: miter;
	vector-effect: non-scaling-stroke;
}

/* a dark opening: a drive bay, a vent, a port, a cut-away */
.cc-hws__hole {
	fill: var(--cc-color-canvas);
	stroke: var(--cc-color-line-strong);
	stroke-width: 1;
	stroke-linejoin: miter;
	vector-effect: non-scaling-stroke;
}

/* quiet furniture: a table, a chair, a desk edge */
.cc-hws__fill {
	fill: color-mix(in srgb, var(--cc-color-white) 6%, transparent);
	stroke: var(--cc-color-line);
	stroke-width: 1;
	stroke-linejoin: miter;
	vector-effect: non-scaling-stroke;
}

/* a flat tint for an area that matters (what a camera covers), the same recipe the diagrams use for signal rings */
.cc-hws__cover {
	fill: color-mix(in srgb, var(--cc-color-action) 7%, transparent);
	stroke: none;
}

/* the lit face of the one active part: a small solid mark in the action colour */
.cc-hws__lamp {
	fill: var(--cc-color-action);
	stroke: none;
}

/* ------------------------------------------------------------ where a card links, the active detail firms up */

@media (prefers-reduced-motion: no-preference) {
	.cc-hws__accent {
		transition: stroke-width var(--cc-transition-fast, 120ms) ease;
	}
}

a:hover .cc-hws__accent,
a:focus-visible .cc-hws__accent {
	stroke-width: 2;
}

/* ------------------------------------------------------------ more contrast */

@media (prefers-contrast: more) {
	.cc-hws__line,
	.cc-hws__soft,
	.cc-hws__faint,
	.cc-hws__node,
	.cc-hws__lit,
	.cc-hws__hole,
	.cc-hws__fill {
		stroke: var(--cc-color-white);
	}

	.cc-hws__soft {
		opacity: 1;
	}

	.cc-hws__node--top {
		fill: color-mix(in srgb, var(--cc-color-white) 16%, var(--cc-color-raised));
	}

	.cc-hws__lit {
		fill: color-mix(in srgb, var(--cc-color-white) 22%, var(--cc-color-raised));
	}

	.cc-hws__accent {
		stroke-width: 2;
	}
}

/* ------------------------------------------------------------ forced colours */

/* The visitor's own palette replaces ours: every line becomes the text colour, every face the page colour, and the active detail
   keeps its place by weight instead of by hue. */
@media (forced-colors: active) {
	.cc-hws__line,
	.cc-hws__soft,
	.cc-hws__faint,
	.cc-hws__accent,
	.cc-hws__node,
	.cc-hws__lit,
	.cc-hws__hole,
	.cc-hws__fill {
		stroke: CanvasText;
	}

	.cc-hws__node,
	.cc-hws__node--top,
	.cc-hws__node--side,
	.cc-hws__lit,
	.cc-hws__hole {
		fill: Canvas;
	}

	.cc-hws__fill,
	.cc-hws__cover {
		fill: none;
	}

	.cc-hws__dot,
	.cc-hws__lamp {
		fill: CanvasText;
	}

	.cc-hws__accent {
		stroke-width: 2.5;
	}

	.cc-hws__soft {
		opacity: 1;
	}
}
