/*
 * Übersicht der Buchempfehlungen.
 *
 * Werte aus dem Prototyp »Übersicht Buchempfehlungen« (Main.dc.html). Aufbau, Abstände und Texte der
 * Seite kommen aus Avada-Elementen; hier steht nur, was Avada nicht kann: die Gestaltung der
 * FacetWP-Facetten und ein paar Details der Karte.
 */

.as-book-filter,
.as-book-reset,
.as-book-card,
.as-book-more-wrap,
.facetwp-facet-buch_anzahl,
.as-book-empty {
	--as-ink: var(--awb-color4, #0f1450);
	--as-muted: #4a4e57;
	--as-accent: #4b6ec8;
	--as-line: #c3eeee;
	--as-line-strong: #b9d4ee;
	--as-strong: var(--awb-typography1-font-family, inherit);

	/* Türkis der Section: Themenfarbe der Seite (Variablen --as-theme* aus dem Modul ThemeBodyClass), sonst Rückfall. */
	--as-teal: var(--as-theme, #9be3e3);
	--as-teal-light: var(--as-theme-light, #afe9e9);
	--as-teal-lighter: var(--as-theme-lighter, #c3eeee);
	--as-teal-dark: var(--as-theme-dark, #4e7272);
	--as-teal-text: var(--as-theme-text, #0f1450);
}

/* Labels »Suche« und »Kategorie« in der Medium-Schrift der Site. */
.as-book-label,
.as-book-label p {
	font-family: var(--as-strong, inherit);
	color: var(--as-ink);
}

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

.as-book-filter .facetwp-facet-buch_suche {
	margin: 0 0 18px;
}

.as-book-filter .facetwp-facet-buch_suche .facetwp-input-wrap {
	position: relative;
	display: block;
	width: 100%;
}

.as-book-filter .facetwp-facet-buch_suche .facetwp-icon {
	position: absolute;
	top: 50%;
	right: auto;
	left: 14px;
	width: 18px;
	height: 18px;
	margin: 0;
	transform: translateY(-50%);
	pointer-events: none;
}

/* Lupe, Schliessen- und Lade-Symbol als SVG-Maske statt der kleinen PNGs von FacetWP (wirkten verpixelt). */
.as-book-filter .facetwp-facet-buch_suche .facetwp-input-wrap .facetwp-icon::before {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--as-ink) none;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M16.5 16.5L21 21'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M16.5 16.5L21 21'/%3E%3C/svg%3E") center / contain no-repeat;
}

.as-book-filter .facetwp-facet-buch_suche .facetwp-input-wrap .facetwp-icon.f-reset::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}

.as-book-filter .facetwp-facet-buch_suche .facetwp-input-wrap .facetwp-icon.f-loading::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 3a9 9 0 1 0 9 9'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 3a9 9 0 1 0 9 9'/%3E%3C/svg%3E");
}

.as-book-filter .facetwp-facet-buch_suche input.facetwp-search {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	height: 44px;
	padding: 0 14px 0 42px;
	font-family: inherit;
	font-size: 16px;
	color: var(--as-ink);
	background: #fff;
	border: 1px solid var(--as-line-strong);
	border-radius: 10px;
}

.as-book-filter .facetwp-facet-buch_suche input.facetwp-search:focus {
	outline: 2px solid var(--as-accent);
	outline-offset: 1px;
}

/* ---------- Kategorie-Chips ---------- */

.as-book-filter .facetwp-facet-buch_kategorie {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
}

.as-book-filter .facetwp-facet-buch_kategorie .facetwp-radio {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	min-height: 40px;
	margin: 0;
	padding: 0 16px;
	font-size: 15px;
	line-height: 1.2;
	color: var(--as-ink);
	cursor: pointer;
	background: #fff none;
	border: 1px solid var(--as-teal-lighter);
	border-radius: 999px;
}

.as-book-filter .facetwp-facet-buch_kategorie .facetwp-radio .facetwp-counter {
	color: var(--as-muted);
}

.as-book-filter .facetwp-facet-buch_kategorie .facetwp-radio.checked {
	font-family: var(--as-strong, inherit);
	color: var(--as-teal-text);
	background: var(--as-teal) none;
	border-color: var(--as-teal);
}

.as-book-filter .facetwp-facet-buch_kategorie .facetwp-radio.checked .facetwp-counter {
	color: var(--as-teal-text);
	opacity: 0.75;
}

.as-book-filter .facetwp-facet-buch_kategorie .facetwp-radio.disabled {
	opacity: 0.4;
	cursor: default;
}

.as-book-filter .facetwp-facet-buch_kategorie .facetwp-radio:focus-visible {
	outline: 2px solid var(--as-ink);
	outline-offset: 2px;
}

@media (hover: hover) {
	.as-book-filter .facetwp-facet-buch_kategorie .facetwp-radio:not(.checked):not(.disabled):hover {
		background: #eef9f9 none;
		border-color: var(--as-teal);
	}
}

/* ---------- Filter zurücksetzen ---------- */

.as-book-reset {
	margin-top: 14px;
}

/* FacetWP gibt jeder Facette 30 px Abstand nach unten; in der Filterbox gilt nur deren Innenabstand. */
.as-book-reset .facetwp-facet {
	margin: 0;
}

.as-book-reset .facetwp-reset {
	min-height: 40px;
	margin: 0;
	padding: 0 16px;
	font-family: var(--as-strong, inherit);
	font-size: 15px;
	line-height: 1.2;
	color: var(--as-teal-text);
	cursor: pointer;
	background: #fff;
	border: 1px solid var(--as-teal);
	border-radius: 999px;
}

.as-book-reset .facetwp-reset:hover {
	background: var(--as-teal);
}

.as-book-reset .facetwp-reset:focus-visible {
	outline: 2px solid var(--as-ink);
	outline-offset: 2px;
}

/* Ohne aktiven Filter ist die Facette ausgeblendet: dann auch den Abstand weglassen. */
.as-book-reset:has(.facetwp-facet.facetwp-hidden) {
	margin-top: 0;
}

/* ---------- Anzahl, Leerzustand, »Weitere laden« ---------- */

.facetwp-facet-buch_anzahl {
	margin: 0 0 32px;
	font-size: 14px;
	color: var(--as-muted);
}

.as-book-empty {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: center;
	padding: 48px 24px;
	color: var(--as-ink);
	text-align: center;
	background: #eef9f9;
	border: 1px solid var(--as-line);
	border-radius: 12px;
}

.as-book-empty__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	margin-bottom: 8px;
	color: var(--as-accent);
	background: #fff;
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(15, 20, 80, 0.08);
}

.as-book-empty__title {
	font-family: var(--as-strong, inherit);
	font-size: 20px;
	line-height: 1.3;
}

.as-book-empty__text {
	font-size: 15px;
	font-weight: 300;
	line-height: 1.5;
}

.as-book-more-wrap {
	display: flex;
	justify-content: center;
	margin: 32px 0;
}

.as-book-more-wrap .facetwp-load-more {
	min-height: 48px;
	margin: 0;
	padding: 0 28px;
	font-family: var(--as-strong, inherit);
	font-size: 16px;
	color: var(--as-teal-text);
	cursor: pointer;
	background: var(--as-teal);
	border: 1px solid var(--as-teal);
	border-radius: 10px;
}

.as-book-more-wrap .facetwp-load-more:hover {
	filter: brightness(0.95);
}

.as-book-more-wrap .facetwp-load-more:focus-visible {
	outline: 2px solid var(--as-ink);
	outline-offset: 2px;
}

/* ---------- Karte ---------- */

/*
 * Der Grid-Eintrag (.as-book-card) trägt nur den Abstand zwischen den Karten; Rahmen und Rundung hat
 * der Wrapper darin. Der Schatten gehört deshalb dorthin, sonst liegt er um die Karte plus Abstand.
 */
.as-book-card > .fusion-column-wrapper {
	transition: box-shadow 0.2s;
}

@media (hover: hover) {
	.as-book-card:hover > .fusion-column-wrapper {
		box-shadow: 0 10px 28px rgba(15, 20, 80, 0.1);
	}
}

/* Höhe der Cover-Fläche; die Mindesthöhe der verschachtelten Spalte setzt Avada hier nicht um. */
.as-book-card .as-book-cover .fusion-column-wrapper {
	position: relative;
	box-sizing: border-box;
	min-height: 232px;
}

.as-book-cover-img img {
	border-radius: 3px 6px 6px 3px;
	box-shadow: 0 8px 20px rgba(15, 20, 80, 0.18);
}

.as-book-card-badge {
	position: absolute;
	right: 12px;
	bottom: 12px;
	display: flex;
	gap: 5px;
	align-items: center;
	padding: 4px 10px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--as-ink);
	background: #fff;
	border-radius: 999px;
}

.as-book-card-badge svg {
	color: var(--as-accent);
}

/* Teaser nach drei Zeilen abschneiden. */
.as-book-clamp {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Kartenkörper füllt die Kartenhöhe; die Fusszeile sitzt unten, auch bei kurzen Texten. */
.as-book-card > .fusion-column-wrapper > .fusion-builder-row-inner:last-child {
	flex: 1 1 auto;
	align-items: stretch;
}

.as-book-card .as-book-body {
	display: flex;
	flex-direction: column;
	align-self: stretch;
}

.as-book-card .as-book-body > .fusion-column-wrapper {
	flex: 1 1 auto;
}

.as-book-card .as-book-foot-wrap {
	margin-top: auto;
}

.as-book-card-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	padding-top: 14px;
	border-top: 1px solid #dff5f5;
}

.as-book-card-foot a,
.as-book-card-foot a:hover,
.as-book-card-foot a:focus,
.as-book-card-foot a:visited {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	min-height: 32px;
	font-family: var(--as-strong, inherit);
	font-size: 15px;
	color: var(--as-accent);
}

.as-book-card-foot a:hover {
	color: var(--as-ink);
}

/*
 * Ganze Karte klickbar (»Stretched Link«): Der Link »Mehr erfahren« bleibt der einzige Link der Karte,
 * seine Klickfläche reicht per ::after über die ganze Karte. So gibt es keinen Link im Link und nur
 * einen Tabstopp pro Karte. Dafür muss die Karte der nächste positionierte Vorfahre des Links sein;
 * die Zwischenebenen von Avada (Zeilen, Spalten, Text-Element) dürfen es nicht sein.
 */
.as-book-card > .fusion-column-wrapper {
	position: relative;
}

.as-book-card .fusion-builder-row.fusion-builder-row-inner.fusion-row,
.as-book-card .fusion-builder-row.fusion-builder-row-inner .fusion-layout-column,
.as-book-card .as-book-body > .fusion-column-wrapper,
.as-book-card .as-book-foot-wrap,
.as-book-card .as-book-card-foot {
	position: static;
}

.as-book-card-foot a::after {
	position: absolute;
	inset: 0;
	z-index: 1;
	content: "";
	border-radius: 12px;
}

/* Fokus: Rahmen um die ganze Karte statt um den kleinen Link. */
.as-book-card-foot a:focus-visible {
	outline: none;
}

.as-book-card-foot a:focus-visible::after {
	outline: 2px solid var(--as-ink);
	outline-offset: 2px;
}
