/* ============================================================
   FTW Staff Gallery — staff-gallery.css  v1.1.0
   Brand: Navy #1B2F5B | Red #C8102E
   ============================================================ */

/* ── Custom Properties ─────────────────────────────────────── */
.ftw-staff-gallery,
.ftw-modal {
	--ftw-navy:       #1B2F5B;
	--ftw-navy-dark:  #111e3c;
	--ftw-navy-light: #243a6e;
	--ftw-red:        #C8102E;
	--ftw-white:      #ffffff;
	--ftw-gray-100:   #f0f2f5;
	--ftw-gray-200:   #e2e6ec;
	--ftw-gray-400:   #9aa3b0;
	--ftw-gray-600:   #5a6478;
	--ftw-gray-800:   #2d3548;
	--ftw-radius:     6px;
	--ftw-shadow-sm:  0 2px 8px rgba(27,47,91,.08);
	--ftw-shadow-md:  0 6px 24px rgba(27,47,91,.14);
	--ftw-shadow-lg:  0 16px 48px rgba(27,47,91,.22);
	--ftw-transition: 0.22s cubic-bezier(.4,0,.2,1);

	/* Column count injected by PHP via inline style — default 3 */
	--ftw-columns: 3;
}

/* ── Section wrapper ────────────────────────────────────────── */
.ftw-staff-gallery {
	max-width: 1200px;
	margin: 0 auto;
	padding: 60px 24px 80px;
}

/* ── Gallery header ─────────────────────────────────────────── */
.ftw-staff-gallery__header {
	text-align: center;
	margin-bottom: 48px;
}

.ftw-staff-gallery__heading {
	font-family: 'Georgia', serif;
	font-size: clamp(2rem, 4vw, 2.75rem);
	font-weight: 700;
	color: var(--ftw-navy);
	letter-spacing: -0.02em;
	margin: 0;
	line-height: 1.15;
}

.ftw-staff-gallery__heading::after {
	content: '';
	display: block;
	width: 56px;
	height: 3px;
	background: var(--ftw-red);
	margin: 14px auto 0;
	border-radius: 2px;
}

.ftw-staff-gallery__subheading {
	font-family: 'Helvetica Neue', Arial, sans-serif;
	font-size: 1rem;
	color: var(--ftw-gray-600);
	max-width: 540px;
	margin: 20px auto 0;
	line-height: 1.65;
}

/* ── Department section ─────────────────────────────────────── */
.ftw-staff-dept {
	margin-bottom: 60px;
}

.ftw-staff-dept__header {
	display: flex;
	align-items: center;
	gap: 0;
	margin-bottom: 32px;
}

.ftw-staff-dept__title {
	font-family: 'Georgia', serif;
	font-size: clamp(1.15rem, 2.5vw, 1.4rem);
	font-weight: 700;
	color: var(--ftw-navy);
	white-space: nowrap;
	margin: 0;
	padding: 0 20px 0 0;
}

.ftw-staff-dept__rule {
	display: block;
	flex: 1;
	height: 3px;
	background: var(--ftw-red);
	border-radius: 2px;
}

/* ── Staff grid ─────────────────────────────────────────────────
   Uses --ftw-columns injected per shortcode instance.
   On tablet: max 3 cols regardless of setting.
   On mobile: always 2 cols.
   ─────────────────────────────────────────────────────────────── */

.ftw-staff-dept__grid {
	display: grid;
	/*
	 * repeat(var(--ftw-columns), 1fr) gives exactly N equal columns.
	 * At narrower viewports the media queries below override this.
	 */
	grid-template-columns: repeat( var(--ftw-columns), 1fr );
	gap: 28px;
}

/* ── Card size notes by column count
   2 cols → ~580px each   (large, executive/leadership style)
   3 cols → ~373px each   (default staff page)
   4 cols → ~270px each
   5 cols → ~210px each
   6 cols → ~168px each
   Font sizes and photo aspect ratio stay constant — the card simply
   gets narrower so photos scale naturally.
   ──────────────────────────────────────────────────────────────── */

/* ── Staff card ─────────────────────────────────────────────── */
.ftw-staff-card {
	background: var(--ftw-white);
	border-radius: var(--ftw-radius);
	box-shadow: var(--ftw-shadow-sm);
	overflow: hidden;
	cursor: pointer;
	transition:
		transform var(--ftw-transition),
		box-shadow var(--ftw-transition),
		border-color var(--ftw-transition);
	position: relative;
	border: 1px solid var(--ftw-gray-200);
	outline: none;
}

.ftw-staff-card:hover,
.ftw-staff-card:focus-visible {
	transform: translateY(-5px);
	box-shadow: var(--ftw-shadow-md);
	border-color: var(--ftw-red);
}

.ftw-staff-card:focus-visible {
	box-shadow: var(--ftw-shadow-md), 0 0 0 3px rgba(200,16,46,.3);
}

/* ── Card photo ─────────────────────────────────────────────── */
.ftw-staff-card__photo-wrap {
	position: relative;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background: var(--ftw-gray-100);
}

.ftw-staff-card__photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	display: block;
	transition: transform 0.4s cubic-bezier(.4,0,.2,1);
}

.ftw-staff-card:hover .ftw-staff-card__photo,
.ftw-staff-card:focus-visible .ftw-staff-card__photo {
	transform: scale(1.05);
}

.ftw-staff-card__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(27,47,91,.75) 0%,
		rgba(27,47,91,.10) 55%,
		transparent 100%
	);
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	padding: 12px;
	opacity: 0;
	transition: opacity var(--ftw-transition);
}

.ftw-staff-card:hover .ftw-staff-card__overlay,
.ftw-staff-card:focus-visible .ftw-staff-card__overlay {
	opacity: 1;
}

.ftw-staff-card__view-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background: var(--ftw-red);
	border-radius: 50%;
	color: #ffffff;
	flex-shrink: 0;
}

.ftw-staff-card__view-btn svg {
	color: #ffffff;
	stroke: #ffffff;
}

/* ── Card info ──────────────────────────────────────────────── */
.ftw-staff-card__info {
	padding: 16px 16px 14px;
}

.ftw-staff-card__name {
	font-family: 'Georgia', serif;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--ftw-navy);
	margin: 0 0 4px;
	line-height: 1.3;
}

/* Slightly larger name at 2 columns */
.ftw-staff-gallery[style*="--ftw-columns: 2"] .ftw-staff-card__name {
	font-size: 1.05rem;
}

.ftw-staff-card__title {
	font-family: 'Helvetica Neue', Arial, sans-serif;
	font-size: 0.75rem;
	color: var(--ftw-red);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: 0 0 12px;
	line-height: 1.4;
}

/* ── Card social links ──────────────────────────────────────── */
.ftw-staff-card__links {
	display: flex;
	gap: 8px;
	align-items: center;
}

.ftw-staff-card__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	color: #ffffff !important;
	text-decoration: none;
	transition: transform var(--ftw-transition), opacity var(--ftw-transition);
	flex-shrink: 0;
}

.ftw-staff-card__link svg {
	color: #ffffff;
	fill: #ffffff;
	flex-shrink: 0;
}

.ftw-staff-card__link:hover {
	transform: scale(1.15);
	opacity: .85;
}

.ftw-staff-card__link--email    { background: var(--ftw-red); }
.ftw-staff-card__link--linkedin { background: #0077B5; }
.ftw-staff-card__link--twitter  { background: #000000; }


/* ═══════════════════════════════════════════════════════════════
   BIO MODAL
   ═══════════════════════════════════════════════════════════════ */

.ftw-modal {
	position: fixed;
	inset: 0;
	z-index: 99990;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.ftw-modal[hidden] { display: none; }

.ftw-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17,30,60,.76);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	cursor: pointer;
}

.ftw-modal__panel {
	position: relative;
	z-index: 1;
	background: var(--ftw-white);
	border-radius: 12px;
	box-shadow: var(--ftw-shadow-lg);
	max-width: 680px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	overscroll-behavior: contain;
	animation: ftw-modal-in 0.28s cubic-bezier(.34,1.56,.64,1) both;
	display: flex;
	flex-direction: column;
}

@keyframes ftw-modal-in {
	from { opacity: 0; transform: scale(0.93) translateY(24px); }
	to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ftw-modal__banner {
	background: var(--ftw-navy);
	border-radius: 12px 12px 0 0;
	border-top: 5px solid var(--ftw-red);
	padding: 36px 40px 0;
	display: flex;
	align-items: flex-end;
	gap: 24px;
	position: relative;
}

.ftw-modal__avatar-wrap {
	flex-shrink: 0;
	width: 100px;
	height: 100px;
	border-radius: 50%;
	border: 3px solid rgba(255,255,255,.25);
	overflow: hidden;
	background: var(--ftw-navy-light);
	margin-bottom: -24px;
	position: relative;
	z-index: 1;
}

.ftw-modal__avatar {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	display: block;
}

.ftw-modal__banner-text {
	padding-bottom: 20px;
	flex: 1;
	min-width: 0;
}

.ftw-modal__label {
	font-family: 'Helvetica Neue', Arial, sans-serif;
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: rgba(255,255,255,.55);
	margin-bottom: 6px;
	display: block;
}

.ftw-modal__name {
	font-family: 'Georgia', serif;
	font-size: clamp(1.2rem, 3vw, 1.55rem);
	font-weight: 700;
	color: #ffffff;
	margin: 0 48px 4px 0;
	line-height: 1.2;
}

.ftw-modal__title {
	font-family: 'Helvetica Neue', Arial, sans-serif;
	font-size: 0.8rem;
	color: rgba(255,255,255,.65);
	font-weight: 500;
	margin: 0;
}

.ftw-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255,255,255,.15);
	border: none;
	cursor: pointer;
	color: #ffffff;
	transition: background var(--ftw-transition);
	padding: 0;
}

.ftw-modal__close:hover { background: var(--ftw-red); }

.ftw-modal__body {
	padding: 36px 40px 36px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.ftw-modal__bio {
	font-family: 'Georgia', serif;
	font-size: 0.9rem;
	color: var(--ftw-gray-800);
	line-height: 1.8;
	flex: 1;
	margin-bottom: 28px;
}

.ftw-modal__bio p   { margin: 0 0 1em; }
.ftw-modal__bio p:last-child { margin-bottom: 0; }

.ftw-modal__links {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	padding-top: 20px;
	border-top: 1px solid var(--ftw-gray-200);
}

.ftw-modal__link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 18px;
	border-radius: 4px;
	font-family: 'Helvetica Neue', Arial, sans-serif;
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: none !important;
	color: #ffffff !important;
	transition: opacity var(--ftw-transition), transform var(--ftw-transition);
	letter-spacing: 0.03em;
}

.ftw-modal__link svg     { fill: #ffffff; flex-shrink: 0; }
.ftw-modal__link:hover   { opacity: .85; transform: translateY(-1px); text-decoration: none !important; }
.ftw-modal__link:visited { color: #ffffff !important; }

.ftw-modal__link--email    { background: var(--ftw-red); }
.ftw-modal__link--linkedin { background: #0077B5; }
.ftw-modal__link--twitter  { background: #000; }


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ─────────────────────────────────────────────────────────────
   Strategy:
   • ≥1024px  — honour --ftw-columns exactly as set
   • 768–1023px — cap at 3 columns (e.g. a 5-col grid drops to 3)
   • 480–767px  — always 2 columns
   • <480px     — always 1 column (portrait phone)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1023px) {
	.ftw-staff-dept__grid {
		grid-template-columns: repeat( min( var(--ftw-columns), 3 ), 1fr );
	}
}

@media (max-width: 767px) {
	.ftw-staff-dept__grid {
		grid-template-columns: repeat( 2, 1fr );
		gap: 16px;
	}
}

@media (max-width: 479px) {
	.ftw-staff-gallery {
		padding: 40px 16px 60px;
	}
	.ftw-staff-dept__grid {
		grid-template-columns: 1fr;
	}
}

/* Modal responsive */
@media (max-width: 600px) {
	.ftw-modal__banner {
		padding: 28px 24px 0;
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}
	.ftw-modal__avatar-wrap {
		width: 80px;
		height: 80px;
		margin-bottom: -18px;
	}
	.ftw-modal__body   { padding: 28px 24px; }
	.ftw-modal__name   { margin-right: 44px; }
}

/* Scroll lock */
body.ftw-modal-open { overflow: hidden; }
