/*
Theme Name: K&V Office
Theme URI: https://kommunikationundverwaltung.de
Author: K&V GmbH
Author URI: https://kommunikationundverwaltung.de
Description: Custom Full-Site Theme im Cargo-Look für KOMMUNIKATION & VERWALTUNG – Office für Musikschaffende. Desktop-Sidebar-Navigation, Icon-Kacheln auf der Startseite, Overlay-Fenster mit macOS-Ampel, Syne-Font.
Version: 1.6.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kv-office
*/

/* =========================================================
   FONTS – Syne (lege die .woff2/.woff-Dateien in /assets/fonts/)
   ========================================================= */
@font-face {
	font-family: "Syne";
	font-weight: 400;
	font-style: normal;
	font-display: swap;
	src: url("assets/fonts/Syne-Regular.woff") format("woff");
}
@font-face {
	font-family: "Syne";
	font-weight: 500;
	font-style: normal;
	font-display: swap;
	src: url("assets/fonts/Syne-Medium.woff") format("woff");
}
@font-face {
	font-family: "Syne";
	font-weight: 600;
	font-style: normal;
	font-display: swap;
	src: url("assets/fonts/Syne-SemiBold.woff") format("woff");
}
@font-face {
	font-family: "Syne";
	font-weight: 700;
	font-style: normal;
	font-display: swap;
	src: url("assets/fonts/Syne-Bold.woff") format("woff");
}
@font-face {
	font-family: "Syne";
	font-weight: 800;
	font-style: normal;
	font-display: swap;
	src: url("assets/fonts/Syne-ExtraBold.woff") format("woff");
}

/* =========================================================
   RESET / BASE
   ========================================================= */
:root {
	--txt-1: rgba(0, 0, 0, 0.85);
	--txt-2: rgba(0, 0, 0, 0.75);
	--txt-3: rgba(0, 0, 0, 0.6);
	--txt-4: rgba(0, 0, 0, 0.4);
	--line: rgba(0, 0, 0, 0.15);
	--bg: #eeeeee;
	--card: #ffffff;
	--radius-card: 1.8rem;
	--radius-nav: 0.5rem;
	--sidebar-w: 20%;
	--content-w: 80%;
	--base-size: 15px;

	/* Typografie – einheitliche, dezente Skala (macOS-Finder-Look) */
	--fs-label: 0.95rem;   /* Nav-Einträge & Kachel-Beschriftungen */
	--fs-body:  0.95rem;   /* Fließtext in Fenstern & Seiten */
	--fs-header: 0.72rem;  /* graue Zwischenüberschriften (Favorites/Rechtliches) */
	--fs-title: 1.35rem;   /* Seitentitel (Impressum, Leistungen ...) */
	--fs-subhead: 1rem;    /* Zwischenüberschriften im Seitentext */
	--logo-nudge: 0rem;    /* Feinjustierung: Logo nach links ziehen, z. B. -0.6rem bei transparentem Bildrand */
}

* { box-sizing: border-box; }

html {
	font-size: var(--base-size);
	-webkit-text-size-adjust: none;
}

body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	background-color: var(--bg);
	color: var(--txt-1);
	font-family: "Syne", system-ui, sans-serif;
	font-weight: 400;
	line-height: 1.3;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

b, strong { font-weight: 700; }

h1 { font-size: var(--fs-title); font-weight: 600; line-height: 1.15; color: var(--txt-1); margin: 0; }
h2 { font-size: var(--fs-subhead); font-weight: 600; line-height: 1.2; color: var(--txt-1); margin: 0; }

hr {
	background: var(--line);
	border: 0;
	height: 1px;
	display: block;
	margin: 0.5rem 0;
}

/* =========================================================
   LAYOUT: Sidebar + Content  (Cargo: zwei weiße Karten auf #eeeeee)
   ========================================================= */
.kv-shell {
	display: flex;
	align-items: stretch;
	min-height: 100vh;
	width: 100%;
	gap: 1rem;
	padding: 1rem;
	background-color: var(--bg);
}

/* --- Sidebar / Finder (weiße Karte, links, fixiert) --- */
.kv-sidebar {
	position: fixed;
	top: 1rem;
	left: 1rem;
	width: calc(var(--sidebar-w) - 1.5rem);
	height: calc(100vh - 2rem);
	z-index: 50;
}

.kv-sidebar-inner {
	background-color: rgba(250, 250, 250, 0.85);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border: 0.1rem solid var(--line);
	border-radius: var(--radius-card);
	padding: 1.2rem 1rem;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	overflow-y: auto;
}

.kv-sidebar-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	width: 100%;
}

.kv-logo,
.kv-logo.custom-logo-link {
	display: block;
	width: 82%;
	margin: 0.2rem 0 1.6rem calc(0.5rem + var(--logo-nudge));
}
.kv-logo img,
.kv-logo .custom-logo {
	border-radius: 6px;
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
}

/* Menü-Toggle (Hamburger + Label) – nur auf Mobile sichtbar */
.kv-nav-toggle {
	display: none;
	align-items: center;
	gap: 0.5rem;
	height: 40px;
	padding: 0 0.8rem;
	background: rgba(0, 0, 0, 0.05);
	border: 0;
	border-radius: 0.6rem;
	cursor: pointer;
	flex: 0 0 auto;
}
.kv-nav-toggle-lines {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 20px;
}
.kv-nav-toggle-label {
	font-family: "Syne", system-ui, sans-serif;
	font-size: var(--fs-label);
	font-weight: 500;
	color: var(--txt-2);
	line-height: 1;
}
/* Label-Text umschalten: geschlossen "Menü", offen "Schließen" */
.kv-nav-toggle-label { font-size: 0; }
.kv-nav-toggle-label::before {
	content: "Menü";
	font-size: var(--fs-label);
}
.kv-nav-open .kv-nav-toggle-label::before { content: "Schließen"; }
.kv-nav-toggle-bar {
	display: block;
	width: 100%;
	height: 2px;
	background: var(--txt-2);
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
/* X-Animation beim Öffnen */
.kv-nav-open .kv-nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.kv-nav-open .kv-nav-toggle-bar:nth-child(2) { opacity: 0; }
.kv-nav-open .kv-nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.kv-nav { width: 100%; display: flex; flex-direction: column; align-items: flex-start; }

.kv-nav-header {
	font-size: var(--fs-header);
	color: var(--txt-4);
	line-height: 1.3;
	padding: 0.7rem 0 0.25rem 0;
	display: block;
	width: 100%;
	text-transform: none;
	letter-spacing: 0.01em;
}

.kv-nav-item {
	font-size: var(--fs-label);
	font-weight: 400;
	color: var(--txt-1);
	line-height: 1.3;
	display: block;
	width: 100%;
	padding: 0.3rem 0.2rem 0.2rem 0.5rem;
	border-radius: var(--radius-nav);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: background-color 0.12s ease;
}
.kv-nav-item:hover { background-color: rgba(0, 0, 0, 0.04); }
.kv-nav-item.active { color: #0068ed; background-color: rgba(0, 0, 0, 0.07); }

.kv-nav-item .icon { margin-right: 0.35rem; }
.kv-nav-ico {
	width: 1.15em;
	height: 1.15em;
	vertical-align: -0.2em;
	margin-right: 0.4rem;
	display: inline-block;
}

/* --- Content (weiße Karte rechts neben der Sidebar) --- */
.kv-content {
	margin-left: calc(var(--sidebar-w) - 0.5rem);
	flex: 1;
	min-height: calc(100vh - 2rem);
	background-color: var(--card);
	border: 0.1rem solid var(--line);
	border-radius: var(--radius-card);
	padding: 3rem;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

/* =========================================================
   STARTSEITE: Icon-Kacheln  (Cargo: 8-Spalten-Grid, linksbündig)
   ========================================================= */
.kv-home {
	width: 100%;
}

.kv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 140px));
	gap: 2.5rem 1rem;
	align-items: end;
	justify-items: center;
	justify-content: start;
	margin-bottom: 1.5rem;
	width: 100%;
}

.kv-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	cursor: pointer;
	transition: opacity 0.12s ease;
}
.kv-tile:active { opacity: 0.7; }

.kv-tile-icon {
	width: 100%;
	max-width: 88px;
	margin: 0 auto 0.7rem;
}
.kv-tile-icon img {
	display: block;
	width: 100%;
	height: auto;
}
/* Portrait-Foto einer/eines Klient:in: quadratisch beschnitten, wie ein Ordner-Preview */
.kv-tile-icon img.kv-tile-photo {
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 0.9rem;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.kv-tile-caption {
	font-size: var(--fs-label);
	line-height: 1.15;
	color: var(--txt-1);
}

/* =========================================================
   OVERLAY-FENSTER (macOS-Window-Style)
   ========================================================= */
.kv-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	background: rgba(0, 0, 0, 0.0);
	overflow-y: auto;
}
.kv-overlay.open { display: flex; }

.kv-window {
	position: relative;
	width: 100%;
	max-width: 45%;
	margin: auto;
	background-color: var(--card);
	border: 0.1rem solid rgba(0, 0, 0, 0.2);
	border-radius: var(--radius-card);
	box-shadow: 0.3rem 0.6rem 1.8rem 0 rgba(0, 0, 0, 0.25);
	padding: 1.5rem 1.5rem 3rem;
	text-align: left;
	font-size: var(--fs-body);
	color: var(--txt-1);
	transform: scale(0.9);
	opacity: 0;
	transition: transform 0.32s ease, opacity 0.32s ease;
}
.kv-overlay.open .kv-window { transform: scale(1); opacity: 1; }

.kv-window-title {
	font-size: var(--fs-label);
	font-weight: 500;
	display: block;
	margin-bottom: 1rem;
}

.kv-traffic {
	display: inline-flex;
	gap: 0.5rem;
	margin-right: 0.8rem;
	vertical-align: middle;
	cursor: pointer;
	text-decoration: none !important;
}
.kv-traffic span {
	display: inline-block;
	width: 0.85rem;
	height: 0.85rem;
	border-radius: 50%;
	font-size: 0;
	line-height: 0;
	text-decoration: none !important;
}
.kv-dot-red    { background: rgb(255, 92, 95); }
.kv-dot-yellow { background: rgb(250, 200, 0); }
.kv-dot-green  { background: rgb(52, 199, 89); }

.kv-window p { margin: 0 0 1rem; }
.kv-window a:not(.kv-traffic) { text-decoration: underline; }
.kv-window img { border-radius: 0.5rem; margin: 0.5rem 0; }

.kv-caption {
	font-size: 0.8rem;
	font-style: italic;
	color: var(--txt-3);
	display: block;
	margin-top: 0.4rem;
}

/* =========================================================
   STATISCHE INHALTSSEITEN (Leistungen, Impressum, Datenschutz)
   Cargo: stehen direkt in der Content-Karte, linksbündig, keine 2. Karte
   ========================================================= */
.kv-page {
	width: 100%;
	max-width: 60rem;
	text-align: left;
}
.kv-page-title { font-size: var(--fs-title); font-weight: 600; margin: 0 0 1.4rem; color: var(--txt-1); }
.kv-page h1 { margin-bottom: 1.2rem; }
.kv-page h4 { margin: 1.4rem 0 0.3rem; font-size: var(--fs-subhead); font-weight: 700; }
.kv-page-body { font-size: var(--fs-body); line-height: 1.5; }
.kv-page p  { margin: 0 0 1rem; }

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 900px) {
	:root { --base-size: 15px; }

	.kv-shell { flex-direction: column; gap: 0.8rem; padding: 0.8rem; }

	.kv-sidebar {
		position: static;
		width: 100%;
		height: auto;
	}
	.kv-sidebar-inner {
		height: auto;
		flex-direction: column;
		align-items: stretch;
		padding: 0.7rem 0.9rem;
	}

	/* Kopfzeile: Logo links, Hamburger rechts */
	.kv-sidebar-head {
		align-items: center;
		gap: 0.8rem;
	}
	.kv-logo { width: auto; max-width: 62%; margin: 0; }
	.kv-nav-toggle { display: flex; }

	/* Nav standardmäßig eingeklappt, öffnet per Toggle */
	.kv-nav {
		max-height: 0;
		overflow: hidden;
		opacity: 0;
		transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.3s ease;
		margin-top: 0;
	}
	.kv-nav-open .kv-nav {
		max-height: 80vh;
		opacity: 1;
		margin-top: 0.8rem;
		overflow-y: auto;
	}
	.kv-nav-item {
		width: 100%;
		padding: 0.5rem 0.4rem;
	}
	.kv-nav-header {
		width: 100%;
	}

	.kv-content {
		margin-left: 0;
		width: 100%;
		min-height: auto;
		padding: 1.4rem 1.2rem 2rem;
	}

	/* Grid überlaufsicher: feste Kachelbreite, bricht automatisch um */
	.kv-grid {
		grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
		gap: 1.6rem 1rem;
		margin-bottom: 1.6rem;
	}
	.kv-tile-icon { max-width: 72px; }
	.kv-tile-caption {
		word-break: break-word;
		hyphens: auto;
	}

	.kv-window { max-width: 100%; }
	.kv-page { max-width: 100%; }
}
