/**
 * CERF College Cards Widget (Grid & Slider) Stylesheet
 *
 * Scoped styles for the Elementor College Cards Widget.
 * Matches reference design with 100% fidelity:
 * NIRF Rank bar, college logo, name, location, program badges,
 * 2x2 stats grid, divider lines, and pill CTA button.
 * Supports both CSS Grid and Swiper Carousel Slider layouts.
 *
 * @package AstraChild
 */

/* ── Container Wrap ────────────────────────────────────────────── */
.cerf-college-widget {
	width: 100%;
	position: relative;
	box-sizing: border-box;
}

.cerf-college-widget *,
.cerf-college-widget *::before,
.cerf-college-widget *::after {
	box-sizing: border-box;
}

/* ── 1. Grid Layout ────────────────────────────────────────────── */
.cerf-college-grid {
	display: grid;
	grid-template-columns: repeat(var(--cerf-cols-desktop, 4), minmax(0, 1fr));
	gap: var(--cerf-gap-desktop, 24px);
	width: 100%;
}

@media (max-width: 1024px) {
	.cerf-college-grid {
		grid-template-columns: repeat(var(--cerf-cols-tablet, 2), minmax(0, 1fr));
		gap: var(--cerf-gap-tablet, 20px);
	}
}

@media (max-width: 767px) {
	.cerf-college-grid {
		grid-template-columns: repeat(var(--cerf-cols-mobile, 1), minmax(0, 1fr));
		gap: var(--cerf-gap-mobile, 16px);
	}
}

/* Elementor Editor Device Preview Support for Grid */
body.elementor-device-tablet .cerf-college-grid {
	grid-template-columns: repeat(var(--cerf-cols-tablet, 2), minmax(0, 1fr)) !important;
	gap: var(--cerf-gap-tablet, 20px) !important;
}

body.elementor-device-mobile .cerf-college-grid {
	grid-template-columns: repeat(var(--cerf-cols-mobile, 1), minmax(0, 1fr)) !important;
	gap: var(--cerf-gap-mobile, 16px) !important;
}

body.elementor-device-desktop .cerf-college-grid {
	grid-template-columns: repeat(var(--cerf-cols-desktop, 4), minmax(0, 1fr)) !important;
	gap: var(--cerf-gap-desktop, 24px) !important;
}

/* ── 2. Slider Layout ──────────────────────────────────────────── */
.cerf-college-slider-wrap {
	position: relative;
	width: 100%;
	padding: 6px 0 16px 0;
}

.cerf-college-slider-wrap.has-arrows-outside {
	padding-left: 20px;
	padding-right: 20px;
}

.cerf-college-swiper {
	width: 100%;
	position: relative;
	overflow: hidden;
	padding: 10px 4px 20px 4px; /* Room for card drop shadow & hover lift */
}

.cerf-college-swiper .swiper-wrapper {
	display: flex;
	align-items: stretch;
}

.cerf-college-swiper .swiper-slide {
	height: auto !important;
	display: flex;
	flex-direction: column;
}

/* Slider Navigation Buttons */
.cerf-swiper-nav-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background: #ffffff;
	color: #653392;
	border: 1px solid #e2e8f0;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 20;
	transition: all 0.22s ease;
	outline: none;
	user-select: none;
}

.cerf-swiper-nav-btn svg {
	width: 18px;
	height: 18px;
	stroke: currentColor;
	stroke-width: 2.4;
	transition: transform 0.2s ease;
}

.cerf-swiper-nav-btn:hover {
	background: #653392;
	color: #ffffff;
	border-color: #653392;
	box-shadow: 0 6px 18px rgba(101, 51, 146, 0.28);
}

.cerf-swiper-nav-btn.swiper-button-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

.cerf-swiper-button-prev {
	left: -18px;
}
.cerf-swiper-button-prev:hover svg {
	transform: translateX(-2px);
}

.cerf-swiper-button-next {
	right: -18px;
}
.cerf-swiper-button-next:hover svg {
	transform: translateX(2px);
}

/* Inside Arrows modifier */
.cerf-college-slider-wrap.arrows-pos-inside .cerf-swiper-button-prev {
	left: 12px;
}
.cerf-college-slider-wrap.arrows-pos-inside .cerf-swiper-button-next {
	right: 12px;
}

/* Top Right Arrows modifier */
.cerf-college-slider-wrap.arrows-pos-top-right .cerf-slider-controls-top {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-bottom: 14px;
}
.cerf-college-slider-wrap.arrows-pos-top-right .cerf-swiper-nav-btn {
	position: static;
	transform: none;
}

/* Slider Pagination Dots */
.cerf-swiper-pagination {
	position: static !important;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 14px;
}

.cerf-swiper-pagination .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	background: #cbd5e1;
	opacity: 1;
	border-radius: 999px;
	transition: all 0.25s ease;
	cursor: pointer;
	margin: 0 !important;
}

.cerf-swiper-pagination .swiper-pagination-bullet-active {
	background: #653392 !important;
	width: 24px !important;
	border-radius: 999px !important;
}

/* ── 3. College Card Shell ─────────────────────────────────────── */
.cerf-college-card {
	background: #ffffff;
	border-radius: 18px;
	border: 1px solid #ebecee;
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	width: 100%;
	height: 100%;
	transition: box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1), transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.24s ease;
	position: relative;
}

.cerf-college-card:hover {
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09);
	transform: translateY(-4px);
	border-color: #dfd7eb;
}

/* ── 4. Top NIRF Banner / Ribbon ───────────────────────────────── */
.cerf-college-card .gcc-nirf-bar {
	display: flex;
	align-items: center;
	gap: 7px;
	background: #f0ebf7;
	border-bottom: 1px solid #e5dcf2;
	padding: 10px 18px;
	color: #653392;
	transition: background 0.2s ease;
}

.cerf-college-card .gcc-nirf-bar svg {
	flex-shrink: 0;
	color: #653392;
	stroke: currentColor;
}

.cerf-college-card .gcc-nirf-bar span {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: #653392;
	line-height: 1.2;
}

.cerf-college-card .gcc-nirf-bar--empty {
	min-height: 38px;
}

/* ── 5. Card Body ──────────────────────────────────────────────── */
.cerf-college-card .gcc-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 0;
}

/* ── 6. Card Header (Logo + Title + Location + Badges) ─────────── */
.cerf-college-card .gcc-header {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 18px 18px 14px;
}

.cerf-college-card .gcc-logo {
	width: 56px;
	height: 56px;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
	background: #f8fafc;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	overflow: hidden;
	padding: 4px;
}

.cerf-college-card .gcc-logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.cerf-college-card .gcc-logo svg {
	width: 28px;
	height: 28px;
	stroke: #653392;
}

.cerf-college-card .gcc-meta {
	flex: 1;
	min-width: 0;
}

.cerf-college-card .gcc-name {
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.3;
	letter-spacing: -0.01em;
	margin: 0 0 4px;
}

.cerf-college-card .gcc-name a {
	color: inherit;
	text-decoration: none;
	transition: color 0.18s ease;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cerf-college-card .gcc-name a:hover {
	color: #653392;
}

.cerf-college-card .gcc-location {
	font-size: 12px;
	color: #64748b;
	margin: 0 0 8px;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cerf-college-card .gcc-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	min-height: 24px;
	margin-top: 4px;
}

.cerf-college-card .gcc-badge {
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	padding: 3px 10px;
	border-radius: 999px;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
}

.cerf-college-card .gcc-badge--primary {
	background: #eff6ff;
	color: #2563eb;
	border: 1px solid #dbeafe;
}

.cerf-college-card .gcc-badge--secondary {
	background: #f0fdf4;
	color: #16a34a;
	border: 1px solid #dcfce7;
}

/* ── 7. Divider ────────────────────────────────────────────────── */
.cerf-college-card .gcc-divider {
	border: none;
	border-top: 1px solid #f1f2f6;
	margin: 0 18px;
}

/* ── 8. 2x2 Stats Grid ─────────────────────────────────────────── */
.cerf-college-card .gcc-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px 12px;
	padding: 14px 18px;
}

.cerf-college-card .gcc-stat {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.cerf-college-card .gcc-stat__label {
	display: block;
	font-size: 11.5px;
	color: #94a3b8;
	font-weight: 400;
	line-height: 1.2;
	margin-bottom: 4px;
}

.cerf-college-card .gcc-stat__value {
	font-size: 13px;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cerf-college-card .gcc-stat__link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	color: #432dd7;
	text-decoration: none;
	line-height: 1.2;
	transition: color 0.18s ease;
	white-space: nowrap;
}

.cerf-college-card .gcc-stat__link svg {
	width: 11px;
	height: 11px;
	stroke: currentColor;
	stroke-width: 2.4;
	flex-shrink: 0;
	transition: transform 0.18s ease;
}

.cerf-college-card .gcc-stat__link:hover {
	color: #653392;
	text-decoration: none;
}

.cerf-college-card .gcc-stat__link:hover svg {
	transform: translate(1px, -1px);
}

/* ── 9. CTA Button Footer ──────────────────────────────────────── */
.cerf-college-card .gcc-footer {
	padding: 12px 18px 18px;
	margin-top: auto; /* Always sticks CTA button to the bottom */
}

.cerf-college-card .gcc-cta {
	display: block;
	width: 100%;
	text-align: center;
	background: #653392;
	color: #ffffff !important;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	padding: 12px 18px;
	border-radius: 999px;
	text-decoration: none !important;
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
	box-shadow: 0 3px 10px rgba(101, 51, 146, 0.22);
	outline: none;
}

.cerf-college-card .gcc-cta:hover {
	background: #51237a;
	color: #ffffff !important;
	box-shadow: 0 5px 16px rgba(101, 51, 146, 0.34);
	transform: translateY(-1px);
}

.cerf-college-card .gcc-cta:active {
	transform: translateY(0);
}

/* ── Responsive adjustments for mobile ─────────────────────────── */
@media (max-width: 480px) {
	.cerf-swiper-button-prev {
		left: 4px;
	}
	.cerf-swiper-button-next {
		right: 4px;
	}
	.cerf-college-card .gcc-header {
		padding: 16px 14px 12px;
		gap: 12px;
	}
	.cerf-college-card .gcc-logo {
		width: 48px;
		height: 48px;
	}
	.cerf-college-card .gcc-stats {
		padding: 12px 14px;
	}
	.cerf-college-card .gcc-footer {
		padding: 10px 14px 16px;
	}
}
