/**
 * Green Create – Blog Showcase
 * Scoped under .gcb-blog-showcase so it never leaks into the theme.
 */

.gcb-blog-showcase {
	--gcb-featured-bg: #3b655f;   /* Figma featured panel */
	--gcb-card-hover: #8f492e;    /* Figma orange (hover) card */
	--gcb-green: #74765a;         /* brand Green — card titles */
	--gcb-blue: #29323f;          /* brand Blue — dates & body */
	--gcb-cream: #f9f5f2;         /* brand Cream — text on dark/orange */
	--gcb-featured-title: #7d9f9a;/* muted teal featured title */
	--gcb-hover-title: #cd8768;   /* peach title on hover card */
	--gcb-card-bg: #f9f5f2;       /* Figma card fill (Cream) */
	--gcb-line: rgba(41, 50, 63, 0.14);
	--gcb-muted: #29323f;
	--gcb-font: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
	box-sizing: border-box;
	font-family: var(--gcb-font);
	width: 100%; /* fill the Elementor container, incl. flex parents */
}

.gcb-blog-showcase *,
.gcb-blog-showcase *::before,
.gcb-blog-showcase *::after {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ *
 * Featured carousel
 * ------------------------------------------------------------------ */
.gcb-featured {
	position: relative;
	margin-bottom: 48px;
	padding-top: 28px; /* room for the dots row above the media */
}

/* Only the viewport clips the slide track — dots/arrows stay visible. */
.gcb-featured__viewport {
	position: relative;
	overflow: hidden;
}

.gcb-featured__track {
	display: flex;
	width: 100%;
	transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
	will-change: transform;
}

.gcb-featured__slide {
	position: relative;
	flex: 0 0 100%;
	min-width: 100%;
	display: grid;
	grid-template-columns: 50.5% 49.5%;
	align-items: stretch;
}

.gcb-featured__media {
	position: relative;
	overflow: hidden;
	min-height: 380px;
	border-radius: 0; /* no rounded corners (Figma) */
}

/* Fill the whole media box (matches the panel height). !important overrides
   themes that force img { height: auto } / border-radius on images. */
.gcb-featured__media img,
.gcb-featured__img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	object-fit: cover;
	border-radius: 0 !important;
	display: block;
}

.gcb-featured__img--placeholder {
	position: static;
	background: repeating-linear-gradient(45deg, #e9e9e6, #e9e9e6 12px, #e2e2df 12px, #e2e2df 24px);
}

.gcb-featured__content {
	background-color: var(--gcb-featured-bg);
	color: var(--gcb-cream);
	padding: clamp(28px, 5vw, 72px);
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.gcb-featured__date {
	font-size: clamp(14px, 1.1vw, 20px);
	letter-spacing: 0.07em;
	text-transform: uppercase;
	font-weight: 500;
	color: var(--gcb-cream);
	margin-bottom: 22px;
}

.gcb-featured__title {
	margin: 0 0 24px;
	font-size: clamp(26px, 2.6vw, 40px);
	line-height: 1.1;
	letter-spacing: -0.4px;
	font-weight: 500;
	color: var(--gcb-featured-title);
}

.gcb-featured__title a {
	color: inherit;
	text-decoration: none;
}

.gcb-featured__title a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gcb-featured__excerpt {
	margin: 0 0 32px;
	font-size: clamp(15px, 1.1vw, 19px);
	line-height: 1.77;
	color: var(--gcb-cream);
	opacity: 0.92;
	max-width: 52ch;
}

/* Dots (Figma: 8px, grey #D9D9D9 inactive, Blue #29323F active) -------- */
.gcb-featured__dots {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	gap: 14px;
	z-index: 3;
	height: 28px;
	align-items: center;
}

/* Strong resets so the host theme's <button> styles can't turn dots into
   rectangles (padding / min-width / radius / appearance all forced). */
.gcb-featured__dot {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	width: 8px !important;
	height: 8px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: 8px;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: #d9d9d9;
	box-shadow: none !important;
	outline: none;
	cursor: pointer;
	flex: 0 0 auto;
	line-height: 0;
	font-size: 0;
	transition: background 0.25s ease;
}

.gcb-featured__dot.is-active {
	background: var(--gcb-blue);
}

.gcb-featured__dot:focus-visible {
	outline: 2px solid var(--gcb-featured-bg);
	outline-offset: 2px;
}

/* Prev/next arrows ------------------------------------------------- */
.gcb-featured__nav {
	position: absolute;
	top: calc(50% + 14px);
	transform: translateY(-50%);
	z-index: 3;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.9);
	color: #2b2b2b;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	transition: background 0.2s ease, transform 0.2s ease;
}

.gcb-featured__nav:hover {
	background: #fff;
}

.gcb-featured__nav--prev {
	left: 12px;
}

.gcb-featured__nav--prev .gcb-arrow {
	transform: rotate(180deg);
}

.gcb-featured__nav--next {
	right: 12px;
}

/* Circular arrow buttons (read-more) ------------------------------- */
.gcb-featured__arrow,
.gcb-card__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 49px;
	height: 49px;
	border-radius: 50%;
	text-decoration: none;
	transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
	flex: 0 0 auto;
}

/* Normal grid card: outlined circle, Blue 1.5px stroke + Blue arrow (Figma). */
.gcb-card__arrow {
	border: 1.5px solid currentColor;
	color: var(--gcb-blue);
	background: transparent;
}

/* Featured: solid muted-teal circle, white arrow, no border (Figma). */
.gcb-featured__arrow {
	border: none;
	background: var(--gcb-featured-title);
	color: #fff;
}

.gcb-featured__arrow:hover,
.gcb-card__arrow:hover {
	transform: translateX(3px);
}

/* Text + arrow read-more variant. */
.gcb-card__more,
.gcb-featured__more {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: inherit;
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.02em;
}

.gcb-card__more { margin-top: auto; }

.gcb-card__more .gcb-arrow,
.gcb-featured__more .gcb-arrow {
	transition: transform 0.25s ease;
}

.gcb-card__more:hover .gcb-arrow,
.gcb-featured__more:hover .gcb-arrow {
	transform: translateX(3px);
}

/* ------------------------------------------------------------------ *
 * Grid
 * ------------------------------------------------------------------ */
.gcb-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px; /* Figma spacing; overridable via the "Gap" control. */
}

.gcb-card {
	position: relative;
	background: var(--gcb-card-bg);
	color: var(--gcb-blue);
	transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease,
		border-color 0.3s ease, box-shadow 0.3s ease;
	display: flex;
	flex-direction: column;
}

.gcb-card__thumb {
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
}

.gcb-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

/* Hover zoom is driven by the "Zoom on hover" control (default scale(1.04)). */

.gcb-card__inner {
	padding: clamp(24px, 2.4vw, 34px);
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 260px;
}

.gcb-card__date {
	font-size: clamp(14px, 1.1vw, 20px);
	letter-spacing: 0.07em;
	text-transform: uppercase;
	font-weight: 500;
	color: var(--gcb-blue);
	margin-bottom: 18px;
}

.gcb-card__terms,
.gcb-featured__terms {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.gcb-term {
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: inherit;
	border: 1px solid currentColor;
	border-radius: 999px;
	padding: 3px 10px;
	opacity: 0.75;
}

.gcb-card__submeta,
.gcb-featured__submeta {
	display: flex;
	gap: 12px;
	font-size: 12px;
	color: var(--gcb-muted);
	margin-bottom: 12px;
}

.gcb-card:hover .gcb-card__submeta,
.gcb-card:focus-within .gcb-card__submeta {
	color: inherit;
	opacity: 0.9;
}

.gcb-card__title {
	margin: 0 0 18px;
	font-size: clamp(22px, 2.1vw, 30px);
	line-height: 1.23;
	letter-spacing: -0.3px;
	font-weight: 500;
	color: var(--gcb-green);
}

.gcb-card__title a {
	color: inherit;
	text-decoration: none;
}

.gcb-card__excerpt {
	margin: 0 0 28px;
	font-size: clamp(15px, 1.1vw, 19px);
	line-height: 1.77;
	color: var(--gcb-blue);
}

.gcb-card__arrow {
	margin-top: auto;
}

/* Hover / focus state — orange card, cream content, peach title (Figma). */
.gcb-card:hover,
.gcb-card:focus-within {
	background-color: var(--gcb-card-hover);
	color: var(--gcb-cream);
	z-index: 1;
}

.gcb-card:hover .gcb-card__date,
.gcb-card:hover .gcb-card__excerpt,
.gcb-card:focus-within .gcb-card__date,
.gcb-card:focus-within .gcb-card__excerpt {
	color: var(--gcb-cream);
}

.gcb-card:hover .gcb-card__title a,
.gcb-card:focus-within .gcb-card__title a {
	color: var(--gcb-hover-title);
}

/* Hover card: solid peach circle, white arrow, no border (Figma). */
.gcb-card:hover .gcb-card__arrow,
.gcb-card:focus-within .gcb-card__arrow {
	color: #fff;
	border-color: transparent;
	background: var(--gcb-hover-title);
}

/* Fade-in for AJAX-appended cards. */
.gcb-card.gcb-card--new {
	animation: gcb-fade-in 0.5s ease both;
}

@keyframes gcb-fade-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ *
 * Load more
 * ------------------------------------------------------------------ */
.gcb-loadmore {
	border-top: 1px solid var(--gcb-line);
	display: flex;
	justify-content: center;
	padding: 28px 0 4px;
}

.gcb-loadmore__btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: none;
	border: none;
	cursor: pointer;
	font-size: clamp(14px, 1.1vw, 18px);
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--gcb-blue);
	padding: 8px 12px;
	transition: color 0.25s ease, opacity 0.25s ease;
}

.gcb-loadmore__btn:hover {
	color: var(--gcb-card-hover);
}

.gcb-loadmore__btn[disabled] {
	opacity: 0.5;
	cursor: default;
}

.gcb-loadmore__spinner {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid currentColor;
	border-right-color: transparent;
	display: none;
}

.gcb-loadmore.is-loading .gcb-loadmore__spinner {
	display: inline-block;
	animation: gcb-spin 0.7s linear infinite;
}

@keyframes gcb-spin {
	to { transform: rotate(360deg); }
}

.gcb-empty {
	grid-column: 1 / -1;
	padding: 40px;
	text-align: center;
	color: var(--gcb-muted);
}

/* ------------------------------------------------------------------ *
 * Related Articles widget (reuses .gcb-card styling)
 * ------------------------------------------------------------------ */
.gcb-related__heading {
	font-family: var(--gcb-font);
	font-size: clamp(24px, 2.4vw, 34px);
	line-height: 1.15;
	letter-spacing: -0.3px;
	font-weight: 500;
	color: var(--gcb-green);
	margin: 0 0 32px;
}

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 1024px) {
	.gcb-grid { grid-template-columns: repeat(2, 1fr); }
	.gcb-featured__slide { grid-template-columns: 50% 50%; }
}

@media (max-width: 767px) {
	.gcb-featured__slide { grid-template-columns: 1fr; }
	.gcb-featured__media { min-height: 220px; }
	.gcb-featured__nav { display: none; }
	.gcb-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ *
 * Reduced motion — kill autoplay transitions & animations
 * ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
	.gcb-featured__track,
	.gcb-card,
	.gcb-card__thumb img,
	.gcb-card__arrow,
	.gcb-featured__arrow,
	.gcb-loadmore__btn {
		transition: none !important;
	}
	.gcb-card.gcb-card--new {
		animation: none !important;
	}
}
