/* =========================================================
   Variablen
   ========================================================= */
.rstermin-calendar-grid {
    --header-h: 25px;
    --cell-h: 100px;
    --cell-pad: -5px;
    --event-h: 18px;
    --event-gap: 4px;
}

/* =========================================================
   Grundlayout
   ========================================================= */
.rstermin-calendar {
    margin: 0 auto;
    font-family: inherit;
}

.rstermin-calendar-desc {
	padding: 0.8rem 0;
}

.rstermin-calendar h1, .rstermin-calendar h3 {
  font-family: 'Open Sans', sans-serif;
}

/* =========================================================
   Navigation
   ========================================================= */
.rstermin-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.1rstermin-calendar-nav a {
    text-decoration: none;
    font-size: 1.8rem;
    padding: 0 0.5rem;
    background: #0066cc;
    color: #ffffff;
    cursor: pointer;
    border-radius: 5px;
    transition: background .2s;
}

.rstermin-calendar-nav .nav-title {
    font-weight: 600;
}

.rstermin-nav-prev, .rstermin-nav-next {
    display: inline-block;
    padding: 5px 30px;
    background: #0066cc;
    color: #ffffff;
    border-radius: 5px;
    text-decoration: none;
    transition: 0.2s ease;
}

.rstermin-nav-prev:hover,
.rstermin-nav-next:hover,
.rstermin-nav-prev:active,
.rstermin-nav-next:active,
.rstermin-nav-prev:focus,
.rstermin-nav-next:focus {
  background: #ac1313;
  color: #fff;
  text-decoration: underline dotted;
}

/* =========================================================
   Kalender Grid Container
   ========================================================= */
.rstermin-calendar-grid {
    border-top: 1px solid #d0d0d0;
    border-right: 1px solid #d0d0d0;
    border-left: 1px solid #d0d0d0;
    background: #fff;
}

/* =========================================================
   Header Calendar
   ========================================================= */
.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    height: var(--header-h);
    background: #f5f6f7;
    border-bottom: 1px solid #d0d0d0;
}

.calendar-header-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.8rem;
    border-right: 1px solid #e0e0e0;
    box-sizing: border-box;
}

.calendar-header-cell:nth-child(7n) {
    border-right: none;
}

/* =========================================================
   Header EventList
   ========================================================= */
/* Header: Titel + Controls */
.rstermin-list-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	border-top: 2px solid #ddd;
}

/* Rechte Seite: alles in EINER Zeile */
.rstermin-list-controls {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	white-space: nowrap;
}

/* Umschalter */
.rstermin-mode-switch {
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.nav-year a, .nav-saison a {
    min-width: 80px;
    padding: 0px 10px;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #006cd9;
    background: #fff;
    border: 1px solid #5395d7;
    text-decoration: none;
    transition: background 0.2s ease;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

.nav-year a:hover, .nav-saison a:hover, .rstermin-list-nav a:hover {
	color: #ffffff;
	background: #ac1313;
	text-decoration: none;
}

/* Text "Filtern nach" */
.rstermin-list-filter {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

/* Trennzeichen */
.rstermin-list-divider, .rstermin-divider-line {
	margin: 0 0.25rem;
}

.rstermin-activ-filter {
	color: #ac1313;
}

/* Navigation */
.rstermin-list-nav {
	display: flex;
	align-items: center;
	gap: 0.8rem;
}

/* Buttons */
.nav-prev-btn,
.nav-next-btn,
.mode-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.rstermin-list-nav a {
	font-size: 0.8rem;
	background: #0066cc;
	color: #ffffff;
	padding: 5px 10px;
	border-radius: 3px;
	text-decoration: none;
}


/* =========================================================
   Kalender Body
   ========================================================= */
.calendar-body {
    position: relative;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: var(--cell-h);
}

.calendar-cell {
    position: relative;
    padding: var(--cell-pad);
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    box-sizing: border-box;
    background: #fff;
}

.calendar-cell:nth-child(7n) {
    border-right: none;
}

.calendar-cell.other-month {
    background: #fafafa;
    color: #aaa;
}

.day-number {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 0 4px 4px;
}

/* =========================================================
   Overlay Events
   ========================================================= */
.rstermin-events-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.event-item {
    position: absolute;
    height: var(--event-h);
    line-height: var(--event-h);
    border-radius: 3px;
    padding: 0 6px;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    font-size: .7rem;
	font-weight: 600;
    color: #111;
    pointer-events: auto;
    text-decoration: none;
}

.event-text {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* =========================================================
   Legende
   ========================================================= */
.rstermin-no-legend {
    height: 20px;
}

.rstermin-legend-title {
    margin: 10px 0 0 0;
    font-weight: 600;
    font-size: 1.1rem;
    font-style: italic;
}

.rstermin-legend {
    margin: 0.5rem 0 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    gap: 0.4rem;
    padding-left: 3px;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

/* =========================================================
   Liste / Monatsüberschriften nur in EventList
   ========================================================= */

.rstermin-event-list {
	border-top: 2px solid #ddd;
}

.rstermin-month-title {
	margin: 0.6rem 0 0.4rem;
	font-size: 0.9rem;
	font-weight: 600;
	color: #0066cc;
	border-bottom: 1px solid #ddd;
}

/* =========================================================
   Terminliste
   ========================================================= */

.rstermin-event {
    scroll-margin-top: 140px;
}

.rstermin-list-title {
    font-weight: 500;
    font-size: 1.3rem;
	margin-top: .5rem;
}

.rstermin-event,
.rstermin-no-events {
    border-top: 0px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.rstermin-event-summary {
	display: flex;
	align-items: center;
	column-gap: 0.8rem;
	padding: 0.4rem 0;
	cursor: pointer;
	font-weight: 600;
	justify-content: space-between;
	font-size: 0.9rem;
	list-style: none;
}

.rstermin-eventlist-summary {
	display: grid;
	grid-template-columns: 285px 1fr auto;
	align-items: center;
	column-gap: 0.8rem;
	padding: 0.4rem 0;
	cursor: pointer;
	font-weight: 600;
	justify-content: space-between;
	font-size: 0.8rem;
	list-style: none;
}

.rstermin-eventlist-summary-left {
	white-space: nowrap;
	padding-right: 0.5rem;
}

.rstermin-eventlist-summary-center {
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rstermin-eventlist-summary-right {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	white-space: nowrap;
}

/* Summary-Link – kompakt */
.rstermin-event-summary-link {
	margin-left: auto;
	font-size: 0.8rem;
	padding: 0.15rem 0.4rem;
    border-radius: 3px;
    color: #006cd9;
    background: #fff;
    border: 1px solid #5395d7;
    text-decoration: none;
    transition: background 0.2s ease;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

.rstermin-event-summary-link:hover, .rstermin-event-summary-link a:hover {
	color: #ffffff;
	background: #ac1313;
	text-decoration: none;
}

.event-summary-arrow {
    width: 0;
    height: 0;
    margin-left: 0.5rem;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid #333;
    transition: transform 0.2s ease;
}

.rstermin-event[open] .event-summary-arrow {
    transform: rotate(90deg);
}

.rstermin-event-summary-datetime {
    padding-right: 8px;
    margin-right: 8px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.rstermin-event-summary-titel {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-left: 10px;
}

/* =========================================================
   Detailansicht – NEU
   ========================================================= */
.rstermin-event-details {
    padding: 0.6rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Top-Bereich: Infos + Aktionen */
.detail-eventlist-top {
	display: flex;
	gap: 1rem;
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
	flex: 1;
}

.detail-eventlist-row {
	display: flex;
	gap: 0.4rem;
	font-size: 0.9rem;
	margin-bottom: 0.25rem;
}

.detail-label {
    font-weight: 600;
    font-size: 0.8rem;
	white-space: nowrap;
}

.detail-value {
    font-size: 0.8rem;
    word-break: break-word;
}

/* Aktionen / Downloads */
.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
	flex-wrap: wrap;
}

.detail-download {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #0066cc;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.8rem;
    text-align: center;
	white-space: nowrap;
}

.detail-download:hover {
	background: #ac1313;
	color: #ffffff;
	text-decoration: none;
}

.detail-actions:active a,
.detail-actions a:focus {
	color: #fff;
}

/* Bemerkungen immer volle Breite */
.detail-remarks-full {
	margin-top: 0.5rem;
	font-size: 0.9rem;
}


/* =========================================================
   Mobile
   ========================================================= */
@media (max-width: 768px) {

	.rstermin-list-title {
		display: none;
	}

	.rstermin-list-controls {
		padding: 10px 0;
	}

	.rstermin-divider-line {
		display: none;
	}

	.rstermin-calendar-desc {
		font-size: 0.9rem;
	}

	.rstermin-list-header {
		flex-direction: column;
		align-items: stretch;
		gap: 0.5rem;
	}

	.rstermin-list-controls {
		flex-wrap: wrap;
		white-space: normal;
		row-gap: 0.4rem;
	}

	.rstermin-mode-switch {
		flex-wrap: wrap;
	}

	.rstermin-list-nav {
		justify-content: space-between;
		width: 100%;
	}

	.rstermin-eventlist-summary, .rstermin-event-summary {
		grid-template-columns: 1fr;
		row-gap: 0.25rem;
	}

	.rstermin-eventlist-summary-left, .rstermin-event-summary {
		font-size: 0.8rem;
	}

	.rstermin-eventlist-summary-center, .rstermin-event-summary-center {
		font-size: 0.9rem;
	}

	/* RECHTER BEREICH: Links eng & zentriert */
	.rstermin-eventlist-summary-right, .rstermin-event-summary-right {
		justify-content: center;
		gap: 0.25rem;
		flex-wrap: wrap;
	}

	/* margin-left nur mobil neutralisieren */
	.rstermin-event-summary-link {
		margin-left: 0;
	}

	.event-summary-arrow {
		display: none;
	}

	.detail-eventlist-top {
		flex-direction: column;
	}

	.detail-actions {
		flex-direction: row;
		gap: 0.3rem;
	}
}
