/*
Theme Name: TVK
Theme URI: https://web.tvk1884.de
Author: TV 1884 Kahl / TVK-app
Description: Schlankes Full-Site-Editing Block-Theme fuer den TV 1884 Kahl. Design-Tokens (Blau 210/59 + Cyan, Inter/Montserrat) abgeleitet aus der neuen tv-kahl.de. Anzeige-/Portal-Schicht — Inhalte kommen ueberwiegend per Pull aus der TVK-app (Plugin tvk-integration).
Version: 0.4.1
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.1
Text Domain: tvk
Tags: full-site-editing, block-theme, clean, verein
*/

/* Tokens kommen aus theme.json. Hier: Komposition, Mikro-Interaktion, Responsive. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@700;800;900&display=swap');

/* ---------- Grundstimmung ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { text-underline-offset: 3px; }
:where(a, button, [role="button"]):focus-visible {
	outline: 3px solid color-mix(in srgb, var(--wp--preset--color--primary) 55%, transparent);
	outline-offset: 2px;
	border-radius: 6px;
}
a, .wp-element-button, button {
	transition: color .15s ease, background-color .15s ease, border-color .15s ease,
	            box-shadow .2s ease, transform .15s ease, opacity .15s ease;
}

/* ---------- Top-Bar (sticky, leicht transluzent) ---------- */
.tvk-topbar {
	position: sticky;
	top: 0;
	z-index: 100;
	background: color-mix(in srgb, var(--wp--preset--color--base) 88%, transparent);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.tvk-topbar__inner { padding-top: .65rem; padding-bottom: .65rem; }
.tvk-topbar__actions { gap: .6rem !important; }

/* Marke */
.tvk-brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.tvk-brand__mark {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 12px;
	background: var(--wp--preset--gradient--hero);
	color: #fff;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 900;
	font-size: .95rem;
	letter-spacing: .02em;
	box-shadow: 0 3px 10px color-mix(in srgb, var(--wp--preset--color--primary) 35%, transparent);
}
.tvk-brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.tvk-brand__title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	font-size: 1.05rem;
	color: var(--wp--preset--color--contrast);
}
.tvk-brand__tagline { font-size: .74rem; color: var(--wp--preset--color--muted-foreground); }
.tvk-brand:hover .tvk-brand__title { color: var(--wp--preset--color--primary-dark); }

/* Mobile-Navigation (Hamburger) — auf Desktop uebernimmt die Sidebar */
@media (min-width: 782px) { .tvk-mobilenav { display: none !important; } }
.tvk-mobilenav .wp-block-navigation__responsive-container-open { padding: .4rem; border-radius: 10px; }

/* ---------- Buttons ---------- */
.tvk-btn {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .55rem 1.15rem;
	border-radius: 10px;
	font-weight: 600;
	font-size: .95rem;
	text-decoration: none;
	background: var(--wp--preset--color--primary);
	color: #fff;
	box-shadow: 0 2px 8px color-mix(in srgb, var(--wp--preset--color--primary) 28%, transparent);
}
.tvk-btn:hover { background: var(--wp--preset--color--primary-dark); color: #fff; transform: translateY(-1px); }
.tvk-btn:active { transform: none; }
.tvk-btn--ghost {
	background: transparent;
	color: var(--wp--preset--color--primary-dark);
	border: 1px solid var(--wp--preset--color--border);
	box-shadow: none;
}
.tvk-btn--ghost:hover { background: var(--wp--preset--color--muted); color: var(--wp--preset--color--primary-dark); }
.tvk-btn--onhero { background: #fff; color: var(--wp--preset--color--primary-dark); box-shadow: 0 3px 12px rgba(0,0,0,.18); }
.tvk-btn--onhero:hover { background: hsl(210 40% 96%); color: var(--wp--preset--color--primary-dark); }
.tvk-btn--heroghost { background: color-mix(in srgb, #fff 16%, transparent); color: #fff; border: 1px solid color-mix(in srgb, #fff 45%, transparent); box-shadow: none; }
.tvk-btn--heroghost:hover { background: color-mix(in srgb, #fff 26%, transparent); color: #fff; }
.tvk-userbox { display: inline-flex; align-items: center; gap: .7rem; font-size: .93rem; }
.tvk-userbox__name { font-weight: 600; }

/* ---------- Layout-Shell ---------- */
.tvk-main { padding-top: 1.75rem; padding-bottom: 3.5rem; }
.tvk-shell { gap: 2rem !important; }
.tvk-shell__aside { align-self: flex-start; }
.tvk-shell__main > * + * { margin-top: 1.75rem; }
@media (max-width: 781px) {
	.tvk-shell__aside { display: none; }        /* mobil: Navigation via Hamburger */
	.tvk-main { padding-top: 1rem; }
}
@media (min-width: 782px) {
	.tvk-sidebar { position: sticky; top: 4.6rem; }
}

/* ---------- Sidebar-Karten ---------- */
.tvk-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.tvk-side-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	padding: .9rem .8rem;
	box-shadow: 0 1px 3px rgba(16, 42, 67, .05);
}
.tvk-side-card__label {
	display: block;
	margin: 0 .4rem .45rem;
	font-family: var(--wp--preset--font-family--heading);
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted-foreground);
}
.tvk-side-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tvk-side-nav a {
	display: flex;
	align-items: center;
	gap: .6rem;
	padding: .5rem .6rem;
	border-radius: 9px;
	font-size: .95rem;
	font-weight: 500;
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}
.tvk-side-nav a:hover {
	background: color-mix(in srgb, var(--wp--preset--color--primary) 10%, transparent);
	color: var(--wp--preset--color--primary-dark);
}
.tvk-side-nav__icon { width: 1.35rem; text-align: center; font-size: .95rem; }

/* ---------- Hero ---------- */
.tvk-hero {
	position: relative;
	overflow: hidden;
	border-radius: 20px;
	background: var(--wp--preset--gradient--hero);
	color: #fff;
	box-shadow: 0 12px 34px color-mix(in srgb, var(--wp--preset--color--primary) 30%, transparent);
}
.tvk-hero::after {           /* dezente Lichtflaeche */
	content: "";
	position: absolute;
	right: -18%;
	top: -55%;
	width: 65%;
	height: 160%;
	background: radial-gradient(closest-side, rgba(255,255,255,.16), transparent 70%);
	pointer-events: none;
}
.tvk-hero__content { position: relative; padding: clamp(1.6rem, 4vw, 2.8rem); max-width: 640px; }
.tvk-hero__kicker {
	margin: 0 0 .5rem;
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: color-mix(in srgb, #fff 78%, transparent);
}
.tvk-hero__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 900;
	line-height: 1.08;
	letter-spacing: -.02em;
}
.tvk-hero__sub { margin: .9rem 0 0; font-size: 1.08rem; line-height: 1.6; color: color-mix(in srgb, #fff 92%, transparent); }
.tvk-hero__sub a { color: #fff; font-weight: 600; }
.tvk-hero__actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }

/* ---------- Schnellzugriff-Karten ---------- */
.tvk-quick {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
	gap: 1rem;
}
.tvk-quick__card {
	display: flex;
	flex-direction: column;
	gap: .3rem;
	padding: 1.15rem 1.1rem;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
	box-shadow: 0 1px 3px rgba(16, 42, 67, .05);
}
.tvk-quick__card:hover {
	transform: translateY(-3px);
	border-color: color-mix(in srgb, var(--wp--preset--color--primary) 40%, var(--wp--preset--color--border));
	box-shadow: 0 10px 26px color-mix(in srgb, var(--wp--preset--color--primary) 16%, transparent);
}
.tvk-quick__icon {
	display: grid;
	place-items: center;
	width: 2.4rem;
	height: 2.4rem;
	margin-bottom: .35rem;
	border-radius: 10px;
	font-size: 1.15rem;
	background: color-mix(in srgb, var(--wp--preset--color--primary) 11%, transparent);
}
.tvk-quick__title { font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1.02rem; }
.tvk-quick__desc { font-size: .88rem; line-height: 1.45; color: var(--wp--preset--color--muted-foreground); }

/* ---------- Abschnitte / Inhalt ---------- */
.tvk-section { scroll-margin-top: 5rem; }
.tvk-section h2 { margin-bottom: .9rem; }
.tvk-welcome { border: 1px solid var(--wp--preset--color--border); }

/* ---------- Termine-Liste (Pull aus TVK-app) ---------- */
.tvk-termine { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.tvk-termin {
	display: flex;
	gap: 1rem;
	align-items: baseline;
	padding: .8rem 1rem;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(16, 42, 67, .05);
}
.tvk-termin:hover { border-color: color-mix(in srgb, var(--wp--preset--color--primary) 35%, var(--wp--preset--color--border)); }
.tvk-termin__date {
	font-weight: 700;
	color: var(--wp--preset--color--primary-dark);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	font-size: .92rem;
}
.tvk-empty {
	padding: 1rem 1.1rem;
	border: 1px dashed var(--wp--preset--color--border);
	border-radius: 12px;
	color: var(--wp--preset--color--muted-foreground);
	background: var(--wp--preset--color--base);
}

/* ---------- Eingebettete Vereins-Tools (ERPNext-Web-Forms etc.) ---------- */
.tvk-embed__frame {
	display: block;
	width: 100%;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	background: var(--wp--preset--color--base);
	box-shadow: 0 1px 3px rgba(16, 42, 67, .05);
}
.tvk-embed__fallback { margin-top: .5rem; font-size: .88rem; color: var(--wp--preset--color--muted-foreground); }

/* ---------- Footer ---------- */
footer.wp-block-group { margin-top: 2.5rem; }
.tvk-legal a { color: var(--wp--preset--color--muted-foreground); }
.tvk-legal a:hover { color: var(--wp--preset--color--primary-dark); }

/* ---------- "Nach oben" ---------- */
.tvk-totop {
	position: fixed;
	right: 1.25rem;
	bottom: 1.25rem;
	z-index: 90;
	width: 2.75rem;
	height: 2.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--wp--preset--color--primary);
	color: #fff;
	font-size: 1.35rem;
	line-height: 1;
	text-decoration: none;
	box-shadow: 0 4px 14px rgba(0,0,0,.18);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .2s ease, visibility .2s ease, transform .2s ease, background-color .15s ease;
}
.tvk-totop.is-visible { opacity: 1; visibility: visible; transform: none; }
.tvk-totop:hover { background: var(--wp--preset--color--primary-dark); color: #fff; }
