/*
Theme Name: Windhager Extranet
Description: Landing page for visitors, private portal for users logged in via the BWT identity server. Dark theme styled after windhagernxt.com. Requires the "BWT Login" plugin.
Version: 1.15.16
Requires PHP: 7.4
Text Domain: windhager-extranet
*/

:root {
	--wx-bg: #181818;
	--wx-surface: #1f1f1f;
	--wx-surface-2: #262626;
	--wx-text: #ffffff;
	--wx-muted: #8c8c8c;
	--wx-border: #333333;
	--wx-accent: #e30613;
	--wx-accent-hover: #c40510;
	--wx-header: #000000;
	--wx-header-text: #ffffff;
	--wx-radius: 12px;
	--wx-width: 1100px;
	--wx-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

/* Keep room for the scrollbar on short pages too, so the layout doesn't shift between pages. */
html { scrollbar-gutter: stable; }

body {
	margin: 0;
	background: var(--wx-bg);
	color: var(--wx-text);
	font-family: var(--wx-font);
	font-size: 16px;
	line-height: 1.6;
	font-weight: 400;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--wx-accent); text-decoration: none; }
a:hover { color: var(--wx-accent-hover); }
img { max-width: 100%; height: auto; }

.wx-container { width: 100%; max-width: var(--wx-width); margin: 0 auto; padding: 0 16px; }

/* Headings — uppercase, light, tracked (Windhager NXT style) */
h1, h2, h3, .wx-page-title, .wx-hero h1 {
	font-weight: 300;
	text-transform: uppercase;
	letter-spacing: 2px;
	line-height: 1.15;
	margin: 0 0 16px;
}

/* Header */
.wx-header { background: var(--wx-header); border-bottom: 1px solid var(--wx-border); }
.wx-header .wx-container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.wx-brand { color: var(--wx-header-text); text-transform: uppercase; letter-spacing: 3px; font-weight: 400; font-size: 1.1rem; }
.wx-brand:hover { color: var(--wx-header-text); }
.wx-brand img { max-height: 40px; width: auto; display: block; }
/* White Windhager wordmark (SVG) sits directly on the dark header. */
.wx-brand .wx-logo { height: 48px; max-height: 48px; width: auto; }
.wx-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
/* Logo, then the name of the logged-in user */
.wx-header-start { display: flex; align-items: center; gap: 20px; min-width: 0; }
.wx-user {
	color: var(--wx-muted); font-size: .85rem; letter-spacing: 1px; text-transform: uppercase;
	padding-left: 20px; border-left: 1px solid var(--wx-border);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Language switcher (Polylang) */
.wx-langs { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; font-size: .8rem; letter-spacing: 1px; }
.wx-langs a { display: block; padding: 4px 6px; color: var(--wx-muted); }
.wx-langs a:hover, .wx-langs a[aria-current] { color: var(--wx-header-text); }

/* Main navigation (logged-in users) */
.wx-mainnav { background: var(--wx-surface); border-bottom: 1px solid var(--wx-border); }
/* Always one line with fixed gaps (they don't shift while fonts load); if a language does not
   fit, the menu scrolls sideways instead of wrapping. */
.wx-menu { list-style: none; margin: 0 -7px; padding: 0; display: flex; gap: 0 8px; overflow-x: auto; scrollbar-width: none; }
.wx-menu li { flex-shrink: 0; }
.wx-menu a {
	display: block; padding: 14px 7px 12px; white-space: nowrap;
	color: var(--wx-muted); font-size: .78rem; font-weight: 500; letter-spacing: 1px; text-transform: uppercase;
	border-bottom: 2px solid transparent;
}
.wx-menu a:hover { color: var(--wx-text); }
.wx-menu .current-menu-item > a, .wx-menu .current_page_item > a { color: var(--wx-text); border-bottom-color: var(--wx-accent); }

/* Buttons */
.wx-btn {
	display: inline-block;
	padding: .7em 1.6em;
	border-radius: var(--wx-radius);
	border: 2px solid var(--wx-accent);
	background: var(--wx-accent);
	color: #fff;
	font-family: var(--wx-font);
	font-weight: 500;
	font-size: .9rem;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	line-height: 1.3;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
}
.wx-btn:hover { background: var(--wx-accent-hover); border-color: var(--wx-accent-hover); color: #fff; }
.wx-btn--ghost { background: transparent; border-color: var(--wx-border); color: var(--wx-text); }
.wx-btn--ghost:hover { background: var(--wx-surface-2); border-color: var(--wx-text); color: var(--wx-text); }
.wx-btn--lg { font-size: 1rem; padding: .85em 2em; }
/* Login button with its dropdown (customers & partners / employees): opens on hover, focus or tap. */
.wx-login { position: relative; }
.wx-login-caret { display: inline-block; width: 0; height: 0; margin-left: .6em; vertical-align: .15em; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; }
.wx-login-menu {
	display: none; position: absolute; right: 0; top: 100%; z-index: 20; min-width: 100%; margin: 0; padding: 6px 0 0; list-style: none;
}
.wx-login-menu li { background: var(--wx-surface); border: 1px solid var(--wx-border); border-top: 0; overflow: hidden; }
.wx-login-menu li:first-child { border-top: 1px solid var(--wx-border); border-radius: var(--wx-radius) var(--wx-radius) 0 0; }
.wx-login-menu li:last-child { border-radius: 0 0 var(--wx-radius) var(--wx-radius); }
.wx-login-menu a { display: block; padding: 12px 18px; color: var(--wx-text); white-space: nowrap; font-size: .85rem; letter-spacing: 1px; text-transform: uppercase; }
.wx-login-menu a:hover, .wx-login-menu a:focus { background: var(--wx-surface-2); color: var(--wx-text); }
.wx-login:hover .wx-login-menu, .wx-login:focus-within .wx-login-menu, .wx-login.is-open .wx-login-menu { display: block; }

/* Main */
.wx-main { flex: 1; padding: 56px 0; }
/* Start + maintenance page: text on the left, Windhager headquarters (assets/windhager-hq.*) on the right */
.wx-hero {
	display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
	min-height: 480px; padding: 64px 56px;
	border: 1px solid var(--wx-border); border-radius: var(--wx-radius); overflow: hidden;
	background-color: var(--wx-surface);
	background-image:
		linear-gradient(90deg, rgba(14, 14, 14, .96) 0%, rgba(14, 14, 14, .82) 38%, rgba(14, 14, 14, .15) 72%, rgba(14, 14, 14, 0) 100%),
		url(assets/windhager-hq.jpg);
	background-image:
		linear-gradient(90deg, rgba(14, 14, 14, .96) 0%, rgba(14, 14, 14, .82) 38%, rgba(14, 14, 14, .15) 72%, rgba(14, 14, 14, 0) 100%),
		image-set(url(assets/windhager-hq.webp) type("image/webp"), url(assets/windhager-hq.jpg) type("image/jpeg"));
	background-size: cover; background-position: 70% center;
}
.wx-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: 3px; max-width: 520px; }
.wx-hero .wx-content { color: #c9c9c9; font-size: 1.1rem; max-width: 460px; margin: 0 0 32px; }
.wx-notice { max-width: 460px; margin: 0 0 32px; padding: 16px 20px; border-left: 4px solid #e2001a; background: rgba(226, 0, 26, .12); color: #fff; font-size: 1rem; line-height: 1.45; }
.wx-notice--tools { max-width: none; margin: 0 0 28px; }
.wx-notice--tools p { margin: 0 0 12px; }
.wx-notice--tools p:last-child { margin-bottom: 0; }
.wx-notice-small { font-size: .85rem; color: var(--wx-muted); }

.wx-card {
	background: var(--wx-surface);
	border: 1px solid var(--wx-border);
	border-radius: var(--wx-radius);
	padding: 36px;
}
.wx-page-title { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: 2px; }

/* Subtitle under a page title (paragraph with class "wx-lead") */
.wx-content .wx-lead { color: var(--wx-muted); font-size: 1.05rem; margin: -6px 0 24px; }

/* Content from the block editor */
.wx-content > :first-child { margin-top: 0; }
.wx-content > :last-child { margin-bottom: 0; }
.wx-content h2 { margin-top: 2em; font-size: 1.25rem; letter-spacing: 1.5px; }

/* Page "Tools" (deploy/setup-tools.php): one row per external tool, then the FLAMES banner */
/* WordPress wraps group content in an inner container: let the parts take part in the layout. */
.wx-content .wx-tools > .wp-block-group__inner-container,
.wx-content .wx-tool > .wp-block-group__inner-container,
.wx-content .wx-flames > .wp-block-group__inner-container { display: contents; }
.wx-content .wx-tools { display: flex; flex-direction: column; gap: 10px; }
.wx-content .wx-tool {
	display: flex; align-items: center; justify-content: space-between; gap: 32px;
	background: var(--wx-surface-2); border: 1px solid var(--wx-border); border-left: 3px solid var(--wx-accent);
	border-radius: var(--wx-radius); padding: 22px 26px;
}
.wx-content .wx-tool-text { flex: 1; min-width: 0; }
.wx-content .wx-tool h3 { margin: 0; font-size: 1.05rem; font-weight: 400; letter-spacing: 1.5px; overflow-wrap: anywhere; }
.wx-content .wx-tool p { color: var(--wx-muted); margin: 6px 0 0; max-width: 640px; }
.wx-content .wx-tool .wx-tool-lead { color: var(--wx-text); }
.wx-content .wx-tool .wp-block-buttons { flex-shrink: 0; margin: 0; }
.wx-content .wx-tool .wp-block-button__link {
	padding: .6em 1.4em; font-size: .8rem; letter-spacing: 1.2px;
	background: transparent; border: 1px solid var(--wx-accent); color: var(--wx-text);
}
.wx-content .wx-tool .wp-block-button__link::after { content: " \2197"; }
.wx-content .wx-tool .wp-block-button__link[href]:hover,
.wx-content .wx-tool button.wp-block-button__link:hover { background: var(--wx-accent); }
/* Greyed out: no link (not logged in, tool not configured) */
.wx-content .wx-tool a.wp-block-button__link:not([href]),
.wx-content .wx-tool span.wp-block-button__link { border-color: var(--wx-border); color: var(--wx-muted); opacity: 1; }
/* Login buttons of the external tools (plugin "Windhager SSO Links"): a form that posts the signed fields */
.wx-content .wx-tool form.wx-sso { margin: 0; }
.wx-content .wx-tool button.wp-block-button__link { font: inherit; font-size: .8rem; cursor: pointer; }

/* White FLAMES banner, flames on the left (like windhager.com) */
.wx-content .wx-flames {
	margin-top: 36px; padding: 36px 40px 36px 220px; min-height: 230px;
	display: flex; flex-direction: column; justify-content: center;
	background: #fff url(assets/flames.png) no-repeat 48px center / 134px auto;
	border-radius: var(--wx-radius); color: #1f1f1f;
}
.wx-content .wx-flames h2 { margin: 0 0 14px; color: #1f1f1f; font-size: 1.3rem; font-weight: 600; letter-spacing: .5px; line-height: 1.35; }
.wx-content .wx-flames p { margin: 0; color: #333; max-width: 640px; }
/* Temporarily hidden (2026-11-16): the FLAMES programme banner is not shown for now. Remove this rule to bring it back. */
.wx-content .wx-flames { display: none; }

.wx-content a { color: var(--wx-accent); text-decoration: underline; text-underline-offset: 3px; }
.wx-content a:hover { color: var(--wx-accent-hover); }
/* Buttons inside page content keep their own colours (the content link rule above is more specific than .wx-btn). */
.wx-content .wx-btn, .wx-content .wx-btn:hover { color: #fff; text-decoration: none; }
.wx-content ul { padding-left: 1.2em; }
.wx-content li { margin: .4em 0; }
.wx-content .wp-block-file {
	display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
	padding: 14px 18px; margin: 10px 0;
	background: var(--wx-surface-2);
	border: 1px solid var(--wx-border); border-radius: var(--wx-radius);
}
.wx-content .wp-block-file a:first-child { color: var(--wx-text); text-decoration: none; }
.wx-content .wp-block-file .wp-block-file__button {
	background: var(--wx-accent); color: #fff; border-radius: var(--wx-radius);
	padding: .45em 1.1em; text-decoration: none; font-size: .8rem; font-weight: 500;
	letter-spacing: 1px; text-transform: uppercase;
}

/* Tables (e.g. download lists) */
.wx-content .wp-block-table { margin: 0 0 32px; overflow-x: auto; }
.wx-content .wp-block-table table { width: 100%; border-collapse: collapse; font-size: .92rem; border: 1px solid var(--wx-border); }
.wx-content .wp-block-table thead { border-bottom: 0; }
.wx-content .wp-block-table th {
	background: #000; text-align: left; padding: 12px 14px; border: 0;
	font-size: .72rem; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
}
.wx-content .wp-block-table td { padding: 12px 14px; border: 0; border-top: 1px solid var(--wx-border); vertical-align: top; }
.wx-content .wp-block-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .025); }
.wx-content .wx-downloads td:first-child { color: var(--wx-muted); font-size: .85rem; }
.wx-content .wx-downloads td:first-child strong { color: var(--wx-text); font-size: .92rem; font-weight: 500; }
.wx-content .wx-downloads td:not(:first-child) { white-space: nowrap; width: 1%; }

/* Buttons from the block editor look like the theme's buttons */
.wx-content .wp-block-buttons { margin: 28px 0 0; }
.wx-content .wp-block-button__link {
	display: inline-block; padding: .85em 2em; border-radius: var(--wx-radius);
	background: var(--wx-accent); color: #fff; text-decoration: none;
	font-weight: 500; font-size: 1rem; letter-spacing: 1.5px; text-transform: uppercase;
}
.wx-content .wp-block-button__link:hover { background: var(--wx-accent-hover); color: #fff; }
/* Greyed out: a link without href or a plain span (not a form button) */
.wx-content a.wp-block-button__link:not([href]), .wx-content span.wp-block-button__link { opacity: .5; cursor: not-allowed; }

/* Placeholder for sections whose content is still missing */
.wx-content .wx-note { color: var(--wx-muted); font-style: italic; }

/* Footer */
/* Footer: company and links as on windhager.com */
.wx-footer { border-top: 1px solid var(--wx-border); background: #000; color: var(--wx-muted); font-size: .85rem; line-height: 1.7; padding: 48px 0 0; }
.wx-footer .wx-container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px 48px; }
.wx-footer a { color: var(--wx-muted); }
.wx-footer a:hover { color: var(--wx-header-text); }
.wx-footer p { margin: 0 0 14px; }
.wx-footer strong { color: var(--wx-header-text); font-weight: 600; }
.wx-footer-logo-link { display: inline-block; margin-bottom: 22px; line-height: 0; }
.wx-footer-logo { display: block; height: 40px; width: auto; }
.wx-footer-company { flex: 1 1 auto; }
.wx-footer-addresses { display: flex; flex-wrap: wrap; gap: 8px 48px; }
.wx-footer-addresses .wx-footer-menus { margin-left: auto; }
.wx-footer-address { min-width: 200px; }
/* Gap between address and contact lines = exactly one line, so every column keeps the same line grid as "Weitere Daten". */
.wx-footer-address p { margin: 0 0 1.7em; }
.wx-footer-address p:last-child { margin-bottom: 0; }
.wx-footer-menus { display: flex; flex-wrap: wrap; gap: 32px 44px; }
.wx-footer-menus ul { list-style: none; margin: 0; padding: 0; min-width: 110px; }
.wx-footer-menus li { margin: 0; } /* Same rhythm as the address lines: one line per link, no extra spacing. */
.wx-footer-head a { color: var(--wx-header-text); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.wx-footer .wx-footer-copy { flex: 1 1 100%; margin: 36px 0 0; padding: 20px 0 24px; border-top: 1px solid var(--wx-border); font-size: .75rem; letter-spacing: 1px; }

/* Thin bar at the top while the next page loads (assets/site.js) */
.wx-progress {
	position: fixed; top: 0; left: 0; z-index: 100000; height: 3px; width: 0; opacity: 0;
	background: var(--wx-accent); box-shadow: 0 0 8px var(--wx-accent); pointer-events: none;
}
.wx-progress.is-active { opacity: 1; animation: wx-progress 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes wx-progress { 0% { width: 0; } 10% { width: 35%; } 100% { width: 92%; } }
@media (prefers-reduced-motion: reduce) { .wx-progress.is-active { animation: none; width: 60%; } }

@media (max-width: 600px) {
	.wx-card { padding: 22px; }
	.wx-content .wx-tool { flex-direction: column; align-items: flex-start; gap: 14px; padding: 18px 20px; }
	.wx-content .wx-flames { padding: 150px 24px 28px; background-position: 24px 24px; background-size: 92px auto; }
	/* Phones: smaller photo, evenly darkened so the text stays readable */
	.wx-hero {
		min-height: 420px; padding: 40px 24px; justify-content: flex-end;
		background-image:
			linear-gradient(0deg, rgba(14, 14, 14, .95) 0%, rgba(14, 14, 14, .7) 55%, rgba(14, 14, 14, .25) 100%),
			url(assets/windhager-hq-1000.jpg);
		background-image:
			linear-gradient(0deg, rgba(14, 14, 14, .95) 0%, rgba(14, 14, 14, .7) 55%, rgba(14, 14, 14, .25) 100%),
			image-set(url(assets/windhager-hq-1000.webp) type("image/webp"), url(assets/windhager-hq-1000.jpg) type("image/jpeg"));
		background-position: 60% center;
	}
	.wx-brand .wx-logo { height: 40px; max-height: 40px; }
	.wx-footer { padding-top: 36px; }
	.wx-footer-menus { gap: 28px 40px; }
}

/* ---- Small screens: burger menu instead of the main navigation bar -------------------- */
.wx-burger, .wx-mobile { display: none; }
@media (max-width: 900px) {
	.wx-header .wx-container { min-height: 64px; }
	.wx-mainnav, .wx-user, .wx-langs, .wx-btn--logout { display: none; }
	.wx-nav { gap: 10px; }
	.wx-btn--login { padding: .55em 1.2em; font-size: .8rem; }

	.wx-burger {
		display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
		width: 44px; height: 44px; padding: 0 11px;
		background: transparent; border: 1px solid var(--wx-border); border-radius: 10px; cursor: pointer;
	}
	.wx-burger span { display: block; height: 2px; background: var(--wx-header-text); border-radius: 1px; transition: transform .2s, opacity .2s; }
	.wx-burger:hover { border-color: var(--wx-muted); }
	/* Open: the three bars become an X */
	.wx-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.wx-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
	.wx-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

	.wx-mobile:not([hidden]) { display: block; border-top: 1px solid var(--wx-border); padding: 6px 0 22px; }
	/* The panel sits inside the header: its container is a plain block, not the header's flex row. */
	.wx-header .wx-mobile .wx-container { display: block; min-height: 0; }
	.wx-mobile-user { margin: 10px 0 4px; color: var(--wx-muted); font-size: .78rem; letter-spacing: 1px; text-transform: uppercase; overflow-wrap: anywhere; }
	.wx-mobile-menu { list-style: none; margin: 0; padding: 0; }
	.wx-mobile-menu a {
		/* Text in line with the user name; the row (and its highlight) reaches the screen edges. */
		display: block; margin: 0 -16px; padding: 14px 16px 14px 13px; border-bottom: 1px solid var(--wx-border); border-left: 3px solid transparent;
		color: var(--wx-text); font-size: .9rem; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase;
	}
	.wx-mobile-menu a:hover { color: var(--wx-text); background: var(--wx-surface); }
	.wx-mobile-menu .current-menu-item > a { border-left-color: var(--wx-accent); background: var(--wx-surface); }
	.wx-mobile-langs { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
	.wx-mobile-langs a {
		display: block; min-width: 48px; padding: 9px 12px; text-align: center;
		border: 1px solid var(--wx-border); border-radius: 10px; color: var(--wx-muted); font-size: .85rem; letter-spacing: 1px;
	}
	.wx-mobile-langs a[aria-current] { color: var(--wx-header-text); border-color: var(--wx-header-text); }
	.wx-mobile-btn { display: block; margin-top: 22px; text-align: center; }
}
