/*
Theme Name: Wilhelm Interiors
Theme URI: https://www.wilhelminteriors.com/
Description: Schlankes Theme für Wilhelm Interiors. Ohne Page-Builder und ohne externe Abhängigkeiten; Schrift (Jost, SIL Open Font License) lokal eingebunden.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wilhelm-interiors
*/

/* ------------------------------------------------------------------ Tokens */

@font-face {
	font-family: "Jost";
	font-style: normal;
	font-weight: 300 700;
	font-display: swap;
	src: url("assets/fonts/jost-latin-wght-normal.woff2") format("woff2");
}

:root {
	--wi-ink: #1d1b18;
	--wi-ink-2: #5c564d;
	--wi-muted: #776f64;
	--wi-paper: #f6f3ee;
	--wi-bg: #ffffff;
	--wi-line: rgba(29, 27, 24, 0.10);
	--wi-line-strong: rgba(29, 27, 24, 0.25);
	--wi-font: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;
	--wi-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--wi-max: 1280px;
	--wi-gutter: 24px;
	--wi-header: 72px;
	--wi-admin-bar: var(--wp-admin--admin-bar--height, 0px);
}

@media (min-width: 900px) {
	:root {
		--wi-gutter: 48px;
		--wi-header: 80px;
	}
}

/* ------------------------------------------------------------------ Base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--wi-header) + 16px); }

body {
	margin: 0;
	background: var(--wi-bg);
	color: var(--wi-ink);
	font: 400 17px/1.65 var(--wi-font);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--wi-ink); outline-offset: 3px; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.15; color: var(--wi-ink); text-wrap: balance; }
h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1.05; letter-spacing: -0.025em; }
h2 { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -0.012em; }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
strong, b { font-weight: 500; }

::selection { background: var(--wi-ink); color: #fff; }

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

.wi-skip {
	position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 16px;
	background: var(--wi-ink); color: #fff; text-decoration: none;
}
.wi-skip:focus { top: calc(8px + var(--wi-admin-bar)); }

.wi-wrap {
	width: 100%;
	max-width: calc(var(--wi-max) + 2 * var(--wi-gutter));
	margin-inline: auto;
	padding-left: max(var(--wi-gutter), env(safe-area-inset-left, 0px));
	padding-right: max(var(--wi-gutter), env(safe-area-inset-right, 0px));
}

.wi-muted { color: var(--wi-muted); }
.wi-tnum { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Shared pieces */

/* The "Maßlinie": a dimension line under small section labels. */
.wi-measure { display: grid; gap: 12px; max-width: 240px; margin-bottom: 24px; }
.wi-measure > span { font-size: 14px; line-height: 1.3; color: var(--wi-muted); }
.wi-dim {
	display: block; position: relative; height: 9px;
	border-left: 1px solid var(--wi-ink); border-right: 1px solid var(--wi-ink);
}
.wi-dim::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: var(--wi-ink); }

.wi-btn,
.wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center;
	height: 48px; padding: 0 24px; border-radius: 2px; border: 1px solid transparent;
	font: 500 15px/1 var(--wi-font); letter-spacing: 0.01em; text-decoration: none;
	transition: background-color 150ms var(--wi-ease), border-color 150ms var(--wi-ease), color 150ms var(--wi-ease), transform 120ms var(--wi-ease);
	cursor: pointer;
}
.wi-btn:active, .wp-block-button__link:active { transform: scale(0.98); }
.wi-btn--primary,
.wp-block-button:not(.is-style-outline) .wp-block-button__link { background: var(--wi-ink); color: #fff; }
.wi-btn--primary:hover,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover { background: #3a362f; color: #fff; }
.wi-btn--secondary,
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--wi-ink); border-color: rgba(29, 27, 24, 0.22); }
.wi-btn--secondary:hover,
.wp-block-button.is-style-outline .wp-block-button__link:hover { border-color: var(--wi-ink); }
.wi-btn--sm { height: 36px; padding: 0 16px; font-size: 14px; }

.wi-actions, .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.wp-block-buttons > .wp-block-button { margin: 0; }

.wi-text-link {
	display: inline-block; font-size: 15px; font-weight: 500; color: var(--wi-ink); text-decoration: none; white-space: nowrap;
	border-bottom: 1px solid var(--wi-line-strong); padding-bottom: 2px; transition: border-color 150ms var(--wi-ease);
}
.wi-text-link:hover { border-color: var(--wi-ink); }

.wi-lede { font-size: 19px; line-height: 1.6; color: var(--wi-ink-2); max-width: 34rem; }
.wi-credit { font-size: 14px; color: var(--wi-muted); margin: 0 0 12px; }

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

.wi-header {
	position: sticky; top: var(--wi-admin-bar); z-index: 50;
	background: rgba(255, 255, 255, 0.96);
	border-bottom: 1px solid var(--wi-line);
}
@supports (backdrop-filter: blur(8px)) {
	.wi-header { background: rgba(255, 255, 255, 0.9); backdrop-filter: saturate(1.2) blur(8px); }
}
.wi-header__inner { height: var(--wi-header); display: flex; align-items: center; gap: 32px; }
.wi-brand { display: block; flex: none; color: var(--wi-ink); }
.wi-brand svg { width: auto; height: 28px; }
.wi-nav { margin-left: auto; display: flex; align-items: center; gap: 32px; }
.wi-nav__list, .wi-nav ul { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
.wi-nav a:not(.wi-btn) {
	font-size: 15px; color: var(--wi-ink-2); text-decoration: none;
	transition: color 150ms var(--wi-ease);
}
.wi-nav a:not(.wi-btn):hover,
.wi-nav a[aria-current="page"],
.wi-nav .current-menu-item > a,
.wi-nav .current_page_item > a { color: var(--wi-ink); }
.wi-nav a[aria-current="page"],
.wi-nav .current-menu-item > a { text-decoration: underline; text-underline-offset: 6px; }

.wi-menu-toggle {
	display: none; margin-left: auto; height: 36px; padding: 0 12px;
	font: 400 15px/1 var(--wi-font); color: var(--wi-ink);
	background: none; border: 1px solid var(--wi-line); border-radius: 2px; cursor: pointer;
}

@media (max-width: 860px) {
	.wi-brand svg { height: 24px; }
	.wi-menu-toggle { display: inline-flex; align-items: center; }
	.wi-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 0;
		padding: 8px max(var(--wi-gutter), env(safe-area-inset-left, 0px)) 24px;
		background: #fff; border-bottom: 1px solid var(--wi-line);
	}
	.wi-header.is-open .wi-nav { display: flex; }
	.wi-nav__list, .wi-nav ul { flex-direction: column; gap: 0; }
	.wi-nav a:not(.wi-btn) { display: block; padding: 12px 0; font-size: 18px; color: var(--wi-ink); border-bottom: 1px solid var(--wi-line); }
	.wi-nav .wi-btn { margin-top: 16px; height: 48px; }
}

/* ------------------------------------------------------------------ Content defaults */

.wi-content > * { margin-top: 0; }
.wi-prose { max-width: calc(44rem + 2 * var(--wi-gutter)); margin-left: 0; }
@media (min-width: 900px) {
	.wi-prose { margin-left: max(0px, calc((100% - var(--wi-max) - 2 * var(--wi-gutter)) / 2)); }
}
.wi-prose { padding-bottom: 128px; }
.wi-prose h2 { font-size: 22px; letter-spacing: 0; margin: 40px 0 8px; }
.wi-prose h3 { font-size: 18px; margin: 32px 0 8px; }
.wi-prose p, .wi-prose li { font-size: 16px; line-height: 1.7; }
.wi-prose a { text-decoration: underline; }

.wi-page-head { padding-top: 96px; padding-bottom: 48px; }
.wi-page-head h1 { max-width: 18ch; }

/* ------------------------------------------------------------------ Home */

.wi-hero {
	max-width: calc(var(--wi-max) + 2 * var(--wi-gutter)); margin: 0 auto;
	padding: 104px max(var(--wi-gutter), env(safe-area-inset-right, 0px)) 64px max(var(--wi-gutter), env(safe-area-inset-left, 0px));
}
.wi-hero .wp-block-columns { display: flex; align-items: flex-end; gap: 64px; margin: 0; }
.wi-hero .wp-block-column { margin: 0; min-width: 0; }
.wi-hero h1 { font-size: clamp(40px, 5.4vw, 72px); line-height: 1.04; max-width: none; }
.wi-hero .wi-lede { margin-bottom: 32px; }

.wi-hero-photo { margin: 0; }
.wi-hero-photo img { width: 100%; height: clamp(240px, 30vw, 480px); object-fit: cover; object-position: 50% 60%; }

.wi-intro {
	max-width: calc(var(--wi-max) + 2 * var(--wi-gutter)); margin: 0 auto;
	padding: 128px var(--wi-gutter);
}
.wi-intro .wp-block-columns { display: flex; gap: 64px; margin: 0; }
.wi-intro .wp-block-column { margin: 0; min-width: 0; }
.wi-intro .wi-measure { padding-top: 12px; }
.wi-intro h2 { margin-bottom: 24px; }
.wi-intro p { font-size: 20px; line-height: 1.6; max-width: 40rem; }
.wi-intro p + p { color: var(--wi-ink-2); }

.wi-signoff { display: flex; align-items: flex-end; gap: 24px; padding-top: 16px; }
.wi-signoff svg { width: 200px; height: auto; flex: none; }
.wi-signoff small { font-size: 14px; color: var(--wi-muted); padding-bottom: 6px; line-height: 1.4; }

.wi-projects { padding-bottom: 128px; }
.wi-section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.wi-section__title { flex: 1; min-width: 0; }
.wi-section__title .wi-measure { max-width: 520px; }

.wi-project-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; }
.wi-tile { display: flex; flex-direction: column; gap: 16px; text-decoration: none; color: inherit; }
.wi-tile--feature { grid-row: span 2; }
.wi-tile__media { position: relative; display: block; overflow: hidden; background: var(--wi-paper); aspect-ratio: 3 / 2; }
.wi-tile--feature .wi-tile__media { aspect-ratio: auto; flex: 1; min-height: 360px; }
.wi-tile__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 200ms var(--wi-ease); }
.wi-tile:hover img { opacity: 0.92; }
.wi-tile__meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.wi-tile__title { font-size: 18px; }
.wi-tile__sub { font-size: 14px; color: var(--wi-muted); text-align: right; }
.wi-tile:hover .wi-tile__title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ------------------------------------------------------------------ Projekte list */

.wi-project-list { padding-bottom: 128px; }
.wi-row {
	display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: center;
	margin-bottom: 96px;
}
.wi-row:nth-child(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.wi-row:nth-child(even) .wi-row__media { order: 2; }
.wi-row__media { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--wi-paper); }
.wi-row__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 200ms var(--wi-ease); }
.wi-row__media:hover img { opacity: 0.92; }
.wi-row__title { margin-bottom: 16px; }
.wi-row__title a { text-decoration: none; }
.wi-row__title a:hover { text-decoration: underline; text-underline-offset: 6px; }
.wi-row__summary { color: var(--wi-ink-2); max-width: 34rem; margin-bottom: 24px; }

/* ------------------------------------------------------------------ Project detail */

.wi-project__content > .wi-credit { margin-top: -24px; margin-bottom: 16px; }
.wi-project__content > p:not(.wi-credit) { font-size: 19px; line-height: 1.6; color: var(--wi-ink-2); max-width: 40rem; }
.wi-project__content { padding-bottom: 64px; }

.wp-block-gallery.wi-masonry {
	display: block !important;
	column-count: 3; column-gap: 20px;
	margin: 48px 0 0;
}
.wp-block-gallery.wi-masonry > .wp-block-image {
	display: block; width: 100% !important; margin: 0 0 20px !important;
	break-inside: avoid;
}
.wp-block-gallery.wi-masonry > .wp-block-image img { width: 100%; height: auto !important; object-fit: contain; }
@media (max-width: 1000px) { .wp-block-gallery.wi-masonry { column-count: 2; } }
@media (max-width: 600px) { .wp-block-gallery.wi-masonry { column-count: 1; } }

.wi-cta { padding-top: 64px; padding-bottom: 128px; }
.wi-cta::before { content: ""; display: block; height: 1px; background: var(--wi-line); margin-bottom: 64px; }
.wi-cta h2 { margin-bottom: 24px; }

/* ------------------------------------------------------------------ Kontakt */

.wi-contact {
	max-width: calc(var(--wi-max) + 2 * var(--wi-gutter)); margin: 0 auto;
	padding: 96px var(--wi-gutter) 128px;
}
.wi-contact .wp-block-columns { display: flex; align-items: center; gap: 64px; margin: 0; }
.wi-contact .wp-block-column { margin: 0; min-width: 0; }
.wi-contact h1 { margin-bottom: 24px; }
.wi-contact .wi-lede { margin-bottom: 32px; }
.wi-contact-list {
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px;
	margin: 48px 0 0; padding: 32px 0 0; border-top: 1px solid var(--wi-line);
}
.wi-contact-list dt { font-size: 14px; color: var(--wi-muted); margin-bottom: 4px; }
.wi-contact-list dd { margin: 0; font-size: 16px; line-height: 1.6; }
.wi-contact-list a { text-decoration: none; }
.wi-contact-list a:hover { text-decoration: underline; }
.wi-portrait { margin: 0 auto; max-width: 300px; }
.wi-portrait img { width: 100%; border-radius: 50%; }

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

.wi-footer { background: var(--wi-paper); padding-top: 80px; padding-bottom: max(40px, env(safe-area-inset-bottom, 0px)); }
.wi-footer__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.wi-footer__label { font-size: 14px; font-weight: 400; color: var(--wi-muted); margin: 0 0 12px; letter-spacing: 0; }
.wi-footer p { margin: 0; font-size: 16px; line-height: 1.7; }
.wi-footer a { text-decoration: none; }
.wi-footer a:hover { text-decoration: underline; }
.wi-footer__bottom {
	margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--wi-line);
	display: flex; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--wi-muted);
}

/* ------------------------------------------------------------------ Motion */

@media (prefers-reduced-motion: no-preference) {
	.wi-hero .wp-block-column { animation: wi-rise 500ms var(--wi-ease) both; }
	.wi-hero .wp-block-column + .wp-block-column { animation-delay: 80ms; }
	@keyframes wi-rise { from { opacity: 0; transform: translateY(8px); } }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
	.wi-signoff svg * { stroke-dashoffset: 0 !important; }
}

/* ------------------------------------------------------------------ Small screens */

@media (max-width: 900px) {
	.wi-page-head { padding-top: 56px; padding-bottom: 32px; }
	.wi-hero { padding-top: 56px; padding-bottom: 40px; }
	.wi-hero .wp-block-columns,
	.wi-intro .wp-block-columns,
	.wi-contact .wp-block-columns { flex-direction: column; align-items: stretch; gap: 24px; }
	.wi-hero .wp-block-column,
	.wi-intro .wp-block-column,
	.wi-contact .wp-block-column { flex-basis: auto !important; }
	.wi-lede { font-size: 17px; }
	.wi-intro { padding-top: 80px; padding-bottom: 80px; }
	.wi-intro p { font-size: 18px; }
	.wi-contact { padding-top: 56px; padding-bottom: 80px; }
	.wi-contact .wp-block-columns { gap: 48px; }
	.wi-contact-list { grid-template-columns: minmax(0, 1fr); }
	.wi-section__head { flex-direction: column; align-items: flex-start; }
	.wi-section__title { width: 100%; }
	.wi-project-grid { grid-template-columns: minmax(0, 1fr); }
	.wi-tile--feature { grid-row: auto; }
	.wi-tile--feature .wi-tile__media { aspect-ratio: 3 / 2; min-height: 0; }
	.wi-projects, .wi-project-list { padding-bottom: 80px; }
	.wi-row, .wi-row:nth-child(even) { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-bottom: 64px; }
	.wi-row:nth-child(even) .wi-row__media { order: 0; }
	.wi-signoff { flex-direction: column; align-items: flex-start; gap: 8px; }
	.wi-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.wi-cta { padding-bottom: 80px; }
}
@media (max-width: 480px) {
	.wi-footer__grid { grid-template-columns: minmax(0, 1fr); }
	.wi-footer__bottom { flex-direction: column; }
	.wi-tile__meta { flex-direction: column; gap: 2px; }
	.wi-tile__sub { text-align: left; }
}
