/* G Ratings – Press Mentions widget */

.grpm-wrap {
	--grpm-per-view: 3;
	--grpm-gap: 28px;
	position: relative;
}

/* ---- Grid mode ---- */
.grpm-grid {
	display: grid;
	grid-template-columns: repeat(var(--grpm-per-view), minmax(0, 1fr));
	gap: var(--grpm-gap);
}

/* ---- Carousel mode ---- */
.grpm-wrap--carousel {
	overflow: hidden;
	padding: 10px 0 26px; /* room for hover lift + shadow inside overflow:hidden */
	margin: -10px 0 -26px;
}

.grpm-track {
	display: flex;
	gap: var(--grpm-gap);
	transition: transform 0.55s cubic-bezier(0.33, 1, 0.68, 1);
	will-change: transform;
}

.grpm-track .grpm-card {
	flex: 0 0 calc((100% - (var(--grpm-per-view) - 1) * var(--grpm-gap)) / var(--grpm-per-view));
	min-width: 0;
}

/* Navigation arrows */
.grpm-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: #ffffff;
	color: #e81c51;
	box-shadow: 0 6px 20px rgba(20, 30, 70, 0.18);
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
	padding: 0;
}

.grpm-nav:hover {
	background: #e81c51;
	color: #ffffff;
}

.grpm-nav--prev {
	left: 8px;
}

.grpm-nav--prev svg {
	transform: rotate(180deg);
}

.grpm-nav--next {
	right: 8px;
}

.grpm-nav[disabled] {
	opacity: 0;
	pointer-events: none;
}

/* ---- Card ---- */
.grpm-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 26px rgba(20, 30, 70, 0.08);
	text-decoration: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.grpm-wrap--lift .grpm-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 16px 38px rgba(20, 30, 70, 0.16);
}

/* Media */
.grpm-card__media {
	position: relative;
	display: block;
	width: 100%;
	padding-bottom: 56%;
	background: #eef1f7;
	overflow: hidden;
}

.grpm-card__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.grpm-wrap--lift .grpm-card:hover .grpm-card__media img {
	transform: scale(1.05);
}

.grpm-card__media--empty {
	background: linear-gradient(135deg, #1a2a5e 0%, #2b3f86 60%, #e81c51 160%);
}

.grpm-card__media--empty::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.55)' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0V7'/%3E%3Cpath d='M18 14h-8M15 18h-5M10 6h8v4h-8z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
}

/* Body */
.grpm-card__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 22px 24px 24px;
	flex: 1;
}

.grpm-card__source {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #e81c51;
	line-height: 1;
}

.grpm-card__favicon {
	width: 18px;
	height: 18px;
	border-radius: 4px;
	flex: 0 0 auto;
}

.grpm-card__title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.35;
	color: #1a2a5e;
	transition: color 0.2s ease;
}

.grpm-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: auto;
	padding-top: 6px;
	font-size: 14px;
	font-weight: 700;
	color: #e81c51;
}

.grpm-card__cta svg {
	transition: transform 0.25s ease;
}

.grpm-card:hover .grpm-card__cta svg {
	transform: translateX(4px);
}

/* Pending cards: subtle shimmer while metadata resolves */
.grpm-card--pending .grpm-card__media::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
	background-size: 200% 100%;
	animation: grpm-shimmer 1.4s infinite;
	z-index: 1;
}

@keyframes grpm-shimmer {
	from { background-position: 200% 0; }
	to   { background-position: -200% 0; }
}

/* Fallback breakpoints (Elementor responsive controls override via --grpm-per-view) */
@media (max-width: 1024px) {
	.grpm-wrap { --grpm-per-view: 2; }
}

@media (max-width: 640px) {
	.grpm-wrap { --grpm-per-view: 1; }

	.grpm-nav {
		width: 38px;
		height: 38px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.grpm-card,
	.grpm-card__media img,
	.grpm-card__cta svg,
	.grpm-track {
		transition: none;
	}

	.grpm-card--pending .grpm-card__media::before {
		animation: none;
	}
}
