/**
 * Team page template styles.
 * Loaded with addiction-treatment.css for shared tokens and breadcrumbs.
 */

.team-page {
	font-family: 'Montserrat', sans-serif;
	background: var(--at-tan, #f5f0e8);
	--team-olive-light: #e9ebe4;
	overflow-x: hidden;
	max-width: 100%;
}

@media (max-width: 1024px) {
	main.team-page {
		margin-top: 0 !important;
		padding-top: 0 !important;
		background-color: transparent !important;
	}
}

.team-page [id] {
	scroll-margin-top: var(--scroll-offset, var(--at-sticky-header-height, 160px));
}

/* Hero */
.team-hero {
	background: var(--at-olive, #45483b);
	color: var(--at-white, #fff);
	padding: 48px 24px 0;
}

.team-hero__inner {
	max-width: 1200px;
	margin: 0 auto;
}

.team-hero__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 40px;
	align-items: center;
	margin-bottom: 40px;
}

.team-hero__content {
	min-width: 0;
}

.team-hero__media {
	display: flex;
	justify-content: center;
	align-items: center;
}

.team-hero__img-wrap {
	position: relative;
	width: 100%;
	max-width: 100%;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}

.team-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 8px;
}

.team-hero__headline {
	font-size: clamp(32px, 5vw, 50px);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.4px;
	margin: 0 0 16px;
	color: #fff;
}

.team-hero__intro {
	font-size: 16px;
	line-height: 1.65;
	margin: 0 0 24px;
	max-width: 720px;
	opacity: 0.92;
}

.team-hero__content .at-hero__cta-wrap {
	margin: 0 0 28px;
}

.team-hero__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 32px 48px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.team-hero__stat {
	min-width: 100px;
}

.team-hero__stat-value {
	display: block;
	font-size: clamp(28px, 4vw, 40px);
	font-weight: 500;
	line-height: 1.1;
	margin-bottom: 6px;
	color: #fff;
}

.team-hero__stat-label {
	display: block;
	font-size: 14px;
	line-height: 1.4;
	opacity: 0.8;
}

/* Filter bar */
.team-filter-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 0 24px;
}

.team-filter {
	display: flex;
	flex-wrap: nowrap;
	gap: 6px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	background: var(--at-tan, #f5f0e8);
	border-radius: 12px;
	padding: 8px;
	scrollbar-width: none;
}

.team-filter::-webkit-scrollbar {
	display: none;
}

.team-page .team-filter a.team-filter__btn,
.team-page .team-filter button.team-filter__btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--at-olive, #45483b) !important;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	height: auto;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s ease, color 0.2s ease;
}

.team-page .team-filter a.team-filter__btn:hover,
.team-page .team-filter a.team-filter__btn:focus,
.team-page .team-filter button.team-filter__btn:hover,
.team-page .team-filter button.team-filter__btn:focus {
	background: rgba(69, 72, 59, 0.1);
	color: var(--at-olive, #45483b) !important;
	outline: none;
	text-decoration: none;
}

.team-page .team-filter a.team-filter__btn.is-active,
.team-page .team-filter button.team-filter__btn.is-active {
	background: var(--at-olive, #45483b);
	color: #fff !important;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.team-page .team-filter a.team-filter__btn.is-active .team-filter__count,
.team-page .team-filter button.team-filter__btn.is-active .team-filter__count {
	opacity: 0.85;
	color: #fff;
}

.team-filter__count {
	font-size: 13px;
	font-weight: 500;
	opacity: 0.65;
}

.team-filter.is-stuck {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 90;
	border-radius: 0;
	padding: 10px 16px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.team-filter-placeholder {
	display: none;
}

.team-filter-placeholder.is-active {
	display: block;
}

/* Sections */
.team-sections {
	padding: 0;
}

.team-section {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 56px 24px;
}

.team-section > .team-section__header,
.team-section > .team-section__video,
.team-section > .team-grid {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

.team-section:nth-child(odd) {
	background: var(--at-tan, #f5f0e8);
}

.team-section:nth-child(even) {
	background: var(--team-olive-light);
}

.team-section:last-child {
	margin-bottom: 0;
}

.team-section.is-hidden {
	display: none;
}

.team-section__header {
	margin-bottom: 28px;
	padding-bottom: 20px;
	border-bottom: 1px solid rgba(69, 72, 59, 0.12);
}

.team-section__title-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	margin-bottom: 10px;
}

.team-section__title {
	font-size: clamp(28px, 4vw, 36px);
	font-weight: 600;
	line-height: 1.2;
	color: #2f3329;
	margin: 0;
}

.team-section__badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(118, 122, 76, 0.12);
	color: #5f6340;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.team-section__description {
	margin: 0;
	font-size: 16px;
	line-height: 1.6;
	color: #5c6154;
	max-width: 760px;
}

.team-section__video {
	margin: 32px 0 0;
}

.team-section__video .at-video__grid {
	justify-items: start;
}

.team-section__video .at-video__item {
	max-width: 760px;
	width: 100%;
}

/* Member grid */
.team-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 24px;
}

.team-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 24px 20px 28px;
	background: #fff;
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-card:hover,
.team-card:focus {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	outline: none;
}

.team-card__photo {
	width: 148px;
	height: 148px;
	margin: 0 auto 20px;
	border-radius: 50%;
	overflow: hidden;
	background: #ece8e0;
	flex-shrink: 0;
}

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

.team-card__group {
	display: none;
}

.team-card__name {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.25;
	color: #2f3329;
	text-align: center;
}

.team-card__role {
	margin: 0 0 14px;
	font-size: 12px;
	font-weight: 600;
	color: #767a4c;
	text-align: center;
	line-height: 1.4;
}

.team-card__bio {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: #5c6154;
	text-align: center;
	flex-grow: 1;
}

@media (min-width: 900px) {
	.team-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

@media (min-width: 768px) {
	.team-hero__grid {
		gap: 28px;
		margin-bottom: 32px;
	}

	.team-hero__img-wrap {
		max-height: 360px;
	}
}

@media (max-width: 768px) {
	.team-hero {
		padding-top: 32px;
	}

	.team-hero__grid {
		grid-template-columns: 1fr;
		gap: 28px;
		margin-bottom: 28px;
	}

	.team-hero__media {
		order: -1;
	}

	.team-hero__content .at-hero__cta-wrap {
		margin-bottom: 24px;
	}

	.team-hero__stats {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
		gap: 10px;
		margin-top: 4px;
		padding-top: 20px;
		border-top: 1px solid rgba(255, 255, 255, 0.14);
	}

	.team-hero__stat {
		min-width: 0;
		padding: 14px 8px;
		background: rgba(255, 255, 255, 0.08);
		border-radius: 10px;
		text-align: center;
	}

	.team-hero__stat-value {
		font-size: clamp(22px, 6.5vw, 30px);
		margin-bottom: 4px;
		line-height: 1.15;
	}

	.team-hero__stat-label {
		font-size: 11px;
		line-height: 1.35;
		letter-spacing: 0.01em;
		opacity: 0.92;
	}

	.team-section {
		padding: 40px 16px;
	}

	.team-grid {
		grid-template-columns: 1fr;
		max-width: 360px;
		margin: 0 auto;
	}

	.team-card__group {
		display: inline-block;
		align-self: center;
		margin: 0 0 10px;
		padding: 4px 12px;
		border-radius: 999px;
		background: rgba(118, 122, 76, 0.14);
		color: #5f6340;
		font-size: 11px;
		font-weight: 600;
		line-height: 1.3;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.team-card,
	.team-filter__btn {
		transition: none;
	}
}
