/**
 * Ratgeber Hub – Frontend-Styles
 * Prefix: rh-
 * Steuerbare Variablen (aus den Plugin-Einstellungen):
 *   --rh-cols, --rh-accent, --rh-chip-active, --rh-radius
 */

/* Rahmen-Reset NUR auf plugin-eigenen Seiten (Body-Klasse rh-managed-template).
   So bleiben Builder-Seiten (Elementor, Avada, Enfold, Divi …) mit Shortcode/Block
   vollständig unberührt – dort bestimmt der Builder das Layout. */
.rh-managed-template .rh-archive-wrap,
.rh-managed-template .rh-article,
.rh-managed-template .rh-hub {
	border: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
}

/* Layout-Container gängiger Themes/Builder zwischen <body> und unserem Bereich. */
.rh-managed-template #main,
.rh-managed-template #content,
.rh-managed-template .container_wrap,
.rh-managed-template .container_wrap_first,
.rh-managed-template .container,
.rh-managed-template .content,
.rh-managed-template .template-blog,
.rh-managed-template .post-entry,
.rh-managed-template .entry-content-wrapper,
.rh-managed-template .post-content,
.rh-managed-template .fusion-fullwidth,
.rh-managed-template .fusion-row,
.rh-managed-template .fusion-builder-row,
.rh-managed-template .elementor-section,
.rh-managed-template .elementor-container,
.rh-managed-template .et_builder_inner_content,
.rh-managed-template .wp-block-group {
	border: 0 !important;
	box-shadow: none !important;
}

/* Fallback-Abstand bei transparenten/überlagernden Headern (bis das JS die
   exakte Header-Höhe gesetzt hat). Deckt Enfold, Avada und Divi ab. */
.html_header_transparency .rh-managed-template .rh-archive-wrap,
.html_header_transparency .rh-managed-template .rh-article,
.av_header_transparency .rh-managed-template .rh-archive-wrap,
.av_header_transparency .rh-managed-template .rh-article,
body.avada-has-header-overlaid.rh-managed-template .rh-archive-wrap,
body.avada-has-header-overlaid.rh-managed-template .rh-article,
body.header-position-overlay.rh-managed-template .rh-archive-wrap,
body.header-position-overlay.rh-managed-template .rh-article,
body.et_transparent_nav.rh-managed-template .rh-archive-wrap,
body.et_transparent_nav.rh-managed-template .rh-article {
	padding-top: 130px;
}

/* Doppelte Theme-Titelleiste/Archiv-Kopf auf plugin-eigenen Seiten ausblenden –
   unser Hero liefert die Überschrift bereits (Avada, Enfold, Divi u. a.). */
.rh-managed-template .fusion-page-title-bar,
.rh-managed-template .fusion-page-title-wrapper,
.rh-managed-template .avada-page-title-bar,
.rh-managed-template .page-title-bar,
.rh-managed-template .title-container,
.rh-managed-template .et_pb_title_container,
.rh-managed-template .page-header .archive-title,
.rh-managed-template .archive-description {
	display: none !important;
}

.rh-hub {
	--rh-cols: 4;
	--rh-accent: #0f172a;
	--rh-chip-active: #e2e8f0;
	--rh-radius: 16px;
	--rh-hero-size: 44px;
	--rh-hero-text-size: 17px;
	--rh-head-size: 30px;
	--rh-card-title-size: 18px;
	--rh-chip-font-size: 15px;
	width: 100%;
	box-sizing: border-box;
}

.rh-hub *,
.rh-hub *::before,
.rh-hub *::after {
	box-sizing: border-box;
}

/* ---------- Hero ---------- */
.rh-hero {
	position: relative;
	background-size: cover;
	background-position: center;
	border-radius: var(--rh-radius);
	overflow: hidden;
	color: #fff;
	background-color: #1f2933;
}

.rh-hero__img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover !important;
	object-position: center;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	z-index: 0;
}

.rh-hero__overlay {
	position: absolute;
	inset: 0;
	display: block;
	z-index: 1;
	background-color: rgba(15, 23, 42, 0.35);
}

.rh-hero__inner {
	position: relative;
	z-index: 2;
	max-width: 640px;
	padding: 80px 48px;
}

.rh-hub .rh-hero__title {
	margin: 0 0 16px;
	font-size: var(--rh-hero-size) !important;
	line-height: 1.1;
	font-weight: 700;
	color: var(--rh-hero-title-color, #fff) !important;
}

.rh-hub .rh-hero__text {
	margin: 0 0 28px;
	font-size: var(--rh-hero-text-size);
	line-height: 1.6;
	color: var(--rh-hero-text-color, #fff) !important;
}

/* ---------- Suchfeld ---------- */
.rh-search {
	position: relative;
	display: inline-flex;
	align-items: center;
	background: var(--rh-search-bg, #fff) !important;
	border-radius: var(--rh-search-radius, 999px);
	border: var(--rh-search-border-width, 0) solid var(--rh-search-border-color, transparent);
	padding: 10px 18px 10px 44px;
	max-width: 100%;
}

.rh-search__icon {
	position: absolute;
	left: 16px;
	width: 16px;
	height: 16px;
	border: 2px solid var(--rh-search-icon, #64748b);
	border-radius: 50%;
}

.rh-search__icon::after {
	content: "";
	position: absolute;
	right: -5px;
	bottom: -4px;
	width: 8px;
	height: 2px;
	background: var(--rh-search-icon, #64748b);
	transform: rotate(45deg);
}

/* Theme-Input-Styles (z. B. Enfold/Avada) hart zurücksetzen, damit das Suchfeld
   als eine einheitliche Pille erscheint und kein zweiter Kasten entsteht. */
.rh-search__input {
	flex: 1 1 auto;
	width: auto;
	min-width: 160px;
	font-size: 0.95rem;
	line-height: 1.4;
	color: #0f172a;
	background: transparent !important;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	margin: 0 !important;
	padding: 0 !important;
	height: auto !important;
	min-height: 0 !important;
	border-radius: 0 !important;
}

.rh-search__input:focus {
	box-shadow: none !important;
	outline: none !important;
}

/* ---------- Filterleiste ---------- */
.rh-filterbar {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 32px 0;
}

.rh-chips {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x;
	flex: 1 1 auto;
	min-width: 0; /* wichtig, damit die Leiste im Flex-Container scrollt statt zu überlaufen */
	padding: 4px;
}

.rh-chips::-webkit-scrollbar {
	display: none;
}

.rh-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	padding: 10px 18px;
	border: 1px solid var(--rh-chip-border, #e2e8f0) !important;
	border-radius: 10px;
	background: var(--rh-chip-bg, #fff) !important;
	color: var(--rh-chip-color, #334155) !important;
	font-size: var(--rh-chip-font-size, 0.95rem) !important;
	font-family: inherit;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.rh-chip:not(.is-active):hover {
	background: var(--rh-chip-hover-bg, #f1f5f9) !important;
	color: var(--rh-chip-hover-color, var(--rh-chip-color, #334155)) !important;
}

.rh-chip.is-active {
	background: var(--rh-chip-active) !important;
	color: var(--rh-chip-active-color, #0f172a) !important;
	border-color: var(--rh-chip-active) !important;
	font-weight: 600;
}

.rh-chip__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.05em;
	line-height: 1;
}

.rh-chip__icon.dashicons {
	width: 1.15em;
	height: 1.15em;
	font-size: 1.15em;
}

.rh-filterbar__arrow {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--rh-arrow-border, #e2e8f0) !important;
	background: var(--rh-arrow-bg, #fff) !important;
	color: var(--rh-arrow-color, #334155) !important;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s ease, filter 0.2s ease;
}

.rh-filterbar__arrow:hover {
	filter: brightness(0.96);
}

.rh-filterbar__arrow[disabled] {
	opacity: 0.35;
	cursor: default;
}

/* ---------- Überschrift ---------- */
.rh-hub .rh-articles-heading {
	text-align: center;
	margin: 8px 0 32px;
	font-size: var(--rh-head-size) !important;
	font-weight: 700;
	color: var(--rh-accent);
}

/* ---------- Karten-Grid ---------- */
.rh-cards {
	display: grid;
	grid-template-columns: repeat(var(--rh-cols), 1fr);
	gap: 24px;
}

.rh-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: var(--rh-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

a.rh-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
}

.rh-card.is-hidden {
	display: none;
}

.rh-card__media {
	position: relative;
	height: 200px;
	background-color: #e2e8f0;
	margin: 12px 12px 0;
	border-radius: calc(var(--rh-radius) - 4px);
	overflow: hidden;
}

/* Echtes <img> statt CSS-Hintergrundbild: dadurch erkennen Lazy-Load-/Optimierungs-
   Plugins (z. B. WP Rocket, Autoptimize, Theme-eigenes Lazy-Loading) das Bild
   zuverlässig, so wie sie es auch bei jedem anderen <img> im Theme tun. Ein per
   Inline-Style gesetztes CSS-Hintergrundbild wird von solchen Skripten oft nicht
   erkannt und bleibt dann leer, obwohl das Bild auf der Einzelartikel-Seite (dort
   bereits ein <img>) korrekt erscheint. */
.rh-card__media-img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover !important;
	object-position: center;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	display: block;
}

.rh-card__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 6px 14px;
	background: #fff;
	color: #0f172a;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 600;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.rh-card__body {
	padding: 18px 20px 24px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1 1 auto;
}

.rh-card__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.82rem;
	color: #64748b;
}

.rh-card__sep {
	opacity: 0.5;
}

.rh-hub .rh-card__title {
	margin: 0;
	font-size: var(--rh-card-title-size) !important;
	font-weight: 700;
	line-height: 1.3;
	color: var(--rh-accent);
}

.rh-card__excerpt {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.5;
	color: #64748b;
}

.rh-card__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	align-self: flex-start;
	margin-top: auto;
	padding: 10px 18px;
	border-radius: var(--rh-btn-radius, 10px);
	background: var(--rh-btn-bg, var(--rh-accent));
	color: var(--rh-btn-color, #fff);
	border: var(--rh-btn-border-width, 0) solid var(--rh-btn-border-color, transparent);
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.2;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

a.rh-card:hover .rh-card__button {
	opacity: 0.9;
}

.rh-card__button-icon {
	color: var(--rh-btn-icon-color, currentColor);
}

.rh-card__button-icon.dashicons {
	width: 1.1em;
	height: 1.1em;
	font-size: 1.1em;
	line-height: 1;
}

.rh-noresults,
.rh-empty {
	text-align: center;
	color: #64748b;
	padding: 32px 0;
}

/* ---------- Seiten-Navigation ---------- */
.rh-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin: 32px 0 8px;
}

.rh-pagination:empty {
	display: none;
}

.rh-page {
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #fff;
	color: #334155;
	font-size: 0.95rem;
	font-family: inherit;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.rh-page:hover {
	border-color: #cbd5e1;
}

.rh-page.is-active {
	background: var(--rh-accent);
	border-color: var(--rh-accent);
	color: #fff;
	font-weight: 600;
}

.rh-page[disabled] {
	opacity: 0.4;
	cursor: default;
}

/* ---------- Einzelartikel ---------- */
.rh-article {
	--rh-article-width: 760px;
	--rh-article-title-size: 40px;
	--rh-article-body-size: 18px;
	width: 100%;
}

.rh-article__inner {
	max-width: var(--rh-article-width);
	margin: 0 auto;
	padding: 0 20px;
	box-sizing: border-box;
}

.rh-article__back {
	display: block;
	margin: 24px 0 24px;
	font-size: 0.9rem;
	color: #64748b;
	text-decoration: none;
}

.rh-article__back:hover {
	color: var(--rh-accent);
}

.rh-article__badge {
	display: inline-block;
	padding: 6px 14px;
	background: var(--rh-chip-active, #e2e8f0);
	color: #0f172a;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 600;
	margin-bottom: 14px;
}

/* !important, damit die Plugin-Einstellung Theme-Regeln (z. B. Enfolds #top h1) überschreibt. */
.rh-article .rh-article__title {
	margin: 0 0 14px;
	font-size: var(--rh-article-title-size) !important;
	line-height: 1.15;
	font-weight: 700;
	color: var(--rh-article-title-color, var(--rh-heading-color, var(--rh-accent))) !important;
}

.rh-article__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
	color: #64748b;
	margin-bottom: 8px;
}

.rh-article__media {
	max-width: var(--rh-article-width);
	margin: 24px auto;
	padding: 0 20px;
	box-sizing: border-box;
}

.rh-article__media img {
	width: 100%;
	height: auto;
	border-radius: var(--rh-radius, 16px);
	display: block;
}

/* Feste, einheitliche Bildhöhe – mittiger Zuschnitt ohne Verzerrung. */
.rh-article--fixedimg .rh-article__media img {
	height: var(--rh-article-img-height, 420px);
	object-fit: cover;
	object-position: center;
}

.rh-article .rh-article__content {
	font-size: var(--rh-article-body-size) !important;
	line-height: 1.7;
	color: #334155;
}

.rh-article .rh-article__content h2 { font-size: var(--rh-h2, 28px) !important; line-height: 1.25; margin: 1.6em 0 0.5em; color: var(--rh-heading-color, var(--rh-accent)) !important; }
.rh-article .rh-article__content h3 { font-size: var(--rh-h3, 22px) !important; line-height: 1.3; margin: 1.4em 0 0.5em; color: var(--rh-heading-color, var(--rh-accent)) !important; }
.rh-article .rh-article__content h4 { font-size: var(--rh-h4, 18px) !important; line-height: 1.35; margin: 1.3em 0 0.5em; color: var(--rh-heading-color, var(--rh-accent)) !important; }
.rh-article__content p { margin: 0 0 1.1em; }
.rh-article__content img { max-width: 100%; height: auto; border-radius: 8px; }
.rh-article__content a { color: var(--rh-accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.rh-cards { grid-template-columns: repeat(2, 1fr); }
	.rh-hero__title { font-size: calc(var(--rh-hero-size) * 0.8); }
	.rh-hero__inner { padding: 56px 32px; }
}

@media (max-width: 640px) {
	.rh-cards { grid-template-columns: 1fr; }
	.rh-hero__title { font-size: calc(var(--rh-hero-size) * 0.62); }
	.rh-hero__inner { padding: 40px 24px; }
	/* Pfeile bleiben sichtbar; zusätzlich ist die Chip-Leiste per Wischen scrollbar. */
	.rh-filterbar__arrow { width: 36px; height: 36px; }
}
