/* ===== RSG Offers Plugin – Frontend ===== */

/* Kategorie-Abschnitt */
.rsg-kategorie {
	margin-bottom: 2.5em;
}

.rsg-kategorie + .rsg-kategorie {
	padding-top: 2em;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.rsg-kategorie__titel {
	margin-top: 0;
	border-bottom: 2px solid currentColor;
	padding-bottom: 0.25em;
	margin-bottom: 1em;
}

/* Kursliste */
.rsg-kurse-liste {
	display: flex;
	flex-direction: column;
	gap: 1.25em;
}

/* Einzelner Kurs */
.rsg-kurs {
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 4px;
	padding: 1.25em;
}

.rsg-kurs__kopf {
	display: flex;
	gap: 1em;
	align-items: flex-start;
	margin-bottom: 0.75em;
}

/* Kursbild */
.rsg-kurs__bild {
	flex-shrink: 0;
}

.rsg-bild-btn {
	display: block;
	background: none;
	border: none;
	padding: 0;
	cursor: zoom-in;
	border-radius: 3px;
	overflow: hidden;
	line-height: 0;
}

.rsg-bild-btn img {
	display: block;
	width: 80px;
	height: 80px;
	object-fit: cover;
	transition: opacity 0.2s;
}

.rsg-bild-btn:hover img,
.rsg-bild-btn:focus img {
	opacity: 0.8;
}

.rsg-bild-btn:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Kursinfos */
.rsg-kurs__info {
	flex: 1;
	min-width: 0;
}

.rsg-kurs__name {
	margin: 0 0 0.3em;
	font-size: 1.1em;
}

.rsg-kurs__beschreibung {
	margin: 0 0 0.5em;
	opacity: 0.8;
	font-size: 0.95em;
}

.rsg-kurs__trainer {
	font-size: 0.9em;
	margin-top: 0.4em;
}

.rsg-kurs__trainer-label {
	font-weight: 600;
	margin-right: 0.25em;
}

.rsg-kurs__zielgruppe {
	font-size: 0.9em;
	margin-top: 0.4em;
}

.rsg-kurs__zielgruppe-label {
	font-weight: 600;
	margin-right: 0.25em;
}

/* Trainer-Button (klickbarer Name) */
.rsg-trainer-btn {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.rsg-trainer-btn:hover,
.rsg-trainer-btn:focus {
	opacity: 0.7;
	outline: none;
}

.rsg-trainer-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 2px;
}

/* Weitere Infos */
.rsg-kurs__weitere-infos {
	font-size: 0.9em;
	padding-top: 0.75em;
	margin-top: 0.75em;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	margin-bottom: 0.75em;
}

.rsg-kurs__weitere-infos > *:first-child {
	margin-top: 0;
}

.rsg-kurs__weitere-infos > *:last-child {
	margin-bottom: 0;
}

/* Termine-Tabelle */
.rsg-kurs__termine {
	margin-top: 0.75em;
}

.rsg-termine-tabelle {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9em;
}

.rsg-termine-tabelle th,
.rsg-termine-tabelle td {
	text-align: left;
	padding: 0.4em 0.75em;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	vertical-align: middle;
}

.rsg-termine-tabelle th {
	font-weight: 600;
	white-space: nowrap;
	background: rgba(0, 0, 0, 0.04);
}

.rsg-termine-tabelle tbody tr:last-child td {
	border-bottom: none;
}

/* ===== Responsive: Termine als Cards ===== */
@media (max-width: 600px) {
	.rsg-kurs__kopf {
		flex-direction: column;
	}

	.rsg-bild-btn img {
		width: 100%;
		height: auto;
		max-height: 180px;
	}

	.rsg-termine-tabelle thead {
		display: none;
	}

	.rsg-termine-tabelle tbody tr {
		display: block;
		margin-bottom: 0.6em;
		border: 1px solid rgba(0, 0, 0, 0.1);
		border-radius: 3px;
		padding: 0.4em 0.6em;
	}

	.rsg-termine-tabelle tbody td {
		display: flex;
		gap: 0.5em;
		padding: 0.2em 0;
		border: none;
		font-size: 0.95em;
	}

	.rsg-termine-tabelle tbody td::before {
		content: attr(data-label);
		font-weight: 600;
		min-width: 5.5em;
		flex-shrink: 0;
	}

	.rsg-termine-tabelle tbody tr:last-child {
		margin-bottom: 0;
	}
}

/* ===== Modals ===== */
.rsg-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1em;
}

.rsg-modal[hidden] {
	display: none;
}

.rsg-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.rsg-modal__container {
	position: relative;
	background: #fff;
	color: #222;
	border-radius: 6px;
	padding: 2em 2em 1.5em;
	max-width: 500px;
	width: 100%;
	max-height: 85vh;
	overflow-y: auto;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
}

.rsg-modal__container--bild {
	background: transparent;
	padding: 0;
	max-width: min(90vw, 900px);
	box-shadow: none;
}

.rsg-modal__close {
	position: absolute;
	top: 0.6em;
	right: 0.6em;
	width: 2em;
	height: 2em;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.07);
	border: 1px solid rgba(0, 0, 0, 0.15);
	font-size: 1.1em;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #333;
	transition: background 0.15s;
}

.rsg-modal__close:hover,
.rsg-modal__close:focus {
	background: rgba(0, 0, 0, 0.15);
	outline: none;
}

.rsg-modal__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.rsg-modal__container--bild .rsg-modal__close {
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	border-color: transparent;
	top: -0.8em;
	right: -0.8em;
}

.rsg-modal__container--bild .rsg-modal__close:hover {
	background: rgba(0, 0, 0, 0.8);
}

/* Trainer-Profil im Modal */
.rsg-trainer-profil__foto {
	text-align: center;
	margin-bottom: 1.25em;
}

.rsg-trainer-profil__foto img {
	width: 110px;
	height: 110px;
	border-radius: 50%;
	object-fit: cover;
}

.rsg-trainer-profil__name {
	margin: 0 0 0.5em;
	font-size: 1.15em;
}

.rsg-trainer-profil__bio {
	font-size: 0.95em;
	margin-bottom: 1em;
}

.rsg-trainer-profil__bio > *:last-child {
	margin-bottom: 0;
}

.rsg-trainer-profil__kontakt {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: 0.9em;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
	padding-top: 0.75em;
	margin-top: 0.75em;
}

.rsg-trainer-profil__kontakt li + li {
	margin-top: 0.3em;
}

/* Lightbox-Bild */
.rsg-lightbox-bild {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}

/* Body-Scroll sperren wenn Modal offen */
body.rsg-modal-open {
	overflow: hidden;
}
