/**
 * Teaching Staff — directory table + mobile cards.
 *
 * @package DBCTE_Tura
 */

.staff-page {
	padding-top: 0;
	padding-bottom: clamp(2.5rem, 5vw, 4rem);
	background: linear-gradient(180deg, #f8fafc 0%, #ffffff 40%);
}

.staff-page.section {
	padding-top: 0;
}

.staff-page__hero {
	margin: 0 calc(50% - 50vw) 0;
	width: 100vw;
	padding: clamp(1.85rem, 4vw, 2.75rem) 1.25rem;
	background:
		radial-gradient(ellipse 65% 70% at 85% 15%, color-mix(in srgb, var(--dbcte-hub-sky) 18%, transparent) 0%, transparent 50%),
		linear-gradient(155deg, var(--dbcte-primary) 0%, color-mix(in srgb, var(--dbcte-primary) 85%, #0c1929 15%) 100%);
	color: #fff;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 10px 36px rgba(15, 23, 42, 0.1);
}

.staff-page__hero-inner {
	max-width: min(100%, 56rem);
	margin: 0 auto;
	text-align: center;
}

.staff-page__title {
	margin: 0;
	font-size: clamp(1.55rem, 3.6vw, 2.05rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
}

.staff-page__shell {
	max-width: min(100%, var(--dbcte-entry-content-max, 72rem));
	margin: 0 auto;
	padding: clamp(1.75rem, 4vw, 2.5rem) 1rem 0;
}

.staff-page__lead {
	margin: 0 0 1.25rem;
	font-size: 1.05rem;
	line-height: 1.65;
	color: var(--dbcte-muted);
	max-width: 42rem;
}

/* Toolbar */
.staff-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
	padding: 1rem 1.15rem;
	border-radius: var(--dbcte-radius);
	background: #fff;
	border: 1px solid rgba(30, 58, 138, 0.1);
	box-shadow: 0 4px 20px rgba(30, 58, 138, 0.06);
}

.staff-toolbar__search {
	flex: 1 1 16rem;
	min-width: 0;
}

.staff-toolbar__label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--dbcte-muted);
}

.staff-toolbar__input {
	width: 100%;
	padding: 0.65rem 0.85rem;
	font: inherit;
	font-size: 0.95rem;
	border: 1px solid rgba(30, 58, 138, 0.2);
	border-radius: 10px;
	background: #f8fafc;
	color: var(--dbcte-text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.staff-toolbar__input:hover {
	border-color: rgba(0, 168, 225, 0.35);
}

.staff-toolbar__input:focus {
	outline: none;
	border-color: var(--dbcte-hub-sky);
	box-shadow: 0 0 0 3px rgba(0, 168, 225, 0.2);
	background: #fff;
}

.staff-toolbar__meta {
	margin: 0;
	font-size: 0.9rem;
	color: var(--dbcte-muted);
	flex-shrink: 0;
}

/* Table */
.staff-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var(--dbcte-radius);
	border: 1px solid rgba(30, 58, 138, 0.12);
	background: #fff;
	box-shadow: 0 8px 32px rgba(30, 58, 138, 0.08);
}

@media (max-width: 767px) {
	.staff-table-wrap {
		display: none;
	}
}

.staff-table {
	width: 100%;
	min-width: 62rem;
	border-collapse: collapse;
	font-size: 0.92rem;
	line-height: 1.5;
}

.staff-table__th,
.staff-table__td {
	padding: 0.75rem 0.85rem;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid #e5e7eb;
}

.staff-table thead .staff-table__th {
	position: sticky;
	top: 0;
	z-index: 1;
	padding: 0.85rem 0.85rem;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6d28d9;
	background: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 100%);
	border-bottom: 2px solid #c4b5fd;
	white-space: nowrap;
}

.staff-table__th--sort {
	cursor: pointer;
	user-select: none;
	transition: background 0.15s ease;
}

.staff-table__th--sort:hover,
.staff-table__th--sort:focus-visible {
	background: #ddd6fe;
	outline: none;
}

.staff-table__th--sort.is-sorted-asc .staff-table__th-inner::after,
.staff-table__th--sort.is-sorted-desc .staff-table__th-inner::after {
	content: "";
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 0.35rem;
	vertical-align: middle;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
}

.staff-table__th--sort.is-sorted-asc .staff-table__th-inner::after {
	border-bottom: 6px solid #6d28d9;
	margin-top: -2px;
}

.staff-table__th--sort.is-sorted-desc .staff-table__th-inner::after {
	border-top: 6px solid #6d28d9;
	margin-bottom: -2px;
}

.staff-table__td--sl {
	width: 4rem;
	font-weight: 600;
	color: var(--dbcte-primary);
	background: rgba(30, 58, 138, 0.03);
}

.staff-table tbody tr:nth-child(even) .staff-table__td {
	background: rgba(248, 250, 252, 0.85);
}

.staff-table tbody tr:hover .staff-table__td {
	background: rgba(0, 168, 225, 0.06);
}

.staff-table__row.is-filtered-out {
	display: none;
}

.staff-table__link {
	color: var(--dbcte-primary-light);
	text-decoration: none;
	font-weight: 500;
	word-break: break-word;
}

.staff-table__td--email .staff-table__link {
	word-break: normal;
	white-space: nowrap;
}

.staff-table__link:hover {
	text-decoration: underline;
	color: var(--dbcte-hub-sky);
}

/* Allow full email on one line; table scrolls horizontally on smaller viewports (see .staff-table-wrap). */
.staff-table__td--email {
	max-width: none;
	white-space: nowrap;
}

/* Mobile cards */
.staff-cards {
	display: none;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 1rem;
	flex-direction: column;
}

@media (max-width: 767px) {
	.staff-cards {
		display: flex;
	}
}

.staff-cards__item {
	margin: 0;
	padding: 1.1rem 1.15rem;
	border-radius: var(--dbcte-radius);
	background: #fff;
	border: 1px solid rgba(30, 58, 138, 0.1);
	box-shadow: 0 4px 20px rgba(30, 58, 138, 0.07);
}

.staff-cards__item.is-filtered-out {
	display: none;
}

.staff-cards__head {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	margin-bottom: 0.35rem;
}

.staff-cards__sl {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	height: 2rem;
	padding: 0 0.4rem;
	font-size: 0.8rem;
	font-weight: 700;
	color: #6d28d9;
	background: #ede9fe;
	border-radius: 8px;
}

.staff-cards__name {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--dbcte-text);
}

.staff-cards__designation {
	margin: 0 0 0.75rem;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--dbcte-primary);
}

.staff-cards__row {
	margin: 0.35rem 0 0;
	font-size: 0.88rem;
	line-height: 1.5;
	color: var(--dbcte-text);
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.65rem;
	align-items: baseline;
}

.staff-cards__label {
	font-weight: 600;
	color: var(--dbcte-muted);
	min-width: 3.25rem;
}

.staff-page__empty {
	margin: 1.5rem 0 0;
	padding: 1rem;
	text-align: center;
	font-size: 0.95rem;
	color: var(--dbcte-muted);
	border-radius: var(--dbcte-radius);
	background: #fef2f2;
	border: 1px solid #fecaca;
}

/* Official faculty PDF */
.staff-pdf-cta {
	margin-top: clamp(1.75rem, 4vw, 2.5rem);
	padding-top: clamp(1.5rem, 3vw, 2rem);
	border-top: 1px solid rgba(30, 58, 138, 0.12);
	text-align: center;
}

.staff-pdf-cta__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.65rem 0.85rem;
	padding: 0.95rem 1.5rem;
	max-width: 100%;
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.3;
	text-decoration: none;
	text-align: center;
	color: #fff;
	background: linear-gradient(
		155deg,
		color-mix(in srgb, var(--dbcte-primary) 92%, #020617 8%) 0%,
		color-mix(in srgb, var(--dbcte-primary-light) 75%, #1e1b4b 25%) 100%
	);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 999px;
	box-shadow:
		0 4px 14px rgba(30, 58, 138, 0.25),
		0 1px 0 rgba(255, 255, 255, 0.12) inset;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.staff-pdf-cta__btn:hover {
	filter: brightness(1.06);
	box-shadow:
		0 8px 24px rgba(30, 58, 138, 0.3),
		0 1px 0 rgba(255, 255, 255, 0.15) inset;
	transform: translateY(-1px);
}

.staff-pdf-cta__btn:focus-visible {
	outline: 2px solid var(--dbcte-hub-sky);
	outline-offset: 3px;
}

.staff-pdf-cta__icon {
	display: flex;
	color: rgba(255, 255, 255, 0.95);
}

.staff-pdf-cta__label {
	flex: 1 1 auto;
	min-width: min(100%, 18rem);
}

.staff-pdf-cta__hint {
	padding: 0.2rem 0.55rem;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--dbcte-primary);
	background: rgba(255, 255, 255, 0.95);
	border-radius: 6px;
}
