/* Folder Stack — basado en la demo de referencia (folder-stack con
 * GSAP): todas las carpetas miden y están en el MISMO lugar siempre;
 * lo único que cambia entre estar al frente y estar atrás en el
 * montón es transform (translateY + scale + rotate chico) y opacity,
 * animado por GSAP en el JS. Nunca hay salto de tamaño de caja. */

.fst-widget {
	--fst-stage-w: min(var(--fst-stage-w-set, 820px), calc(100vw - 60px));
	--fst-stage-h: var(--fst-stage-h-set, 560px);
	--fst-ratio: calc(var(--fst-stage-w) / 820px);

	--fst-folder-w: calc(700px * var(--fst-ratio));
	--fst-folder-h: calc(420px * var(--fst-ratio));
	--fst-folder-left: calc(60px * var(--fst-ratio));
	--fst-folder-top: calc(70px * var(--fst-ratio));

	--fst-radius-ref: 36px;
	--fst-radius: calc(var(--fst-radius-ref) * var(--fst-ratio));

	--fst-flap-w: calc(240px * var(--fst-ratio));
	--fst-flap-h: calc(58px * var(--fst-ratio));
	--fst-flap2-left: calc(220px * var(--fst-ratio));
	--fst-flap2-w: calc(60px * var(--fst-ratio));

	--fst-content-pad-v: calc(112px * var(--fst-ratio));
	--fst-content-pad-h: calc(50px * var(--fst-ratio));

	--fst-color-start: #6f1b1b;
	--fst-color-end: #4a0f0f;

	position: relative;
	width: 100%;
	max-width: calc(var(--fst-stage-w) + 40px);
	margin: 0 auto;
	padding: 20px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fst-stage {
	position: relative;
	width: var(--fst-stage-w);
	height: var(--fst-stage-h);
	margin-bottom: 24px;
}

.fst-folder {
	position: absolute;
	left: var(--fst-folder-left);
	top: var(--fst-folder-top);
	width: var(--fst-folder-w);
	height: var(--fst-folder-h);
	margin: 0;
	padding: 0;
	border: none;
	box-sizing: border-box;
	border-radius: var(--fst-radius);
	background: linear-gradient(145deg, var(--fst-color-start), var(--fst-color-end));
	box-shadow: 0 calc(30px * var(--fst-ratio)) calc(60px * var(--fst-ratio)) rgba(0, 0, 0, .35);
	transform-origin: center;
	cursor: pointer;
	text-align: left;
	font: inherit;
	color: inherit;
	will-change: transform, opacity;
	-webkit-appearance: none;
	appearance: none;
}

.fst-folder:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Pestaña/lengüeta de la carpeta arriba a la izquierda, igual que la
   referencia (rectángulo + esquina en diagonal). */
.fst-folder::before {
	content: '';
	position: absolute;
	top: calc(-1 * var(--fst-flap-h) * 0.586);
	left: 0;
	width: var(--fst-flap-w);
	height: var(--fst-flap-h);
	background: inherit;
	border-radius: calc(var(--fst-radius) * 0.78) calc(var(--fst-radius) * 0.78) 0 0;
}

.fst-folder::after {
	content: '';
	position: absolute;
	top: calc(-1 * var(--fst-flap-h) * 0.586);
	left: var(--fst-flap2-left);
	width: var(--fst-flap2-w);
	height: var(--fst-flap-h);
	background: inherit;
	transform: skewX(-30deg);
	border-top-right-radius: calc(var(--fst-radius) * 0.56);
}

.fst-content {
	position: relative;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	padding: var(--fst-content-pad-v) var(--fst-content-pad-h);
	display: flex;
	flex-direction: column;
	justify-content: center;
	pointer-events: none;
	color: #ffffff;
	overflow: hidden;
}

.fst-num {
	font-size: 64px;
	line-height: 1;
	opacity: .9;
}

.fst-title {
	font-size: 34px;
	font-weight: 700;
	margin: calc(14px * var(--fst-ratio)) 0;
	line-height: 1.15;
}

.fst-desc {
	max-width: 92%;
	font-size: 18px;
	line-height: 1.45;
	opacity: .9;
}

/* Controles */
.fst-nav {
	display: flex;
	align-items: center;
	gap: 16px;
}

.fst-nav-btn {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, .06);
	color: #1b1b1b;
	font-size: 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .2s ease, background-color .2s ease;
}

.fst-nav-btn:hover {
	background: rgba(0, 0, 0, .12);
	transform: scale(1.06);
}

.fst-no-arrows .fst-nav {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.fst-folder {
		transition: none !important;
	}
}
