/**
 * Z8 Team Cards - Frontend Stylesheet
 */

:root {
	--z8-color-1: #00B9F2; /* آبی */
	--z8-color-2: #AADE1C; /* سبز */
	--z8-color-3: #EC008C; /* ارغوانی */
	--z8-color-4: #FFF000; /* زرد */
}

/* ============================================================
   Section & Grid Container
   ============================================================ */
.z8-team-section {
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box;
}

.z8-team-cards-grid {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;
	gap: var(--z8-grid-gap-desktop, 12px);
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box;
}

@media (max-width: 1024px) {
	.z8-team-cards-grid {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: var(--z8-grid-gap-tablet, 16px);
	}
}

@media (max-width: 767px) {
	.z8-team-cards-grid {
		grid-template-columns: repeat(1, 1fr) !important;
		gap: var(--z8-grid-gap-mobile, 20px);
	}
}

/* ============================================================
   Individual Card
   ============================================================ */
.z8-team-card {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	background-color: var(--card-theme-color, #00B9F2);
	padding-top: var(--z8-card-border-top, 6px);
	transition: box-shadow 0.35s ease, transform 0.35s ease;
	user-select: none;
	outline: none;
	box-sizing: border-box;
}

/* Cyclic Color Sequence (Blue, Green, Magenta, Yellow) */
.z8-team-card.color-pattern-1,
.z8-team-card:nth-child(4n + 1) {
	--card-theme-color: var(--z8-color-1, #00B9F2);
}

.z8-team-card.color-pattern-2,
.z8-team-card:nth-child(4n + 2) {
	--card-theme-color: var(--z8-color-2, #AADE1C);
}

.z8-team-card.color-pattern-3,
.z8-team-card:nth-child(4n + 3) {
	--card-theme-color: var(--z8-color-3, #EC008C);
}

.z8-team-card.color-pattern-4,
.z8-team-card:nth-child(4n + 4) {
	--card-theme-color: var(--z8-color-4, #FFF000);
}

/* Hover & Flipped State Stacking - Allow 3D corners to extend freely */
.z8-team-card:hover,
.z8-team-card:focus-within,
.z8-team-card.is-flipped {
	z-index: 25;
	box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   3D Flip Container
   ============================================================ */
.z8-flip-box {
	position: relative;
	width: 100%;
	height: var(--z8-card-height-desktop, 600px);
	perspective: var(--z8-card-perspective, 1000px);
	cursor: pointer;
	box-sizing: border-box;
}

@media (max-width: 1024px) {
	.z8-flip-box {
		height: var(--z8-card-height-tablet, 540px);
	}
}

@media (max-width: 767px) {
	.z8-flip-box {
		height: var(--z8-card-height-mobile, 480px);
	}
}

.z8-flip-box-inner {
	position: relative;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	transition: transform var(--z8-flip-duration, 0.65s) cubic-bezier(0.4, 0.2, 0.2, 1);
}

/* Flip Trigger */
.z8-team-card:hover .z8-flip-box-inner,
.z8-team-card:focus-within .z8-flip-box-inner,
.z8-team-card.is-flipped .z8-flip-box-inner {
	transform: rotateY(180deg);
}

/* Flip Faces */
.z8-flip-face {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	background-position: center center;
	background-repeat: no-repeat;
	background-size: cover;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: center;
	text-align: center;
	padding: 20px 15px 25px 15px;
	box-sizing: border-box;
}

/* Front Face */
.z8-flip-face-front {
	transform: rotateY(0deg);
	z-index: 2;
}

.z8-flip-face-front .z8-face-title {
	color: #ffffff;
	font-family: inherit;
	font-size: 38px;
	font-weight: 300;
	text-transform: uppercase;
	line-height: 1.15;
	letter-spacing: 0.3px;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.75);
	max-width: 90%;
	margin: 0;
	padding: 0;
}

/* Back Face */
.z8-flip-face-back {
	transform: rotateY(180deg);
	z-index: 1;
}

.z8-flip-face-back .z8-face-title {
	color: #FFEF00;
	font-family: inherit;
	font-size: 30px;
	font-weight: 600;
	line-height: 1.2;
	text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.85);
	margin: 0;
	padding: 0;
}

/* Fallback background if image is missing */
.z8-flip-face:not([style*="background-image"]) {
	background-color: #23272e;
}

/* ============================================================
   Bottom Tagline / Quote Banner
   ============================================================ */
.z8-card-tagline {
	padding: 10px 14px;
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	box-sizing: border-box;
}

.z8-card-tagline p {
	font-family: inherit;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.35;
	color: #000000;
	margin: 0;
	padding: 0;
}
