/* AGSCH Documentos — visor en ventana (modal) de la página de cada documento. */

html.agsch-visor-abierto { overflow: hidden; }

.agsch-visor {
	--agsch-visor-azul: #001558;
	--agsch-visor-amarillo: #feb135;
	box-sizing: border-box;
	width: min(1200px, 96vw); height: 94vh; height: 94dvh; max-width: none; max-height: none;
	margin: auto; padding: 0; border: 0; border-radius: 10px; overflow: hidden;
	background: #f1f2f6; color: #1f2937; box-shadow: 0 12px 48px rgba(0, 0, 0, .35);
	font-family: inherit; font-size: 16px; line-height: 1.4;
}
.agsch-visor[open] { display: flex; flex-direction: column; }
.agsch-visor::backdrop { background: rgba(0, 21, 88, .72); }
.agsch-visor:fullscreen { width: 100vw; height: 100vh; border-radius: 0; }

/* Barra superior */
.agsch-visor__barra {
	flex: 0 0 auto; display: flex; align-items: center; gap: .5em;
	padding: .45em .6em .45em 1em; background: var(--agsch-visor-azul); color: #fff;
}
.agsch-visor__titulo {
	flex: 1 1 auto; min-width: 0; margin: 0; padding: 0;
	overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
	font-family: inherit; font-size: 1em; font-weight: 700; line-height: 1.3; color: #fff;
}
.agsch-visor__zoom, .agsch-visor__acciones { flex: 0 0 auto; display: flex; align-items: center; gap: .25em; }
.agsch-visor__zoom[hidden] { display: none; }
.agsch-visor__zoom { margin-right: .5em; padding-right: .5em; border-right: 1px solid rgba(255, 255, 255, .25); }

.agsch-visor__btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .35em;
	min-width: 2.4em; height: 2.4em; margin: 0; padding: 0 .55em; border: 0; border-radius: 6px;
	background: transparent; color: #fff !important; font: inherit; font-size: .9em; font-weight: 600;
	text-decoration: none !important; cursor: pointer; box-shadow: none;
}
.agsch-visor__btn svg { fill: currentColor; flex: 0 0 auto; }
.agsch-visor__btn:hover, .agsch-visor__btn:focus-visible { background: var(--agsch-visor-amarillo); color: var(--agsch-visor-azul) !important; }
.agsch-visor__btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.agsch-visor__btn[hidden] { display: none; }
.agsch-visor__pct { min-width: 4.2em; font-variant-numeric: tabular-nums; }
.agsch-visor__descargar { border: 1.5px solid rgba(255, 255, 255, .7); }

/* Contenido */
.agsch-visor__cuerpo { position: relative; flex: 1 1 auto; min-height: 0; background: #e6e8ef; }
.agsch-visor__marco { display: block; width: 100%; height: 100%; border: 0; background: #e6e8ef; }
.agsch-visor__cuerpo--img { overflow: auto; display: flex; overscroll-behavior: contain; }
.agsch-visor__img { display: block; margin: auto; max-width: none; height: auto; background: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .15); }
.agsch-visor__img--ajustada { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; cursor: zoom-in; }
.agsch-visor__cuerpo--zoom .agsch-visor__img { cursor: zoom-out; }
.agsch-visor__error { margin: auto; padding: 1.5em; text-align: center; }

/* Celulares: pantalla completa, botones solo con ícono */
@media (max-width: 700px) {
	.agsch-visor { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
	.agsch-visor__barra { padding: .35em .35em .35em .75em; gap: .25em; }
	.agsch-visor__txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.agsch-visor__descargar { border: 0; }
	.agsch-visor__full { display: none; }
	.agsch-visor__zoom { margin-right: .15em; padding-right: .15em; }
	.agsch-visor__pct { min-width: 3.6em; font-size: .8em; }
}
@media (max-width: 420px) {
	.agsch-visor__nueva { display: none; }
}
