/* OOteach Katalog – Frontend & Backend-Vorschau
 * Bewusst neutral gehalten; erbt Schrift/Farben weitgehend vom Theme.
 */

.ooteach-catalog {
	--ooteach-accent: #1F999C; /* OpenOlat-Türkis, per Einstellung/CSS-Variable überschreibbar */
	--ooteach-radius: 10px;
	--ooteach-border: #e3e6e2;
	--ooteach-muted: #5c6660;
	margin: 0 0 1.5rem;
}

.ooteach-catalog *,
.ooteach-catalog *::before,
.ooteach-catalog *::after {
	box-sizing: border-box;
}

/* --- Umschalter --- */
.ooteach-toolbar {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	margin: 0 0 1rem;
	background: #f2f4f1;
	border-radius: 999px;
}

.ooteach-view-btn {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--ooteach-muted);
	font: inherit;
	font-size: 0.9rem;
	line-height: 1.2;
	padding: 0.4rem 1rem;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ooteach-view-btn:hover {
	color: #1f2723;
}

.ooteach-view-btn.is-active {
	background: #ffffff;
	color: #1f2723;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* --- Einträge: gemeinsame Basis --- */
.ooteach-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ooteach-item {
	margin: 0;
	animation: ooteach-fade-in 0.35s ease both;
}

@keyframes ooteach-fade-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ooteach-item { animation: none; }
}

.ooteach-item-link {
	display: flex;
	text-decoration: none;
	color: inherit;
	border: 1px solid var(--ooteach-border);
	border-radius: var(--ooteach-radius);
	overflow: hidden;
	background: #fff;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.ooteach-item-link:hover,
.ooteach-item-link:focus-visible {
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.ooteach-item-media {
	display: block;
	background: #eef1ee;
	overflow: hidden;
}

.ooteach-item-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ooteach-item-body {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 0.9rem 1rem 1.1rem;
	flex: 1 1 auto;
}

/* --- Ansicht: Cards (Kacheln) --- */
.ooteach-catalog.is-cards .ooteach-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 1.1rem;
}

.ooteach-catalog.is-cards .ooteach-item-link {
	flex-direction: column;
	height: 100%;
}

.ooteach-catalog.is-cards .ooteach-item-link:hover,
.ooteach-catalog.is-cards .ooteach-item-link:focus-visible {
	transform: translateY(-2px);
}

.ooteach-catalog.is-cards .ooteach-item-media {
	aspect-ratio: 16 / 10;
	width: 100%;
}

/* Beschreibung in der Card-Ansicht ausblenden (nur per Hover-Tooltip). */
.ooteach-catalog.is-cards .ooteach-item-desc {
	display: none;
}

/* --- Ansicht: Liste (Zeilen, ohne Bilder) --- */
.ooteach-catalog.is-list .ooteach-list {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.ooteach-catalog.is-list .ooteach-item-link {
	flex-direction: row;
	align-items: stretch;
}

/* In der Liste keine Bilder. */
.ooteach-catalog.is-list .ooteach-item-media {
	display: none;
}

.ooteach-catalog.is-list .ooteach-item-body {
	justify-content: center;
	padding: 0.85rem 1.1rem;
}

.ooteach-item-title {
	font-weight: 600;
	font-size: 1.02rem;
	line-height: 1.3;
	color: #1f2723;
}

.ooteach-item-format {
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ooteach-muted);
}

.ooteach-item-date {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--ooteach-accent);
}

.ooteach-item-location {
	font-size: 0.82rem;
	color: var(--ooteach-muted);
}

.ooteach-item-desc {
	font-size: 0.88rem;
	line-height: 1.45;
	color: #3b433e;
}

/* --- Kalender --- */
.ooteach-calendar {
	display: none;
}

.ooteach-catalog.is-calendar .ooteach-list {
	display: none;
}

.ooteach-catalog.is-calendar .ooteach-calendar {
	display: block;
}

.ooteach-cal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin: 0 0 0.75rem;
}

.ooteach-cal-title {
	font-weight: 600;
	font-size: 1.1rem;
	color: #1f2723;
}

.ooteach-cal-nav {
	display: inline-flex;
	gap: 0.4rem;
}

.ooteach-cal-nav button {
	appearance: none;
	border: 1px solid var(--ooteach-border);
	background: #fff;
	width: 2rem;
	height: 2rem;
	border-radius: 6px;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	color: #1f2723;
}

.ooteach-cal-nav button:hover {
	border-color: var(--ooteach-accent);
	color: var(--ooteach-accent);
}

.ooteach-cal-nav button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	border-color: var(--ooteach-border);
	color: #1f2723;
}

.ooteach-cal-nav .ooteach-cal-today {
	width: auto;
	padding: 0 0.75rem;
	font-size: 0.85rem;
}

.ooteach-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
}

.ooteach-cal-weekday {
	text-align: center;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--ooteach-muted);
	padding: 0.3rem 0;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.ooteach-cal-cell {
	min-height: 74px;
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--ooteach-border);
	border-radius: 6px;
	padding: 4px;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.ooteach-cal-cell.is-empty {
	background: transparent;
	border-color: transparent;
}

.ooteach-cal-daynum {
	font-size: 0.72rem;
	color: var(--ooteach-muted);
	text-align: right;
}

.ooteach-cal-cell.is-today {
	border-color: var(--ooteach-accent);
	box-shadow: inset 0 0 0 1px var(--ooteach-accent);
}

.ooteach-cal-event {
	display: block;
	max-width: 100%;
	font-size: 0.72rem;
	line-height: 1.25;
	text-decoration: none;
	color: #fff;
	background: var(--ooteach-accent);
	border-radius: 4px;
	padding: 2px 5px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
}

.ooteach-cal-event.is-past {
	background: #b7bfb8;
}

.ooteach-cal-event:hover {
	filter: brightness(0.94);
}

.ooteach-cal-undated {
	margin: 1rem 0 0;
	padding: 0.75rem 1rem;
	border: 1px dashed var(--ooteach-border);
	border-radius: 8px;
}

.ooteach-cal-undated-title {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--ooteach-muted);
	margin: 0 0 0.4rem;
}

.ooteach-cal-undated ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.ooteach-cal-undated a {
	font-size: 0.82rem;
	text-decoration: none;
	color: #1f2723;
	border: 1px solid var(--ooteach-border);
	border-radius: 999px;
	padding: 0.25rem 0.75rem;
}

.ooteach-cal-undated a:hover {
	border-color: var(--ooteach-accent);
	color: var(--ooteach-accent);
}

/* --- Zustände --- */
.ooteach-notice,
.ooteach-error,
.ooteach-empty {
	padding: 0.85rem 1rem;
	border-radius: 8px;
	font-size: 0.9rem;
}

.ooteach-notice {
	background: #fff8e5;
	border: 1px solid #f2e2ad;
	color: #6b5a1e;
}

.ooteach-error {
	background: #fdecec;
	border: 1px solid #f3bcbc;
	color: #8a2a2a;
}

.ooteach-empty {
	background: #f2f4f1;
	border: 1px solid var(--ooteach-border);
	color: var(--ooteach-muted);
}

/* --- „Alle anzeigen"-Button / Claim --- */
.ooteach-showall {
	margin-top: 1.5rem;
	text-align: center;
}

.ooteach-showall-title {
	font-weight: 700;
	font-size: 1.05rem;
	color: #1f2723;
	margin-bottom: 0.3rem;
}

.ooteach-showall-sub {
	font-size: 0.92rem;
	color: var(--ooteach-muted);
	max-width: 44ch;
	margin: 0 auto 0.9rem;
	line-height: 1.45;
}

.ooteach-showall-btn {
	display: inline-block;
	text-decoration: none;
	color: #fff;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.2;
	padding: 0.7rem 1.6rem;
	border-radius: 8px;
	transition: filter 0.15s ease, transform 0.15s ease;
}

.ooteach-showall-btn:hover,
.ooteach-showall-btn:focus-visible {
	filter: brightness(0.93);
	transform: translateY(-1px);
	color: #fff;
}

/* --- Backend-Vorschau --- */
.ooteach-preview-box {
	margin-top: 0.5rem;
	padding: 1.25rem;
	background: #fbfcfb;
	border: 1px solid var(--ooteach-border);
	border-radius: 10px;
	max-width: 1000px;
}

@media (max-width: 600px) {
	.ooteach-cal-cell {
		min-height: 56px;
	}
	.ooteach-cal-event {
		font-size: 0.65rem;
	}
}
