/*
Theme Name: CHRÄMERmitSTIL
Description: Eigenes Theme für chraemermitstil.ch – handgefertigte Chrämer aus Wollerau.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: chraemer
*/

/* Colours come from the object itself: plywood paint (sperrholz), brass plaque (messing),
   the tiled counter top (kachelblau). Messing is decorative only – it fails text contrast. */

:root {
	--chr-frame: clamp(10px, 1.6vw, 20px);
	--chr-shadow-in: inset 0 0.6rem 1.2rem -0.4rem rgb(51 40 31 / 0.35);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
p, li { max-width: 68ch; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

:where(a, button, input, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--kachelblau);
	outline-offset: 3px;
}

.screen-reader-text:not(:focus) {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* ---------- Header ---------- */

.chr-header { padding-block: 1.25rem; border-bottom: 1px solid var(--wp--preset--color--sperrholz); }
.chr-logo { margin: 0; line-height: 1; font-family: var(--wp--preset--font-family--bodoni); }
.chr-logo a { display: inline-flex; flex-direction: column; gap: 0.2rem; color: inherit; text-decoration: none; }
.chr-logo .chr-logo__cr { font-size: 0.8125rem; letter-spacing: 0.08em; font-weight: 500; }
.chr-logo .chr-logo__name { font-size: clamp(1.25rem, 2.4vw, 1.625rem); font-weight: 500; letter-spacing: 0.02em; }
.chr-logo .chr-logo__mit { font-size: 0.72em; font-style: italic; letter-spacing: 0; }

.chr-header .wp-block-navigation { font-size: 1rem; font-weight: 500; gap: clamp(1rem, 2.5vw, 2.25rem); }
.chr-header .wp-block-navigation a { text-decoration: none; padding-block: 0.35rem; border-bottom: 2px solid transparent; }
.chr-header .wp-block-navigation a:hover,
.chr-header .wp-block-navigation .current-menu-item > a { border-bottom-color: var(--wp--preset--color--messing); }
.chr-header .wp-block-navigation__responsive-container.is-menu-open { padding: 2rem; font-size: 1.5rem; }

/* ---------- Hero: the Chrämer in its plywood frame, one photo per season ---------- */

.chr-hero { padding-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--60); }
.chr-hero h1 { margin-top: 0; font-size: clamp(2.625rem, 4.4vw, 4.25rem); hyphens: manual; }
.chr-hero__lead { font-size: var(--wp--preset--font-size--large); line-height: 1.45; color: var(--wp--preset--color--nussbaum-mild); }

.chr-seasons { position: relative; }
.chr-seasons__stage {
	display: grid;
	background: var(--wp--preset--color--sperrholz);
	padding: var(--chr-frame);
	box-shadow: 0 1px 0 rgb(51 40 31 / 0.08), 0 1.5rem 3rem -1.5rem rgb(51 40 31 / 0.45);
}
.chr-seasons__stage > figure.wp-block-image {
	grid-area: 1 / 1;
	margin: 0;
	position: relative;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}
.chr-seasons__stage > figure.wp-block-image.is-active { opacity: 1; visibility: visible; transition: opacity 0.6s ease; }
.chr-seasons__stage > figure.wp-block-image::after {
	content: ""; position: absolute; inset: 0; box-shadow: var(--chr-shadow-in); pointer-events: none;
}
.chr-seasons__stage img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.chr-seasons__stage figcaption { display: none; }

.chr-seasons__tabs {
	display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem;
	margin: 1.1rem 0 0; padding: 0; list-style: none;
}
.chr-seasons__tabs button {
	font: inherit; font-size: 1rem; font-weight: 500; color: var(--wp--preset--color--nussbaum-mild);
	background: none; border: 0; border-bottom: 2px solid transparent; padding: 0.35rem 0; cursor: pointer;
}
.chr-seasons__tabs button:hover { color: var(--wp--preset--color--nussbaum); }
.chr-seasons__tabs button[aria-selected="true"] {
	color: var(--wp--preset--color--nussbaum);
	border-bottom-color: var(--wp--preset--color--messing);
}
.chr-seasons__hint { margin: 0.35rem 0 0; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--nussbaum-mild); }

/* Without JavaScript the seasons are a scrollable strip with visible captions. */
html:not(.js) .chr-seasons__stage { grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; gap: var(--chr-frame); }
html:not(.js) .chr-seasons__stage > figure.wp-block-image { grid-area: auto; opacity: 1; visibility: visible; scroll-snap-align: start; }
html:not(.js) .chr-seasons__stage figcaption { display: block; }

@media (prefers-reduced-motion: reduce) {
	.chr-seasons__stage > figure.wp-block-image,
	.chr-seasons__stage > figure.wp-block-image.is-active { transition: none; }
}

/* ---------- Timeline (1944 → 2017 is a real sequence) ---------- */

.chr-year {
	margin: 0; font-family: var(--wp--preset--font-family--bodoni); font-weight: 400;
	font-size: clamp(3.5rem, 9vw, 7rem); line-height: 0.9; letter-spacing: -0.02em;
	font-variant-numeric: lining-nums;
}
.chr-timeline .wp-block-column + .wp-block-column { position: relative; }
.chr-timeline .wp-block-image img { aspect-ratio: 1; object-fit: cover; }
@media (min-width: 782px) {
	.chr-timeline .wp-block-column + .wp-block-column::before {
		content: ""; position: absolute; left: calc(-1 * var(--wp--style--block-gap, 2rem) / 2); top: 0.5rem; bottom: 0;
		border-left: 1px solid var(--wp--preset--color--sperrholz);
	}
}

/* ---------- Bands ---------- */

.chr-band { background: var(--wp--preset--color--sperrholz-hell); }
.chr-band--holz { background: var(--wp--preset--color--sperrholz); }
.chr-band--holz a:where(:not(.wp-element-button)) { color: var(--wp--preset--color--nussbaum); }

/* ---------- Brass plaque ---------- */

.chr-plaque {
	position: relative;
	display: inline-flex !important; flex-direction: column; align-items: center; gap: 0.1rem !important;
	min-width: min(100%, 19rem);
	padding: 1.6rem 3.2rem !important;
	border-radius: 3px;
	color: #3b2b14;
	background:
		linear-gradient(100deg, rgb(255 255 255 / 0) 30%, rgb(255 248 225 / 0.45) 46%, rgb(255 255 255 / 0) 60%),
		linear-gradient(180deg, #d6ba80 0%, #b8955a 48%, #a9864f 52%, #c6a76d 100%);
	box-shadow:
		inset 0 0 0 1px rgb(255 240 200 / 0.55),
		inset 0 0 0 4px rgb(120 90 40 / 0.35),
		0 2px 3px rgb(51 40 31 / 0.35);
	font-family: var(--wp--preset--font-family--bodoni);
	text-align: center;
}
.chr-plaque::before, .chr-plaque::after {
	content: ""; position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #f3e2b5, #8a6a35 70%);
	box-shadow: 0 1px 1px rgb(51 40 31 / 0.4);
}
.chr-plaque::before { left: 1rem; }
.chr-plaque::after { right: 1rem; }
.chr-plaque p { margin: 0 !important; text-shadow: 0 1px 0 rgb(255 245 215 / 0.55); }
.chr-plaque p:first-child { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 500; line-height: 1.1; }
.chr-plaque p:last-child:not(:first-child) { font-size: 1.0625rem; font-style: italic; }

/* ---------- Gallery as shelf compartments ---------- */

.wp-block-gallery.chr-faecher {
	background: var(--wp--preset--color--sperrholz);
	padding: var(--chr-frame);
	gap: var(--chr-frame) !important;
}
.wp-block-gallery.chr-faecher figure.wp-block-image { position: relative; }
.wp-block-gallery.chr-faecher figure.wp-block-image::after {
	content: ""; position: absolute; inset: 0; box-shadow: var(--chr-shadow-in); pointer-events: none;
}
.wp-block-gallery.chr-faecher.has-nested-images figure.wp-block-image img { aspect-ratio: 4 / 3; object-fit: cover; }
.wp-block-gallery.chr-faecher figure.wp-block-image figcaption { display: none; }

/* ---------- Measured drawing ---------- */

.chr-masse { margin: 0; }
.chr-masse svg { display: block; width: 100%; max-width: 34rem; height: auto; }
.chr-masse .k { fill: none; stroke: var(--wp--preset--color--nussbaum); stroke-width: 1.6; stroke-linejoin: round; }
.chr-masse .k-in { fill: none; stroke: var(--wp--preset--color--nussbaum); stroke-width: 1; opacity: 0.55; }
.chr-masse .m { fill: none; stroke: var(--wp--preset--color--messing); stroke-width: 1.2; }
.chr-masse text { font-family: var(--wp--preset--font-family--karla); font-size: 15px; font-weight: 600; fill: var(--wp--preset--color--nussbaum); }
.chr-masse figcaption { margin-top: 0.5rem; }

/* ---------- Lists ---------- */

.chr-list { list-style: none; padding: 0; }
.chr-list li { position: relative; padding-left: 1.4rem; margin-bottom: 0.35rem; }
.chr-list li::before {
	content: ""; position: absolute; left: 0; top: 0.62em; width: 0.5rem; height: 0.5rem;
	border: 1px solid var(--wp--preset--color--messing); background: var(--wp--preset--color--sperrholz);
}

/* ---------- Venues ---------- */

.chr-venue { border-top: 1px solid var(--wp--preset--color--sperrholz); padding-top: 1.5rem; }
.chr-venue .wp-block-image img { width: 9rem; height: auto; mix-blend-mode: multiply; }
.chr-venue h3 { margin-block: 0.75rem 0.25rem; }
.chr-venue p { margin-block: 0.15rem; }

/* ---------- Contact form ---------- */

.chr-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.25rem; }
.chr-field { margin: 0; display: flex; flex-direction: column; gap: 0.35rem; max-width: none; }
.chr-field--full { grid-column: 1 / -1; }
.chr-field label { font-size: var(--wp--preset--font-size--small); font-weight: 600; }
.chr-field input, .chr-field textarea {
	font: inherit; color: inherit; width: 100%; box-sizing: border-box;
	padding: 0.7rem 0.8rem; border: 1px solid #b9ad95; border-radius: 2px; background: #fff;
}
.chr-field input:focus, .chr-field textarea:focus { border-color: var(--wp--preset--color--kachelblau); }
.chr-check { flex-direction: row; align-items: flex-start; gap: 0.6rem; }
.chr-check input { width: auto; margin-top: 0.3rem; }
.chr-check label { font-weight: 400; }
.chr-form button {
	justify-self: start; font: inherit; font-weight: 600; cursor: pointer;
	color: var(--wp--preset--color--kreide); background: var(--wp--preset--color--kachelblau);
	border: 0; border-radius: 2px; padding: 0.85rem 1.6rem;
}
.chr-form button:hover { background: var(--wp--preset--color--nussbaum); }
.chr-hp { position: absolute !important; left: -9999px; }
.chr-notice { padding: 1rem 1.25rem; border-left: 4px solid var(--wp--preset--color--kachelblau); background: var(--wp--preset--color--sperrholz-hell); max-width: none; }
.chr-notice--error { border-left-color: #9b3b2a; }
@media (max-width: 600px) { .chr-form { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */

.chr-footer { font-size: var(--wp--preset--font-size--small); }
.chr-footer a { color: inherit; }
.chr-footer p { margin-block: 0.2rem; }
.chr-footer .chr-logo .chr-logo__name { font-size: 1.25rem; }

/* ---------- Misc ---------- */

.chr-contact-lines p { margin-block: 0 1.5rem; }
.chr-contact-lines strong { display: block; font-size: var(--wp--preset--font-size--small); font-weight: 600; margin-bottom: 0.15rem; }
.chr-lede { font-size: var(--wp--preset--font-size--large); line-height: 1.45; color: var(--wp--preset--color--nussbaum-mild); }
@media (max-width: 781px) {
	.chr-timeline > .wp-block-column + .wp-block-column { margin-top: var(--wp--preset--spacing--40); }
}
