/*---------------------------------------
  ENVOLVIDOS.CSS — Seção de alunos
  Capsula lateral com 4 módulos + grid de alunos
-----------------------------------------*/

:root {
	--envolvidos-capsule-bg: #ffffff;
	--envolvidos-tab-color: #1a1a1a;
	--envolvidos-tab-active-bg: var(--primary-color);
	--envolvidos-tab-active-color: #ffffff;
	--envolvidos-avatar-bg: #ffffff;
	--envolvidos-avatar-color: var(--accent-color);
	--envolvidos-subtitle-color: #555555;
}

body.dark-mode {
	--envolvidos-capsule-bg: #1f1b3a;
	--envolvidos-tab-color: #ffffff;
	--envolvidos-avatar-bg: #1f1b3a;
	--envolvidos-avatar-color: var(--primary-color);
	--envolvidos-subtitle-color: #cccccc;
}

.envolvidos-section {
	background-color: var(--section-bg-color);
}

.envolvidos-subtitle {
	color: var(--envolvidos-subtitle-color);
	max-width: 38rem;
	margin: 0.5rem auto 0;
	font-size: 1rem;
}

/* Mobile-first: capsula acima do grid */
.envolvidos-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2rem;
}

/*---------------------------------------
  CÁPSULA LATERAL DE MÓDULOS
-----------------------------------------*/
.modulos-capsule {
	display: flex;
	flex-direction: row;
	background-color: var(--envolvidos-capsule-bg);
	border-radius: var(--border-radius-large);
	padding: 0.4rem;
	gap: 0.4rem;
	box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
}

.modulo-tab {
	all: unset;
	cursor: pointer;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--envolvidos-tab-color);
	font-weight: var(--font-weight-bold);
	font-size: 1.2rem;
	transition: background-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
	font-family: var(--body-font-family);
}

.modulo-tab:hover {
	transform: scale(1.08);
}

.modulo-tab.active {
	background-color: var(--envolvidos-tab-active-bg);
	color: var(--envolvidos-tab-active-color);
	box-shadow: 0 0.3rem 0.8rem rgba(255, 161, 0, 0.45);
}

.modulo-tab:focus-visible {
	outline: 0.15rem solid var(--accent-color);
	outline-offset: 0.2rem;
}

/*---------------------------------------
  PAINEL DE ALUNOS
-----------------------------------------*/
.alunos-painel-wrapper {
	flex: 1;
	width: 100%;
}

.alunos-painel {
	display: none;
	animation: fadeInUp 0.35s ease;
}

.alunos-painel.active {
	display: block;
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(0.6rem);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.alunos-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.2rem 1rem;
	justify-items: center;
}

.aluno-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	width: 100%;
	max-width: 9rem;
	position: relative;
	outline: none;
}

.aluno-card:focus-visible .aluno-avatar {
	box-shadow: 0 0 0 0.2rem var(--accent-color);
}

.aluno-avatar {
	width: 5rem;
	height: 5rem;
	border-radius: 50%;
	background-color: var(--envolvidos-avatar-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 0.6rem;
	color: var(--envolvidos-avatar-color);
	font-weight: var(--font-weight-bold);
	font-size: 1.4rem;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
	overflow: hidden;
}

.aluno-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.aluno-card:hover .aluno-avatar {
	transform: translateY(-0.25rem);
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
}

.aluno-nome {
	margin: 0;
	font-weight: var(--font-weight-medium);
	font-size: 0.95rem;
	color: var(--p-color);
}

.aluno-cargo {
	font-size: 0.8rem;
	color: var(--envolvidos-subtitle-color);
}

/*---------------------------------------
  POPOVER DO ALUNO (hover/focus)
-----------------------------------------*/
.aluno-popover {
	position: absolute;
	top: calc(100% + 0.8rem);
	left: 50%;
	transform: translateX(-50%) translateY(0.4rem);
	width: 17rem;
	max-width: calc(100vw - 2rem);
	background-color: var(--envolvidos-capsule-bg);
	border-radius: var(--border-radius-medium);
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
	padding: 1rem;
	text-align: left;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
	z-index: 20;
}

.aluno-popover::before {
	content: "";
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 0.5rem solid transparent;
	border-bottom-color: var(--envolvidos-capsule-bg);
}

.aluno-card:hover .aluno-popover,
.aluno-card:focus-within .aluno-popover {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}

.aluno-popover-header {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	margin-bottom: 0.6rem;
}

.aluno-popover-avatar {
	width: 2.6rem;
	height: 2.6rem;
	border-radius: 50%;
	background-color: var(--envolvidos-avatar-bg);
	color: var(--envolvidos-avatar-color);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: var(--font-weight-bold);
	font-size: 0.85rem;
	flex-shrink: 0;
	box-shadow: 0 0.3rem 0.6rem rgba(0, 0, 0, 0.12);
	overflow: hidden;
}

.aluno-popover-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.aluno-popover-nome {
	margin: 0;
	font-weight: var(--font-weight-bold);
	font-size: 0.95rem;
	color: var(--p-color);
	line-height: 1.2;
}

.aluno-popover-cargo {
	font-size: 0.75rem;
	color: var(--envolvidos-subtitle-color);
}

.aluno-popover-descricao {
	margin: 0 0 0.7rem 0;
	font-size: 0.85rem;
	line-height: 1.45;
	color: var(--p-color);
}

.aluno-popover-linkedin {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem;
	font-weight: var(--font-weight-medium);
	color: var(--accent-color);
	text-decoration: none;
	padding: 0.35rem 0.7rem;
	border-radius: var(--border-radius-small);
	background-color: rgba(255, 0, 77, 0.08);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.aluno-popover-linkedin:hover {
	background-color: var(--accent-color);
	color: #ffffff;
}

.aluno-popover-linkedin i {
	font-size: 1rem;
}

/*---------------------------------------
  BREAKPOINT — TABLET (>= 576px)
-----------------------------------------*/
@media (min-width: 36rem) {
	.alunos-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 1.5rem;
	}

	.aluno-avatar {
		width: 5.5rem;
		height: 5.5rem;
	}
}

/*---------------------------------------
  BREAKPOINT — DESKTOP (>= 992px)
  Cápsula à esquerda em coluna, grid à direita
-----------------------------------------*/
@media (min-width: 62rem) {
	.envolvidos-wrapper {
		flex-direction: row;
		align-items: flex-start;
		gap: 3rem;
	}

	.modulos-capsule {
		flex-direction: column;
		padding: 0.6rem 0.5rem;
		gap: 0.6rem;
		position: sticky;
		top: 6rem;
	}

	.modulo-tab {
		width: 3.4rem;
		height: 3.4rem;
		font-size: 1.3rem;
	}

	.alunos-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 1.8rem 1.2rem;
	}

	.aluno-avatar {
		width: 6rem;
		height: 6rem;
		font-size: 1.6rem;
	}

	.aluno-nome {
		font-size: 1rem;
	}
}
