/*
Theme Name: Edel-Weiss
Description: Gallery theme for the studio of Erich Weiss. Child theme of Twenty Twenty-Five: quiet gallery wall, the works carry the colour.
Template: twentytwentyfive
Version: 1.2.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: edelweiss
*/

/* Works grid: justified rows. Each tile's width follows its image's aspect ratio (--ar, set in
   functions.php), so every work is shown whole and the rows line up at an even height. */
.ew-grid.ew-grid {
	display: flex !important;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
	align-items: flex-start;
}
.ew-grid > li {
	flex: var(--ar, 1) 1 calc(var(--ar, 1) * clamp(11rem, 21vw, 16rem));
	min-width: 0;
	margin: 0;
}
.ew-grid::after { /* keeps the last row from stretching */
	content: "";
	flex: 999 1 0;
}
.ew-grid .wp-block-post-featured-image {
	margin: 0;
	aspect-ratio: var(--ar, 1);
}
.ew-grid .wp-block-post-featured-image a {
	display: block;
	height: 100%;
}
.ew-grid .wp-block-post-featured-image img {
	width: 100% !important;
	height: 100% !important;
	object-fit: contain !important;
	box-shadow: 0 6px 16px rgb(0 0 0 / 0.14);
	transition: transform 0.35s ease;
}
.ew-grid .wp-block-post-featured-image:hover img {
	transform: translateY(-3px);
}
.ew-grid .wp-block-post-title {
	font-size: var(--wp--preset--font-size--medium) !important;
	overflow-wrap: normal;
	word-break: normal;
	hyphens: auto; /* "Fenster-blick", not "Fensterbl ick" on narrow tiles */
}
@media (max-width: 600px) {
	.ew-grid > li { flex-basis: 100%; }
}

/* Series cover cards on the front page */
.ew-cover img {
	aspect-ratio: 4 / 3;
	width: 100%;
	height: auto;
	object-fit: contain; /* whole work on a mat, never cropped */
	background: var(--wp--preset--color--accent-5);
	padding: clamp(10px, 2vw, 20px);
	box-sizing: border-box;
}

/* Single work: the painting hangs on the wall */
.ew-artwork img {
	max-height: 82vh;
	width: auto !important;
	max-width: 100%;
	margin: 0 auto;
	display: block;
	box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
}

.ew-label {
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--accent-4);
}

.ew-kicker {
	text-transform: uppercase;
	letter-spacing: 0.16em;
	font-size: 0.78rem;
	font-weight: 600;
}

/* Series filter chips on the works page */
.ew-series .wp-block-categories-list,
.ew-series ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	padding: 0;
	margin: 0;
}
.ew-series li a {
	display: inline-block;
	padding: 0.4em 1em;
	border: 1px solid currentColor;
	border-radius: 999px;
	text-decoration: none;
}
.ew-series li a:hover {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Canvas texture: a near-white weave tile multiplied over the background colours (base, accent-5),
   so the page keeps its white/grey tones but reads like primed canvas. Tile: scripts/make_canvas_texture.py */
body,
.has-base-background-color,
.has-accent-5-background-color,
.ew-cover img {
	background-image: url("assets/canvas.jpg");
	background-size: 1024px 1024px;
	background-blend-mode: multiply;
}
