/* =====================================================================
   tnz_tabler · estilos propios de la web pública (sobre Tabler 1.7.3)
   Tabler pone casi todo; aquí solo va lo específico de la plantilla.
   ===================================================================== */

:root {
	--tnz-header-height: 4rem;
}

html {
	scroll-behavior: smooth;
	/* Los anclajes (#seccion) no quedan tapados por la cabecera fija */
	scroll-padding-top: calc(var(--tnz-header-height) + 1rem);
}

/* ---------- Cabecera ---------- */
.tnz-header {
	/* .page de Tabler es flex en columna: sin esto la cabecera se encoge a su
	   min-height y el menú desplegado en móvil se sale por debajo */
	flex-shrink: 0;
}
.tnz-header .navbar-brand-image {
	height: 2.5rem;
	width: auto;
	max-width: 14rem;
	object-fit: contain;
}
.tnz-header .dropdown-menu {
	min-width: 14rem;
}
.tnz-search-dropdown {
	width: min(22rem, calc(100vw - 2rem));
}
/* Menú plegado (móvil/tableta): la .navbar de Tabler tiene altura fija y el
   menú desplegado se salía por debajo, transparente, encima del contenido.
   Aquí la cabecera crece y el menú va en su propia fila, con fondo. */
@media (max-width: 991.98px) {
	.tnz-header {
		height: auto;
		min-height: var(--tnz-header-height);
		background: var(--tblr-bg-surface);
	}
	.tnz-header > .container-xl {
		flex-wrap: wrap;
	}
	.tnz-header .navbar-collapse {
		flex-basis: 100%;
		order: 10;
		background: var(--tblr-bg-surface);
		border-top: 1px solid var(--tblr-border-color);
		margin-top: .5rem;
		padding: .25rem 0 .5rem;
		max-height: calc(100vh - var(--tnz-header-height));
		max-height: calc(100dvh - var(--tnz-header-height));
		overflow-y: auto;
	}
	.tnz-header .navbar-nav .nav-link {
		padding: .65rem 0;
	}
	.tnz-header .navbar-collapse .dropdown-menu {
		border: 0;
		box-shadow: none;
		background: var(--tblr-bg-surface-secondary);
		margin: 0 0 .25rem;
	}
}

/* ---------- Hero / carrusel de la galería ---------- */
.tnz-hero .carousel-item img {
	height: clamp(14rem, 42vw, 34rem);
	object-fit: cover;
}
.tnz-hero .carousel-caption {
	left: 8%;
	right: 8%;
	bottom: 12%;
	text-shadow: 0 1px 12px rgba(0, 0, 0, .45);
}
.tnz-hero .carousel-caption h2 {
	color: #fff;
	font-size: clamp(1.4rem, 3.5vw, 2.75rem);
	font-weight: 600;
	margin: 0;
}
.tnz-hero .carousel-caption p {
	margin: .5rem 0 0;
	font-size: clamp(.95rem, 1.6vw, 1.15rem);
}
.tnz-hero::after {
	/* Velo para que el texto siempre se lea */
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 55%;
	background: linear-gradient(to top, rgba(0, 0, 0, .45), transparent);
	pointer-events: none;
}
.tnz-hero.tnz-hero-rounded {
	border-radius: var(--tblr-border-radius-lg);
	overflow: hidden;
}

/* ---------- Imagen destacada del artículo ---------- */
.tnz-featured-img {
	width: 100%;
	max-height: 28rem;
	object-fit: cover;
}

/* ---------- Tarjetas de los listados ---------- */
.tnz-card .card-img-top {
	aspect-ratio: 4 / 3;
	object-fit: cover;
}
.tnz-card .card-title a:hover {
	color: var(--tblr-primary) !important;
	text-decoration: none;
}

/* ---------- Galería (miniaturas + visor) ---------- */
.tnz-gallery-item {
	display: block;
	border-radius: var(--tblr-border-radius);
	overflow: hidden;
	position: relative;
}
.tnz-gallery-item img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform .3s ease;
}
.tnz-gallery-item:hover img,
.tnz-gallery-item:focus-visible img {
	transform: scale(1.05);
}
.tnz-gallery-item .tnz-gallery-zoom {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 1.75rem;
	background: rgba(0, 0, 0, .35);
	opacity: 0;
	transition: opacity .2s ease;
}
.tnz-gallery-item:hover .tnz-gallery-zoom,
.tnz-gallery-item:focus-visible .tnz-gallery-zoom {
	opacity: 1;
}
.tnz-lightbox .modal-content {
	background: #0b0f17;
	border: 0;
}
.tnz-lightbox .carousel-item img {
	max-height: 80vh;
	width: auto;
	max-width: 100%;
	margin: 0 auto;
	display: block;
}
.tnz-lightbox .carousel-caption {
	position: static;
	padding: .75rem 1rem 1rem;
	color: rgba(255, 255, 255, .85);
}
.tnz-lightbox .btn-close {
	z-index: 5;
}

/* ---------- Texto enriquecido (cuerpo de las páginas) ---------- */
.tnz-content {
	overflow-wrap: break-word;
}
.tnz-content img,
.tnz-content video,
.tnz-content iframe {
	max-width: 100%;
}
.tnz-content img {
	height: auto;
}
.tnz-content table {
	max-width: 100%;
}
.tnz-content::after {
	/* Cierra los float del HTML antiguo (imágenes alineadas, etc.) */
	content: "";
	display: block;
	clear: both;
}

/* ---------- Comentarios ---------- */
.tnz-comment + .tnz-comment {
	border-top: 1px solid var(--tblr-border-color);
}

/* ---------- Botón volver arriba ---------- */
.tnz-back-to-top {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 1030;
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s ease;
}
.tnz-back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
}

/* ---------- Pie ---------- */
.tnz-footer {
	background: var(--tblr-bg-surface);
}
.tnz-footer .footer-logo {
	height: 2rem;
	width: auto;
	max-width: 12rem;
	object-fit: contain;
}
.tnz-footer .list-unstyled li + li {
	margin-top: .35rem;
}
.tnz-footer a:not(.btn) {
	color: var(--tblr-secondary);
}
.tnz-footer a:not(.btn):hover {
	color: var(--tblr-primary);
	text-decoration: none;
}
.tnz-banners img {
	max-width: 100%;
	height: auto;
}

/* =====================================================================
   Compatibilidad con HTML antiguo (Bootstrap 3)
   Los cuerpos de las páginas (editor) y los formularios que genera
   tnz_generar_formulario() traen clases de BS3: se mapean a lo más
   parecido en BS5/Tabler para que no se rompan.
   ===================================================================== */
/* Ojo: Tabler tiene su propia .img-responsive (caja de proporción con
   padding-top y borde, para fondos). En un <img> se quiere la de BS3. */
img.img-responsive { display: block; max-width: 100%; height: auto; padding-top: 0; border: 0; background: none; }
.center-block { display: block; margin-left: auto; margin-right: auto; }
.pull-left { float: left !important; }
.pull-right { float: right !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.clearB, .clearfix::after { clear: both; }
.clearfix::after { content: ""; display: table; }
.floatL { float: left; }
.floatR { float: right; }
@media (max-width: 767.98px) { .hidden-xs { display: none !important; } }
@media (min-width: 768px) and (max-width: 991.98px) { .hidden-sm { display: none !important; } }
@media (min-width: 992px) and (max-width: 1199.98px) { .hidden-md { display: none !important; } }
@media (min-width: 1200px) { .hidden-lg { display: none !important; } }
@media (min-width: 768px) { .col-sm-offset-1 { margin-left: 8.333333%; } .col-sm-offset-2 { margin-left: 16.666667%; } .col-sm-offset-3 { margin-left: 25%; } }
@media (min-width: 992px) { .col-md-offset-1 { margin-left: 8.333333%; } .col-md-offset-2 { margin-left: 16.666667%; } .col-md-offset-3 { margin-left: 25%; } .col-md-offset-4 { margin-left: 33.333333%; } }
.btn-default { --tblr-btn-color: var(--tblr-body-color); --tblr-btn-bg: var(--tblr-bg-surface); --tblr-btn-border-color: var(--tblr-border-color); }
.panel { margin-bottom: 1rem; border: 1px solid var(--tblr-border-color); border-radius: var(--tblr-border-radius); background: var(--tblr-bg-surface); }
.panel-heading { padding: .75rem 1rem; border-bottom: 1px solid var(--tblr-border-color); font-weight: 600; }
.panel-body { padding: 1rem; }
.well { padding: 1rem; margin-bottom: 1rem; background: var(--tblr-bg-surface-secondary); border-radius: var(--tblr-border-radius); }
.thumbnail { display: block; padding: .25rem; border: 1px solid var(--tblr-border-color); border-radius: var(--tblr-border-radius); }
.label { display: inline-block; padding: .2em .55em; font-size: 75%; font-weight: 600; line-height: 1; border-radius: var(--tblr-border-radius-sm); color: #fff; background: var(--tblr-secondary); }
.label-primary { background: var(--tblr-primary); }
.label-success { background: var(--tblr-success); }
.label-info { background: var(--tblr-info); }
.label-warning { background: var(--tblr-warning); }
.label-danger { background: var(--tblr-danger); }
/* Modal BS3 dentro de los formularios generados */
.modal .close { border: 0; background: transparent; font-size: 1.5rem; line-height: 1; opacity: .6; margin-left: auto; }
.modal .close:hover { opacity: 1; }
.modal-header .close { order: 2; }
/* Formularios generados + FormValidation 0.8.1 (framework BS3) */
.form-group { margin-bottom: 1rem; }
.tecniz_f_label, .tnz-form label:not(.form-check-label):not(.form-selectgroup-item) { font-weight: 500; margin-bottom: .35rem; display: inline-block; }
.has-error .form-control,
.has-error .form-select { border-color: var(--tblr-danger); }
.has-error .help-block,
.has-error .control-label { color: var(--tblr-danger); }
.help-block { display: block; margin-top: .25rem; font-size: .8125rem; }
.msg_info { padding: .75rem 1rem; margin-bottom: 1rem; border-radius: var(--tblr-border-radius); background: var(--tblr-info-lt); color: var(--tblr-info); }
.tnz-form .row > [class*="col-"] { margin-bottom: .25rem; }
