/**
 * Webe Sitemap – Frontend-Styles.
 *
 * Bewusst theme-neutral: Farben werden vom Theme geerbt (currentColor),
 * alle Maße laufen über CSS-Variablen und sind per Elementor überschreibbar.
 */

.webe-sitemap {
	--webe-sitemap-cols: 1;
	--webe-sitemap-col-gap: 2.5rem;
	--webe-sitemap-item-gap: 0.5rem;
	--webe-sitemap-indent: 1.25rem;
	--webe-sitemap-group-gap: 2.5rem;
}

.webe-sitemap--cols-2 {
	--webe-sitemap-cols: 2;
}

.webe-sitemap--cols-3 {
	--webe-sitemap-cols: 3;
}

.webe-sitemap--cols-4 {
	--webe-sitemap-cols: 4;
}

/* Gruppen ------------------------------------------------------------- */

.webe-sitemap__group + .webe-sitemap__group {
	margin-top: var(--webe-sitemap-group-gap);
}

.webe-sitemap__group[hidden] {
	display: none;
}

.webe-sitemap__group-title {
	margin: 0 0 1rem;
}

/* Listen -------------------------------------------------------------- */

.webe-sitemap__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.webe-sitemap__list:not(.webe-sitemap__list--child) {
	column-count: var(--webe-sitemap-cols);
	column-gap: var(--webe-sitemap-col-gap);
}

.webe-sitemap__list--child {
	margin-top: var(--webe-sitemap-item-gap);
	padding-inline-start: var(--webe-sitemap-indent);
}

.webe-sitemap__item {
	margin: 0 0 var(--webe-sitemap-item-gap);
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	page-break-inside: avoid;
}

.webe-sitemap__item[hidden] {
	display: none;
}

/*
 * Bewusst ohne Farb- und Schriftangaben: im Modus „Standard“ erbt die Sitemap
 * exakt die Link-Stile des Themes. Individuelle Werte kommen als Inline-CSS
 * aus den Einstellungen bzw. aus den Elementor-Controls.
 */
.webe-sitemap__link {
	overflow-wrap: break-word;
}

.webe-sitemap__date {
	display: inline-block;
	margin-inline-start: 0.5em;
	font-size: 0.85em;
	opacity: 0.7;
}

/* Suche --------------------------------------------------------------- */

.webe-sitemap__search {
	margin-bottom: 1.5rem;
}

.webe-sitemap__search-label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.webe-sitemap__search-input {
	width: 100%;
	max-width: 32rem;
	padding: 0.65em 0.9em;
	font: inherit;
	color: inherit;
	background-color: transparent;
	border: 1px solid currentColor;
	border-radius: 4px;
	box-sizing: border-box;
}

.webe-sitemap__search-input:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.webe-sitemap__status {
	margin: 0.5rem 0 0;
	font-size: 0.875em;
	opacity: 0.75;
	min-height: 1.4em;
}

.webe-sitemap__no-results,
.webe-sitemap__empty-state {
	margin: 1rem 0 0;
	opacity: 0.8;
}

.webe-sitemap__no-results[hidden] {
	display: none;
}

/* Treffer-Hervorhebung ------------------------------------------------ */

.webe-sitemap__item mark {
	background: none;
	color: inherit;
	font-weight: 700;
	padding: 0;
}

/* Lizenzhinweis (nur für Administratoren sichtbar) -------------------- */

.webe-sitemap--unlicensed {
	padding: 1rem;
	border: 1px dashed currentColor;
	border-radius: 4px;
	font-size: 0.9em;
	opacity: 0.85;
}

/* Responsive ---------------------------------------------------------- */

@media (max-width: 767px) {
	.webe-sitemap__list:not(.webe-sitemap__list--child) {
		column-count: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.webe-sitemap * {
		transition: none !important;
	}
}

/* Beschreibungen und Aktualisierungsdatum ----------------------------- */

.webe-sitemap__description {
	display: block;
	margin-top: 0.15em;
	font-size: 0.9em;
	opacity: 0.8;
	max-width: 60ch;
}

.webe-sitemap__modified {
	display: inline-block;
	margin-inline-start: 0.5em;
	font-size: 0.8em;
	opacity: 0.7;
}

.webe-sitemap__item--current > .webe-sitemap__link {
	font-weight: 700;
}
