/*
Theme Name: Comuneres
Theme URI: https://comuneres.de
Author: Carsten Tilsner
Description: Schlankes Firmen-Theme für Comuneres – Feine Software für öffentliche Aufgaben. Legt bei Aktivierung Startseite, Produktseiten, Kontakt, Impressum, Datenschutz und das Hauptmenü an.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: Proprietär
Text Domain: comuneres
*/

/* ---------- Grundlagen ---------- */
:root {
	--c-primary: #194c61;
	--c-primary-dark: #123848;
	--c-accent: #1bc5be;
	--c-accent-soft: #e6f8f7;
	--c-bg: #ffffff;
	--c-bg-soft: #f4f8fa;
	--c-text: #1e2b33;
	--c-muted: #5b6b75;
	--c-line: #e2eaee;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(25, 76, 97, .06), 0 8px 24px rgba(25, 76, 97, .07);
	--shadow-hover: 0 2px 4px rgba(25, 76, 97, .08), 0 14px 32px rgba(25, 76, 97, .13);
	--font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	--wrap: 1160px;
	--gutter: clamp(16px, 4vw, 40px);
	--header-h: 76px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.6;
	color: var(--c-text);
	background: var(--c-bg);
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
}

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

a { color: var(--c-primary); text-underline-offset: 3px; }
a:hover { color: var(--c-accent); }

h1, h2, h3, h4 { color: var(--c-primary); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }

:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; z-index: 1000; top: 8px; left: 8px;
	background: #fff; padding: 8px 14px; box-shadow: var(--shadow);
}

/* ---------- Kopfbereich ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, .92);
	backdrop-filter: saturate(160%) blur(10px);
	-webkit-backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid var(--c-line);
}
.site-header .wrap {
	height: var(--header-h);
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.site-logo { display: block; line-height: 0; flex-shrink: 0; }
.site-logo img { height: 34px; width: auto; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.main-nav a {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 8px 14px; border-radius: 999px;
	color: var(--c-primary); text-decoration: none; font-weight: 600; font-size: 15.5px;
	white-space: nowrap; transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--c-bg-soft); color: var(--c-primary); }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a { background: var(--c-accent-soft); }

/* Kontakt mit Mail-Icon, als Button hervorgehoben */
.main-nav .menu-kontakt > a { background: var(--c-primary); color: #fff; margin-left: 8px; }
.main-nav .menu-kontakt > a:hover,
.main-nav .menu-kontakt.current-menu-item > a { background: var(--c-primary-dark); color: #fff; }
.main-nav .menu-kontakt > a::before {
	content: ""; width: 18px; height: 18px; flex-shrink: 0; background: currentColor;
	-webkit-mask: var(--icon-mail) center / contain no-repeat;
	mask: var(--icon-mail) center / contain no-repeat;
}
:root {
	--icon-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E");
}

.nav-toggle {
	display: none; border: 0; background: transparent; padding: 10px; margin-right: -10px;
	color: var(--c-primary); cursor: pointer; border-radius: 10px;
}
.nav-toggle svg { display: block; width: 26px; height: 26px; }
.nav-toggle .icon-close { display: none; }
.nav-open .nav-toggle .icon-open { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }

/* ---------- Startseite ---------- */
.home-main {
	flex: 1;
	display: flex; flex-direction: column; justify-content: center;
	gap: clamp(28px, 6vh, 64px);
	padding-block: clamp(24px, 5vh, 56px);
	position: relative; overflow: hidden;
	background:
		radial-gradient(900px 480px at 88% 8%, var(--c-accent-soft), transparent 70%),
		linear-gradient(180deg, #fff 0%, var(--c-bg-soft) 100%);
}

.hero { display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; gap: 40px; }
.hero-eyebrow {
	display: inline-block; margin: 0 0 14px; padding: 5px 12px; border-radius: 999px;
	background: #fff; border: 1px solid var(--c-line);
	color: var(--c-muted); font-size: 14px; font-weight: 600; letter-spacing: .02em;
}
.hero h1 { font-size: clamp(32px, 4.6vw, 54px); margin: 0 0 16px; }
.hero h1 .accent { color: var(--c-accent); }
.hero-text { font-size: clamp(17px, 1.5vw, 19px); color: var(--c-muted); max-width: 36em; margin: 0 0 26px; }
.hero-text p { margin: 0 0 .6em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { display: flex; justify-content: center; }
.hero-art img { width: min(100%, 340px); opacity: .95; filter: drop-shadow(0 18px 40px rgba(25, 76, 97, .15)); }

.btn, .wp-block-button__link {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 12px 22px; border-radius: 999px; border: 2px solid var(--c-primary);
	background: var(--c-primary); color: #fff; font-weight: 600; font-size: 16px;
	text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .15s;
	font-family: inherit; line-height: 1.3;
}
.btn:hover, .wp-block-button__link:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--c-primary); }
.btn-ghost:hover { background: var(--c-primary); color: #fff; }
.btn svg { width: 18px; height: 18px; }

/* Produktkacheln */
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; list-style: none; margin: 0; padding: 0; }
.product-card {
	position: relative; height: 100%;
	display: flex; flex-direction: column; gap: 8px;
	padding: 22px 22px 20px; border-radius: var(--radius);
	background: #fff; border: 1px solid var(--c-line); box-shadow: var(--shadow);
	transition: box-shadow .2s, transform .2s, border-color .2s;
}
.product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: #cfe3e8; }
.product-card .icon {
	width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
	background: var(--c-accent-soft); color: var(--c-primary); margin-bottom: 4px;
}
.product-card .icon svg { width: 26px; height: 26px; }
.product-card h2 { font-size: 19px; margin: 0; }
.product-card h2 a { text-decoration: none; color: inherit; }
.product-card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.product-card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--c-muted); flex: 1; }
.product-card .more { font-size: 14.5px; font-weight: 600; color: var(--c-accent); }

/* ---------- Unterseiten ---------- */
.page-main { flex: 1; }
.page-hero {
	background:
		radial-gradient(700px 300px at 90% 0%, var(--c-accent-soft), transparent 70%),
		var(--c-bg-soft);
	border-bottom: 1px solid var(--c-line);
	padding-block: clamp(32px, 6vw, 64px);
}
.page-hero .wrap { display: flex; align-items: center; gap: 22px; }
.page-hero .icon {
	flex-shrink: 0; width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center;
	background: #fff; color: var(--c-primary); box-shadow: var(--shadow);
}
.page-hero .icon svg { width: 34px; height: 34px; }
.page-hero h1 { font-size: clamp(30px, 4vw, 44px); margin: 0; }
.page-hero .lead { margin: 6px 0 0; color: var(--c-muted); font-size: clamp(17px, 1.6vw, 19.5px); max-width: 40em; }

.entry { padding-block: clamp(32px, 5vw, 56px) clamp(48px, 7vw, 80px); }
.entry > .wrap { max-width: 860px; }
.entry h2 { font-size: clamp(22px, 2.4vw, 27px); margin: 1.8em 0 .5em; }
.entry h2:first-child { margin-top: 0; }
.entry h3 { font-size: 19px; margin: 1.4em 0 .4em; }
.entry ul { padding-left: 1.2em; }
.entry li { margin-bottom: .35em; }
.entry li::marker { color: var(--c-accent); }

/* Produktbilder */
.entry .product-shot { margin: 1.6em 0 2em; }
.entry .product-shot img {
	display: block; width: 100%; height: auto;
	border-radius: var(--radius); border: 1px solid var(--c-line); box-shadow: var(--shadow);
}
.entry .product-shot.narrow { max-width: 720px; margin-inline: auto; }
.entry .product-shot figcaption { margin-top: 10px; font-size: 14.5px; color: var(--c-muted); text-align: center; }

/* Funktionskacheln innerhalb der Produktseiten */
.entry .feature-grid { gap: 18px; margin-block: 1.4em 2em; }
.entry .feature-grid .wp-block-column {
	background: var(--c-bg-soft); border: 1px solid var(--c-line); border-radius: var(--radius);
	padding: 20px 22px;
}
.entry .feature-grid h3 { margin-top: 0; font-size: 18px; }
.entry .feature-grid p { margin: 0; font-size: 15.5px; color: var(--c-muted); }

.entry .cta-box {
	margin-top: 2.4em; padding: 26px 28px; border-radius: var(--radius);
	background: var(--c-primary); color: #e9f3f6;
}
.entry .cta-box h2 { color: #fff; margin: 0 0 .3em; font-size: 22px; }
.entry .cta-box p { margin: 0 0 1em; }
.entry .cta-box .wp-block-button__link { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-primary-dark); }
.entry .cta-box .wp-block-button__link:hover { background: #fff; border-color: #fff; }

/* ---------- Kontaktformular ---------- */
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin-top: 1.2em; }
.contact-form .full { grid-column: 1 / -1; }
.contact-form label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; color: var(--c-primary); }
.contact-form .opt { font-weight: 400; color: var(--c-muted); }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
	width: 100%; padding: 12px 14px; border: 1px solid #cbd8de; border-radius: 10px;
	font: inherit; font-size: 16px; color: var(--c-text); background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.contact-form textarea { min-height: 160px; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus {
	outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(27, 197, 190, .2);
}
.contact-form .consent { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--c-muted); }
.contact-form .consent input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--c-primary); flex-shrink: 0; }
.contact-form .consent label { font-weight: 400; color: inherit; margin: 0; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-notice { padding: 14px 18px; border-radius: 10px; margin: 0 0 1.2em; font-weight: 600; }
.form-notice.ok { background: var(--c-accent-soft); color: var(--c-primary); border: 1px solid #b5ebe8; }
.form-notice.err { background: #fdeeee; color: #9b1c1c; border: 1px solid #f5c2c2; }

/* ---------- Fußbereich ---------- */
.site-footer { border-top: 1px solid var(--c-line); background: #fff; font-size: 14.5px; color: var(--c-muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 16px; }
.site-footer ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.site-footer a { color: var(--c-muted); text-decoration: none; }
.site-footer a:hover { color: var(--c-primary); text-decoration: underline; }

/* ---------- Kleine Bildschirmhöhen (Desktop): Startseite ohne Scrollen ---------- */
@media (min-width: 961px) and (max-height: 860px) {
	:root { --header-h: 64px; }
	.home-main { gap: 28px; padding-block: 20px; }
	.hero-eyebrow { display: none; }
	.hero h1 { font-size: clamp(30px, 3.6vw, 44px); margin-bottom: 10px; }
	.hero-text { font-size: 17px; margin-bottom: 16px; }
	.hero-art img { width: min(100%, 240px); }
	.product-card { padding: 16px 18px; gap: 6px; }
	.product-card .icon { width: 38px; height: 38px; margin: 0; }
	.product-card .icon svg { width: 22px; height: 22px; }
	.product-card .more { display: none; }
	.site-footer .wrap { padding-block: 12px; }
}
@media (min-width: 961px) and (max-height: 660px) {
	.hero-art img { width: min(100%, 180px); }
	.product-card p { font-size: 14px; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
	.main-nav a { padding: 8px 10px; font-size: 15px; }
}
@media (max-width: 960px) {
	.products { grid-template-columns: repeat(2, 1fr); }
	.hero { grid-template-columns: 1fr; }
	.hero-art { display: none; }
}

/* ---------- Mobil: Burger-Menü ---------- */
@media (max-width: 900px) {
	:root { --header-h: 64px; }
	.site-logo img { height: 28px; }
	.nav-toggle { display: block; }
	.main-nav {
		position: fixed; inset: var(--header-h) 0 auto 0;
		background: #fff; border-bottom: 1px solid var(--c-line); box-shadow: var(--shadow);
		padding: 10px var(--gutter) 18px;
		transform: translateY(-8px); opacity: 0; visibility: hidden;
		transition: opacity .18s, transform .18s, visibility .18s;
	}
	.nav-open .main-nav { transform: none; opacity: 1; visibility: visible; }
	.main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
	.main-nav a { display: flex; padding: 13px 14px; font-size: 17px; border-radius: 10px; }
	.main-nav .menu-kontakt > a { margin: 8px 0 0; justify-content: center; }
}

@media (max-width: 600px) {
	body { font-size: 16px; }
	.home-main { justify-content: flex-start; gap: 26px; padding-block: 28px 32px; }
	.hero-eyebrow { display: none; }
	.hero h1 { font-size: 31px; }
	.hero-text { margin-bottom: 20px; }
	.hero-actions .btn { flex: 1; justify-content: center; }
	.products { grid-template-columns: 1fr; gap: 10px; }
	.product-card {
		display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px;
		padding: 14px 16px; align-items: center;
	}
	.product-card .icon { grid-row: span 2; margin: 0; width: 44px; height: 44px; }
	.product-card h2 { font-size: 17px; }
	.product-card p { font-size: 14px; }
	.product-card .more { display: none; }
	.page-hero .wrap { align-items: flex-start; gap: 16px; }
	.page-hero .icon { width: 50px; height: 50px; border-radius: 13px; }
	.page-hero .icon svg { width: 27px; height: 27px; }
	.contact-form { grid-template-columns: 1fr; }
	.site-footer .wrap { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; }
}
