/* ==========================================================================
   Eunoia Books — frontend
   ========================================================================== */

.eb-book {
	--eb-v: #6d28d9;
	--eb-f: #c026d3;
	--eb-grad: linear-gradient(135deg, #6d28d9 0%, #a21caf 55%, #db2777 100%);
	--eb-ink: #1a1128;
	--eb-muted: #6f6684;
	--eb-line: #ece7f5;
	--eb-soft: #f7f3fd;
	--eb-radius: 22px;
	font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
	color: var(--eb-ink);
	max-width: 1240px;
	margin: 0 auto;
	padding: 24px 0 64px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
.eb-book *, .eb-book *::before, .eb-book *::after { box-sizing: border-box; }
.eb-book img, .eb-book video { display: block; max-width: 100%; height: auto; }
.eb-book h1, .eb-book h2, .eb-book p, .eb-book figure, .eb-book blockquote, .eb-book ul { margin: 0; padding: 0; }
.eb-book :where(button.eb-fig-btn, button.eb-retrato-foto, button.eb-video-card) {
	all: unset;
	display: block;
	position: relative;
	width: 100%;
	cursor: zoom-in;
	box-sizing: border-box;
}
.eb-book button:focus-visible { outline: 3px solid var(--eb-f); outline-offset: 3px; }

.eb-kicker {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	background: var(--eb-grad);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	margin-bottom: 14px !important;
}
.eb-kicker--light { background: none; color: rgba(255, 255, 255, .85); }

.eb-preview {
	background: #fff4e0;
	color: #8a4b00;
	border-radius: 12px;
	padding: 10px 16px;
	font-size: 14px;
	margin-bottom: 16px;
}
.eb-volver {
	display: inline-block;
	font-weight: 600;
	font-size: 14px;
	color: var(--eb-v) !important;
	text-decoration: none !important;
	margin-bottom: 16px;
}
.eb-volver:hover { color: var(--eb-f) !important; }
.eb-empty { text-align: center; color: var(--eb-muted); padding: 60px 20px; }

/* ---------- HERO ---------- */

.eb-hero {
	position: relative;
	min-height: min(52vh, 480px);
	border-radius: calc(var(--eb-radius) + 8px);
	overflow: hidden;
	display: flex;
	align-items: flex-end;
	background: #1a0b2e;
	isolation: isolate;
}
.eb-hero-bg { position: absolute; inset: 0; z-index: -2; }
.eb-hero-bg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.04);
	animation: eb-kenburns 18s ease-out forwards;
}
.eb-hero::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(to top, rgba(22, 6, 44, .92) 0%, rgba(22, 6, 44, .55) 38%, rgba(22, 6, 44, 0) 70%),
		linear-gradient(120deg, rgba(109, 40, 217, .35), rgba(219, 39, 119, .15));
}
.eb-hero--sin-foto { background: var(--eb-grad); min-height: 460px; }
.eb-hero--sin-foto::after {
	background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, .18), transparent 45%),
		radial-gradient(circle at 10% 90%, rgba(255, 255, 255, .12), transparent 40%);
}
.eb-hero-content {
	padding: clamp(28px, 5vw, 64px);
	color: #fff;
	max-width: 900px;
	animation: eb-rise .9s cubic-bezier(.2, .7, .2, 1) both;
}
.eb-hero-title {
	font-size: clamp(2.3rem, 6.2vw, 5.2rem) !important;
	font-weight: 800 !important;
	line-height: .98 !important;
	letter-spacing: -.03em;
	color: #fff !important;
	margin: 0 !important;
}
.eb-hero-sub {
	margin-top: 16px !important;
	font-size: clamp(1rem, 1.6vw, 1.25rem);
	color: rgba(255, 255, 255, .85);
	font-weight: 500;
}
.eb-stats {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 28px !important;
}
.eb-stats li {
	margin: 0;
	padding: 9px 16px;
	border-radius: 99px;
	background: rgba(255, 255, 255, .12);
	border: 1px solid rgba(255, 255, 255, .22);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	font-size: 14px;
	color: #fff;
}
.eb-stats strong { font-weight: 700; margin-right: 4px; }

/* ---------- FRASE ---------- */

.eb-frase {
	position: relative;
	max-width: 820px;
	margin: clamp(48px, 8vw, 96px) auto 0 !important;
	padding: 0 24px !important;
	text-align: center;
	border: 0 !important;
	background: none !important;
}
.eb-frase::before {
	content: '“';
	display: block;
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 120px;
	line-height: .6;
	height: 56px;
	background: var(--eb-grad);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.eb-frase p {
	font-family: 'Playfair Display', Georgia, serif;
	font-style: italic;
	font-weight: 500;
	font-size: clamp(1.4rem, 2.8vw, 2.1rem);
	line-height: 1.35;
	color: var(--eb-ink);
}

/* ---------- SECCIONES ---------- */

.eb-section { margin-top: clamp(56px, 9vw, 110px); padding: 0 4px; }
.eb-section-head {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: end;
	column-gap: 18px;
	margin-bottom: 32px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--eb-line);
}
.eb-section-num {
	grid-row: span 2;
	font-size: clamp(3rem, 7vw, 5.5rem);
	font-weight: 800;
	line-height: .8;
	letter-spacing: -.04em;
	background: var(--eb-grad);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.eb-section-head h2 {
	font-size: clamp(1.6rem, 3.2vw, 2.4rem) !important;
	font-weight: 700 !important;
	letter-spacing: -.02em;
	line-height: 1.1 !important;
	color: var(--eb-ink) !important;
	margin: 0 !important;
}
.eb-section-head p { color: var(--eb-muted); font-size: 15px; }

/* ---------- FIGURAS (grupales / galería) ---------- */

.eb-fig { position: relative; margin: 0 !important; }
.eb-book .eb-fig-btn { border-radius: var(--eb-radius); overflow: hidden; background: var(--eb-soft); padding: 0; border: 0; box-shadow: none; }
.eb-fig-btn img, .eb-fig-btn video {
	width: 100%;
	transition: transform .7s cubic-bezier(.2, .7, .2, 1), filter .4s;
}
.eb-fig-btn:hover img, .eb-fig-btn:hover video { transform: scale(1.035); }
.eb-fig figcaption {
	margin-top: 10px;
	font-size: 14px;
	color: var(--eb-muted);
	padding: 0 4px;
}

.eb-grupales { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 300px)); justify-content: center; }
.eb-grupales .eb-fig-btn img { aspect-ratio: 4 / 3; object-fit: cover; }

.eb-galeria { columns: 3 280px; column-gap: 18px; }
.eb-galeria .eb-fig { break-inside: avoid; margin-bottom: 18px !important; }

/* Play */
.eb-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 68px;
	height: 68px;
	margin: -34px 0 0 -34px;
	border-radius: 50%;
	background: var(--eb-grad);
	box-shadow: 0 10px 30px rgba(109, 40, 217, .45);
	transition: transform .3s;
	pointer-events: none;
}
.eb-play::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 11px 0 11px 18px;
	border-color: transparent transparent transparent #fff;
}
.eb-fig-btn:hover .eb-play, .eb-video-card:hover .eb-play { transform: scale(1.1); }
.eb-fig--video .eb-fig-btn { cursor: pointer; }

/* ---------- RETRATOS ---------- */

.eb-retratos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: clamp(18px, 2.4vw, 32px) clamp(14px, 2vw, 24px);
}
.eb-retratos--equipo { grid-template-columns: repeat(auto-fill, minmax(170px, 220px)); }
.eb-retrato { margin: 0 !important; text-align: left; }
.eb-book .eb-retrato-foto {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	position: relative;
	aspect-ratio: 4 / 5;
	border-radius: var(--eb-radius);
	overflow: hidden;
	background: var(--eb-soft);
	transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s;
}
.eb-retrato-foto::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgba(26, 17, 40, .06);
	pointer-events: none;
}
.eb-retrato-foto img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}
.eb-retrato:hover .eb-retrato-foto {
	transform: translateY(-6px);
	box-shadow: 0 18px 40px -12px rgba(109, 40, 217, .35);
}
.eb-retrato:hover .eb-retrato-foto img { transform: scale(1.05); }
.eb-book .eb-retrato-foto--vacia { display: grid; place-items: center; background: var(--eb-grad); }
.eb-retrato-foto--vacia span {
	font-size: clamp(2.2rem, 4vw, 3rem);
	font-weight: 700;
	color: rgba(255, 255, 255, .92);
	letter-spacing: .04em;
}
.eb-retrato figcaption { padding: 14px 4px 0; display: flex; flex-direction: column; gap: 3px; }
.eb-retrato strong {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--eb-ink);
	background-image: var(--eb-grad);
	background-size: 0 2px;
	background-repeat: no-repeat;
	background-position: 0 100%;
	transition: background-size .45s;
	align-self: flex-start;
	padding-bottom: 2px;
}
.eb-retrato:hover strong { background-size: 100% 2px; }
.eb-rol {
	align-self: flex-start;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--eb-v);
	background: var(--eb-soft);
	border-radius: 99px;
	padding: 2px 10px;
	margin-top: 4px;
}
.eb-retrato em { font-size: 13px; color: var(--eb-muted); line-height: 1.4; margin-top: 4px; }

/* ---------- VIDEOS ---------- */

.eb-videos { display: grid; grid-template-columns: 1fr; gap: 32px; max-width: 1100px; margin: 0 auto; }
.eb-videos .eb-play { width: 96px; height: 96px; margin: -48px 0 0 -48px; }
.eb-videos .eb-play::after { border-width: 15px 0 15px 25px; }
.eb-video-title { font-size: 20px !important; }
.eb-book .eb-video-card { cursor: pointer; background: none; padding: 0; border: 0; }
.eb-video-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	border-radius: var(--eb-radius);
	overflow: hidden;
	background: var(--eb-grad);
}
.eb-video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s; }
.eb-video-card:hover .eb-video-thumb img { transform: scale(1.04); }
.eb-video-title { display: block; margin-top: 12px; font-weight: 600; font-size: 16px; padding: 0 4px; }

/* ---------- CIERRE ---------- */

.eb-fin {
	margin-top: clamp(64px, 10vw, 120px);
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}
.eb-fin-mark {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 16px;
	background: var(--eb-grad);
	color: #fff;
	font-weight: 800;
	font-size: 24px;
	margin-bottom: 10px;
	transform: rotate(-6deg);
}
.eb-fin p { font-weight: 700; font-size: 18px; }
.eb-fin small { color: var(--eb-muted); font-size: 14px; margin-bottom: 14px; }

/* ---------- ÍNDICE ---------- */

.eb-index-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.eb-index-title {
	font-size: clamp(2.2rem, 5vw, 3.8rem) !important;
	font-weight: 800 !important;
	letter-spacing: -.03em;
	line-height: 1.02 !important;
	color: var(--eb-ink) !important;
}
.eb-index-title em {
	font-family: 'Playfair Display', Georgia, serif;
	font-weight: 500;
	background: var(--eb-grad);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	padding-right: .08em;
}
.eb-index-sub { margin-top: 14px !important; color: var(--eb-muted); font-size: 17px; }
.eb-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px; }
.eb-index-card {
	display: flex;
	flex-direction: column;
	text-decoration: none !important;
	color: var(--eb-ink) !important;
	border-radius: calc(var(--eb-radius) + 4px);
	background: #fff;
	border: 1px solid var(--eb-line);
	overflow: hidden;
	transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s;
}
.eb-index-card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px -18px rgba(109, 40, 217, .35); }
.eb-index-cover { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--eb-grad); }
.eb-index-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.eb-index-card:hover .eb-index-cover img { transform: scale(1.06); }
.eb-index-info { display: flex; flex-direction: column; gap: 4px; padding: 20px 22px 22px; }
.eb-index-info strong { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.eb-index-info span { color: var(--eb-muted); font-size: 14px; }
.eb-index-info .eb-index-meta { margin-top: 8px; font-weight: 600; color: var(--eb-v); }

/* ---------- LIGHTBOX ---------- */

.eb-lb {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: grid;
	grid-template-rows: 1fr auto;
	background: rgba(14, 6, 26, .94);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s, visibility .3s;
	font-family: 'Poppins', system-ui, sans-serif;
}
.eb-lb.is-open { opacity: 1; visibility: visible; }
.eb-lb-stage { position: relative; display: grid; place-items: center; padding: 64px 72px 12px; min-height: 0; }
.eb-lb-stage img, .eb-lb-stage video {
	max-width: 100%;
	max-height: calc(100vh - 150px);
	width: auto;
	height: auto;
	border-radius: 14px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
	animation: eb-zoom .35s cubic-bezier(.2, .7, .2, 1);
}
.eb-lb-stage iframe {
	width: min(1100px, 100%);
	aspect-ratio: 16 / 9;
	height: auto;
	max-height: calc(100vh - 150px);
	border: 0;
	border-radius: 14px;
	background: #000;
}
.eb-lb-bar { display: flex; justify-content: center; gap: 16px; align-items: baseline; padding: 14px 24px 26px; color: #fff; text-align: center; }
.eb-lb-cap { font-size: 16px; font-weight: 500; }
.eb-lb-count { font-size: 13px; color: rgba(255, 255, 255, .55); }
.eb-lb button {
	all: unset;
	position: absolute;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .1);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background .2s;
	z-index: 2;
}
.eb-lb button:hover { background: var(--eb-grad, #a21caf); background: linear-gradient(135deg, #6d28d9, #db2777); }
.eb-lb .eb-lb-close { top: 16px; right: 16px; }
.eb-lb .eb-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.eb-lb .eb-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.eb-lb.is-single .eb-lb-prev, .eb-lb.is-single .eb-lb-next { display: none !important; }
html.eb-lb-lock { overflow: hidden; }

/* ---------- Animaciones ---------- */

@keyframes eb-kenburns { to { transform: scale(1); } }
@keyframes eb-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes eb-zoom { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.eb-reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
.eb-reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	.eb-book *, .eb-lb * { animation: none !important; transition: none !important; }
	.eb-reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
	.eb-book { padding: 12px 0 48px; --eb-radius: 16px; }
	.eb-hero { min-height: 48vh; }
	.eb-grupales { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.eb-retratos { grid-template-columns: repeat(2, 1fr); }
	.eb-retratos--equipo { grid-template-columns: repeat(2, 1fr); }
	.eb-retrato strong { font-size: 14px; }
	.eb-galeria { columns: 2; column-gap: 10px; }
	.eb-galeria .eb-fig { margin-bottom: 10px !important; }
	.eb-videos { grid-template-columns: 1fr; }
	.eb-lb-stage { padding: 60px 8px 8px; }
	.eb-lb .eb-lb-prev, .eb-lb .eb-lb-next { top: auto !important; bottom: 18px; transform: none !important; }
	.eb-lb-bar { padding-bottom: 80px; }
}

/* ==========================================================================
   v1.0.2 — Escala más compacta y paleta suavizada (violeta + lavanda + rosa empolvado)
   ========================================================================== */

.eb-book {
	--eb-v: #6b4fd8;
	--eb-f: #b98ad6;
	--eb-grad: linear-gradient(135deg, #6b4fd8 0%, #9a83e6 55%, #d8a9cf 100%);
	--eb-soft: #f5f2fc;
	--eb-radius: 14px;
	max-width: 1080px;
}

/* Hero */
.eb-hero { min-height: 300px; border-radius: 20px; }
.eb-hero::after {
	background:
		linear-gradient(to top, rgba(28, 16, 52, .88) 0%, rgba(28, 16, 52, .45) 45%, rgba(28, 16, 52, 0) 80%),
		linear-gradient(120deg, rgba(107, 79, 216, .28), rgba(216, 169, 207, .12));
}
.eb-hero--sin-foto { min-height: 260px; }
.eb-hero-content { padding: clamp(22px, 3.5vw, 40px); max-width: 720px; }
.eb-hero-title { font-size: clamp(1.8rem, 3.6vw, 2.8rem) !important; line-height: 1.05 !important; }
.eb-hero-sub { font-size: 1rem; margin-top: 10px !important; }
.eb-stats { margin-top: 18px !important; gap: 8px; }
.eb-stats li { padding: 6px 12px; font-size: 13px; }

/* Frase y secciones */
.eb-frase { margin-top: 48px !important; max-width: 680px; }
.eb-frase::before { font-size: 80px; height: 40px; }
.eb-frase p { font-size: clamp(1.15rem, 2vw, 1.5rem); }
.eb-section { margin-top: clamp(40px, 6vw, 72px); }
.eb-section-head { margin-bottom: 22px; padding-bottom: 12px; column-gap: 14px; }
.eb-section-num { font-size: clamp(2.2rem, 4vw, 3.2rem); }
.eb-section-head h2 { font-size: clamp(1.25rem, 2.2vw, 1.7rem) !important; }
.eb-section-head p { font-size: 14px; }

/* Fotos de la promo */
.eb-grupales { grid-template-columns: repeat(auto-fill, minmax(160px, 220px)); gap: 12px; }

/* Retratos */
.eb-retratos,
.eb-retratos--equipo {
	grid-template-columns: repeat(auto-fill, minmax(120px, 150px));
	justify-content: center;
	gap: 20px 16px;
}
.eb-retrato:hover .eb-retrato-foto { transform: translateY(-4px); box-shadow: 0 12px 26px -12px rgba(107, 79, 216, .35); }
.eb-retrato figcaption { padding-top: 10px; }
.eb-retrato strong { font-size: 14px; }
.eb-retrato em { font-size: 12px; }
.eb-rol { font-size: 10px; padding: 2px 8px; }
.eb-book .eb-retrato-foto--vacia span { font-size: 1.8rem; }

/* Galería */
.eb-galeria { columns: 4 200px; column-gap: 12px; }
.eb-galeria .eb-fig { margin-bottom: 12px !important; }

/* Videos */
.eb-videos { max-width: 880px; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 430px)); justify-content: center; }
.eb-videos .eb-play, .eb-play { width: 60px; height: 60px; margin: -30px 0 0 -30px; box-shadow: 0 8px 22px rgba(107, 79, 216, .35); }
.eb-videos .eb-play::after, .eb-play::after { border-width: 10px 0 10px 16px; }
.eb-video-title { font-size: 16px !important; }

/* Cierre e índice */
.eb-fin { margin-top: 56px; }
.eb-fin-mark { width: 44px; height: 44px; font-size: 19px; border-radius: 12px; }
.eb-index-title { font-size: clamp(1.8rem, 3.6vw, 2.8rem) !important; }
.eb-index-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.eb-index-info strong { font-size: 17px; }

/* Lightbox */
.eb-lb button:hover { background: linear-gradient(135deg, #6b4fd8, #d8a9cf); }

@media (max-width: 700px) {
	.eb-hero { min-height: 240px; }
	.eb-retratos, .eb-retratos--equipo { grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
	.eb-retrato strong { font-size: 12px; }
	.eb-grupales { grid-template-columns: repeat(2, 1fr); }
	.eb-galeria { columns: 2; }
}
