/* =========================================================
   AP Team — front end
   Change the colors in the variables below to match the theme,
   or override them from the theme's shared stylesheet.
   ========================================================= */

.apteam-grid,
.apteam-featured-list,
.apteam-single,
.apteam-modal {
	--apteam-accent: #2f54eb;
	--apteam-accent-soft: #eef2ff;
	--apteam-text: #1f2333;
	--apteam-muted: #5f6577;
	--apteam-border: #e6e8ef;
	--apteam-card-bg: #ffffff;
	--apteam-photo-bg: #eef0f6;
	--apteam-hero-bg: #f6f7fb;
	--apteam-radius: 16px;
	--apteam-gap: 32px;
	--apteam-font-size: 18px;
}

/* ---------- Grid ---------- */
.apteam-grid {
	display: grid;
	gap: var(--apteam-gap);
	margin: 0 0 40px;
}

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

/* ---------- Card ---------- */
.apteam-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 12px;
	background: var(--apteam-card-bg);
	border: 1px solid var(--apteam-border);
	border-radius: calc(var(--apteam-radius) + 6px);
	transition: box-shadow 0.35s ease, translate 0.35s ease, border-color 0.35s ease;
}

.apteam-card:hover {
	translate: 0 -6px;
	border-color: transparent;
	box-shadow: 0 22px 48px rgba(20, 24, 40, 0.12);
}

.apteam-card:focus-within {
	border-color: var(--apteam-accent);
}

.apteam-card__photo {
	position: relative;
	aspect-ratio: 4 / 5;
	border-radius: var(--apteam-radius);
	background: var(--apteam-photo-bg);
	overflow: hidden;
	isolation: isolate;
}

.apteam-card__photo::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(15, 18, 32, 0.55), transparent 45%);
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
}

.apteam-card:hover .apteam-card__photo::after,
.apteam-card:focus-within .apteam-card__photo::after {
	opacity: 1;
}

.apteam-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	transition: scale 0.6s ease;
}

.apteam-card:hover .apteam-card__img {
	scale: 1.06;
}

/* Social links that slide up over the photo */
.apteam-links--overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 16px;
	z-index: 2;
	justify-content: center;
	gap: 8px;
	opacity: 0;
	translate: 0 12px;
	transition: opacity 0.35s ease, translate 0.35s ease;
}

.apteam-card:hover .apteam-links--overlay,
.apteam-card:focus-within .apteam-links--overlay {
	opacity: 1;
	translate: 0 0;
}

.apteam-links--overlay .apteam-links__btn {
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
}

@media (hover: none) {
	.apteam-links--overlay {
		opacity: 1;
		translate: 0 0;
	}
	.apteam-card__photo::after {
		opacity: 1;
	}
}

/* Initials placeholder (no photo yet) */
.apteam-initials {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.95);
	font-size: clamp(2.5rem, 6vw, 4rem);
	font-weight: 700;
	letter-spacing: 0.04em;
}

.apteam-initials--1 { background: linear-gradient(135deg, #2f54eb, #7b61ff); }
.apteam-initials--2 { background: linear-gradient(135deg, #f0623d, #f7a541); }
.apteam-initials--3 { background: linear-gradient(135deg, #0fa38e, #3fc7c0); }
.apteam-initials--4 { background: linear-gradient(135deg, #c2338b, #f06fa5); }

.apteam-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--apteam-photo-bg);
}

.apteam-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 18px 10px 8px;
}

.apteam-card__designation {
	margin: 0 0 6px;
	color: var(--apteam-accent);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.apteam-card__name {
	margin: 0;
	font-size: 1.35rem;
	line-height: 1.25;
	color: var(--apteam-text);
}

.apteam-card__link {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-align: inherit;
	text-decoration: none;
	cursor: pointer;
}

/* Whole card clickable; overlay links sit above it */
.apteam-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
}

.apteam-card__link:focus-visible {
	outline: none;
}

.apteam-card__bio {
	margin: 10px 0 0;
	font-size: var(--apteam-font-size);
	line-height: 1.6;
	color: var(--apteam-muted);
}

.apteam-card__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	padding-top: 16px;
	color: var(--apteam-text);
	font-size: 0.9rem;
	font-weight: 600;
	transition: color 0.25s ease, gap 0.25s ease;
}

.apteam-card:hover .apteam-card__more {
	gap: 10px;
	color: var(--apteam-accent);
}

/* ---------- Featured profile (single member) ---------- */
.apteam-featured-list {
	display: grid;
	gap: 40px;
	margin: 0 0 40px;
}

.apteam-feature {
	display: grid;
	grid-template-columns: minmax(260px, 380px) 1fr;
	background: var(--apteam-card-bg);
	border: 1px solid var(--apteam-border);
	border-radius: var(--apteam-radius);
	overflow: hidden;
	box-shadow: 0 18px 50px rgba(20, 24, 40, 0.08);
}

.apteam-feature__photo {
	position: relative;
	min-height: 380px;
	background: var(--apteam-photo-bg);
}

.apteam-feature__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.apteam-feature__photo .apteam-initials,
.apteam-hero__photo .apteam-initials {
	font-size: 5rem;
}

.apteam-feature__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 48px 52px;
}

.apteam-feature__designation,
.apteam-hero__designation {
	display: inline-block;
	align-self: flex-start;
	margin: 0 0 14px;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--apteam-accent-soft);
	color: var(--apteam-accent);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.apteam-feature__name {
	margin: 0 0 14px;
	font-size: 2.25rem;
	line-height: 1.15;
	color: var(--apteam-text);
}

.apteam-feature__summary {
	margin: 0 0 22px;
	font-size: var(--apteam-font-size);
	line-height: 1.7;
	color: var(--apteam-muted);
}

.apteam-feature__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-top: 8px;
}

/* ---------- Skills tags ---------- */
.apteam-skills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
}

.apteam-skills__tag {
	margin: 0;
	padding: 6px 12px;
	border: 1px solid var(--apteam-border);
	border-radius: 8px;
	background: var(--apteam-card-bg);
	color: var(--apteam-text);
	font-size: 0.85rem;
	line-height: 1.3;
}

/* ---------- Buttons & links ---------- */
.apteam-btn {
	display: inline-flex;
	border: 0;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	align-items: center;
	padding: 13px 26px;
	border-radius: 10px;
	background: var(--apteam-accent);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	transition: filter 0.2s ease, translate 0.2s ease;
}

.apteam-btn:hover {
	color: #fff;
	filter: brightness(1.1);
	translate: 0 -1px;
}

.apteam-links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.apteam-links li {
	margin: 0;
}

.apteam-links__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--apteam-border);
	border-radius: 10px;
	background: var(--apteam-card-bg);
	color: var(--apteam-text);
	text-decoration: none;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.apteam-links__btn:hover {
	color: var(--apteam-accent);
	border-color: var(--apteam-accent);
}

.apteam-links__btn span {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.apteam-icon {
	display: block;
}

/* ---------- Single member page ---------- */
.apteam-single {
	padding: 0 0 80px;
}

.apteam-single__container {
	max-width: 1140px;
	margin: 0 auto;
	padding: 0 20px;
}

.apteam-hero {
	margin-bottom: 60px;
	padding: 70px 0;
	background: var(--apteam-hero-bg);
}

.apteam-hero__inner {
	display: grid;
	grid-template-columns: 340px 1fr;
	gap: 56px;
	align-items: center;
}

.apteam-hero__photo {
	position: relative;
	aspect-ratio: 4 / 5;
	border-radius: var(--apteam-radius);
	overflow: hidden;
	background: var(--apteam-photo-bg);
	box-shadow: 0 18px 50px rgba(20, 24, 40, 0.12);
}

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

.apteam-hero__body {
	display: flex;
	flex-direction: column;
}

.apteam-hero__name {
	margin: 0 0 16px;
	font-size: 2.75rem;
	line-height: 1.1;
	color: var(--apteam-text);
}

.apteam-hero__summary {
	margin: 0 0 24px;
	max-width: 620px;
	font-size: var(--apteam-font-size);
	line-height: 1.7;
	color: var(--apteam-muted);
}

/* Bio content (from the editor) */
.apteam-content__bio {
	max-width: 820px;
	color: var(--apteam-text);
	font-size: var(--apteam-font-size);
	line-height: 1.8;
}

.apteam-content__bio > :first-child {
	margin-top: 0;
}

.apteam-content__bio h2,
.apteam-content__bio h3 {
	margin: 40px 0 16px;
	line-height: 1.3;
	color: var(--apteam-text);
}

.apteam-content__bio p {
	margin: 0 0 18px;
}

.apteam-content__bio ul {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 24px;
	margin: 0 0 28px;
	padding: 0;
	list-style: none;
}

.apteam-content__bio ul li {
	position: relative;
	margin: 0;
	padding: 14px 16px 14px 46px;
	border: 1px solid var(--apteam-border);
	border-radius: 10px;
	background: var(--apteam-card-bg);
	font-size: 0.97rem;
	line-height: 1.5;
}

.apteam-content__bio ul li::before {
	content: "";
	position: absolute;
	top: 15px;
	left: 16px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--apteam-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12 4 4 8-8' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---------- Profile popup ---------- */
.apteam-modal {
	width: min(920px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100dvh - 48px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: calc(var(--apteam-radius) + 6px);
	background: var(--apteam-card-bg);
	color: var(--apteam-text);
	box-shadow: 0 30px 80px rgba(10, 12, 24, 0.35);
	overflow: hidden;
}

.apteam-modal[open] {
	display: flex;
	animation: apteam-modal-in 0.3s ease both;
}

.apteam-modal.is-closing {
	animation: apteam-modal-out 0.2s ease both;
}

.apteam-modal::backdrop {
	background: rgba(15, 18, 32, 0.6);
	backdrop-filter: blur(4px);
	animation: apteam-fade-in 0.3s ease both;
}

.apteam-modal.is-closing::backdrop {
	animation: apteam-fade-out 0.2s ease both;
}

.apteam-modal-open {
	overflow: hidden;
}

.apteam-modal__panel {
	position: relative;
	width: 100%;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.apteam-modal__close {
	position: sticky;
	top: 16px;
	z-index: 3;
	float: right;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin: 16px 16px -58px 0;
	padding: 0;
	border: 1px solid var(--apteam-border);
	border-radius: 50%;
	background: var(--apteam-card-bg);
	color: var(--apteam-text);
	cursor: pointer;
	transition: rotate 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.apteam-modal__close:hover {
	rotate: 90deg;
	color: var(--apteam-accent);
	border-color: var(--apteam-accent);
}

.apteam-modal__close:focus-visible {
	outline: 3px solid var(--apteam-accent);
	outline-offset: 2px;
}

.apteam-modal__head {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 36px;
	align-items: center;
	padding: 40px 44px 32px;
	background: var(--apteam-hero-bg);
}

.apteam-modal__photo {
	position: relative;
	aspect-ratio: 4 / 5;
	border-radius: var(--apteam-radius);
	overflow: hidden;
	background: var(--apteam-photo-bg);
	box-shadow: 0 14px 36px rgba(20, 24, 40, 0.14);
}

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

.apteam-modal__photo .apteam-initials {
	font-size: 4rem;
}

.apteam-modal__intro {
	display: flex;
	flex-direction: column;
	padding-right: 40px;
}

.apteam-modal__designation {
	align-self: flex-start;
	margin: 0 0 12px;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--apteam-accent-soft);
	color: var(--apteam-accent);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.apteam-modal__name {
	margin: 0 0 12px;
	font-size: 2.25rem;
	line-height: 1.15;
	color: var(--apteam-text);
}

.apteam-modal__summary {
	margin: 0 0 20px;
	font-size: var(--apteam-font-size);
	line-height: 1.7;
	color: var(--apteam-muted);
}

.apteam-modal__content {
	padding: 32px 44px 44px;
}

.apteam-modal__bio {
	max-width: none;
	font-size: var(--apteam-font-size);
}

.apteam-modal__bio h2,
.apteam-modal__bio h3 {
	margin-top: 28px;
	font-size: 1.35rem;
}

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

@keyframes apteam-modal-out {
	from { opacity: 1; transform: none; }
	to   { opacity: 0; transform: translateY(16px) scale(0.98); }
}

@keyframes apteam-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes apteam-fade-out {
	from { opacity: 1; }
	to   { opacity: 0; }
}

/* ---------- Scroll animation (JS adds .is-visible) ---------- */
.apteam-js .apteam-animate {
	opacity: 0;
	transform: translateY(30px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}

.apteam-js .apteam-animate.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.apteam-grid--cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
	.apteam-grid { --apteam-gap: 24px; }
	.apteam-grid--cols-3,
	.apteam-grid--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	.apteam-feature {
		grid-template-columns: 1fr;
	}

	.apteam-feature__photo {
		min-height: 0;
		aspect-ratio: 4 / 3;
	}

	.apteam-feature__body {
		padding: 32px 28px;
	}

	.apteam-hero__inner {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.apteam-hero__photo {
		max-width: 340px;
	}

	.apteam-hero__name {
		font-size: 2.25rem;
	}

	.apteam-content__bio ul {
		grid-template-columns: 1fr;
	}

	.apteam-modal__head {
		grid-template-columns: 1fr;
		gap: 24px;
		padding-top: 72px;
	}

	.apteam-modal__photo {
		max-width: 220px;
	}

	.apteam-modal__intro {
		padding-right: 0;
	}

	.apteam-modal__name {
		font-size: 1.85rem;
	}
}

@media (max-width: 575px) {
	.apteam-grid--cols-2,
	.apteam-grid--cols-3,
	.apteam-grid--cols-4 { grid-template-columns: 1fr; }

	.apteam-card__photo {
		aspect-ratio: 1 / 1;
	}

	.apteam-modal {
		width: 100vw;
		max-height: 100dvh;
		height: 100dvh;
		border-radius: 0;
	}

	.apteam-modal__head,
	.apteam-modal__content {
		padding-left: 20px;
		padding-right: 20px;
	}

	.apteam-feature__name {
		font-size: 1.85rem;
	}

	.apteam-hero {
		padding: 44px 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.apteam-js .apteam-animate {
		opacity: 1;
		transform: none;
		transition: none;
	}
	.apteam-card,
	.apteam-card__img,
	.apteam-links--overlay,
	.apteam-modal,
	.apteam-modal::backdrop,
	.apteam-btn {
		animation: none;
		transition: none;
	}
}
