/* ================================================
   MC Module Slider – Stylesheet
   ================================================ */

.mc-module-slider {
	position: relative;
	width: 100%;
	font-family: inherit;
}

/* ── Slides wrapper: the height-setter ── */
.mcms-slides-wrapper {
	position: relative;
	overflow: hidden;
	min-height: 620px; /* fallback; overridden by widget style controls */
}

/* ── Every slide: always in the DOM, stacked absolutely ── */
.mcms-slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	z-index: 0;
	transition: opacity 0.5s ease;
}

.mcms-slide--active {
	opacity: 1;
	pointer-events: auto;
	z-index: 1;
	transition: none; /* entry is handled by animation, not transition */
}

/* ── Background ── */
.mcms-slide__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-color: #1a1a2e;
}
.mcms-slide__overlay {
	position: absolute;
	inset: 0;
}

/* ── Content ── */
.mcms-slide__content {
	position: relative;
	z-index: 2;
	padding: 60px 40px;
	max-width: 820px;
	width: 100%;
}
.mcms-align-center { text-align: center; margin: 0 auto; }
.mcms-align-left   { text-align: left; }
.mcms-align-right  { text-align: right; margin-left: auto; }

.mcms-slide__tagline {
	margin: 0 0 12px;
	color: #ffffff;
	font-size: 15px;
	letter-spacing: 0.04em;
	font-style: italic;
}
.mcms-slide__heading {
	margin: 0 0 18px;
	color: #ffffff;
	font-size: 52px;
	line-height: 1.15;
	font-weight: 700;
}
.mcms-slide__description {
	margin: 0 0 32px;
	color: #eeeeee;
	font-size: 17px;
	line-height: 1.65;
	max-width: 640px;
}
.mcms-align-center .mcms-slide__description { margin-left: auto; margin-right: auto; }

/* ── Buttons ── */
.mcms-slide__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}
.mcms-align-center .mcms-slide__buttons { justify-content: center; }
.mcms-align-right .mcms-slide__buttons { justify-content: flex-end; }

.mcms-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 32px;
	border-radius: 4px;
	text-decoration: none;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	border: 2px solid transparent;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
	line-height: 1.2;
}
.mcms-btn:hover {
	transform: translateY(-2px);
}
.mcms-btn__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.mcms-btn--btn1 {
	background-color: #cc1818;
	color: #ffffff;
	border-color: #cc1818;
}
.mcms-btn--btn1:hover {
	background-color: #a01212;
}

.mcms-btn--btn2 {
	background-color: transparent;
	color: #ffffff;
	border-color: #ffffff;
}
.mcms-btn--btn2:hover {
	background-color: #ffffff;
	color: #cc1818;
}

/* ════════════════════════════════════════════════
   CONTENT entrance animation (tagline / heading /
   description / buttons) — staggered fade-up, runs
   independently of the background slide transition
   ════════════════════════════════════════════════ */

.mcms-btn {
	opacity: 0;
}

/* Steady state: visible once active, and while the
   parent slide is animating out (parent-level opacity/
   transform already handles the visual fade/exit) */
.mcms-slide--active .mcms-btn,
.mcms-slide--animate-out .mcms-btn {
	opacity: 1;
}

@keyframes mcmsContentFadeUp {
	from { opacity: 0; transform: translateY(28px); }
	to   { opacity: 1; transform: translateY(0); }
}

.mcms-slide--animate-in .mcms-btn {
	animation-name: mcmsContentFadeUp;
	animation-duration: 0.9s;
	animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
	animation-fill-mode: forwards;
	animation-delay: 0.75s;
}
.mcms-slide--animate-in .mcms-btn:nth-child(2) {
	animation-delay: 0.85s;
}

/* ── Letter-by-letter reveal for tagline & heading ──
   (technique after tobiasahlin.com/moving-letters/:
   split into per-character spans, each with its own
   staggered animation-delay set inline by JS) */
.mcms-word {
	display: inline-block;
}
.mcms-letter {
	display: inline-block;
	opacity: 0;
}

/* Steady state / exiting: letters fully visible, no motion */
.mcms-slide--active .mcms-slide__tagline .mcms-letter,
.mcms-slide--active .mcms-slide__heading .mcms-letter,
.mcms-slide--active .mcms-slide__description .mcms-letter,
.mcms-slide--animate-out .mcms-slide__tagline .mcms-letter,
.mcms-slide--animate-out .mcms-slide__heading .mcms-letter,
.mcms-slide--animate-out .mcms-slide__description .mcms-letter {
	opacity: 1;
	transform: none;
}

@keyframes mcmsLetterIn {
	from { opacity: 0; transform: translateY(60%) rotateZ(8deg); }
	to   { opacity: 1; transform: translateY(0) rotateZ(0deg); }
}

.mcms-slide--animate-in .mcms-slide__tagline .mcms-letter,
.mcms-slide--animate-in .mcms-slide__heading .mcms-letter {
	animation-name: mcmsLetterIn;
	animation-duration: 0.9s;
	animation-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);
	animation-fill-mode: forwards;
}

/* ── Description: slow overlapping fade-in (after
   tobiasahlin.com/moving-letters/#3 "Great Thinkers") — every letter simply
   fades from 0 to 1 opacity, but the fade duration is much longer than the
   per-letter stagger, so neighbouring letters are still fading in together —
   a soft, slow dissolve-in wave rather than a snap-in or a typewriter. ── */
@keyframes mcmsLetterFadeSlow {
	from { opacity: 0; }
	to   { opacity: 1; }
}
.mcms-slide--animate-in .mcms-slide__description .mcms-letter {
	animation-name: mcmsLetterFadeSlow;
	animation-duration: 1.2s;
	animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); /* easeInOutQuad */
	animation-fill-mode: forwards;
}

/* ════════════════════════════════════════════════
   Elementor-style entrance animation override
   (tagline / heading / description / buttons) — set per-widget
   via Content > Slider Settings. When an element has
   .mcms-anim-target, JS drives its entrance with the
   chosen animate.css class instead of the built-in
   letter/fade-up reveal above.
   ════════════════════════════════════════════════ */
.mcms-anim-target {
	opacity: 0;
}
.mcms-slide--active .mcms-anim-target,
.mcms-slide--animate-out .mcms-anim-target {
	opacity: 1;
}

/* Cancel the built-in reveal effects on elements the panel has opted
   into an explicit animation for, so the two don't run at once. */
.mcms-slide--animate-in .mcms-slide__tagline.mcms-anim-target .mcms-letter,
.mcms-slide--animate-in .mcms-slide__heading.mcms-anim-target .mcms-letter,
.mcms-slide--animate-in .mcms-slide__description.mcms-anim-target .mcms-letter {
	animation-name: none;
	opacity: 1;
	transform: none;
}
.mcms-slide--animate-in .mcms-btn.mcms-anim-target {
	animation-name: none;
}

/* animate.css duration modifiers (mirrors Elementor's own "Fast/Slow"
   options); JS adds the specific animation's class name alongside these. */
.mcms-animated {
	animation-duration: 1.25s;
	animation-fill-mode: forwards;
}
.mcms-animated.mcms-anim-slow {
	animation-duration: 2s;
}
.mcms-animated.mcms-anim-fast {
	animation-duration: 0.75s;
}

/* ════════════════════════════════════════════════
   ENTER animations  (.mcms-slide--animate-in)
   EXIT  animations  (.mcms-slide--animate-out)
   ════════════════════════════════════════════════ */

.mcms-slide--animate-in,
.mcms-slide--animate-out {
	transition: none;
}

@keyframes mcmsEnterFromLeft {
	from { opacity: 0; transform: translateX(-100%); }
	to   { opacity: 1; transform: translateX(0); }
}
@keyframes mcmsExitToRight {
	from { opacity: 1; transform: translateX(0); }
	to   { opacity: 0; transform: translateX(100%); }
}
@keyframes mcmsEnterFromRight {
	from { opacity: 0; transform: translateX(100%); }
	to   { opacity: 1; transform: translateX(0); }
}
@keyframes mcmsExitToLeft {
	from { opacity: 1; transform: translateX(0); }
	to   { opacity: 0; transform: translateX(-100%); }
}
@keyframes mcmsFadeIn {
	from { opacity: 0; transform: scale(1.04); }
	to   { opacity: 1; transform: scale(1); }
}
@keyframes mcmsFadeOut {
	from { opacity: 1; transform: scale(1); }
	to   { opacity: 0; transform: scale(0.97); }
}
@keyframes mcmsSpinIn {
	from { opacity: 0; transform: rotate(-180deg) scale(0.25); }
	to   { opacity: 1; transform: rotate(0deg)    scale(1); }
}
@keyframes mcmsSpinOut {
	from { opacity: 1; transform: rotate(0deg)   scale(1); }
	to   { opacity: 0; transform: rotate(180deg) scale(0.25); }
}

.mc-module-slider[data-transition="ltr"] .mcms-slide--animate-in {
	animation: mcmsEnterFromLeft 0.55s ease forwards;
	z-index: 2;
}
.mc-module-slider[data-transition="ltr"] .mcms-slide--animate-out {
	animation: mcmsExitToRight 0.55s ease forwards;
	z-index: 2;
}

.mc-module-slider[data-transition="rtl"] .mcms-slide--animate-in {
	animation: mcmsEnterFromRight 0.55s ease forwards;
	z-index: 2;
}
.mc-module-slider[data-transition="rtl"] .mcms-slide--animate-out {
	animation: mcmsExitToLeft 0.55s ease forwards;
	z-index: 2;
}

.mc-module-slider[data-transition="fade"] .mcms-slide--animate-in {
	animation: mcmsFadeIn 0.55s ease forwards;
	z-index: 2;
}
.mc-module-slider[data-transition="fade"] .mcms-slide--animate-out {
	animation: mcmsFadeOut 0.55s ease forwards;
	z-index: 1;
}

.mc-module-slider[data-transition="spin"] .mcms-slide--animate-in {
	animation: mcmsSpinIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
	z-index: 2;
}
.mc-module-slider[data-transition="spin"] .mcms-slide--animate-out {
	animation: mcmsSpinOut 0.5s ease forwards;
	z-index: 1;
}

/* ── Arrow navigation ── */
.mcms-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	background: rgba(255,255,255,0.15);
	color: #fff;
	border: none;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(4px);
}
.mcms-arrow:hover { background: rgba(255,255,255,0.3); }
.mcms-arrow--prev { left: 20px; }
.mcms-arrow--next { right: 20px; }
.mcms-arrow i, .mcms-arrow svg { font-size: 20px; width: 20px; height: 20px; }
.mcms-arrow__img { width: 22px; height: auto; display: block; pointer-events: none; }

/* ── Bottom tab navigation ──
   .mcms-tabs is the fixed-width mask; .mcms-tabs-track is the flex strip
   that JS slides via transform when a "Max Visible Tabs" limit is set. */
.mcms-tabs {
	overflow: hidden;
	border-top: 1px solid rgba(0,0,0,0.1);
	background: #f5f5f5;
	position: relative;
	z-index: 3;
}

.mcms-tabs-track {
	display: flex;
	flex-wrap: wrap;
	transition: transform 0.35s ease;
}
.mcms-tabs--limited .mcms-tabs-track {
	flex-wrap: nowrap;
}

.mcms-tab {
	flex: 1 0 auto;
	padding: 16px 24px;
	border: none;
	border-right: 1px solid rgba(0,0,0,0.08);
	background: #f5f5f5;
	color: #222222;
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	white-space: nowrap;
	transition: background-color 0.25s, color 0.25s;
	letter-spacing: 0.02em;
}
.mcms-tab:last-child { border-right: none; }
.mcms-tab:hover { filter: brightness(0.95); }
.mcms-tab--active { background: #cc1818; color: #ffffff; }

/* ── Responsive ── */
@media (max-width: 768px) {
	.mcms-slide__heading { font-size: 28px !important; }
	.mcms-slide__content { padding: 40px 20px; }
	.mcms-tabs:not(.mcms-tabs--limited) .mcms-tab { flex: 0 0 50%; border-bottom: 1px solid rgba(0,0,0,0.08); }
}
@media (max-width: 480px) {
	.mcms-tabs:not(.mcms-tabs--limited) .mcms-tab { flex: 0 0 100%; }
	.mcms-slide__buttons { flex-direction: column; align-items: stretch; }
	.mcms-btn { width: 100%; }
}
