/* ================= GRID ================= */
.tme-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	align-items: stretch;
}

/* ================= CARD ================= */
.tme-card {
	background-color: #1a1420;
	border: 1px solid rgba(212, 160, 23, 0.45);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.tme-photo-wrap {
	position: relative;
}

.tme-photo {
	width: 100%;
	height: 240px;
	background-size: cover;
	background-position: center top;
	background-color: rgba(255, 255, 255, 0.05);
}

.tme-corner {
	position: absolute;
	width: 22px;
	height: 22px;
	border: 2px solid #d4a017;
	z-index: 2;
	pointer-events: none;
}
.tme-corner-tl { top: 0;    left: 0;  border-right: none; border-bottom: none; }
.tme-corner-tr { top: 0;    right: 0; border-left: none;  border-bottom: none; }
.tme-corner-bl { bottom: 0; left: 0;  border-right: none; border-top: none; }
.tme-corner-br { bottom: 0; right: 0; border-left: none;  border-top: none; }

.tme-content {
	padding: 22px 20px 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.tme-name {
	color: #d4a017;
	font-family: 'Cinzel Decorative', serif;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.5px;
	margin-bottom: 6px;
}

.tme-role {
	color: rgba(255, 255, 255, 0.5);
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 3px;
	text-transform: uppercase;
	margin-bottom: 14px;
}

/* bio: sirf thori lines, baaki popup mein */
.tme-bio {
	color: rgba(255, 255, 255, 0.75);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.6;
	margin: 0 0 18px;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	overflow: hidden;
}

/* READ MORE: underlined text link */
.tme-open {
	margin-top: auto;
	align-self: flex-start;
	background: transparent !important;
	border: 0 !important;
	padding: 0 0 2px !important;
	color: #d4a017;
	font-family: "Barlow Condensed", Sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
	letter-spacing: 2px;
	text-transform: uppercase;
	text-decoration: underline;
	text-underline-offset: 4px;
	cursor: pointer;
	border-radius: 0;
	box-shadow: none;
	transition: opacity 0.2s ease;
}
.tme-open:hover,
.tme-open:focus-visible {
	
	opacity: 0.75;
	color: #d4a017;
}

/* ================= POPUP ================= */
.tme-modal[hidden] {
	display: none;
}

.tme-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.tme-modal-overlay {
	position: absolute;
	inset: 0;
	background: var(--tme-overlay, rgba(20, 0, 8, 0.85));
	opacity: 0;
	transition: opacity 0.35s ease;
}

.tme-modal-box {
	position: relative;
	display: flex;
	align-items: center;
	gap: 32px;
	width: 100%;
	max-width: var(--tme-max-w, 1100px);
	max-height: 90vh;
	padding: 40px;
	box-sizing: border-box;
	overflow-y: auto;
	background: var(--tme-bg, #3a0016);
	border: 1px solid var(--tme-accent, #d4a017);
	border-radius: 24px;
	box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);

	/* neeche se upar slide */
	transform: translateY(110vh);
	opacity: 0;
	transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.tme-modal.is-open .tme-modal-overlay { opacity: 1; }
.tme-modal.is-open .tme-modal-box     { transform: translateY(0); opacity: 1; }

.tme-modal-photo {
	flex: 0 0 34%;
	aspect-ratio: 4 / 5;
	border-radius: 10px;
	background-size: cover;
	background-position: center top;
	background-color: rgba(255, 255, 255, 0.05);
}

.tme-modal-body {
	flex: 1;
	min-width: 0;
	padding-top: 6px;
}

.tme-modal-name {
	color: var(--tme-name-color, #fff);
	font-family: var(--tme-name-font, 'Cinzel Decorative', serif);
	font-size: 38px;
	font-weight: 700;
	line-height: 1.15;
	margin-bottom: 8px;
}

.tme-modal-role {
	color: var(--tme-role-color, #f5b301);
	font-family: inherit;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 2px;
	margin-bottom: 22px;
}

.tme-modal-bio {
	color: var(--tme-text, rgba(255, 255, 255, 0.75));
	font-family: inherit;
	font-size: 13px;
	line-height: 1.9;
	margin: 0 0 24px;
}

.tme-modal-body .tme-links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.tme-modal-link {
	display: inline-block;
	border: 1px solid var(--tme-accent, #d4a017);
	color: var(--tme-role-color, #f5b301);
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.5px;
	padding: 7px 14px;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.tme-modal-link:hover {
	background-color: var(--tme-accent, #d4a017);
	color: var(--tme-bg, #3a0016);
}

.tme-modal-close {
	display:none !important;
	position: absolute;
	top: 14px;
	right: 16px;
	z-index: 3;
	width: 36px;
	height: 36px;
	line-height: 32px;
	padding: 0;
	background: transparent;
	border: 1px solid var(--tme-accent, #d4a017);
	border-radius: 50%;
	color: var(--tme-accent, #d4a017);
	font-size: 22px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.tme-modal-close:hover {
	background: var(--tme-accent, #d4a017);
	color: var(--tme-bg, #3a0016);
}

body.tme-modal-open {
	overflow: hidden;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
	.tme-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
	.tme-modal { padding: 12px; align-items: flex-end; }
	.tme-modal-box {
		flex-direction: column;
		gap: 20px;
		padding: 22px 20px 28px;
		border-radius: 20px;
		max-height: 92vh;
	}
	.tme-modal-photo { flex: 0 0 auto; width: 100%; aspect-ratio: 4 / 4; }
	.tme-modal-name  { font-size: 28px; }
	.tme-modal-role  { font-size: 16px; margin-bottom: 14px; }
	.tme-modal-bio   { line-height: 1.8; }
}

@media (max-width: 600px) {
	.tme-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.tme-modal-box, .tme-modal-overlay { transition-duration: 0.01s; }
}
