/* Removed iframe styles - content is now direct */

.prev, .next {
	cursor: pointer;
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	padding: 15px 20px;
	color: #fff;
	background-color: rgba(0, 0, 0, 0.5);
	font-weight: bold;
	font-size: 30px;
	visibility: hidden;
	z-index: 1000;
	transition: background-color 0.3s;
}
.prev:hover, .next:hover {
	background-color: rgba(0, 0, 0, 0.8);
}
.prev {
	left: 0;
	border-radius: 0 3px 3px 0;
}
.next {
	right: 0;
	border-radius: 3px 0 0 3px;
}
html {
	margin: 0;
	padding: 0;
	overflow-x: hidden !important;
	overflow-y: scroll !important;
	width: 100%;
	height: 100%;
	-webkit-overflow-scrolling: touch;
}

body {
	margin: 0;
	padding: 0;
	overflow-x: hidden !important;
	overflow-y: scroll !important;
	width: 100%;
	height: auto;
	min-height: 100vh;
	-webkit-overflow-scrolling: touch;
	position: relative;
}

/* Responsive body adjustments */
body#publication {
	width: 100%;
	margin: 0;
	padding: 0;
	position: relative;
	overflow-x: hidden !important;
	overflow-y: auto !important;
	height: auto;
	min-height: 100vh;
}

/* Bootstrap integration - wrapper for responsive scaling */
.publication-wrapper {
	width: 1920px;
	height: 5502px;
	position: relative;
	margin: 0 auto;
	transform-origin: top center;
	display: block;
	overflow: visible;
}

/* Fix para scroll en móviles - SOLUCIÓN DEFINITIVA */
@media (max-width: 768px) {
	/* Usar zoom que SÍ afecta el layout */
	.publication-wrapper {
		width: 1920px;
		height: 5502px;
		zoom: calc(100vw / 1920);
		-moz-transform: scale(calc(100vw / 1920));
		-moz-transform-origin: top center;
		margin: 0 auto;
		display: block;
	}
	
	/* Calcular altura escalada */
	body#publication {
		height: auto !important;
		min-height: calc(5502px * (100vw / 1920) + 200px) !important;
		overflow-y: scroll !important;
		overflow-x: hidden !important;
		position: relative !important;
	}
	
	html {
		height: auto !important;
		overflow-y: scroll !important;
		overflow-x: hidden !important;
	}
	
	body {
		height: auto !important;
		min-height: calc(5502px * (100vw / 1920) + 200px) !important;
		overflow-y: scroll !important;
		overflow-x: hidden !important;
	}
	
	/* Contenedores Bootstrap con altura escalada */
	body#publication .container-fluid {
		height: auto !important;
		min-height: calc(5502px * (100vw / 1920) + 200px) !important;
		overflow: visible !important;
		padding-bottom: 200px !important;
		display: block !important;
	}
	
	body#publication .row {
		height: auto !important;
		min-height: calc(5502px * (100vw / 1920) + 200px) !important;
		overflow: visible !important;
		display: block !important;
	}
	
	body#publication .col-12 {
		height: auto !important;
		min-height: calc(5502px * (100vw / 1920) + 200px) !important;
		overflow: visible !important;
		display: block !important;
	}
}

/* Prevent Bootstrap from affecting InDesign layout */
.publication-wrapper * {
	box-sizing: content-box;
}

/* Override Bootstrap container padding for our layout */
body#publication .container-fluid {
	padding: 0 !important;
	max-width: 100% !important;
	overflow-x: hidden !important;
	overflow-y: visible !important;
	height: auto !important;
}

body#publication .row {
	margin: 0 !important;
	--bs-gutter-x: 0 !important;
	--bs-gutter-y: 0 !important;
	overflow-x: hidden !important;
	overflow-y: visible !important;
	height: auto !important;
}

body#publication .col-12 {
	padding: 0 !important;
	flex: 0 0 auto !important;
	width: 100% !important;
	overflow-x: hidden !important;
	overflow-y: visible !important;
	height: auto !important;
}

/* Ensure Bootstrap doesn't override our positioning */
.publication-wrapper [style*="position:absolute"] {
	position: absolute !important;
}

.publication-wrapper [style*="position:relative"] {
	position: relative !important;
}

/* Video Container Styles */
.video-container {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.95);
	z-index: 10000;
	justify-content: center;
	align-items: center;
}
.video-container.active {
	display: flex;
}
.demo-video {
	max-width: 90%;
	max-height: 90%;
	width: auto;
	height: auto;
}
.close-video {
	position: absolute;
	top: 20px;
	right: 30px;
	font-size: 40px;
	color: #fff;
	background: none;
	border: none;
	cursor: pointer;
	z-index: 10001;
	line-height: 1;
	padding: 10px;
	transition: color 0.3s;
}
.close-video:hover {
	color: #ffd588;
}

/* Responsive Design with Bootstrap Integration */

/* Desktop - Bootstrap xl breakpoint and above */
@media screen and (min-width: 1921px) {
	.publication-wrapper {
		transform: none;
		width: 1920px;
	}
}

/* Large screens - Bootstrap lg breakpoint */
@media screen and (max-width: 1920px) and (min-width: 992px) {
	.publication-wrapper {
		transform: scale(calc(100vw / 1920));
		transform-origin: top center;
		width: 1920px;
		height: 5502px;
	}
	
	body#publication .container-fluid,
	body#publication .row,
	body#publication .col-12 {
		height: auto;
		min-height: calc(5502px * (100vw / 1920));
	}
}

/* Medium screens - Bootstrap md breakpoint (Tablets) */
@media screen and (max-width: 991px) and (min-width: 769px) {
	.publication-wrapper {
		transform: scale(calc(100vw / 1920));
		transform-origin: top center;
		width: 1920px;
		height: 5502px;
	}
	
	body#publication .container-fluid,
	body#publication .row,
	body#publication .col-12 {
		height: auto;
		min-height: calc(5502px * (100vw / 1920));
	}
}

/* Small screens - Bootstrap sm breakpoint (Mobile Landscape) */
@media screen and (max-width: 768px) and (orientation: landscape) {
	.publication-wrapper {
		transform: scale(calc(100vw / 1920));
		transform-origin: top center;
		width: 1920px;
		height: 5502px;
	}
	
	body#publication .container-fluid,
	body#publication .row,
	body#publication .col-12 {
		height: auto;
		min-height: calc(5502px * (100vw / 1920));
	}
	
	.prev, .next {
		padding: 10px 15px;
		font-size: 24px;
	}
	
	.demo-video {
		max-width: 95%;
		max-height: 85%;
	}
	
	.close-video {
		top: 10px;
		right: 15px;
		font-size: 30px;
	}
}

/* Extra small screens - Bootstrap xs (Mobile Portrait) - USANDO ZOOM */
@media screen and (max-width: 768px) {
	/* Usar zoom en lugar de transform para que afecte el layout */
	.publication-wrapper {
		width: 1920px;
		height: 5502px;
		zoom: calc(100vw / 1920);
		-moz-transform: scale(calc(100vw / 1920));
		-moz-transform-origin: top center;
		transform-origin: top center;
		margin: 0 auto;
		display: block;
	}
	
	/* Los contenedores padres deben ajustarse al contenido escalado */
	body#publication .container-fluid {
		overflow-x: hidden !important;
		overflow-y: visible !important;
		height: auto !important;
		width: 100% !important;
		min-height: calc(5502px * (100vw / 1920)) !important;
		padding-bottom: 50px !important;
		display: block !important;
	}
	
	body#publication .row {
		overflow-x: hidden !important;
		overflow-y: visible !important;
		height: auto !important;
		width: 100% !important;
		min-height: calc(5502px * (100vw / 1920)) !important;
		display: block !important;
	}
	
	body#publication .col-12 {
		overflow-x: hidden !important;
		overflow-y: visible !important;
		height: auto !important;
		width: 100% !important;
		min-height: calc(5502px * (100vw / 1920)) !important;
		display: block !important;
	}
	
	/* FORZAR SCROLL en elementos raíz */
	html {
		overflow-x: hidden !important;
		overflow-y: scroll !important;
		-webkit-overflow-scrolling: touch;
		width: 100% !important;
		height: 100% !important;
		position: relative !important;
	}
	
	body {
		overflow-x: hidden !important;
		overflow-y: scroll !important;
		-webkit-overflow-scrolling: touch;
		width: 100% !important;
		height: auto !important;
		position: relative !important;
		min-height: 100vh !important;
	}
	
	body#publication {
		position: relative !important;
		overflow-x: hidden !important;
		overflow-y: scroll !important;
		height: auto !important;
		min-height: 100vh !important;
		width: 100% !important;
	}
	
	.prev, .next {
		padding: 8px 12px;
		font-size: 20px;
		background-color: rgba(0, 0, 0, 0.7);
	}
	
	.demo-video {
		max-width: 100%;
		max-height: 70vh;
		width: 100%;
	}
	
	.close-video {
		top: 10px;
		right: 10px;
		font-size: 28px;
		padding: 5px;
	}
}

/* Very small mobile - Bootstrap xs smaller */
@media screen and (max-width: 480px) {
	.publication-wrapper {
		width: 1920px;
		height: 5502px;
		zoom: calc(100vw / 1920);
		-moz-transform: scale(calc(100vw / 1920));
		-moz-transform-origin: top center;
		transform-origin: top center;
		margin: 0 auto;
	}
	
	body#publication .container-fluid {
		min-height: calc(5502px * (100vw / 1920) + 100px) !important;
		padding-bottom: 100px !important;
		height: auto !important;
	}
	
	body#publication .row,
	body#publication .col-12 {
		min-height: calc(5502px * (100vw / 1920) + 100px) !important;
		height: auto !important;
	}
	
	html, body {
		overflow-y: scroll !important;
		-webkit-overflow-scrolling: touch;
		height: auto !important;
	}
	
	body#publication {
		overflow-y: scroll !important;
		height: auto !important;
	}
	
	.prev, .next {
		padding: 6px 10px;
		font-size: 18px;
	}
	
	.demo-video {
		max-width: 100%;
		max-height: 60vh;
	}
	
	.close-video {
		top: 5px;
		right: 5px;
		font-size: 24px;
	}
}

/* Extra small mobile */
@media screen and (max-width: 360px) {
	.publication-wrapper {
		transform: scale(calc(100vw / 1920));
		transform-origin: top center;
		width: 1920px;
	}
	
	.prev, .next {
		padding: 5px 8px;
		font-size: 16px;
	}
}
