/**
 * Staff Dashboard + Staff Directory (front end).
 * -----------------------------------------------
 * Layers dashboard/directory layout on top of the shared design system. Every
 * color, radius, and font comes from the design-system custom properties — this
 * file adds no new brand values, only structure. Shared by both the
 * [csw_staff_dashboard] and [csw_staff_directory] shortcodes (they register one
 * handle between them).
 *
 * Version: 0.5.0
 */

/* ==================================================================== *
 * Shared shell
 * ==================================================================== */
/* Width is owned by the design system's screen shell (--csw-screen-max). */
.csw-dashboard,
.csw-directory {
	font-family: var(--csw-font-body);
	color: var(--csw-ink);
	padding: 8px 0 40px;
}

.csw-dashboard .csw-empty,
.csw-directory .csw-empty {
	color: var(--csw-muted);
	font-size: 15px;
	margin: 0;
}

.csw-empty--sm {
	font-size: 14px;
}

/* Standalone notice / gate cards (signed-out, unlinked, staff-only) stay narrow
   — the design system sets their width via --csw-notice-max. */

.csw-dashboard--notice .csw-card p,
.csw-directory--notice .csw-card p {
	margin: 0 0 14px;
}

.csw-dashboard--notice .csw-card p:last-child,
.csw-directory--notice .csw-card p:last-child {
	margin-bottom: 0;
}

/* ==================================================================== *
 * Dashboard header + action buttons
 * ==================================================================== */
.csw-dashboard__header {
	margin-bottom: 28px;
}

.csw-dashboard__header .csw-headline {
	font-size: clamp(28px, 4vw, 44px);
}

.csw-dashboard__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-top: 18px;
}

.csw-dashboard__actions .csw-btn {
	font-size: 14px;
	padding: 14px 26px;
}

/* ==================================================================== *
 * Content sections
 * ==================================================================== */
.csw-dashboard__section {
	background: var(--csw-surface);
	border: 1px solid var(--csw-line);
	border-radius: var(--csw-card-radius);
	padding: 22px 24px;
	margin-bottom: 22px;
	scroll-margin-top: 24px;
}

.csw-section-header .csw-count,
.csw-training-col__head .csw-count {
	display: inline-block;
	min-width: 22px;
	padding: 1px 8px;
	margin-left: 6px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.6;
	text-align: center;
	color: var(--csw-btn-text);
	background: var(--csw-teal);
	border-radius: 999px;
	vertical-align: middle;
}

/* ---------- Compliance alerts ---------- */
.csw-alert-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.csw-alert {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	padding: 12px 14px;
	border-left: 4px solid var(--csw-muted);
	background: var(--csw-surface-alt);
	border-radius: 0 var(--csw-card-radius) var(--csw-card-radius) 0;
	margin-bottom: 10px;
}

.csw-alert:last-child {
	margin-bottom: 0;
}

.csw-alert--expired {
	border-left-color: var(--csw-red);
}

.csw-alert--warning {
	border-left-color: var(--csw-olive);
}

.csw-alert--info {
	border-left-color: var(--csw-teal);
}

.csw-alert__msg {
	font-size: 15px;
}

.csw-alert__meta {
	color: var(--csw-muted);
	font-size: 13px;
	white-space: nowrap;
}

/* ---------- Training status grid ---------- */
.csw-training-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.csw-training-col {
	background: var(--csw-surface-alt);
	border: 1px solid var(--csw-line);
	border-top: 4px solid var(--csw-muted);
	border-radius: var(--csw-card-radius);
	padding: 14px;
}

.csw-training-col--completed { border-top-color: var(--csw-green); }
.csw-training-col--due       { border-top-color: var(--csw-olive); }
.csw-training-col--expired   { border-top-color: var(--csw-red); }
.csw-training-col--upcoming  { border-top-color: var(--csw-teal); }

.csw-training-col__head {
	font-family: var(--csw-font-display);
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--csw-navy);
	margin: 0 0 10px;
}

.csw-training-col--completed .csw-count { background: var(--csw-green); }
.csw-training-col--due .csw-count       { background: var(--csw-olive); }
.csw-training-col--expired .csw-count   { background: var(--csw-red); }
.csw-training-col--upcoming .csw-count  { background: var(--csw-teal); }

.csw-training-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.csw-training-list li {
	padding: 8px 0;
	border-bottom: 1px solid var(--csw-line);
}

.csw-training-list li:last-child {
	border-bottom: 0;
}

.csw-training-name {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--csw-ink);
}

.csw-training-date {
	display: block;
	font-size: 12px;
	color: var(--csw-muted);
}

/* ---------- Announcements ---------- */
.csw-announcements {
	list-style: none;
	margin: 0;
	padding: 0;
}

.csw-announcement {
	padding: 14px 0;
	border-bottom: 1px solid var(--csw-line);
}

.csw-announcement:first-child {
	padding-top: 0;
}

.csw-announcement:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.csw-announcement__title {
	font-family: var(--csw-font-display);
	font-size: 17px;
	font-weight: 700;
	color: var(--csw-navy);
	margin: 0 0 4px;
}

.csw-announcement__date {
	display: block;
	font-size: 12px;
	color: var(--csw-muted);
	margin-bottom: 8px;
}

.csw-announcement__body {
	font-size: 15px;
	line-height: 1.55;
}

.csw-announcement__body p:last-child {
	margin-bottom: 0;
}

/* ---------- Pending / "coming soon" stubs ---------- */
.csw-dashboard__pending {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 22px;
}

.csw-dashboard__pending .csw-dashboard__section {
	margin-bottom: 0;
}

.csw-dashboard__section--stub {
	background: var(--csw-surface-alt);
	border-style: dashed;
}

.csw-dashboard__section--stub .csw-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	color: var(--csw-muted);
	border-bottom-color: var(--csw-line);
}

.csw-badge {
	display: inline-block;
	font-family: var(--csw-font-body);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: none;
	padding: 2px 10px;
	border-radius: 999px;
}

.csw-badge--soon {
	color: var(--csw-btn-text);
	background: var(--csw-muted);
}

/* ==================================================================== *
 * Directory
 * ==================================================================== */
.csw-directory__header .csw-headline {
	font-size: clamp(26px, 3.6vw, 40px);
}

.csw-directory__filters {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px;
	align-items: end;
	background: var(--csw-surface);
	border: 1px solid var(--csw-line);
	border-radius: var(--csw-card-radius);
	padding: 18px 20px;
	margin-bottom: 18px;
}

.csw-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.csw-field label {
	font-family: var(--csw-font-display);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--csw-navy);
}

.csw-field input[type="search"],
.csw-field select {
	width: 100%;
	padding: 9px 12px;
	font-size: 14px;
	color: var(--csw-ink);
	background: var(--csw-surface);
	border: 1px solid var(--csw-line);
	border-radius: 4px;
	line-height: 1.3;
}

.csw-field input[type="search"]:focus,
.csw-field select:focus {
	outline: 2px solid var(--csw-teal);
	outline-offset: 1px;
	border-color: var(--csw-teal);
}

.csw-field--actions {
	justify-content: flex-end;
}

.csw-directory__status {
	min-height: 20px;
	font-size: 14px;
	color: var(--csw-muted);
	margin-bottom: 10px;
}

.csw-directory__status.is-loading {
	color: var(--csw-teal);
}

/* ---------- Results grid ---------- */
.csw-directory__grid {
	display: grid;
	gap: 20px;
}

.csw-cols-1 { grid-template-columns: 1fr; }
.csw-cols-2 { grid-template-columns: repeat(2, 1fr); }
.csw-cols-3 { grid-template-columns: repeat(3, 1fr); }
.csw-cols-4 { grid-template-columns: repeat(4, 1fr); }

.csw-directory__grid .csw-empty {
	grid-column: 1 / -1;
	padding: 30px 0;
	text-align: center;
}

/* ---------- Staff card ---------- */
.csw-staff-card {
	background: var(--csw-surface);
	border: 1px solid var(--csw-line);
	border-radius: var(--csw-card-radius);
	overflow: hidden;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.csw-staff-card:hover {
	box-shadow: 0 6px 18px rgba(26, 33, 72, 0.12);
	transform: translateY(-2px);
}

.csw-staff-card__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.csw-staff-card__photo {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	background: var(--csw-surface-alt);
	overflow: hidden;
}

.csw-staff-card__photo img,
.csw-staff-photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.csw-staff-card__initials {
	font-family: var(--csw-font-display);
	font-size: 40px;
	font-weight: 800;
	color: var(--csw-teal);
	letter-spacing: 0.02em;
}

.csw-staff-card__body {
	padding: 14px 16px 18px;
}

.csw-staff-card__name {
	font-family: var(--csw-font-display);
	font-size: 17px;
	font-weight: 700;
	color: var(--csw-navy);
	margin: 0 0 3px;
}

.csw-staff-card__title {
	font-size: 14px;
	color: var(--csw-plum);
	font-weight: 600;
	margin: 0 0 2px;
}

.csw-staff-card__meta {
	font-size: 13px;
	color: var(--csw-muted);
	margin: 0 0 8px;
}

.csw-staff-card__tags {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.csw-tag {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--csw-teal);
	background: rgba(64, 130, 146, 0.1);
	border-radius: 999px;
	padding: 3px 10px;
}

/* ==================================================================== *
 * Directory — single detail view
 * ==================================================================== */
.csw-directory__back {
	margin: 0 0 16px;
}

.csw-directory__back a {
	color: var(--csw-teal);
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
}

.csw-directory__back a:hover {
	text-decoration: underline;
}

.csw-staff-detail {
	background: var(--csw-surface);
	border: 1px solid var(--csw-line);
	border-radius: var(--csw-card-radius);
	padding: 28px;
}

.csw-staff-detail__header {
	display: flex;
	gap: 24px;
	align-items: center;
	margin-bottom: 24px;
}

.csw-staff-detail__photo {
	flex: 0 0 140px;
	width: 140px;
	height: 140px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--csw-surface-alt);
	border-radius: var(--csw-card-radius);
	overflow: hidden;
}

.csw-staff-detail__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.csw-staff-detail__id .csw-headline {
	font-size: clamp(24px, 3vw, 34px);
	margin-bottom: 6px;
}

.csw-staff-detail__title {
	font-size: 16px;
	font-weight: 600;
	color: var(--csw-plum);
	margin: 0;
}

.csw-staff-detail__facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px 24px;
	margin-bottom: 24px;
}

.csw-fact {
	font-size: 15px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--csw-line);
}

.csw-fact__label {
	display: block;
	font-family: var(--csw-font-display);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--csw-muted);
	margin-bottom: 2px;
}

.csw-fact__value {
	color: var(--csw-ink);
}

.csw-staff-detail__expertise {
	margin-bottom: 24px;
}

.csw-staff-detail__bio {
	font-size: 15px;
	line-height: 1.6;
}

.csw-staff-detail__bio p:last-child {
	margin-bottom: 0;
}

/* ==================================================================== *
 * Responsive
 * ==================================================================== */
@media (max-width: 900px) {
	.csw-training-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.csw-cols-3,
	.csw-cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.csw-training-grid,
	.csw-dashboard__pending,
	.csw-cols-2,
	.csw-cols-3,
	.csw-cols-4 {
		grid-template-columns: 1fr;
	}
	.csw-dashboard__actions .csw-btn {
		flex: 1 1 auto;
		text-align: center;
	}
	.csw-staff-detail__header {
		flex-direction: column;
		text-align: center;
	}
	.csw-alert {
		flex-direction: column;
		gap: 4px;
	}
}
