/**
 * Scaffidi Toolkit – Sticky Sidebars.
 * Migriert aus dem Kallyas-Child-Theme (style.css), Klassen auf sctk-*,
 * Toggle als echter Button, Chevron per CSS statt Emoji.
 */

.sctk-sidebar {
	position: fixed;
	top: 20%;
	right: 0;
	display: flex;
	align-items: stretch;
	z-index: 1000;
	font-family: "Open Sans", Helvetica, Arial, sans-serif;
	/* drop-shadow statt box-shadow: schattiert die gerenderte Silhouette der
	   Gesamteinheit (Balken + Panel) gleichmaessig an allen Kanten. */
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.18));
}

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

/* Blauer vertikaler Toggle-Balken (echter Button, Theme-Styles neutralisiert).
   writing-mode liegt bewusst nur auf dem Label: der Button bleibt im normalen
   Schreibmodus, damit flex-direction:column Label oben / Chevron darunter stapelt. */
.sctk-sidebar__toggle {
	all: unset;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: #0073aa;
	color: #fff;
	width: 50px;
	min-height: 100px;
	cursor: pointer;
	font-size: 14px;
	font-weight: bold;
	padding: 14px 5px;
	transition: none;
}

/* Nur die Beschriftung steht vertikal. */
.sctk-sidebar__label {
	writing-mode: vertical-rl;
	text-orientation: mixed;
}

.sctk-sidebar__toggle:hover {
	background: #005f8c;
}

/* Sichtbarer Tastatur-Fokus (Kallyas resettet Outlines global). */
.sctk-sidebar__toggle:focus {
	outline: none;
}

.sctk-sidebar__toggle:focus-visible {
	outline: 3px solid #1a1a1a;
	outline-offset: -3px;
}

/* Chevron per CSS (kein Emoji-Text -> keine wp-emoji-<img>-Umwandlung). */
.sctk-sidebar__chevron {
	display: block;
	width: 12px;
	height: 12px;
	position: relative;
	flex: 0 0 auto;
}

.sctk-sidebar__chevron::before {
	content: "";
	position: absolute;
	top: 2px;
	left: 3px;
	width: 8px;
	height: 8px;
	border-left: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg); /* zeigt nach links = "ausklappen" */
}

.sctk-sidebar__toggle[aria-expanded="true"] .sctk-sidebar__chevron::before {
	transform: rotate(225deg); /* zeigt nach rechts = "einklappen" */
}

/* Panel: im geschlossenen Zustand via hidden-Attribut (display:none, raus aus dem A11y-Tree).
   Kein eigener Innenabstand – die Zeilen fuellen die Hoehe randlos. */
.sctk-sidebar__panel {
	background: #fff;
	padding: 0;
	border: 1px solid #ddd;
	min-width: 190px;
}

/* Offen: Links teilen sich die Panel-Hoehe gleichmaessig (1 Link = mittig,
   2 Links = je 50 % usw.). :not([hidden]) noetig, damit display:flex das
   hidden-Attribut (display:none) nicht aushebelt. */
.sctk-sidebar__panel:not([hidden]) {
	display: flex;
	flex-direction: column;
}

.sctk-sidebar__link {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	color: #333;
	text-decoration: none;
	padding: 0 20px;
}

/* Optionales Icon (Inline-SVG, currentColor) – bei mehreren Links vor dem Label. */
.sctk-sidebar__icon {
	display: inline-flex;
	flex: 0 0 auto;
	color: #0073aa;
}

.sctk-sidebar__icon svg {
	display: block;
	width: 18px;
	height: 18px;
}

/* Einzel-Link: Kachel-Layout – Icon mittig ueber dem Label. */
.sctk-sidebar__panel--single .sctk-sidebar__link {
	flex-direction: column;
	justify-content: center;
	gap: 10px;
	text-align: center;
	padding: 16px 20px;
}

.sctk-sidebar__panel--single .sctk-sidebar__icon svg {
	width: 32px;
	height: 32px;
}

/* Feine Trennlinie zwischen den Zeilen. */
.sctk-sidebar__link + .sctk-sidebar__link {
	border-top: 1px solid #e5e5e5;
}

.sctk-sidebar__link:hover {
	background: rgba(0, 115, 170, 0.08);
	color: #005f8c;
	text-decoration: underline;
}

.sctk-sidebar__link:focus-visible {
	outline: 2px solid #0073aa;
	outline-offset: -2px;
	background: rgba(0, 115, 170, 0.08);
}

@media (forced-colors: active) {
	.sctk-sidebar__chevron::before {
		border-color: ButtonText;
	}
	.sctk-sidebar__toggle:focus-visible {
		outline-color: Highlight;
	}
}

/* Animation nur ohne Reduce-Wunsch (Default ruhig). */
@media (prefers-reduced-motion: no-preference) {
	.sctk-sidebar__toggle {
		transition: background 0.3s ease;
	}
	.sctk-sidebar__chevron::before {
		transition: transform 0.3s ease;
	}
	.sctk-sidebar__link {
		transition: background 0.2s ease;
	}
}
