/**
 * Green Create Timeline — front-end styles.
 * Design tokens: Cream #F9F5F2 · Blue #29323F · Green #74765A · IBM Plex Sans.
 */

.gc-timeline {
	--gc-cream: #f9f5f2;
	--gc-blue: #29323f;
	--gc-green: #74765a;
	--gc-line: #d8d5cf;
	--gc-gap: clamp(16px, 2vw, 24px);
	--gc-radius: 0px;
	--gc-dot: #a8a296;
	--gc-speed: 550ms;
	/* Fixed image height — identical for every slide at any given width. */
	--gc-media-height: clamp(200px, 22vw, 300px);
	--gc-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

	/* Cards visible per breakpoint (overridable inline via the shortcode/block). */
	--gc-per: var(--gc-per-mobile, 1);

	font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	position: relative;
	box-sizing: border-box;
	width: 100%;
	color: var(--gc-blue);
}

.gc-timeline *,
.gc-timeline *::before,
.gc-timeline *::after {
	box-sizing: border-box;
}

/* Elementor: the widget can collapse to width:0 inside a flex container because
   the track is overflow:hidden and provides no intrinsic width to stretch to.
   Force the widget + its wrapper to fill the available column width. */
.elementor-widget-gc_timeline,
.elementor-widget-gc_timeline > .elementor-widget-container {
	width: 100%;
}

@media (min-width: 640px) {
	.gc-timeline {
		--gc-per: var(--gc-per-tablet, 2);
	}
}

@media (min-width: 1024px) {
	.gc-timeline {
		--gc-per: var(--gc-per-desktop, 3);
	}
}

/* ---------- Viewport & track ---------- */

.gc-timeline__viewport {
	overflow: hidden; /* fallback for browsers without overflow:clip */
	overflow-x: clip; /* clip the slider horizontally… */
	overflow-y: visible; /* …but let hover lift/shadow show vertically */
	width: 100%;
}

.gc-timeline__track {
	display: flex;
	align-items: stretch;
	gap: var(--gc-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	transform: translate3d(0, 0, 0);
	transition: transform var(--gc-speed) var(--gc-ease);
	will-change: transform;
	/* Horizontal swipes are ours; vertical scrolling stays native (mobile). */
	touch-action: pan-y;
}

.gc-timeline.is-dragging .gc-timeline__track,
.gc-timeline.is-instant .gc-timeline__track {
	transition: none;
}

/* Hide navigation when every slide already fits (no scrolling possible). */
.gc-timeline.is-static .gc-timeline__controls {
	display: none;
}

/* ---------- Slide ---------- */

.gc-timeline__slide {
	flex: 0 0 calc((100% - (var(--gc-per) - 1) * var(--gc-gap)) / var(--gc-per));
	max-width: calc((100% - (var(--gc-per) - 1) * var(--gc-gap)) / var(--gc-per));
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
	position: relative;
}

/* ---------- Year + connector ---------- */

.gc-timeline__year {
	text-align: center;
	color: var(--gc-green);
	font-weight: 500;
	font-size: clamp(20px, 1.4vw + 12px, 24px);
	line-height: 1.231;
	letter-spacing: -0.24px;
	margin: 0;
}

/* Connector overlaps into the card top so the dot sits ~inside the cream
   card, matching the Figma design. z-index keeps line + dot above the card. */
.gc-timeline__connector {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding-top: 14px;
	margin-bottom: -22px;
	position: relative;
	z-index: 2;
}

.gc-timeline__line {
	width: 1px;
	height: clamp(56px, 6vh, 84px);
	background: var(--gc-line);
}

.gc-timeline__dot {
	width: 6px;
	height: 6px;
	margin-top: -3px;
	border-radius: 50%;
	background: var(--gc-dot);
}

/* ---------- Card ---------- */

.gc-timeline__card {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	background: var(--gc-cream);
	border-radius: var(--gc-radius);
	overflow: hidden;
}

.gc-timeline__card-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: clamp(40px, 4.5vw, 64px) clamp(20px, 2.4vw, 36px) clamp(20px, 2.4vw, 32px);
}

.gc-timeline__card-title {
	margin: 0 0 clamp(12px, 1.4vw, 20px);
	color: var(--gc-blue);
	font-weight: 500;
	font-size: clamp(19px, 1.2vw + 12px, 24px);
	line-height: 1.231;
	letter-spacing: -0.24px;
}

.gc-timeline__card-desc {
	margin: 0;
	max-width: 46ch;
	color: var(--gc-blue);
	opacity: 0.7;
	font-weight: 400;
	font-size: clamp(15px, 0.6vw + 12px, 18px);
	line-height: 1.54;
}

/* Fixed height + pinned to the bottom, so every image is the exact same size
   and aligns across cards regardless of title/description length. */
.gc-timeline__media {
	position: relative;
	flex: 0 0 auto;
	margin-top: auto;
	width: 100%;
	height: var(--gc-media-height);
	overflow: hidden;
	background: #e7e2dc;
	/* Square by default; overrides any theme rounding. Card radius (if set via
	   Elementor) still applies because the card clips this element. */
	border-radius: 0;
}

.gc-timeline__img,
.gc-timeline__media-placeholder {
	display: block;
	/* !important throughout: many themes set `img { height: auto !important }`,
	   which would otherwise let each image render at its own aspect ratio inside
	   the fixed-height frame. These lock every image to the same size and defeat
	   theme image rounding. */
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover !important;
	border-radius: 0 !important;
}

.gc-timeline__media-placeholder {
	background: linear-gradient(135deg, #ece7e1, #ded8d0);
}

/* ---------- Controls ---------- */

.gc-timeline__controls {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	gap: 16px;
	margin-top: clamp(24px, 3vw, 40px);
}

.gc-timeline__nav-group {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

/* The reset values are stated explicitly so a theme's global button styles
   (full-width backgrounds, big radii, min-heights, etc.) can't hijack them. */
.gc-timeline__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	margin: 0;
	box-shadow: none;
	text-decoration: none;
	line-height: 1;
	border-width: 1px;
	border-style: solid;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
	/* !important defends the circular pill, size and colours against aggressive
	   theme button resets (padding, min-height, radius, backgrounds — often set
	   with !important). Elementor's arrow style controls also emit !important so
	   they still override these. */
	width: 44px !important;
	height: 44px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	padding: 0 !important;
	border-radius: 50% !important;
	background-color: transparent !important;
	border-color: rgba(41, 50, 63, 0.25) !important;
	color: var(--gc-blue) !important;
}

.gc-timeline__nav:hover:not(:disabled) {
	background-color: var(--gc-blue) !important;
	border-color: var(--gc-blue) !important;
	color: #fff !important;
}

.gc-timeline__nav:focus-visible {
	outline: 2px solid var(--gc-green);
	outline-offset: 2px;
}

.gc-timeline__nav:disabled {
	opacity: 0.3;
	cursor: default;
}

.gc-timeline__arrow {
	display: block;
	width: 19px !important;
	height: 12px !important;
	max-width: none !important;
	flex: 0 0 auto;
}

/* ---------- Stage (positioning context for side arrows) ---------- */

.gc-timeline__stage {
	position: relative;
}

/* Side-positioned arrows: overlay the card row, one on each edge, vertically
   centred on the cards. The stage spans the full slide (year + connector +
   card), so we bias the vertical centre downward by ~half the year/connector
   height to sit on the card itself. */
.gc-timeline[data-arrows="sides"] .gc-timeline__stage > .gc-timeline__nav-group {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(50% + var(--gc-side-arrow-offset, 44px));
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0;
	margin: 0;
	padding: 0 clamp(6px, 1.5vw, 22px);
	pointer-events: none;
	z-index: 5;
}

.gc-timeline[data-arrows="sides"] .gc-timeline__nav {
	pointer-events: auto;
	/* Solid so the arrow reads clearly over any image. */
	background-color: #ffffff !important;
	box-shadow: 0 2px 10px rgba(41, 50, 63, 0.12);
}

.gc-timeline[data-arrows="sides"] .gc-timeline__nav:hover:not(:disabled) {
	background-color: var(--gc-blue) !important;
}

/* ---------- Dots (optional) ---------- */

.gc-timeline__dots {
	display: flex;
	align-items: center;
	gap: 8px;
}

.gc-timeline__dot-btn {
	width: 8px;
	height: 8px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(41, 50, 63, 0.25);
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.gc-timeline__dot-btn:hover {
	background: rgba(41, 50, 63, 0.5);
}

.gc-timeline__dot-btn.is-active {
	background: var(--gc-green);
	transform: scale(1.25);
}

.gc-timeline__dot-btn:focus-visible {
	outline: 2px solid var(--gc-green);
	outline-offset: 2px;
}

/* ---------- Utility ---------- */

.gc-timeline__empty {
	padding: 24px;
	border: 1px dashed rgba(41, 50, 63, 0.3);
	color: var(--gc-blue);
	text-align: center;
}

.gc-timeline__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Keyboard focus for the swipeable track. */
.gc-timeline__viewport:focus-visible {
	outline: 2px solid var(--gc-green);
	outline-offset: 4px;
}

/* ---------- Content alignment (Elementor content_align control) ---------- */

.gc-align-left .gc-timeline__card-body,
.gc-align-left .gc-timeline__year {
	align-items: flex-start;
	text-align: left;
}

.gc-align-left .gc-timeline__connector {
	align-items: flex-start;
}

.gc-align-right .gc-timeline__card-body,
.gc-align-right .gc-timeline__year {
	align-items: flex-end;
	text-align: right;
}

.gc-align-right .gc-timeline__connector {
	align-items: flex-end;
}

/* ---------- Card hover effects (set via the `hover` attr / Elementor control) ---------- */

.gc-timeline__card {
	transition: transform 0.35s var(--gc-ease), box-shadow 0.35s var(--gc-ease);
}

.gc-timeline__img {
	transition: transform 0.55s var(--gc-ease);
}

/* Lift: card rises with a soft shadow. */
.gc-timeline[data-hover="lift"] .gc-timeline__card:hover,
.gc-timeline[data-hover="lift-zoom"] .gc-timeline__card:hover {
	transform: translateY(-6px);
	box-shadow: 0 16px 36px rgba(41, 50, 63, 0.14);
}

/* Shadow: soft shadow only, no movement. */
.gc-timeline[data-hover="shadow"] .gc-timeline__card:hover {
	box-shadow: 0 16px 36px rgba(41, 50, 63, 0.14);
}

/* Zoom: the image scales gently within its frame. */
.gc-timeline[data-hover="zoom"] .gc-timeline__card:hover .gc-timeline__img,
.gc-timeline[data-hover="lift-zoom"] .gc-timeline__card:hover .gc-timeline__img {
	transform: scale(1.06);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.gc-timeline__track,
	.gc-timeline__card,
	.gc-timeline__img {
		transition: none;
	}
	.gc-timeline__nav,
	.gc-timeline__dot-btn {
		transition: none;
	}
	/* Keep the shadow, drop the movement. */
	.gc-timeline .gc-timeline__card:hover {
		transform: none;
	}
	.gc-timeline .gc-timeline__card:hover .gc-timeline__img {
		transform: none;
	}
}
