/* =================================================================
   Teams Block
   Styles: cards (default) | round | minimal

   "Cards" is the base style — no .is-style-cards prefix needed.
   Only round and minimal override the base.
   ================================================================= */

/* Base */
.teams {
	position: relative;
}

/* Padding */
.teams--py-sm {
	padding-block: 2rem;
}
.teams--py-md {
	padding-block: 3rem;
}
.teams--py-lg {
	padding-block: 4rem;
}

/* Background */
.teams--bg-default {
	background-color: var(--wp--preset--color--bg);
}
.teams--bg-light {
	background-color: var(--wp--preset--color--bg-secondary);
}

/* Grid */
.teams__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--teams-gap, 1.5rem);
	margin-top: 3rem;
}

/* Gap variants */
.teams--gap-sm {
	--teams-gap: 0.75rem;
}
.teams--gap-md {
	--teams-gap: 1.5rem;
}
.teams--gap-lg {
	--teams-gap: 2.5rem;
}

/* Column classes */
.teams--cols-2 .teams__grid {
	--teams-cols: 2;
}
.teams--cols-3 .teams__grid {
	--teams-cols: 3;
}
.teams--cols-4 .teams__grid {
	--teams-cols: 4;
}

/* Grid width: narrow caps max-width and centers */
.teams--width-narrow .teams__grid {
	max-width: 56rem;
	margin-inline: auto;
}

/* Grid centering (flexbox override).
   When fewer items than columns, center instead of left-align. */
.teams--grid-center .teams__grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	column-gap: var(--teams-gap, 1.5rem);
	row-gap: var(--teams-gap, 1.5rem);
}

.teams--grid-center .team-member {
	width: 100%;
}

/* Card content alignment */
.teams--card-center .team-member__body {
	text-align: center;
}
.teams--card-left .team-member__body {
	text-align: left;
}
.teams--card-center .team-member__contact {
	justify-content: center;
}
.teams--card-left .team-member__contact {
	justify-content: flex-start;
}

/* Card border-radius */
.teams--radius-square .team-member,
.teams--radius-square .team-member__photo {
	border-radius: 0;
}

.teams--radius-rounded .team-member,
.teams--radius-rounded .team-member__photo {
	border-radius: var(--wp--custom--radius--8);
}

/* CTA button */
.teams__cta {
	text-align: center;
	margin-top: 2.5rem;
}

/* Placeholder */
.teams__placeholder {
	min-height: 10rem;
	border: 2px dashed var(--wp--preset--color--border);
	background: var(--wp--preset--color--bg-secondary);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--wp--custom--radius--8);
	color: var(--wp--preset--color--text-muted);
	font-size: 0.875rem;
	width: 100%;
}

/* =================================================================
   Shared card styles (name, role, desc, contact, image)
   Applied to all three style variants.
   ================================================================= */

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

.team-member__name {
	color: var(--wp--preset--color--text-heading);
	font-size: 0.9375rem;
	font-weight: 500;
	letter-spacing: 0.01875rem;
	text-transform: uppercase;
	margin: 0 0 0.5rem;
}

.team-member__name a {
	color: inherit;
	text-decoration: none;
}

.team-member__role {
	color: var(--wp--preset--color--text-muted);
	font-size: 0.875rem;
	font-weight: 500;
	margin: 0;
	text-wrap: balance;
}

.team-member__desc {
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--wp--preset--color--text-body);
	margin: 0.75rem 0 0;
	text-wrap: pretty;
}

.team-member__contact {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.team-member__contact-item {
	font-size: 0.8125rem;
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	text-underline-offset: 0.15rem;
}

.team-member__contact-item:hover {
	opacity: 0.7;
}

/* =================================================================
   Style: Cards (default — base, no .is-style-cards prefix)
   ================================================================= */

.team-member {
	position: relative;
	background: var(--wp--preset--color--white);
	overflow: hidden;
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

.team-member__photo {
	aspect-ratio: var(--teams-photo-ratio, 3/4);
	overflow: hidden;
}

.team-member__body {
	padding: 1.25rem 1.5rem;
}

.team-member--linked:hover {
	transform: translateY(-0.125rem);
	box-shadow: var(--wp--preset--shadow--200);
}

/* Stretched link: cubre toda la card */
.team-member__link {
	color: inherit;
	text-decoration: none;
}

.team-member__link::after {
	content: '';
	position: absolute;
	inset: 0;
}

.team-member__link:focus-visible::after {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 0.125rem;
}

/* El contact queda por encima del stretched link */
.team-member__contact {
	position: relative;
	z-index: 1;
}

/* =================================================================
   Style: Round (circular photos — ignores photo_ratio)
   ================================================================= */

.is-style-round .team-member {
	background: transparent;
	text-align: center;
}

.is-style-round .team-member__photo {
	width: 8rem;
	height: 8rem;
	aspect-ratio: auto;
	margin: 0 auto 1rem;
	border-radius: 50%;
	border: 0.25rem solid var(--wp--preset--color--white);
	box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
}

.is-style-round .team-member__body {
	text-align: center;
	padding: 0;
}

.is-style-round .team-member__contact {
	justify-content: center;
}

/* Round always 50% regardless of radius setting */
.teams--radius-square.is-style-round .team-member__photo {
	border-radius: 50%;
}

.is-style-round .team-member--linked:hover {
	transform: none;
	box-shadow: none;
}

.is-style-round .team-member--linked:hover .team-member__photo {
	box-shadow: 0 0.375rem 1.25rem rgba(0, 0, 0, 0.12);
	transform: scale(1.03);
}

/* =================================================================
   Style: Minimal (clean, no card bg)
   ================================================================= */

.is-style-minimal .team-member {
	background: transparent;
}

.is-style-minimal .team-member__photo {
	aspect-ratio: var(--teams-photo-ratio, 1/1);
	margin-bottom: 1rem;
}

.is-style-minimal .team-member__body {
	padding: 0;
}

.is-style-minimal .team-member--linked:hover {
	transform: none;
	box-shadow: none;
}

.is-style-minimal .team-member--linked:hover .team-member__image {
	opacity: 0.9;
}

/* =================================================================
   Responsive
   ================================================================= */

/* Small mobile: cap card width */
@media (max-width: 29.9375rem) {
	.team-member {
		max-width: 20rem;
		margin-inline: auto;
	}

	.is-style-round .team-member {
		max-width: none;
	}
}

/* Large mobile (30rem / 480px): 2 columns */
@media (min-width: 30rem) and (max-width: 47.9375rem) {
	.teams--grid-left .teams__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.teams--grid-center .team-member {
		width: calc((100% - var(--teams-gap, 1.5rem)) / 2);
	}
}

/* Tablet (48rem / 768px) */
@media (min-width: 48rem) {
	.teams--py-sm {
		padding-block: 3rem;
	}
	.teams--py-md {
		padding-block: 4.5rem;
	}
	.teams--py-lg {
		padding-block: 6rem;
	}

	.teams--grid-left .teams__grid {
		grid-template-columns: repeat(min(var(--teams-cols, 3), 2), 1fr);
	}

	.teams--grid-center .team-member {
		width: calc((100% - var(--teams-gap, 1.5rem)) / 2);
	}

	.is-style-round .team-member__photo {
		width: 9rem;
		height: 9rem;
	}
}

/* Desktop (64rem / 1024px) */
@media (min-width: 64rem) {
	.teams--grid-left .teams__grid {
		grid-template-columns: repeat(var(--teams-cols, 3), 1fr);
	}

	.teams--cols-2.teams--grid-center .team-member {
		width: calc((100% - var(--teams-gap, 1.5rem)) / 2);
	}
	.teams--cols-3.teams--grid-center .team-member {
		width: calc((100% - 2 * var(--teams-gap, 1.5rem)) / 3);
	}
	.teams--cols-4.teams--grid-center .team-member {
		width: calc((100% - 3 * var(--teams-gap, 1.5rem)) / 4);
	}

	.is-style-round .team-member__photo {
		width: 10rem;
		height: 10rem;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.team-member {
		transition: none;
	}

	.is-style-round .team-member--linked:hover .team-member__photo {
		transform: none;
	}
}
