/* =========================================================
   HOMEPAGE SECTION — Global Collaborations —
   [endo_global_collaborations]
   Department of Endocrinology, CMC Vellore
   -------------------------------------------------------
   Colour variables (--endo-navy, --endo-gold, --endo-blue-accent,
   --endo-border) are declared once in header.css / hero.css /
   quickactions.css, loaded site-wide, and reused here.
   ========================================================= */

.endo-global-collab * { box-sizing: border-box; }

.endo-global-collab {
	background: #fff;
	padding: 48px 0;
}

.endo-gc-outer {
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 24px;
}

.endo-gc-card {
	display: grid;
	grid-template-columns: 0.62fr 1.38fr;
	align-items: stretch;
	border: 1px solid var(--endo-border);
	border-radius: 14px;
	overflow: hidden;
	min-width: 0;
}

/* ===========================================================
   LEFT — dotted world-map backdrop + stat strip
   =========================================================== */
.endo-gc-stats-wrap {
	position: relative;
	overflow: hidden;
	padding: 28px 24px;
	border-right: 1px solid var(--endo-border);
	background: #F7F9FC;
	min-width: 0;
}

/* CSS-only dot-grid standing in for a world-map graphic — no image asset
   required. Swap in a real dotted-world-map background image here later
   if preferred (background-image on this same element). */
.endo-gc-map-bg {
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(44, 111, 227, 0.18) 1.4px, transparent 1.4px);
	background-size: 12px 12px;
	-webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, #000 55%, transparent 100%);
	mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, #000 55%, transparent 100%);
	pointer-events: none;
}

.endo-gc-stats {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	height: 100%;
}

.endo-gc-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 6px;
	flex: 1 1 0;
	min-width: 0;
}

.endo-gc-stat-number {
	font-size: 1.9rem;
	font-weight: 800;
	color: var(--endo-navy);
	line-height: 1.1;
}

.endo-gc-stat-label {
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1.35;
	color: #5B6577;
}

/* ===========================================================
   RIGHT — heading + logo carousel
   =========================================================== */
.endo-gc-logos-wrap {
	padding: 24px 28px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
}

.endo-gc-title {
	margin: 0 0 16px;
	color: var(--endo-navy);
	font-size: 1.1rem;
	font-weight: 800;
	letter-spacing: .3px;
	text-transform: uppercase;
}

.endo-gc-carousel {
	position: relative;
}

.endo-gc-viewport {
	overflow: hidden;
	min-width: 0;
	/* Soft fade at each edge so logos don't hard-cut mid-tile as they
	   scroll in/out — standard marquee treatment. */
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
}

.endo-gc-track {
	display: flex;
	align-items: center;
	gap: 36px;
	width: max-content;
	/* Promote to its own compositor layer so the browser can run the
	   animation on the GPU compositor thread instead of repainting on
	   the main thread every frame — keeps it smooth on lower-powered
	   phones. */
	will-change: transform;
	/* The track renders the logo list twice back to back (see the PHP
	   template); animating exactly one set-width (-50%) at constant
	   speed loops seamlessly since the second half is a pixel copy of
	   the first — no index math, no resize-driven re-snap, nothing to
	   fall out of sync on mobile. */
	animation: endo-gc-marquee 32s linear infinite;
}

/* Pause on hover/focus (desktop) and touch (mobile, where :hover doesn't
   apply) so a visitor can read a logo without it sliding away. */
.endo-gc-carousel:hover .endo-gc-track,
.endo-gc-carousel:focus-within .endo-gc-track,
.endo-gc-track.is-paused {
	animation-play-state: paused;
}

@keyframes endo-gc-marquee {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

/* Respect visitors who've asked for reduced motion — logos stay static. */
@media (prefers-reduced-motion: reduce) {
	.endo-gc-track {
		animation: none;
	}
}

.endo-gc-logo {
	flex: 0 0 auto;
	width: 150px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	height: 64px;
	opacity: 1;
}
.endo-gc-logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */

/* ---- Laptops: slightly smaller tiles/gap ---- */
@media (max-width: 1199px) {
	.endo-gc-track { gap: 28px; }
	.endo-gc-logo { width: 130px; }
}

/* ---- Tablets: stack map/stats above logos ---- */
@media (max-width: 900px) {
	.endo-global-collab { padding: 40px 0; }

	.endo-gc-card { grid-template-columns: 1fr; }

	.endo-gc-stats-wrap {
		border-right: none;
		border-bottom: 1px solid var(--endo-border);
	}

	.endo-gc-track { gap: 22px; }
	.endo-gc-logo { width: 110px; height: 52px; }
}

/* ---- Phones ---- */
@media (max-width: 560px) {
	.endo-global-collab { padding: 32px 0; }

	.endo-gc-stats { flex-wrap: wrap; row-gap: 18px; }
	.endo-gc-stat { flex: 1 1 45%; }

	.endo-gc-logos-wrap { padding: 20px 18px; }
	.endo-gc-track { gap: 18px; animation-duration: 22s; }
	.endo-gc-logo { width: 92px; height: 46px; }
}
