/* ==========================================================================
   Werdegang in Wochen – ergänzt ../css/style.css (nutzt dessen Variablen)
   ========================================================================== */

.wg-page {
	--wk-gap: 2px;
	--wk-empty: #e6dfd2;          /* gelebte Woche ohne Abschnitt */
	--wk-future: rgba(160, 120, 64, 0.22);
	--wk-ink: #2a2318;
}

.wg-page main { padding-top: 4.5rem; }

/* ── Lebenswochen-Bereich ─────────────────────────────────────────── */
.wg-weeks {
	max-width: 1180px;
	margin: 0 auto;
	padding: 3.5rem 2rem 6rem;
	display: grid;
	grid-template-columns: minmax(260px, 330px) 1fr;
	gap: 3.5rem;
	align-items: start;
}

.wg-aside-inner {
	position: sticky;
	top: 6rem;
}

.wg-title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: clamp(2.4rem, 4.6vw, 3.6rem);
	font-weight: 400;
	line-height: 1.02;
	letter-spacing: -0.01em;
	margin-bottom: 1.4rem;
}

.wg-intro {
	color: var(--text2);
	font-size: 0.98rem;
	line-height: 1.75;
	margin-bottom: 2rem;
}

.wg-intro strong {
	font-weight: 500;
	color: var(--text);
	font-variant-numeric: tabular-nums;
}

/* Legende = Filter */
.wg-legend {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	margin-bottom: 1.4rem;
	border-top: 1px solid var(--border);
	padding-top: 0.9rem;
}

.lg-item {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	width: 100%;
	background: none;
	border: 0;
	border-radius: 3px;
	padding: 0.32rem 0.45rem;
	margin-left: -0.45rem;
	font: inherit;
	font-size: 0.88rem;
	color: var(--text2);
	text-align: left;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.lg-item:hover { background: rgba(160, 120, 64, 0.08); color: var(--text); }
.lg-item[aria-pressed="true"] { background: rgba(160, 120, 64, 0.14); color: var(--text); font-weight: 400; }
.lg-item:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.lg-swatches { display: inline-flex; gap: 2px; flex-shrink: 0; min-width: 40px; }
.lg-swatches i { width: 12px; height: 12px; border-radius: 2px; display: block; }

.lg-years {
	margin-left: auto;
	font-size: 0.78rem;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.wg-symbols {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.2rem;
	font-size: 0.8rem;
	color: var(--muted);
	margin-bottom: 1.4rem;
}

.wg-symbols span { display: inline-flex; align-items: center; gap: 0.45rem; }
.wg-symbols .wk-m { position: static; transform: none; pointer-events: none; flex-shrink: 0; }
.wg-symbols .wk-m::before { display: none; }
.wg-symbols .wk-m--ziel { transform: rotate(45deg); }

.wg-sym-today {
	width: 11px; height: 11px;
	border-radius: 2px;
	box-shadow: 0 0 0 1.5px var(--wk-ink);
	display: inline-block;
}

.wg-readout {
	font-size: 0.86rem;
	color: var(--text2);
	min-height: 3.4em;
	border-left: 2px solid var(--gold2);
	padding-left: 0.8rem;
	line-height: 1.6;
}

/* ── Raster ───────────────────────────────────────────────────────── */
.wk-grid {
	display: flex;
	flex-direction: column;
	gap: var(--wk-gap);
	user-select: none;
}

.wk-row {
	display: grid;
	grid-template-columns: 2.2rem 1fr 2.6rem;
	align-items: center;
	gap: 0.5rem;
	animation: wk-rowin 0.45s ease both;
	animation-delay: calc(var(--r) * 14ms);
}

.wk-row.is-decade { margin-top: 5px; }

.wk-age, .wk-year {
	font-size: 0.68rem;
	line-height: 1;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.wk-age { text-align: right; }
.wk-year { text-align: left; opacity: 0.75; }

.wk-cells {
	display: grid;
	grid-template-columns: repeat(52, 1fr);
	gap: var(--wk-gap);
}

.wk-c {
	position: relative;
	display: block;
	aspect-ratio: 1;
	border-radius: 2px;
	background: var(--wk-empty);
	transition: opacity 0.25s ease, filter 0.25s ease;
}

.wk-c.is-future {
	background: transparent;
	box-shadow: inset 0 0 0 1px var(--wk-future);
}

.wk-c.is-today {
	box-shadow: 0 0 0 1.5px var(--wk-ink);
	z-index: 2;
}

.wk-c.is-today::after {
	content: '';
	position: absolute;
	inset: -1.5px;
	border-radius: 3px;
	box-shadow: 0 0 0 1.5px var(--wk-ink);
	animation: wk-pulse 2.4s ease-out infinite;
	pointer-events: none;
}

.wk-c.is-hover { filter: brightness(0.82); }

/* Hervorhebung über Legende / Stationen */
.wk-grid.is-focus .wk-c:not(.is-on) { opacity: 0.22; }
.wk-grid.is-focus .wk-c.is-future:not(.is-on) { opacity: 0.5; }

/* ── Marker ───────────────────────────────────────────────────────── */
.wk-m {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	transform: translate(-50%, -50%);
	background: var(--wk-ink);
	box-shadow: 0 0 0 2px var(--bg);
	cursor: pointer;
	z-index: 3;
	display: block;
	transition: transform 0.15s ease;
}

/* größere Trefferfläche */
.wk-m::before {
	content: '';
	position: absolute;
	inset: -8px;
}

.wk-m--ziel {
	border-radius: 1px;
	background: var(--bg);
	box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 0 2px var(--bg);
	transform: translate(-50%, -50%) rotate(45deg);
}

button.wk-m:hover,
button.wk-m.is-active { transform: translate(-50%, -50%) scale(1.45); }
button.wk-m--ziel:hover,
button.wk-m--ziel.is-active { transform: translate(-50%, -50%) rotate(45deg) scale(1.45); }

button.wk-m:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 3px;
}

/* Marker bleiben bei Hervorhebung sichtbar */
.wk-grid.is-focus .wk-c:not(.is-on) .wk-m { opacity: 0.5; }

/* ── Tooltip ──────────────────────────────────────────────────────── */
.wk-tip {
	position: absolute;
	z-index: 150;
	width: 250px;
	background: var(--card);
	border: 1px solid var(--border);
	border-top: 3px solid var(--tip-c, var(--gold));
	border-radius: 4px;
	box-shadow: 0 14px 40px rgba(100, 70, 20, 0.18);
	padding: 0.85rem 1.05rem 0.95rem;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.18s ease, transform 0.18s ease;
	pointer-events: auto;
}

.wk-tip.is-visible { opacity: 1; transform: translateY(0); }

/* langsames Ausblenden */
.wk-tip.is-leaving {
	opacity: 0;
	transform: translateY(0);
	transition: opacity 0.9s ease;
}

/* kleiner Pfeil */
.wk-tip::after {
	content: '';
	position: absolute;
	left: var(--arrow-x, 50%);
	width: 10px;
	height: 10px;
	background: var(--card);
	border: 1px solid var(--border);
	transform: translateX(-50%) rotate(45deg);
}

.wk-tip[data-side="top"]::after    { bottom: -6px; border-top: 0; border-left: 0; }
.wk-tip[data-side="bottom"]::after { top: -8px; border-bottom: 0; border-right: 0; background: var(--tip-c, var(--gold)); border-color: var(--tip-c, var(--gold)); }

.wk-tip-date {
	font-size: 0.76rem;
	color: var(--muted);
	margin-bottom: 0.2rem;
}

.wk-tip-kind {
	color: var(--gold);
	font-style: italic;
}

.wk-tip-title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 1.12rem;
	line-height: 1.25;
	color: var(--text);
	margin-bottom: 0.6rem;
}

.wk-tip-tags,
.wk-d-tags {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	margin-bottom: 0.8rem;
}

.wk-tip-tags li,
.wk-d-tags li {
	font-size: 0.72rem;
	color: var(--text2);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0.08rem 0.55rem;
	line-height: 1.6;
}

.wk-tip-more {
	background: none;
	border: 0;
	border-bottom: 1px solid rgba(160, 120, 64, 0.35);
	padding: 0 0 2px;
	font: inherit;
	font-size: 0.8rem;
	color: var(--gold);
	cursor: pointer;
	transition: border-color 0.2s;
}

.wk-tip-more:hover { border-color: var(--gold); }
.wk-tip-more:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ── Detail-Schublade ─────────────────────────────────────────────── */
.wk-drawer {
	position: fixed;
	inset: 0;
	z-index: 250;
	visibility: hidden;
	transition: visibility 0s linear 0.35s;
}

.wk-drawer.is-open {
	visibility: visible;
	transition: none;
}

.wk-drawer-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(42, 35, 24, 0.32);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.wk-drawer.is-open .wk-drawer-backdrop { opacity: 1; }

.wk-drawer-panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(460px, 100%);
	background: var(--card);
	border-left: 4px solid var(--d-c, var(--gold));
	box-shadow: -20px 0 60px rgba(100, 70, 20, 0.18);
	padding: 3.2rem 2.4rem 2rem;
	overflow-y: auto;
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(.2, .8, .2, 1);
	display: flex;
	flex-direction: column;
}

.wk-drawer.is-open .wk-drawer-panel { transform: translateX(0); }
.wk-drawer-panel:focus { outline: none; }

.wk-drawer-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	background: none;
	border: 1px solid var(--border);
	border-radius: 50%;
	color: var(--text2);
	cursor: pointer;
}

.wk-drawer-close svg { width: 12px; height: 12px; }
.wk-drawer-close:hover { border-color: var(--gold); color: var(--gold); }

.wk-d-date { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.4rem; }

.wk-d-title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 1.9rem;
	font-weight: 400;
	line-height: 1.15;
	margin-bottom: 1rem;
}

.wk-d-text p {
	color: var(--text2);
	font-size: 0.95rem;
	line-height: 1.8;
	margin-bottom: 1rem;
	max-width: 60ch;
}

.wk-d-links { list-style: none; margin: 0.4rem 0 1.5rem; }
.wk-d-links li + li { margin-top: 0.4rem; }

.wk-d-nav {
	margin-top: auto;
	padding-top: 1.4rem;
	border-top: 1px solid var(--border);
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}

.wk-d-step {
	background: none;
	border: 1px solid var(--border);
	border-radius: 3px;
	padding: 0.5rem 1rem;
	font: inherit;
	font-size: 0.82rem;
	color: var(--text2);
	cursor: pointer;
	max-width: 48%;
	text-align: left;
	line-height: 1.35;
}

.wk-d-step:last-child { text-align: right; }
.wk-d-step small { display: block; color: var(--muted); font-size: 0.72rem; }
.wk-d-step:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.wk-d-step:disabled { opacity: 0.35; cursor: default; }

/* ── Stationen ────────────────────────────────────────────────────── */
.wg-section {
	padding: 6rem 2rem;
	border-top: 1px solid var(--border);
}

.wg-section--alt { background: var(--bg2); }

.wg-col { max-width: 780px; margin: 0 auto; }

.st-list { list-style: none; }

.st {
	display: grid;
	grid-template-columns: 7.5rem 14px 1fr;
	gap: 1.1rem;
	padding: 1rem 0.6rem;
	margin: 0 -0.6rem;
	border-bottom: 1px solid var(--border);
	border-radius: 3px;
	cursor: default;
	transition: background 0.15s;
}

.st:first-child { border-top: 1px solid var(--border); }
.st:hover, .st:focus-within { background: rgba(160, 120, 64, 0.06); }

.st-when {
	font-size: 0.85rem;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
	padding-top: 0.2rem;
}

.st-dot {
	width: 12px;
	height: 12px;
	border-radius: 2px;
	margin-top: 0.42rem;
	background: var(--c);
}

.st-list--ziele .st-dot {
	background: transparent;
	box-shadow: inset 0 0 0 1.5px var(--gold);
	transform: rotate(45deg) scale(0.8);
}

.st-title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 1.15rem;
	font-weight: 400;
	line-height: 1.35;
}

.st-title button {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-align: left;
	border-bottom: 1px solid transparent;
}

.st-title button:hover { border-color: var(--gold); color: var(--gold); }

.st-sub { font-size: 0.88rem; color: var(--text2); }

.st-subtitle {
	font-family: 'Playfair Display', Georgia, serif;
	font-weight: 400;
	font-size: 1.4rem;
	margin: 3.5rem 0 1.2rem;
}

/* ── Werkzeugkasten ───────────────────────────────────────────────── */
.sk-note {
	color: var(--text2);
	font-size: 0.92rem;
	margin: -2.4rem 0 2.6rem;
}

.sk-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
	gap: 2.6rem 3.5rem;
}

.sk-group h3 {
	font-family: 'Playfair Display', Georgia, serif;
	font-weight: 400;
	font-size: 1.2rem;
	margin-bottom: 0.8rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--border);
}

.sk-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.42rem 0;
}

.sk-name { font-size: 0.92rem; color: var(--text2); }

.sk-bar { display: inline-flex; gap: 3px; flex-shrink: 0; }

.sk-bar i {
	width: 13px;
	height: 13px;
	border-radius: 2px;
	box-shadow: inset 0 0 0 1px rgba(160, 120, 64, 0.35);
	background: transparent;
	transition: background 0.3s ease, box-shadow 0.3s ease;
	transition-delay: calc(var(--i) * 45ms);
}

.sk-grid.is-in .sk-bar i.f {
	background: var(--gold);
	box-shadow: inset 0 0 0 1px var(--gold);
}

/* ── Sprachen-Verlauf ─────────────────────────────────────────────── */
.wg-col--wide { max-width: 1040px; }

.lc-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-bottom: 1.4rem;
}

.lc-legend .lg-item {
	width: auto;
	margin: 0;
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0.2rem 0.75rem 0.2rem 0.55rem;
	font-size: 0.84rem;
}

.lc-legend .lg-item i {
	width: 14px;
	height: 3px;
	border-radius: 2px;
	display: block;
}

.lc-wrap { position: relative; }

#lc-svg { display: block; width: 100%; overflow: visible; }

.lc-grid line { stroke: rgba(160, 120, 64, 0.16); stroke-width: 1; }
.lc-grid line.lc-base { stroke: rgba(160, 120, 64, 0.45); }
.lc-tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }

.lc-line {
	fill: none;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: opacity 0.2s ease, stroke-width 0.2s ease;
}

.lc-line.is-drawing { transition: stroke-dashoffset 1.6s cubic-bezier(.3, .6, .2, 1), opacity 0.2s ease; }

.lc-label {
	font-size: 12px;
	fill: var(--text2);
	paint-order: stroke;
	stroke: var(--bg);
	stroke-width: 4px;
	stroke-linejoin: round;
	transition: opacity 0.2s ease;
}

.lc-wrap.is-focus .lc-line:not(.is-on),
.lc-wrap.is-focus .lc-label:not(.is-on) { opacity: 0.12; }
.lc-wrap.is-focus .lc-line.is-on { stroke-width: 3.2; }

.lc-phase { opacity: 0.85; }
.lc-guide { stroke: var(--text2); stroke-width: 1; stroke-dasharray: 2 3; }
.lc-dot { stroke: var(--card); stroke-width: 2; }

.lc-read {
	position: absolute;
	top: 0;
	min-width: 150px;
	max-width: 230px;
	background: var(--card);
	border: 1px solid var(--border);
	border-top: 3px solid var(--gold);
	border-radius: 4px;
	box-shadow: 0 10px 30px rgba(100, 70, 20, 0.14);
	padding: 0.55rem 0.8rem 0.6rem;
	font-size: 0.8rem;
	pointer-events: none;
	z-index: 5;
}

.lc-read b {
	display: block;
	font-family: 'Playfair Display', Georgia, serif;
	font-weight: 400;
	font-size: 1.05rem;
	margin-bottom: 0.2rem;
}

.lc-read div { display: flex; align-items: center; gap: 0.45rem; color: var(--text2); line-height: 1.6; }
.lc-read div i { width: 10px; height: 3px; border-radius: 2px; }
.lc-read div span { margin-left: auto; padding-left: 0.8rem; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ── Entwurfs-Hinweis ─────────────────────────────────────────────── */
.wg-draft {
	position: fixed;
	left: 1rem;
	bottom: 1rem;
	z-index: 90;
	font-size: 0.75rem;
	background: #fff6dc;
	color: #7a5a20;
	border: 1px dashed var(--gold2);
	border-radius: 3px;
	padding: 0.3rem 0.7rem;
}

/* nav: aktiver Punkt */
.nav-links a[aria-current="page"] { color: var(--gold); }

/* ── Animation ────────────────────────────────────────────────────── */
@keyframes wk-rowin {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes wk-pulse {
	0%   { opacity: 0.9; inset: -1.5px; }
	70%  { opacity: 0;   inset: -6px; }
	100% { opacity: 0;   inset: -6px; }
}

@media (prefers-reduced-motion: reduce) {
	.wk-row { animation: none; }
	.wk-c.is-today::after { animation: none; display: none; }
	.wk-tip, .wk-tip.is-leaving, .wk-drawer-panel, .sk-bar i, .lc-line.is-drawing { transition: none; }
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 960px) {
	.wg-weeks {
		grid-template-columns: 1fr;
		gap: 2rem;
		padding: 2.5rem 1.2rem 4rem;
	}
	.wg-aside-inner { position: static; }
	.wg-legend { flex-direction: row; flex-wrap: wrap; gap: 0.3rem; }
	.lg-item { width: auto; margin-left: 0; border: 1px solid var(--border); border-radius: 999px; padding: 0.25rem 0.7rem; }
	.lg-years { display: none; }
}

@media (max-width: 600px) {
	.wg-page { --wk-gap: 1px; }
	.wg-page main { padding-top: 6.5rem; }
	.lg-swatches { min-width: 0; }
	.wk-row { grid-template-columns: 1.4rem 1fr 0; gap: 0.3rem; }
	.wk-year { display: none; }
	.wk-c { border-radius: 1px; }
	.wk-m { width: 8px; height: 8px; }
	.wg-section { padding: 4rem 1.2rem; }
	.st { grid-template-columns: 1fr; gap: 0.2rem; }
	.st-dot { display: none; }
	.sk-grid { grid-template-columns: 1fr; }
	.lc-label { display: none; }   /* zu eng – die Legende übernimmt */

	/* Schublade wird zum Bottom-Sheet */
	.wk-drawer-panel {
		top: auto;
		width: 100%;
		max-height: 85vh;
		border-left: 0;
		border-top: 4px solid var(--d-c, var(--gold));
		border-radius: 10px 10px 0 0;
		padding: 2.6rem 1.4rem 1.4rem;
		transform: translateY(100%);
	}
	.wk-drawer.is-open .wk-drawer-panel { transform: translateY(0); }
}

/* ── Druck ────────────────────────────────────────────────────────── */
@media print {
	nav, footer, .wk-tip, .wk-drawer, .wg-draft, .wg-readout, .wg-symbols, .lc-read, .lc-legend { display: none !important; }
	.lc-phase { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.wg-page main { padding-top: 0; }
	.wg-weeks { grid-template-columns: 1fr; padding: 0; }
	.wg-aside-inner { position: static; }
	.wk-row { animation: none; }
	.wk-c, .lg-swatches i, .st-dot, .sk-bar i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.sk-bar i.f { background: var(--gold) !important; }
	.wg-section { padding: 2rem 0; break-inside: avoid; }
	.st { break-inside: avoid; }
}