/*
 * Alpha Team Manager - frontend
 *
 * Layout adapts to the width of the section itself (container queries), so the shortcode looks
 * right in a full-width page, an Elementor column or a sidebar alike:
 *   < 600px  : 1 team card per view, leaders stacked
 *   600-959px: tablet columns, leaders two-up
 *   >= 960px : desktop columns
 *
 * Selectors are prefixed with .atm-team to win over theme/Elementor element styles.
 *
 * Defaults reproduce the live alpha.school campus team cards (measured on /dorado/ and /miami/):
 * Montserrat; name 20/24 bold #0000EF; bio 15/22.5 (16/24 on phones) #324A6D; quote 14/19.6;
 * serif 60px quote mark #C2ECFD; 1px #C2ECFD divider at 90%; 15px photo radius; 20px rhythm.
 * Every value is a custom property, so settings and the Elementor widget can override it.
 */

.atm-team {
	--atm-font: Montserrat, sans-serif;
	--atm-accent: #0000ef;
	--atm-text: #324a6d;
	--atm-quote-mark: #c2ecfd;
	--atm-divider: #c2ecfd;
	--atm-radius: 15px;
	--atm-space: 20px;
	--atm-name-size: 20px;
	--atm-bio-size: 15px;
	--atm-quote-size: 14px;
	--atm-mark-size: 60px;
	--atm-gap: 24px;
	--atm-row-gap: 64px;
	--atm-nav-size: 40px;
	--atm-dot: 7px;
	--atm-placeholder: #e6f3fb;

	container: atm-team / inline-size;
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	color: var(--atm-text);
	font-family: var(--atm-font);
	text-align: left;
}

.atm-team *,
.atm-team *::before,
.atm-team *::after {
	box-sizing: border-box;
}

.atm-team .atm-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.atm-team .atm-team__title {
	margin: 0 0 40px;
	color: var(--atm-accent);
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
}

/* ---------------------------------------------------------------- Rows */

.atm-row {
	--atm-pv: var(--atm-cols-sm, 1);
	--atm-stacked: 0;
	position: relative;
}

.atm-row + .atm-row {
	margin-top: var(--atm-row-gap);
}

.atm-row--leaders {
	--atm-gap: 40px;
}

.atm-row--stack-sm {
	--atm-stacked: 1;
}

.atm-row__stage {
	position: relative;
}

.atm-track {
	position: relative; /* Makes slide offsetLeft relative to the scroller. */
	display: flex;
	gap: var(--atm-gap);
	align-items: flex-start;
	margin: 0;
	padding: 6px 2px 10px;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
}

.atm-track:focus-visible {
	outline: 2px solid var(--atm-accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Scrollbar stays visible without JS so the row is still discoverable. */
.atm-js .atm-track {
	scrollbar-width: none;
}

.atm-js .atm-track::-webkit-scrollbar {
	display: none;
}

.atm-track.is-dragging {
	scroll-snap-type: none;
	cursor: grabbing;
	user-select: none;
}

.atm-row.is-scrollable .atm-card__media {
	cursor: grab;
}

.atm-card {
	flex: 0 0 calc((100% - (var(--atm-pv) - 1) * var(--atm-gap)) / var(--atm-pv));
	min-width: 0;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
}

/* Fewer cards than columns: centre them (auto margins collapse to 0 once the row overflows). */
.atm-card:first-child {
	margin-inline-start: auto;
}

.atm-card:last-child {
	margin-inline-end: auto;
}

/* Leaders stacked on small screens. */
.atm-row--stack-sm .atm-track {
	flex-direction: column;
	gap: 56px;
	overflow: visible;
	scroll-snap-type: none;
}

.atm-row--stack-sm .atm-card {
	flex: 0 0 auto;
	width: 100%;
	margin-inline: 0;
}

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

.atm-team .atm-card__media {
	position: relative;
	display: block;
	width: var(--atm-img-w, 100%);
	max-width: 100%;
	height: var(--atm-img-h, auto);
	aspect-ratio: var(--atm-ratio, 1/1);
	margin: 0 auto var(--atm-space);
	overflow: hidden;
	border-radius: var(--atm-radius);
	background: var(--atm-placeholder);
}

.atm-team .atm-card__media img,
.atm-team .atm-card__media .atm-card__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
	object-position: var(--atm-fx, 50%) var(--atm-fy, 0%);
	transform: scale(var(--atm-zoom, 1));
	transform-origin: var(--atm-fx, 50%) var(--atm-fy, 0%);
	-webkit-user-drag: none;
}

.atm-team .atm-card__initials {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--atm-accent);
	font-size: 2.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	opacity: 0.55;
}

.atm-team .atm-card__body {
	min-width: 0;
}

/* Name | Title: Montserrat 20px / 24px bold, same on every screen size (as on alpha.school). */
.atm-team .atm-card__heading {
	margin: 0 0 var(--atm-space);
	padding: 0;
	color: var(--atm-accent);
	font-family: var(--atm-font);
	font-size: var(--atm-name-size);
	font-style: normal;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
}

.atm-team .atm-card__sep {
	margin: 0;
}

/* Bio: 15px / 1.5 from tablet up, one pixel larger on phones (16px / 24px, as on alpha.school). */
.atm-team .atm-card__bio {
	color: var(--atm-text);
	font-family: var(--atm-font);
	font-size: calc(var(--atm-bio-size) + 1px);
	font-weight: 400;
	line-height: 1.5;
}

.atm-team .atm-card__bio p {
	margin: 0 0 0.9em;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

.atm-team .atm-card__bio > :last-child {
	margin-bottom: 0;
}

.atm-team .atm-card__bio a {
	color: var(--atm-accent);
}

/* 1px line at 90% width, 25px above and below (20px rhythm + 5px padding, as on alpha.school). */
.atm-team .atm-card__divider {
	width: 90%;
	height: 0;
	/* Side margins follow the card's text alignment (set by the Elementor widget). */
	margin: calc(var(--atm-space) + 5px) var(--atm-divider-mr, auto) calc(var(--atm-space) + 5px) var(--atm-divider-ml, 0);
	padding: 0;
	border: 0;
	border-top: 1px solid var(--atm-divider);
	background: none;
	opacity: 1;
}

.atm-team .atm-quote {
	margin: 0;
	padding: 0;
}

/* Heavy serif opening quote in a 36px box, as rendered by Elementor's blockquote on alpha.school. */
.atm-team .atm-quote__mark {
	display: block;
	height: calc(var(--atm-mark-size) * 0.6);
	margin: 0 0 5px;
	overflow: visible;
	color: var(--atm-quote-mark);
	font-family: "Times New Roman", Times, serif;
	font-size: var(--atm-mark-size);
	font-style: normal;
	font-weight: 900;
	line-height: var(--atm-mark-size);
	user-select: none;
}

.atm-team .atm-quote__text {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--atm-text);
	font-family: var(--atm-font);
	font-size: var(--atm-quote-size);
	font-style: normal;
	font-weight: 400;
	line-height: 1.4;
	quotes: none;
}

.atm-team .atm-quote__text::before,
.atm-team .atm-quote__text::after {
	content: none;
}

.atm-team .atm-quote__text p {
	margin: 0 0 0.6em;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
}

.atm-team .atm-quote__text p:last-child {
	margin-bottom: 0;
}

.atm-team .atm-quote__author {
	margin: 22px 0 0;
	color: var(--atm-accent);
	font-family: var(--atm-font);
	font-size: var(--atm-quote-size);
	font-style: normal;
	font-weight: 700;
	line-height: 1.4;
}

/* Single leader: image beside the text once there is room. */
.atm-row--feature .atm-card {
	flex-basis: 100%;
}

.atm-card--feature .atm-card__media {
	width: min(100%, 420px);
}

/* ---------------------------------------------------------------- Controls */

.atm-team .atm-nav {
	position: absolute;
	top: 100%;
	z-index: 2;
	display: none;
	align-items: center;
	justify-content: center;
	width: var(--atm-nav-size);
	height: var(--atm-nav-size);
	min-width: 0;
	min-height: 0;
	margin: 16px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: var(--atm-accent);
	line-height: 1;
	cursor: pointer;
	transition: opacity 0.2s ease, background-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.atm-team .atm-nav:hover,
.atm-team .atm-nav:focus {
	background: rgba(0, 0, 229, 0.06);
	color: var(--atm-accent);
	border: 0;
	box-shadow: none;
}

.atm-team .atm-nav:focus-visible {
	outline: 2px solid var(--atm-accent);
	outline-offset: 2px;
}

.atm-team .atm-nav[disabled],
.atm-team .atm-nav[aria-disabled="true"] {
	opacity: 0.3;
	cursor: default;
	background: transparent;
}

.atm-team .atm-nav svg {
	display: block;
	width: 22px;
	height: 22px;
	pointer-events: none;
}

.atm-team .atm-nav--prev {
	left: 0;
}

.atm-team .atm-nav--prev svg {
	transform: scaleX(-1);
}

.atm-team .atm-nav--next {
	right: 0;
}

.atm-row.is-scrollable .atm-nav {
	display: flex;
}

.atm-controls {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: var(--atm-nav-size);
	margin-top: 16px;
	padding: 0 calc(var(--atm-nav-size) + 8px);
}

.atm-row.is-scrollable .atm-controls {
	display: flex;
}

.atm-dots {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

.atm-team .atm-dot {
	position: relative;
	width: 24px;
	height: 24px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.atm-team .atm-dot::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: var(--atm-dot);
	height: var(--atm-dot);
	border-radius: 50%;
	background: var(--atm-accent);
	opacity: 0.22;
	transform: translate(-50%, -50%);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.atm-team .atm-dot:hover,
.atm-team .atm-dot:focus {
	background: transparent;
	border: 0;
}

.atm-team .atm-dot:hover::before {
	opacity: 0.5;
}

.atm-team .atm-dot[aria-current="true"]::before {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1.15);
}

.atm-team .atm-dot:focus-visible {
	outline: 2px solid var(--atm-accent);
	outline-offset: 0;
}

.atm-counter {
	color: var(--atm-accent);
	font-size: 0.8125rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.atm-team .atm-play {
	position: relative;
	width: 28px;
	height: 28px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1.5px solid var(--atm-accent);
	border-radius: 50%;
	background: transparent;
	color: var(--atm-accent);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.atm-team .atm-play:hover,
.atm-team .atm-play:focus {
	background: rgba(0, 0, 229, 0.06);
	color: var(--atm-accent);
}

.atm-play__icon,
.atm-play__icon::before {
	position: absolute;
	top: 50%;
	left: 50%;
}

/* Pause bars (playing) */
.atm-play__icon {
	width: 8px;
	height: 10px;
	border-inline: 2.5px solid currentColor;
	transform: translate(-50%, -50%);
}

/* Play triangle (paused) */
.atm-play.is-paused .atm-play__icon {
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 5px 0 5px 8px;
	border-color: transparent transparent transparent currentColor;
	transform: translate(-35%, -50%);
}

/* Editors-only configuration notice. */
.atm-notice {
	padding: 12px 16px;
	border-left: 4px solid #d63638;
	background: #fcf0f1;
	color: #1d2327;
	font-size: 14px;
	line-height: 1.5;
}

/* ---------------------------------------------------------------- Tablet (section >= 600px) */

@container atm-team (min-width: 600px) {
	/* Custom properties are set on rows: a container cannot be styled by its own query. */
	.atm-row {
		--atm-pv: var(--atm-cols-md, 2);
		--atm-gap: 32px;
	}

	.atm-row--stack-sm {
		--atm-stacked: 0;
	}

	.atm-row--leaders {
		--atm-gap: 48px;
	}

	.atm-row--stack-sm .atm-track {
		flex-direction: row;
		gap: var(--atm-gap);
		overflow-x: auto;
		scroll-snap-type: x mandatory;
	}

	.atm-row--stack-sm .atm-card {
		flex: 0 0 calc((100% - (var(--atm-pv) - 1) * var(--atm-gap)) / var(--atm-pv));
		width: auto;
	}

	.atm-row--stack-sm .atm-card:first-child {
		margin-inline-start: auto;
	}

	.atm-row--stack-sm .atm-card:last-child {
		margin-inline-end: auto;
	}

	/* Arrows move to the sides of the row. */
	.atm-row.is-scrollable.has-arrows .atm-row__stage {
		padding-inline: calc(var(--atm-nav-size) + 4px);
	}

	.atm-team .atm-nav {
		top: 50%;
		margin: 0;
		transform: translateY(-50%);
	}

	.atm-controls {
		margin-top: 32px;
		padding: 0;
	}

	.atm-row.is-scrollable .atm-controls:not(:has(.atm-dots, .atm-play)) {
		display: none;
	}

	.atm-team .atm-card__bio {
		font-size: var(--atm-bio-size);
	}
}

/* ---------------------------------------------------------------- Single leader side by side (>= 700px) */

@container atm-team (min-width: 700px) {
	.atm-card--feature {
		display: grid;
		grid-template-columns: minmax(0, 36fr) minmax(0, 64fr);
		gap: 44px;
		align-items: center;
	}

	.atm-card--feature .atm-card__media {
		width: 100%;
		margin: 0;
	}
}

/* ---------------------------------------------------------------- Desktop (section >= 960px) */

@container atm-team (min-width: 960px) {
	.atm-row {
		--atm-pv: var(--atm-cols-lg, 3);
		--atm-gap: 40px;
		--atm-row-gap: 88px;
	}

	.atm-row--leaders {
		--atm-gap: 64px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.atm-team .atm-nav,
	.atm-team .atm-dot::before {
		transition: none;
	}
}

@media print {
	.atm-track {
		flex-wrap: wrap;
		overflow: visible;
	}

	.atm-team .atm-nav,
	.atm-controls {
		display: none !important;
	}
}
