/*
 * mod_huawei_trainings — Stylesheet
 * ---------------------------------------------------------------
 * Light card-grid look, aligned with the other Netcamp modules
 * (mod_memberdashboard, mod_membershipbenefits, ...): white cards,
 * soft shadows, rounded corners, brand blue (#2957aa) as the single
 * accent. Status colours (green/amber/red/grey) carry real meaning —
 * they mirror the date status — everything else stays neutral.
 */

.hwt-module {
	--hwt-primary: #2957aa;
	--hwt-primary-dark: #1f4382;
	--hwt-primary-soft: rgba(41, 87, 170, 0.08);
	--hwt-bg-surface: #ffffff;
	--hwt-bg-surface-raised: #f4f6fa;
	--hwt-border: #e1e6ed;
	--hwt-text: #1c2533;
	--hwt-text-dim: #69748a;
	--hwt-ok: #1ea672;            /* garantiert */
	--hwt-warn: #d18a1c;          /* geplant */
	--hwt-danger: #d6453d;        /* ausgebucht / abgesagt */
	--hwt-neutral: #98a2b3;       /* auf Anfrage */
	--hwt-radius: 12px;
	--hwt-font-body: -apple-system, 'Segoe UI', Roboto, system-ui, Helvetica, Arial, sans-serif;

	color: var(--hwt-text);
	font-family: var(--hwt-font-body);
	-webkit-font-smoothing: antialiased;
}

.hwt-module * {
	box-sizing: border-box;
}

.hwt-module a {
	color: inherit;
	text-decoration: none;
}

/* ---------------------------------------------------------------
   Toolbar
   --------------------------------------------------------------- */

.hwt-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: center;
	background: var(--hwt-bg-surface-raised);
	border: 1px solid var(--hwt-border);
	border-radius: var(--hwt-radius);
	padding: 0.85rem 1rem;
	margin-bottom: 1.5rem;
}

.hwt-search {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: var(--hwt-bg-surface);
	border: 1px solid var(--hwt-border);
	border-radius: 8px;
	padding: 0.5rem 0.75rem;
	flex: 1 1 220px;
	min-width: 0;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hwt-search:focus-within {
	border-color: var(--hwt-primary);
	box-shadow: 0 0 0 3px var(--hwt-primary-soft);
}

.hwt-search__prompt {
	display: inline-flex;
	color: var(--hwt-text-dim);
	flex-shrink: 0;
}

.hwt-search__prompt svg {
	width: 15px;
	height: 15px;
	stroke: currentColor;
	fill: none;
}

.hwt-search input[type="search"] {
	flex: 1;
	min-width: 0;
	background: transparent;
	border: none;
	color: var(--hwt-text);
	font-family: inherit;
	-webkit-appearance: none;
	appearance: none;
	/* 16px minimum, not 0.9rem (14.4px): below 16px, iOS Safari zooms the
	   whole page in on focus, which is what made this field look huge on
	   mobile - it wasn't the field growing, it was the page zooming. */
	font-size: 16px;
}

.hwt-search input[type="search"]:focus {
	outline: none;
}

.hwt-search__submit {
	flex-shrink: 0;
}

.hwt-toolbar select {
	background: var(--hwt-bg-surface);
	border: 1px solid var(--hwt-border);
	color: var(--hwt-text);
	border-radius: 8px;
	padding: 0.5rem 0.6rem;
	font-size: 0.85rem;
	font-family: inherit;
	max-width: 170px;
}

.hwt-toolbar select:focus {
	border-color: var(--hwt-primary);
	outline: none;
}

.hwt-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.82rem;
	color: var(--hwt-text-dim);
	white-space: nowrap;
}

.hwt-toggle input {
	accent-color: var(--hwt-primary);
}

.hwt-toolbar__reset {
	background: transparent;
	border: 1px solid var(--hwt-border);
	color: var(--hwt-text-dim);
	border-radius: 8px;
	padding: 0.5rem 0.85rem;
	font-size: 0.82rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.hwt-toolbar__reset:hover {
	border-color: var(--hwt-primary);
	color: var(--hwt-primary);
	background: var(--hwt-primary-soft);
}

/* ---------------------------------------------------------------
   Grid
   --------------------------------------------------------------- */

.hwt-grid-wrap {
	position: relative;
}

.hwt-grid-wrap.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

.hwt-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.25rem;
}

.hwt-empty {
	color: var(--hwt-text-dim);
	background: var(--hwt-bg-surface-raised);
	border: 1px dashed var(--hwt-border);
	border-radius: var(--hwt-radius);
	padding: 2rem;
	text-align: center;
}

/* ---------------------------------------------------------------
   Card
   --------------------------------------------------------------- */

.hwt-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--hwt-bg-surface);
	border: 1px solid var(--hwt-border);
	border-radius: var(--hwt-radius);
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
	transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.hwt-card:hover {
	transform: translateY(-3px);
	border-color: var(--hwt-primary);
	box-shadow: 0 14px 28px -16px rgba(16, 24, 40, 0.22);
}

.hwt-card__strip {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	z-index: 1;
}

.hwt-card__strip.is-ok { background: var(--hwt-ok); }
.hwt-card__strip.is-warn { background: var(--hwt-warn); }
.hwt-card__strip.is-danger { background: var(--hwt-danger); }
.hwt-card__strip.is-neutral { background: var(--hwt-neutral); }

.hwt-card__media {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--hwt-bg-surface-raised);
}

.hwt-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.hwt-card:hover .hwt-card__media img {
	transform: scale(1.04);
}

.hwt-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	padding: 1.1rem 1.2rem 1.3rem;
	flex: 1;
}

.hwt-card__badges {
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.hwt-badge {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	padding: 0.22rem 0.55rem;
	border-radius: 100px;
	border: 1px solid var(--hwt-border);
	color: var(--hwt-text-dim);
	background: var(--hwt-bg-surface-raised);
}

.hwt-badge--level {
	color: var(--hwt-primary);
	border-color: var(--hwt-primary-soft);
	background: var(--hwt-primary-soft);
}

.hwt-badge--cert {
	color: var(--hwt-text-dim);
}

.hwt-card__title {
	font-size: 1.12rem;
	font-weight: 700;
	line-height: 1.35;
	margin: 0;
	color: var(--hwt-text);
}

.hwt-card__title a:hover {
	color: var(--hwt-primary);
}

.hwt-card__meta {
	font-size: 0.8rem;
	color: var(--hwt-text-dim);
	margin: 0;
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.hwt-card__teaser {
	font-size: 0.88rem;
	color: var(--hwt-text-dim);
	line-height: 1.5;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hwt-card__date-row {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.85rem;
	margin-top: 0.2rem;
}

.hwt-card__date-line {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	min-width: 0;
}

.hwt-card__date-line .hwt-card__date-label,
.hwt-card__date-line .hwt-card__date-value,
.hwt-card__date-line .hwt-card__date-value--request {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hwt-card__status-line {
	display: flex;
	padding-left: 1.25rem; /* aligns with the text after the dot above */
}

.hwt-card__end-date-line {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	padding-left: 1.25rem; /* aligns with the text after the dot above */
	font-size: 0.78rem;
	color: var(--hwt-text-dim);
}

.hwt-card__city-line {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	padding-left: 1.25rem; /* aligns with the text after the dot above */
	font-size: 0.78rem;
	color: var(--hwt-text-dim);
}

.hwt-card__city-icon {
	display: inline-flex;
	width: 12px;
	height: 12px;
	flex-shrink: 0;
	color: var(--hwt-primary);
}

.hwt-card__city-icon svg {
	width: 100%;
	height: 100%;
}

.hwt-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}

.hwt-dot.is-ok { background: var(--hwt-ok); }
.hwt-dot.is-warn { background: var(--hwt-warn); }
.hwt-dot.is-danger { background: var(--hwt-danger); }
.hwt-dot.is-neutral { background: var(--hwt-neutral); }

.hwt-card__date-label {
	color: var(--hwt-text-dim);
	flex-shrink: 0;
}

.hwt-card__date-value {
	font-weight: 600;
	color: var(--hwt-text);
}

.hwt-card__date-value--request {
	color: var(--hwt-text-dim);
	font-style: italic;
	font-weight: 400;
}

.hwt-card__status-label {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.hwt-card__status-label.is-ok { color: var(--hwt-ok); }
.hwt-card__status-label.is-warn { color: var(--hwt-warn); }
.hwt-card__status-label.is-danger { color: var(--hwt-danger); }

/* Seat-utilisation gauge */

.hwt-gauge {
	position: relative;
	height: 18px;
	background: var(--hwt-bg-surface-raised);
	border: 1px solid var(--hwt-border);
	border-radius: 100px;
	overflow: hidden;
}

.hwt-gauge__fill {
	position: absolute;
	inset: 0 auto 0 0;
	display: block;
	opacity: 0.55;
}

.hwt-gauge__fill.is-ok { background: var(--hwt-ok); }
.hwt-gauge__fill.is-warn { background: var(--hwt-warn); }
.hwt-gauge__fill.is-danger { background: var(--hwt-danger); }
.hwt-gauge__fill.is-neutral { background: var(--hwt-neutral); }

.hwt-gauge__label {
	position: relative;
	z-index: 1;
	display: block;
	text-align: center;
	font-size: 0.68rem;
	font-weight: 600;
	line-height: 18px;
	color: var(--hwt-text);
	letter-spacing: 0.02em;
}

.hwt-card__footer {
	margin-top: auto;
	padding-top: 0.7rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem;
	border-top: 1px solid var(--hwt-border);
}

.hwt-card__price {
	font-weight: 700;
	font-size: 0.95rem;
	white-space: nowrap;
	color: var(--hwt-text);
}

.hwt-card__price-vat {
	display: block;
	font-weight: 400;
	font-size: 0.68rem;
	color: var(--hwt-text-dim);
	white-space: nowrap;
}

.hwt-card__actions {
	display: flex;
	gap: 0.45rem;
}

.hwt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.8rem;
	font-weight: 600;
	padding: 0.5rem 0.9rem;
	border-radius: 8px;
	white-space: nowrap;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hwt-module .hwt-btn--ghost {
	border: 1px solid var(--hwt-border);
	color: var(--hwt-text-dim);
	background: var(--hwt-bg-surface);
}

.hwt-module .hwt-btn--ghost:hover {
	border-color: var(--hwt-primary);
	color: var(--hwt-primary);
	background: var(--hwt-primary-soft);
}

.hwt-module .hwt-btn--primary {
	background: var(--hwt-primary);
	color: #fff;
}

.hwt-module .hwt-btn--primary:hover {
	background: var(--hwt-primary-dark);
	color: #fff;
}

/* ---------------------------------------------------------------
   Accessibility
   --------------------------------------------------------------- */

.hwt-module a:focus-visible,
.hwt-module button:focus-visible,
.hwt-module input:focus-visible,
.hwt-module select:focus-visible {
	outline: 2px solid var(--hwt-primary);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.hwt-card,
	.hwt-card__media img {
		transition: none !important;
	}
	.hwt-card:hover {
		transform: none;
	}
}

@media (max-width: 540px) {
	.hwt-toolbar {
		flex-direction: column;
		align-items: stretch;
	}
	.hwt-search {
		/* flex: 1 1 220px on .hwt-search is meant as a minimum WIDTH for
		   the desktop row layout. Once the toolbar switches to a column
		   direction here, the main axis becomes vertical, so that same
		   "220px" flex-basis gets reinterpreted as a HEIGHT instead -
		   that's what was making the search box render ~220px tall on
		   mobile. Resetting the basis to auto fixes it. */
		flex: 1 1 auto;
	}
	.hwt-toolbar select {
		max-width: none;
	}
}

/* ---------------------------------------------------------------
   Detail page
   --------------------------------------------------------------- */

.hwt-btn--sm { font-size: 0.72rem; padding: 0.35rem 0.65rem; }
.hwt-btn--lg { font-size: 0.92rem; padding: 0.7rem 1.3rem; }
.hwt-btn--block { display: flex; width: 100%; margin-top: 0.8rem; }

.hwt-detail-back {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--hwt-primary);
	background: var(--hwt-primary-soft);
	border: 1px solid var(--hwt-border);
	border-radius: 100px;
	padding: 0.45rem 0.95rem 0.45rem 0.7rem;
	margin-bottom: 1.25rem;
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.hwt-detail-back svg {
	width: 15px;
	height: 15px;
	flex-shrink: 0;
}

.hwt-detail-back:hover {
	background: var(--hwt-primary);
	color: #fff;
	transform: translateX(-2px);
}

.hwt-detail__hero {
	position: relative;
	border-radius: var(--hwt-radius);
	overflow: hidden;
	margin-bottom: 1.75rem;
	aspect-ratio: 21 / 9;
	background: var(--hwt-bg-surface-raised);
	box-shadow: 0 18px 38px -22px rgba(16, 24, 40, 0.35);
}

.hwt-detail__hero img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hwt-detail__hero-overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 1.5rem 1.75rem;
	background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.85) 88%);
}

.hwt-detail__hero-overlay .hwt-detail__title,
.hwt-detail__hero-overlay .hwt-card__meta {
	color: #f4f6fa;
}

.hwt-detail__header {
	margin-bottom: 1.5rem;
}

.hwt-detail__title {
	font-size: clamp(1.6rem, 3.2vw, 2.3rem);
	font-weight: 800;
	letter-spacing: -0.01em;
	margin: 0.5rem 0 0.3rem;
	color: var(--hwt-text);
}

.hwt-detail__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 2rem;
	align-items: start;
}

@media (max-width: 800px) {
	.hwt-detail__layout {
		grid-template-columns: 1fr;
	}
}

/* Each section is its own card, instead of plain text blocks running
   together — this is the main "looks a bit fade" fix: more separation,
   more visual weight per section. */
.hwt-detail__section {
	scroll-margin-top: 1rem;
	background: var(--hwt-bg-surface);
	border: 1px solid var(--hwt-border);
	border-radius: var(--hwt-radius);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
	padding: 1.5rem 1.6rem;
	margin-bottom: 1.5rem;
	font-size: 1.1rem;
	line-height: 1.7;
	color: var(--hwt-text);
}

.hwt-detail__section h2 {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	font-size: 1.15rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	margin: 0 0 1rem;
	color: var(--hwt-text);
}

.hwt-detail__section h2::before {
	content: "";
	display: inline-block;
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 2px;
	background: var(--hwt-primary);
	flex-shrink: 0;
}

.hwt-detail__on-request {
	color: var(--hwt-text-dim);
	margin-bottom: 0.8rem;
}

.hwt-detail__form-context {
	display: inline-block;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--hwt-primary);
	background: var(--hwt-primary-soft);
	border-radius: 100px;
	padding: 0.3rem 0.8rem;
	margin: 0 0 1.1rem;
}

/* Agenda — numbered steps instead of a default browser <ol>, applied to
   whatever HTML list is stored in the training's agenda field. */
.hwt-agenda ol {
	list-style: none;
	counter-reset: hwt-agenda;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.6rem;
}

.hwt-agenda ol li {
	counter-increment: hwt-agenda;
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	padding: 0.15rem 0;
}

.hwt-agenda ol li::before {
	content: counter(hwt-agenda);
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
	background: var(--hwt-primary-soft);
	color: var(--hwt-primary);
	font-size: 0.78rem;
	font-weight: 700;
}

/* Dates — a card list instead of a wide table, so nothing ever needs
   horizontal scrolling regardless of sidebar width. */
.hwt-date-list {
	display: grid;
	gap: 0.75rem;
}

.hwt-date-card {
	position: relative;
	background: var(--hwt-bg-surface-raised);
	border: 1px solid var(--hwt-border);
	border-radius: 10px;
	padding: 0.9rem 1.1rem 0.9rem 1.3rem;
	overflow: hidden;
}

.hwt-date-card.is-past {
	opacity: 0.55;
}

.hwt-date-card__strip {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 4px;
}

.hwt-date-card__strip.is-ok { background: var(--hwt-ok); }
.hwt-date-card__strip.is-warn { background: var(--hwt-warn); }
.hwt-date-card__strip.is-danger { background: var(--hwt-danger); }
.hwt-date-card__strip.is-neutral { background: var(--hwt-neutral); }

.hwt-date-card__row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.hwt-date-card__row--head {
	justify-content: space-between;
	margin-bottom: 0.5rem;
}

.hwt-date-card__date {
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--hwt-text);
}

.hwt-date-card__row--meta {
	font-size: 0.95rem;
	color: var(--hwt-text-dim);
	row-gap: 0.35rem;
}

/* Bigger status pill specifically inside the detail page's date cards —
   .hwt-card__status-label itself is shared with the overview grid, which
   must stay untouched, so this only wins where .hwt-date-card is an
   ancestor (higher specificity: two classes vs. one). */
.hwt-date-card .hwt-card__status-label {
	font-size: 0.85rem;
}

.hwt-date-card__fact {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	white-space: nowrap;
}

.hwt-date-card__fact-label {
	font-weight: 600;
	color: var(--hwt-text);
}

.hwt-date-card__icon {
	display: inline-flex;
	width: 14px;
	height: 14px;
	color: var(--hwt-primary);
	flex-shrink: 0;
}

.hwt-date-card__icon svg {
	width: 100%;
	height: 100%;
}

.hwt-date-card__seats {
	font-weight: 600;
	color: var(--hwt-text);
}

.hwt-date-card__row--action {
	margin-top: 0.7rem;
	justify-content: flex-end;
}

.hwt-detail__sidebar-card {
	background: var(--hwt-bg-surface);
	border: 1px solid var(--hwt-border);
	border-radius: var(--hwt-radius);
	box-shadow: 0 14px 32px -20px rgba(16, 24, 40, 0.25);
	padding: 1.4rem;
	position: sticky;
	top: 1rem;
}

.hwt-detail__facts {
	margin: 0 0 1.1rem;
	display: grid;
	gap: 0.7rem;
}

.hwt-detail__facts > div {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.85rem;
	border-bottom: 1px dashed var(--hwt-border);
	padding-bottom: 0.55rem;
}

.hwt-detail__facts dt {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--hwt-text-dim);
}

.hwt-detail__fact-icon {
	display: inline-flex;
	width: 16px;
	height: 16px;
	color: var(--hwt-primary);
	flex-shrink: 0;
}

.hwt-detail__fact-icon svg {
	width: 100%;
	height: 100%;
}

.hwt-detail__facts dd {
	margin: 0;
	font-weight: 600;
	text-align: right;
	color: var(--hwt-text);
}

.hwt-detail__cta-box {
	background: var(--hwt-primary-soft);
	border: 1px solid var(--hwt-border);
	border-radius: 10px;
	padding: 1rem;
}

.hwt-detail__cta-box--request {
	background: var(--hwt-bg-surface-raised);
}

.hwt-detail__next-date {
	font-size: 0.82rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--hwt-text-dim);
	margin: 0;
}

.hwt-detail__next-date strong {
	display: block;
	text-transform: none;
	letter-spacing: normal;
	color: var(--hwt-text);
	font-size: 1.02rem;
	line-height: 1.3;
	font-weight: 700;
	margin-top: 0.25rem;
}
