/* Jobwoche Event-Slider — Gestaltung
 *
 * Werte 1:1 aus jobwoche1.de: der Block "HERO EVENT SLIDER" in
 * public/index.html (Klassen .hslider-*) und die Inline-Stile aus
 * public/js/layout/hero.js. Die Klassen heissen hier .jwes-*, damit sie
 * sich mit nichts im Theme mh-magazine beissen.
 *
 * Eigene Variablen statt der globalen --p / --tx / --surface aus der
 * Anwendung: in WordPress gibt es die nicht, und ein Theme koennte
 * gleichnamige Namen anders belegen. --jwes-p, --jwes-tx, --jwes-font-*
 * setzt das Plugin pro Einbindung inline aus den Design-Werten der API.
 */

.jwes {
	/* Brand — wird inline aus /api/v1/design ueberschrieben */
	--jwes-p:          #059669;
	--jwes-tx:         #111827;
	--jwes-tx2:        #374151;
	--jwes-tx3:        #6b7280;
	--jwes-surface:    #ffffff;
	--jwes-border:     #e2e8f0;
	--jwes-border2:    #d1d9d6;
	--jwes-shadow-xs:  0 1px 2px rgba(0,0,0,.05);
	--jwes-font-head:  'Outfit', 'Plus Jakarta Sans', sans-serif;
	--jwes-font-body:  'DM Sans', 'Inter', sans-serif;
	--jwes-cols:       4;

	margin: 0 0 24px;
	box-sizing: border-box;
}
.jwes *, .jwes *::before, .jwes *::after { box-sizing: border-box; }

/* ── Kopfzeile ─────────────────────────────────────────────────────
   flex-wrap, min-width:0 und nowrap sind kein Schmuck: ohne sie brach
   auf dem Handy das Abzeichen mitten im Satz um ("In" / "deiner Naehe")
   und der Pfeil von "Alle" rutschte in eine zweite Zeile. */
.jwes-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px 12px;
	flex-wrap: wrap;
	margin: 0 0 10px;
}
.jwes-headline {
	font-family: var(--jwes-font-head);
	font-size: 20px;
	font-weight: 800;
	color: var(--jwes-tx);
	line-height: 1.25;
	min-width: 0;
}
.jwes-badge {
	font-size: 10.5px;
	background: #dcfce7;
	color: #166534;
	padding: 2px 8px;
	border-radius: 5px;
	font-weight: 700;
	margin-left: 8px;
	white-space: nowrap;
	display: inline-block;
	vertical-align: middle;
}
.jwes-badge[hidden] { display: none; }

.jwes-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.jwes-nav-btn {
	width: 28px; height: 28px; border-radius: 50%;
	background: var(--jwes-surface);
	border: 1.5px solid var(--jwes-border);
	cursor: pointer; font-size: 14px; line-height: 1;
	display: flex; align-items: center; justify-content: center;
	transition: all .12s; color: var(--jwes-tx2);
	box-shadow: var(--jwes-shadow-xs);
	padding: 0; margin: 0;
	font-family: inherit;
	-webkit-appearance: none; appearance: none;
	text-shadow: none;
}
.jwes-nav-btn:hover,
.jwes-nav-btn:focus-visible { background: var(--jwes-p); color: #fff; border-color: var(--jwes-p); }
.jwes-nav-btn[disabled] { opacity: .35; cursor: default; }
.jwes-nav-btn[disabled]:hover { background: var(--jwes-surface); color: var(--jwes-tx2); border-color: var(--jwes-border); }

.jwes-all {
	color: var(--jwes-p);
	font-size: 12px;
	font-weight: 600;
	margin-left: 4px;
	white-space: nowrap;
	text-decoration: none;
	font-family: var(--jwes-font-body);
	box-shadow: none;
}
.jwes-all:hover, .jwes-all:focus { color: var(--jwes-p); text-decoration: underline; }

/* ── Schiene ──────────────────────────────────────────────────────── */
.jwes-viewport { position: relative; overflow: hidden; border-radius: 14px; }

.jwes-track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc(100% / var(--jwes-cols) - 9px);
	gap: 12px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.jwes-track::-webkit-scrollbar { display: none; }

/* ── Kachel ───────────────────────────────────────────────────────── */
.jwes-card {
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
	display: flex; flex-direction: column;
	transition: transform .16s ease, box-shadow .16s ease;
	box-shadow: 0 3px 12px rgba(0,0,0,.14);
	background: var(--jwes-surface);
	text-decoration: none;
	color: inherit;
	min-width: 0;
}
.jwes-card:hover,
.jwes-card:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 10px 28px rgba(0,0,0,.22);
	text-decoration: none;
	color: inherit;
}
.jwes-card[hidden] { display: none; }

.jwes-bg { position: relative; display: block; height: 130px; flex-shrink: 0; overflow: hidden; }
.jwes-bg img {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: cover;
	max-width: none; border: 0; border-radius: 0;
	display: block; margin: 0; padding: 0;
	box-shadow: none;
}

.jwes-content {
	display: block;
	padding: 9px 11px 10px;
	background: var(--jwes-surface);
	overflow: visible;
}
.jwes-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-family: var(--jwes-font-head);
	font-size: 13px;
	font-weight: 700;
	color: var(--jwes-tx);
	line-height: 1.3;
	margin-bottom: 4px;
	white-space: normal;
}
.jwes-meta {
	display: block;
	font-size: 11.5px;
	color: var(--jwes-tx3);
	font-family: var(--jwes-font-body);
	line-height: 1.35;
}
.jwes-dist[hidden] { display: none; }

/* ── Punkte ───────────────────────────────────────────────────────── */
.jwes-dots { display: flex; justify-content: center; gap: 5px; margin-top: 10px; }
.jwes-dot {
	width: 7px; height: 7px;
	border-radius: 4px;
	background: var(--jwes-border2);
	border: none; cursor: pointer;
	transition: all .2s;
	padding: 0; margin: 0;
	-webkit-appearance: none; appearance: none;
	box-shadow: none;
}
.jwes-dot.is-active { width: 18px; background: var(--jwes-p); }

/* ── Hinweis fuer die Redaktion (nur fuer Angemeldete sichtbar) ───── */
.jwes-leer { color: #996800; font-style: italic; }

/* ── Schmalere Fenster: gleiche Schwellen wie in der Anwendung ────── */
@media (max-width: 900px) {
	.jwes-track { grid-auto-columns: calc(33.33% - 8px); }
}
@media (max-width: 600px) {
	.jwes-track { grid-auto-columns: calc(80% - 6px); }
	.jwes-card { height: auto; min-height: 0; }
	.jwes-bg { height: 140px; }
	.jwes-content { padding: 8px 10px 10px; white-space: normal; }
	.jwes-headline { font-size: 18px; }
}

/* Wer Bewegung im Betriebssystem abbestellt hat, bekommt keine. */
@media (prefers-reduced-motion: reduce) {
	.jwes-track { scroll-behavior: auto; }
	.jwes-card { transition: none; }
	.jwes-card:hover { transform: none; }
}
