/* MGH Milestones widget – horizontal scroll row of image + year + description */
/* Title: H3 desktop / Mobile H3. Year: H5 / Mobile H5. Description: Paragraph / Mobile Paragraph. */
/* Image: 323×200 desktop, 300×186 mobile. Gap 20px image→year, 10px year→description. 20px between items. */

.mgh-milestones {
	padding: 60px 20px 0;
	max-width: 884px;
	margin-left: auto;
	margin-right: auto;
}

.mgh-milestones__title {
	margin: 0 0 20px 0;
	line-height: 1.2;
}

/* Specificity beats Elementor per-page typography CSS (post-*.css). Token: heading-3. */
div.elementor-widget.elementor-widget-mgh_milestones .mgh-milestones .mgh-milestones__title {
	font-family: var(--mgh-heading-3-font-family), sans-serif;
	font-size: var(--mgh-heading-3-size);
	font-weight: var(--mgh-heading-3-weight);
	line-height: var(--mgh-heading-3-line-height);
	letter-spacing: var(--mgh-heading-3-letter-spacing);
}

/* Stack track + scroll hints in one grid cell so the hints overlay the row. */
.mgh-milestones__viewport {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: auto;
	position: relative;
}

.mgh-milestones__track {
	grid-column: 1;
	grid-row: 1;
	min-width: 0;
	width: 100%;
	z-index: 1;
	display: flex;
	flex-direction: row;
	gap: 20px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	cursor: grab;
}

.mgh-milestones__track::-webkit-scrollbar {
	display: none;
}

.mgh-milestones__track.is-dragging {
	cursor: grabbing;
	user-select: none;
}

/* Right-edge affordance when the row overflows (shown via JS: .mgh-milestones--overflow, hidden at end: .mgh-milestones--scrolled-end). */
.mgh-milestones__scroll-hint {
	grid-column: 1;
	grid-row: 1;
	z-index: 2;
	display: flex;
	align-items: flex-start;
	justify-content: flex-end;
	min-width: 0;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease;
}

/* Match .mgh-milestones__image-wrap height so the chevron centers on the image strip only. */
.mgh-milestones__scroll-hint-band {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	width: auto;
	height: 186px;
	box-sizing: border-box;
	padding-right: 0.5rem;
	padding-left: 0.25rem;
}

.mgh-milestones__scroll-hint-icon {
	display: block;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
	background-color: rgba(255, 255, 255, 0.9);
	background-image: url("../images/chevron-arrow.svg");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 12px 12px;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
	pointer-events: none;
}

.mgh-milestones__scroll-hint--prev {
	justify-content: flex-start;
}

.mgh-milestones__scroll-hint--prev .mgh-milestones__scroll-hint-band {
	justify-content: flex-start;
	padding-right: 0.25rem;
	padding-left: 0.5rem;
}

.mgh-milestones__scroll-hint-icon--prev {
	transform: scaleX(-1);
}

.mgh-milestones__viewport.mgh-milestones--overflow:not(.mgh-milestones--scrolled-end):not(.mgh-scroll-hint-dismissed) .mgh-milestones__scroll-hint--next {
	opacity: 1;
}

.mgh-milestones__viewport.mgh-milestones--overflow:not(.mgh-milestones--scrolled-end):not(.mgh-scroll-hint-dismissed) .mgh-milestones__scroll-hint--next .mgh-milestones__scroll-hint-icon {
	pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
	.mgh-milestones__scroll-hint {
		transition: none;
	}
}

.mgh-milestones__item {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
}

.mgh-milestones__link {
	display: block;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	margin-bottom: 20px;
}

.mgh-milestones__image-wrap {
	position: relative;
	width: 300px;
	height: 186px;
	border-radius: 8px 8px 0 0;
	overflow: hidden;
	flex-shrink: 0;
}

.mgh-milestones__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	vertical-align: middle;
	transition: transform 300ms ease-out;
	transform: scale(1);
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
}

/* Beat Elementor's .elementor img { height: auto; max-width: 100% } (loads after widget CSS). */
div.elementor-widget.elementor-widget-mgh_milestones .mgh-milestones__image-wrap img.mgh-milestones__img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	object-position: center;
}

.mgh-milestones__link:hover .mgh-milestones__img,
.mgh-milestones__link:focus .mgh-milestones__img {
	transform: scale(1.1);
}

.mgh-milestones__placeholder {
	width: 300px;
	height: 186px;
	background: #eee;
	border-radius: 8px 8px 0 0;
	flex-shrink: 0;
	margin-bottom: 20px;
}

.mgh-milestones__year {
	margin: 0 0 10px 0;
	line-height: var(--mgh-heading-5-line-height);
	font-family: var(--mgh-heading-5-font-family), sans-serif;
	font-weight: var(--mgh-heading-5-weight);
	font-size: var(--mgh-heading-5-size);
	color: #2c3a60;
	width: 300px;
}

.mgh-milestones__description {
	margin: 0;
	line-height: var(--mgh-paragraph-line-height);
	font-family: var(--mgh-paragraph-font-family), sans-serif;
	font-weight: var(--mgh-paragraph-weight);
	font-size: var(--mgh-paragraph-size);
	color: #242424;
	width: 300px;
}

/* Desktop: image 323×200, padding 100px 50px 0 50px (match image-text) */
@media (min-width: 1280px) {
	.mgh-milestones {
		max-width: 100%;
		padding: 100px 50px 0 50px;
	}

	.mgh-milestones__image-wrap,
	.mgh-milestones__placeholder {
		width: 323px;
		height: 200px;
	}

	.mgh-milestones__year {
		width: 323px;
	}

	.mgh-milestones__description {
		width: 323px;
	}

	.mgh-milestones__scroll-hint-band {
		height: 200px;
	}

	.mgh-milestones__viewport.mgh-milestones--overflow .mgh-milestones__scroll-hint--next .mgh-milestones__scroll-hint-icon {
		pointer-events: auto;
	}
}
