/**
 * Yeldam Journey Timeline — Styles
 *
 * Widget-controlled values arrive as CSS custom properties on the
 * `.yeldam-tl` root, set by Elementor's control `selectors` (see
 * includes/Elementor/Controls.php). Each carries its own fallback here,
 * tuned to Yeldam's brand palette. There is a single stylesheet for both
 * the frontend and the Elementor editor preview iframe -- no separate
 * editor-only file, per this plugi.yeldam-tl--js[data-enable-scroll-animation="1"] .yeldam-tl__milestonen's file structure.
 *
 * GSAP ScrollTrigger drives the progress line / milestone activation
 * when available (see timeline.js); this stylesheet defines the states
 * those interactions animate between, plus everything that is pure CSS:
 * hover micro-interactions, the lightbox/video popup, and all responsive
 * behaviour. When GSAP is disabled or unavailable, timeline.js falls
 * back to toggling the same classes via IntersectionObserver, and the
 * CSS transitions defined here take over the animation.
 *
 * Breakpoints follow Elementor's own defaults:
 *   Desktop > 1024px, Tablet 768–1024px, Mobile < 768px.
 */

/* -----------------------------------------------------------------------
 * Root / defaults (Yeldam brand palette)
 * ---------------------------------------------------------------------*/

.yeldam-tl {
	--tl-primary: #24B24B;
	--tl-dark-green: #1E9A40;
	--tl-accent: #F4B400;
	--tl-bg: #F7FFF8;
	--tl-white: #FFFFFF;
	--tl-text: #1F1F1F;

	--tl-container-width: 1000px;
	--tl-card-width: 100%;
	--tl-gap: 64px;
	--tl-line-width: 3px;
	--tl-connector-thickness: 2px;
	--tl-dot-size: 20px;
	--tl-hover-border: var( --tl-primary );
	--tl-hover-bg: var( --tl-white );
	--tl-item-dot: var( --tl-primary );
	--tl-item-bg: var( --tl-white );

	position: relative;
	background-color: var( --tl-bg );
	color: var( --tl-text );
	padding: clamp( 50px, 6vw, 100px ) 24px;
	box-sizing: border-box;
	overflow: hidden;
}

.yeldam-tl *,
.yeldam-tl *::before,
.yeldam-tl *::after {
	box-sizing: inherit;
}

.yeldam-tl--empty {
	padding: 24px;
	border: 1px dashed rgba( 31, 31, 31, 0.3 );
	text-align: center;
}

/* -----------------------------------------------------------------------
 * Header
 * ---------------------------------------------------------------------*/

.yeldam-tl__header {
	max-width: 720px;
	margin: 0 auto clamp( 32px, 5vw, 64px );
	text-align: center;
}

.yeldam-tl__title {
	margin: 0 0 12px;
}

.yeldam-tl__subtitle {
	margin: 0;
	opacity: 0.75;
}

/* -----------------------------------------------------------------------
 * Track — shared base
 * ---------------------------------------------------------------------*/

.yeldam-tl__track {
	position: relative;
	max-width: var( --tl-container-width );
	margin-inline: auto;
}

.yeldam-tl__line {
	position: absolute;
	background-color: rgba( 31, 31, 31, 0.12 );
	border-radius: var( --tl-line-width );
	overflow: hidden;
}

.yeldam-tl__line-progress {
	position: absolute;
	inset: 0;
	background: linear-gradient( var( --tl-dark-green ), var( --tl-primary ) );
	transform-origin: top center;
	transform: scaleY( 0 );
}

.yeldam-tl__dot {
	width: var( --tl-dot-size );
	height: var( --tl-dot-size );
	border-radius: 50%;
	background-color: var( --tl-white );
	border: 3px solid var( --tl-item-dot );
	transition: background-color 400ms ease, transform 400ms ease, box-shadow 400ms ease;
	z-index: 2;
}

.yeldam-tl__dot.is-active {
	background-color: var( --tl-item-dot );
	transform: scale( 1.15 );
	box-shadow: 0 0 0 6px rgba( 36, 178, 75, 0.18 );
}

/* -----------------------------------------------------------------------
 * Milestone entrance states (fade / fade-up / zoom / slide) — the target
 * of both the GSAP timeline and the IntersectionObserver+CSS fallback.
 *
 * Content is visible (opacity: 1) by default and ONLY ever hidden for
 * the entrance effect once `.yeldam-tl--js` is present on the root --
 * a class timeline.js adds itself the moment it successfully finds and
 * initializes this widget instance. This is deliberate progressive
 * enhancement: if JS never runs at all (script blocked, CDN
 * unreachable, an unrelated error elsewhere on the page, an old
 * browser), every milestone's text and images stay fully visible --
 * the only thing that's lost is the fade/slide-in effect, never the
 * content itself. Previously this was gated purely on the
 * `data-enable-scroll-animation` attribute set at render time, which
 * meant a JS failure of any kind left every card permanently at
 * opacity: 0 -- invisible -- while the sibling timeline line (never
 * opacity-gated) kept rendering, exactly the "only line is visible"
 * failure mode this fixes.
 * ---------------------------------------------------------------------*/

.yeldam-tl__milestone {
	position: relative;
}

.yeldam-tl--js[data-enable-scroll-animation="1"] .yeldam-tl__milestone {
	/* opacity: 0; */
	transition: opacity 700ms ease, transform 700ms ease;
}

.yeldam-tl--js[data-enable-scroll-animation="1"] .yeldam-tl--anim-fade {
	transform: none;
}

.yeldam-tl--js[data-enable-scroll-animation="1"] .yeldam-tl--anim-fade-up {
	transform: translateY( 48px );
}

.yeldam-tl--js[data-enable-scroll-animation="1"] .yeldam-tl--anim-zoom {
	transform: scale( 0.85 );
}

.yeldam-tl--js[data-enable-scroll-animation="1"] .yeldam-tl--anim-slide-left {
	transform: translateX( -64px );
}

.yeldam-tl--js[data-enable-scroll-animation="1"] .yeldam-tl--anim-slide-right {
	transform: translateX( 64px );
}

.yeldam-tl__milestone.is-in-view {
	opacity: 1;
	transform: none;
}

.yeldam-tl__milestone.is-in-view .yeldam-tl__image {
	transform: scale( 1 );
}

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

.yeldam-tl__card {
	width: 100%;
	background-color: var( --tl-item-bg );
	border-radius: 20px;
	overflow: hidden;
	transition: box-shadow 350ms ease, transform 350ms ease, border-color 350ms ease;
}

.yeldam-tl[data-enable-hover-animation="1"] .yeldam-tl__card:hover {
	transform: translateY( -6px );
	border-color: var( --tl-hover-border );
	box-shadow: 0 20px 48px rgba( 31, 31, 31, 0.12 );
}

.yeldam-tl__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background-color: rgba( 31, 31, 31, 0.05 );
}

.yeldam-tl__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	transform: scale( 1.06 );
	transition: transform 900ms ease;
}

.yeldam-tl[data-enable-hover-animation="1"] .yeldam-tl__card:hover .yeldam-tl__image {
	transform: scale( 1.12 );
}

.yeldam-tl__play-button {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 56px;
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba( 255, 255, 255, 0.9 );
	border: 0;
	border-radius: 50%;
	color: var( --tl-primary );
	cursor: pointer;
	transition: transform 250ms ease, background-color 250ms ease;
}

.yeldam-tl__play-button:hover,
.yeldam-tl__play-button:focus-visible {
	transform: scale( 1.1 );
	background: var( --tl-white );
}

.yeldam-tl__play-icon {
	margin-left: 3px;
	font-size: 1.1rem;
}

.yeldam-tl__badge {
	position: absolute;
	top: 14px;
	left: 14px;
	padding: 4px 14px;
	border-radius: 999px;
	background-color: var( --tl-accent );
	color: var( --tl-text );
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.yeldam-tl__status {
	position: absolute;
	top: 14px;
	right: 14px;
	padding: 4px 14px;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	backdrop-filter: blur( 6px );
	background: rgba( 255, 255, 255, 0.75 );
	color: var( --tl-text );
}

.yeldam-tl__status--open {
	background: rgba( 36, 178, 75, 0.85 );
	color: var( --tl-white );
}

.yeldam-tl__status--coming-soon {
	background: rgba( 244, 180, 0, 0.9 );
	color: var( --tl-text );
}

.yeldam-tl__status--new {
	background: rgba( 31, 31, 31, 0.85 );
	color: var( --tl-white );
}

.yeldam-tl__body {
	padding: 24px;
}

.yeldam-tl__date {
	display: inline-block;
	margin-bottom: 8px;
	font-weight: 700;
	color: var( --tl-dark-green );
}

.yeldam-tl__store-name {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 6px;
}

.yeldam-tl__store-icon-wrap {
	display: inline-flex;
	color: var( --tl-primary );
	font-size: 1.1em;
	transition: transform 300ms ease;
}

.yeldam-tl[data-enable-hover-animation="1"] .yeldam-tl__card:hover .yeldam-tl__store-icon-wrap {
	transform: scale( 1.2 );
}

.yeldam-tl__location {
	margin: 0 0 12px;
	opacity: 0.7;
	font-size: 0.9rem;
}

.yeldam-tl__location::before {
	content: '\1F4CD';
	margin-right: 6px;
}

.yeldam-tl__short-description {
	margin: 0 0 8px;
	font-weight: 600;
}

.yeldam-tl__description {
	margin: 0 0 16px;
	line-height: 1.6;
}

.yeldam-tl__description :first-child {
	margin-top: 0;
}

.yeldam-tl__description :last-child {
	margin-bottom: 0;
}

.yeldam-tl__features {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.yeldam-tl__feature {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.yeldam-tl__feature-icon-wrap {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: rgba( 36, 178, 75, 0.12 );
	color: var( --tl-primary );
	font-size: 0.7rem;
	margin-top: 2px;
}

.yeldam-tl__feature-text {
	display: flex;
	flex-direction: column;
}

.yeldam-tl__feature-desc {
	font-size: 0.85rem;
	opacity: 0.7;
}

/* -----------------------------------------------------------------------
 * Gallery thumbnails
 * ---------------------------------------------------------------------*/

.yeldam-tl__gallery {
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 8px;
	margin: 0 0 16px;
}

.yeldam-tl__gallery-thumb {
	position: relative;
	aspect-ratio: 1 / 1;
	padding: 0;
	border: 0;
	border-radius: 10px;
	overflow: hidden;
	cursor: zoom-in;
	background: none;
}

.yeldam-tl__gallery-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 300ms ease;
}

.yeldam-tl__gallery-thumb:hover img,
.yeldam-tl__gallery-thumb:focus-visible img {
	transform: scale( 1.08 );
}

.yeldam-tl__gallery-thumb:focus-visible {
	outline: 2px solid var( --tl-primary );
	outline-offset: 2px;
}

/* -----------------------------------------------------------------------
 * Actions (button / maps / directions)
 * ---------------------------------------------------------------------*/

.yeldam-tl__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.yeldam-tl__button {
	display: inline-flex;
	align-items: center;
	padding: 10px 22px;
	border-radius: 999px;
	background-color: var( --tl-primary );
	color: var( --tl-white );
	text-decoration: none;
	font-weight: 600;
	transition: background-color 250ms ease, transform 250ms ease;
}

.yeldam-tl__button:hover,
.yeldam-tl__button:focus-visible {
	background-color: var( --tl-dark-green );
	transform: translateY( -2px );
}

.yeldam-tl__button--outline {
	background-color: transparent;
	color: var( --tl-dark-green );
	border: 2px solid var( --tl-primary );
}

.yeldam-tl__button--outline:hover,
.yeldam-tl__button--outline:focus-visible {
	background-color: rgba( 36, 178, 75, 0.1 );
	color: var( --tl-dark-green );
}

/* =========================================================================
 * TIMELINE STYLE: ZIG-ZAG (alternating left/right, default)
 * =======================================================================*/

.yeldam-tl--style-zigzag .yeldam-tl__line {
	top: 0;
	bottom: 0;
	left: 50%;
	width: var( --tl-line-width );
	transform: translateX( -50% );
}

.yeldam-tl--style-zigzag .yeldam-tl__track {
	display: flex;
	flex-direction: column;
	gap: var( --tl-gap );
}

.yeldam-tl--style-zigzag .yeldam-tl__milestone {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: start;
	column-gap: 32px;
}

.yeldam-tl--style-zigzag .yeldam-tl__dot {
	grid-column: 2;
	justify-self: center;
	margin-top: 8px;
}

.yeldam-tl--style-zigzag .yeldam-tl__card {
	grid-column: 1;
	justify-self: end;
	max-width: var( --tl-card-width );
}

.yeldam-tl--style-zigzag .yeldam-tl__milestone:nth-child( even ) .yeldam-tl__card {
	grid-column: 3;
	justify-self: start;
}

/* =========================================================================
 * TIMELINE STYLE: VERTICAL (all cards on one side, or centered)
 * =======================================================================*/

.yeldam-tl--style-vertical .yeldam-tl__track {
	display: flex;
	flex-direction: column;
	gap: var( --tl-gap );
}

.yeldam-tl--style-vertical .yeldam-tl__line {
	top: 0;
	bottom: 0;
	width: var( --tl-line-width );
}

.yeldam-tl--style-vertical.yeldam-tl--align-left .yeldam-tl__line {
	left: calc( var( --tl-dot-size ) / 2 );
}

.yeldam-tl--style-vertical.yeldam-tl--align-right .yeldam-tl__line {
	right: calc( var( --tl-dot-size ) / 2 );
}

.yeldam-tl--style-vertical.yeldam-tl--align-center .yeldam-tl__line {
	left: 50%;
	transform: translateX( -50% );
}

.yeldam-tl--style-vertical .yeldam-tl__milestone {
	display: flex;
	align-items: flex-start;
	gap: 24px;
}

.yeldam-tl--style-vertical.yeldam-tl--align-left .yeldam-tl__milestone {
	flex-direction: row;
}

.yeldam-tl--style-vertical.yeldam-tl--align-right .yeldam-tl__milestone {
	flex-direction: row-reverse;
}

.yeldam-tl--style-vertical.yeldam-tl--align-center .yeldam-tl__milestone {
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.yeldam-tl--style-vertical .yeldam-tl__dot {
	margin-top: 8px;
	flex: none;
}

.yeldam-tl--style-vertical .yeldam-tl__card {
	max-width: var( --tl-card-width );
}

.yeldam-tl--style-vertical.yeldam-tl--align-center .yeldam-tl__card {
	max-width: none;
	width: 100%;
}

/* =========================================================================
 * TIMELINE STYLE: HORIZONTAL (scrollable row)
 * =======================================================================*/

.yeldam-tl--style-horizontal .yeldam-tl__track {
	display: flex;
	align-items: flex-start;
	gap: var( --tl-gap );
	overflow-x: auto;
	padding-bottom: 24px;
	scroll-snap-type: x proximity;
}

.yeldam-tl--style-horizontal .yeldam-tl__line {
	top: calc( var( --tl-dot-size ) / 2 - var( --tl-line-width ) / 2 );
	left: 0;
	right: 0;
	height: var( --tl-line-width );
}

.yeldam-tl--style-horizontal .yeldam-tl__line-progress {
	transform-origin: left center;
	transform: scaleX( 0 );
}

.yeldam-tl--style-horizontal .yeldam-tl__milestone {
	flex: 0 0 auto;
	width: min( 360px, 80vw );
	display: flex;
	flex-direction: column;
	align-items: center;
	scroll-snap-align: start;
}

.yeldam-tl--style-horizontal .yeldam-tl__dot {
	margin-bottom: 16px;
}

.yeldam-tl--style-horizontal .yeldam-tl__card {
	width: 100%;
}

/* -----------------------------------------------------------------------
 * Lightbox
 * ---------------------------------------------------------------------*/

.yeldam-tl__lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba( 15, 20, 15, 0.92 );
	backdrop-filter: blur( 6px );
}

.yeldam-tl__lightbox[hidden] {
	display: none;
}

.yeldam-tl__lightbox-image {
	max-width: min( 90vw, 1100px );
	max-height: 85vh;
	border-radius: 12px;
	box-shadow: 0 24px 64px rgba( 0, 0, 0, 0.4 );
}

.yeldam-tl__lightbox-close,
.yeldam-tl__lightbox-nav,
.yeldam-tl__video-popup-close {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba( 255, 255, 255, 0.12 );
	color: var( --tl-white );
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 200ms ease, transform 200ms ease;
}

.yeldam-tl__lightbox-close,
.yeldam-tl__video-popup-close {
	top: 24px;
	right: 24px;
	width: 44px;
	height: 44px;
	font-size: 1.5rem;
}

.yeldam-tl__lightbox-nav {
	top: 50%;
	translate: 0 -50%;
	width: 52px;
	height: 52px;
	font-size: 1.8rem;
}

.yeldam-tl__lightbox-prev {
	left: 24px;
}

.yeldam-tl__lightbox-next {
	right: 24px;
}

.yeldam-tl__lightbox-close:hover,
.yeldam-tl__lightbox-nav:hover,
.yeldam-tl__video-popup-close:hover,
.yeldam-tl__lightbox-close:focus-visible,
.yeldam-tl__lightbox-nav:focus-visible,
.yeldam-tl__video-popup-close:focus-visible {
	background: rgba( 255, 255, 255, 0.25 );
	transform: scale( 1.05 );
}

/* -----------------------------------------------------------------------
 * Video popup
 * ---------------------------------------------------------------------*/

.yeldam-tl__video-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba( 15, 20, 15, 0.92 );
	backdrop-filter: blur( 6px );
}

.yeldam-tl__video-popup[hidden] {
	display: none;
}

.yeldam-tl__video-popup-body {
	width: min( 90vw, 960px );
}

.yeldam-tl__video-popup-body iframe,
.yeldam-tl__video-popup-body video {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 12px;
}

/* -----------------------------------------------------------------------
 * Collapsed cards on mobile (accordion-style)
 * ---------------------------------------------------------------------*/

@media ( max-width: 767px ) {
	.yeldam-tl[data-collapse-cards-mobile="1"] .yeldam-tl__description-group {
		display: grid;
		grid-template-rows: 0fr;
		opacity: 0;
		overflow: hidden;
		transition: grid-template-rows 350ms ease, opacity 350ms ease;
	}

	.yeldam-tl[data-collapse-cards-mobile="1"] .yeldam-tl__description-group > * {
		min-height: 0;
		overflow: hidden;
	}

	.yeldam-tl[data-collapse-cards-mobile="1"] .yeldam-tl__card.is-expanded .yeldam-tl__description-group {
		grid-template-rows: 1fr;
		opacity: 1;
	}

	.yeldam-tl[data-collapse-cards-mobile="1"] .yeldam-tl__store-name {
		cursor: pointer;
	}
}

/* -----------------------------------------------------------------------
 * Responsive: Tablet
 * ---------------------------------------------------------------------*/

@media ( max-width: 1024px ) {
	.yeldam-tl--style-zigzag .yeldam-tl__milestone {
		grid-template-columns: auto 1fr;
		column-gap: 20px;
	}

	.yeldam-tl--style-zigzag .yeldam-tl__dot {
		grid-column: 1;
		justify-self: start;
	}

	.yeldam-tl--style-zigzag .yeldam-tl__card,
	.yeldam-tl--style-zigzag .yeldam-tl__milestone:nth-child( even ) .yeldam-tl__card {
		grid-column: 2;
		justify-self: stretch;
		max-width: none;
	}

	.yeldam-tl--style-zigzag .yeldam-tl__line {
		left: calc( var( --tl-dot-size ) / 2 );
		transform: none;
	}

	.yeldam-tl--style-vertical .yeldam-tl__card {
		max-width: none;
	}
}

/* -----------------------------------------------------------------------
 * Responsive: Mobile — stack vertically, full width cards
 * ---------------------------------------------------------------------*/

@media ( max-width: 767px ) {
	.yeldam-tl {
		padding-inline: 16px;
	}

	.yeldam-tl--style-vertical .yeldam-tl__milestone,
	.yeldam-tl--style-vertical.yeldam-tl--align-right .yeldam-tl__milestone {
		flex-direction: row;
	}

	.yeldam-tl--style-horizontal .yeldam-tl__track {
		flex-direction: column;
		overflow-x: visible;
	}

	.yeldam-tl--style-horizontal .yeldam-tl__milestone {
		width: 100%;
		flex-direction: row;
		align-items: flex-start;
		gap: 20px;
	}

	.yeldam-tl--style-horizontal .yeldam-tl__line {
		top: 0;
		bottom: 0;
		left: calc( var( --tl-dot-size ) / 2 );
		right: auto;
		width: var( --tl-line-width );
		height: auto;
	}

	.yeldam-tl--style-horizontal .yeldam-tl__line-progress {
		transform-origin: top center;
		transform: scaleY( 0 );
	}

	.yeldam-tl__gallery {
		grid-template-columns: repeat( 3, 1fr );
	}

	.yeldam-tl[data-hide-image-mobile="1"] .yeldam-tl__media {
		display: none;
	}

	.yeldam-tl[data-hide-description-mobile="1"] .yeldam-tl__description {
		display: none;
	}

	.yeldam-tl__actions {
		flex-direction: column;
	}

	.yeldam-tl__button {
		width: 100%;
		justify-content: center;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.yeldam-tl__milestone,
	.yeldam-tl__image,
	.yeldam-tl__card,
	.yeldam-tl__dot,
	.yeldam-tl__button,
	.yeldam-tl__line-progress {
		transition-duration: 1ms !important;
		animation-duration: 1ms !important;
	}
}
