/* =============================================================
 * Rebus Bücherbus — Frontend-Styles
 * Theme via CSS-Variablen anpassbar (Override in deinem Theme-CSS):
 *   .rebus-bb-frontend { --rbb-accent: #002d5b; }
 * ============================================================= */

.rebus-bb-frontend {
	--rbb-accent:  #263286;
	--rbb-accent2: #9DC31A;
	--rbb-line:    #e5e7eb;
	--rbb-muted:   #6b7280;
	--rbb-soft:    #f9fafb;
	--rbb-tint:    #eef0fa;
	font-family: inherit;
}

/* ---- Generische Tabellen (Detail-View, Tourenplan) ---------- */
.rebus-bb-frontend table {
	width: 100%;
	border-collapse: collapse;
	margin: 1em 0;
}
.rebus-bb-frontend th,
.rebus-bb-frontend td {
	padding: 6px 10px;
	text-align: left;
	border-bottom: 1px solid #e5e5e5;
	vertical-align: top;
}
.rebus-bb-frontend th {
	background: #f6f7f7;
	font-weight: 600;
}

/* ---- Haltestellen-Liste (alphabetisch, mehrspaltig) -------- */
.rebus-bb-stops-list {
	list-style: none;
	padding: 0;
	margin: 0;
	columns: 2;
	column-gap: 2em;
}
.rebus-bb-stops-list li {
	padding: 4px 0;
	break-inside: avoid;
}
@media (max-width: 600px) {
	.rebus-bb-stops-list { columns: 1; }
}

/* ---- Tourenplan: Wochentag-Tabs ---------------------------- */
.rebus-bb-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	border-bottom: 2px solid #ddd;
	margin-bottom: 1em;
}
.rebus-bb-tab {
	background: #f6f7f7;
	border: 1px solid #ddd;
	border-bottom: 0;
	padding: 6px 12px;
	cursor: pointer;
	border-radius: 4px 4px 0 0;
	font: inherit;
}
.rebus-bb-tab.is-active {
	background: #fff;
	border-color: #aaa;
	font-weight: 600;
}
.rebus-bb-tab small {
	font-weight: normal;
	color: #666;
	margin-left: 4px;
}

.rebus-bb-tour-panel { display: none; }
.rebus-bb-tour-panel.is-active { display: block; }

.rebus-bb-next-dates {
	background: #f0f6fc;
	padding: 8px 12px;
	border-radius: 4px;
}

.rebus-bb-tour-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	flex-wrap: wrap;
}
.rebus-bb-pdf-actions { display: inline-flex; gap: 6px; }
.rebus-bb-pdf-link {
	font-size: 0.85em;
	font-weight: 500;
	padding: 4px 10px;
	border-radius: 4px;
	background: var(--rbb-accent);
	color: #fff;
	text-decoration: none;
	white-space: nowrap;
}
.rebus-bb-pdf-link:hover { filter: brightness(1.1); color: #fff; }
.rebus-bb-pdf-link.secondary {
	background: transparent;
	border: 1px solid var(--rbb-accent);
	color: var(--rbb-accent);
}
.rebus-bb-pdf-link.secondary:hover { background: var(--rbb-tint); color: var(--rbb-accent); }

/* ===========================================================
 * Widget: Nächste Termine (Karten-Slider)
 * =========================================================== */

.rebus-bb-empty {
	color: var(--rbb-muted);
	font-style: italic;
	padding: 1em 0;
}

.rebus-bb-days-wrap { position: relative; }

/* Prev/Next-Buttons (oben rechts) */
.rebus-bb-slider-nav {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-bottom: 10px;
}
.rebus-bb-slider-btn {
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--rbb-line);
	background: #fff;
	color: var(--rbb-accent);
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, opacity 0.15s;
}
.rebus-bb-slider-btn:hover:not(:disabled) { background: var(--rbb-tint); }
.rebus-bb-slider-btn:disabled { opacity: 0.35; cursor: default; }

/* Slider-Schiene */
.rebus-bb-days {
	display: flex;
	gap: 1em;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 6px;
	scrollbar-width: thin;
}
.rebus-bb-days::-webkit-scrollbar { height: 6px; }
.rebus-bb-days::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* Tages-Karte */
.rebus-bb-day {
	flex: 0 0 calc((100% - 2em) / 3); /* 3 sichtbar @ Desktop, 2 × 1em gap */
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	min-width: 0;
	border: 1px solid var(--rbb-line);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}
.rebus-bb-day.has-badge { border-color: var(--rbb-accent); }

/* Karten-Header (Datum + Wochentag + Badge) */
.rebus-bb-day-header {
	display: flex;
	align-items: baseline;
	gap: 12px;
	padding: 12px 16px;
	background: var(--rbb-soft);
	border-bottom: 1px solid var(--rbb-line);
}
.rebus-bb-day.has-badge .rebus-bb-day-header { background: var(--rbb-tint); }
.rebus-bb-day-date {
	font-size: 1.6em;
	font-weight: 700;
	color: var(--rbb-accent);
	line-height: 1;
}
.rebus-bb-day-meta { display: flex; flex-direction: column; gap: 2px; }
.rebus-bb-day-weekday { font-weight: 600; }
.rebus-bb-day-badge {
	align-self: flex-start;
	display: inline-block;
	padding: 2px 8px;
	font-size: 0.75em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #fff;
	background: var(--rbb-accent);
	border-radius: 999px;
}

/* Karten-Body: Tour-Blöcke */
.rebus-bb-day-tours {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 8px 16px 12px;
}
.rebus-bb-tour-block {
	padding-top: 10px;
	border-top: 1px dashed var(--rbb-line);
}
.rebus-bb-tour-block:first-child {
	padding-top: 0;
	border-top: 0;
}
.rebus-bb-tour-title {
	margin: 0 0 6px;
	font-size: 0.95em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--rbb-accent);
}

/* Stops-Liste innerhalb eines Tour-Blocks */
.rebus-bb-stoplist {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}
.rebus-bb-stoplist li {
	display: grid;
	grid-template-columns: 7.5em 1fr;
	column-gap: 1.5em;
	align-items: baseline;
	padding: 6px 0;
	border-bottom: 1px solid #f3f4f6;
}
.rebus-bb-stoplist li:last-child { border-bottom: 0; }

.rebus-bb-stop-time {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	color: #111827;
	font-size: 0.92em;
	white-space: nowrap;
}
.rebus-bb-stop-time-abfahrt {
	color: var(--rbb-muted);
	font-weight: 400;
}

.rebus-bb-stop-place {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}
.rebus-bb-stop-ort  { font-weight: 600; }
.rebus-bb-stop-halt { color: var(--rbb-muted); font-size: 0.88em; }

/* Slider-Breakpoints */
@media (max-width: 1024px) {
	.rebus-bb-day { flex: 0 0 calc((100% - 1em) / 2); } /* 2 Karten */
}
@media (max-width: 640px) {
	.rebus-bb-day { flex: 0 0 100%; }                   /* 1 Karte */
}
@media (max-width: 480px) {
	.rebus-bb-stoplist li { grid-template-columns: 6.5em 1fr; column-gap: 1em; }
	.rebus-bb-day-date { font-size: 1.4em; }
}

/* ===========================================================
 * Widget: Suche
 * =========================================================== */

#rebus-bb-search-input {
	width: 100%;
	max-width: 480px;
	padding: 8px 12px;
	font-size: 16px;
	border: 1px solid #ccc;
	border-radius: 4px;
}
#rebus-bb-search-results { margin-top: 1em; }

.rebus-bb-search-result {
	padding: 10px;
	border-bottom: 1px solid #eee;
}
.rebus-bb-search-result strong { display: block; }
.rebus-bb-search-result .meta {
	color: #666;
	font-size: 0.9em;
}
.rebus-bb-search-empty {
	color: #888;
	font-style: italic;
	padding: 8px 0;
}
