/* Cátedra extraordinaria de estudios canadienses — estilos del sitio público
   Basado en el diseño original (rojo, azul profundo y duotonos morados) con estructura renovada */

@font-face { font-family: "Avenir"; src: url("fonts/AvenirLTStd-Book.woff2") format("woff2"), url("fonts/AvenirLTStd-Book.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Avenir"; src: url("fonts/AvenirLTStd-Oblique.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Avenir"; src: url("fonts/AvenirLTStd-Medium.woff2") format("woff2"), url("fonts/AvenirLTStd-Medium.woff") format("woff"); font-weight: 500 900; font-display: swap; }

:root {
  --rojo: #D7071D;
  --rojo-oscuro: #a10516;
  --azul: #062C74;
  --lila: #ada3cf;
  --gris: #54595F;
  --texto: #2b2b2e;
  --fondo-suave: #f5f4f8;
  --sombra: 0 14px 34px rgba(0,0,0,.18);
  --bs-link-color: var(--azul);
  --bs-link-color-rgb: 6, 44, 116;
  --bs-link-hover-color: var(--rojo);
  --bs-link-hover-color-rgb: 215, 7, 29;
  --bs-body-font-family: "Avenir", "Avenir Next", "Segoe UI", Roboto, Arial, sans-serif;
}
body { font-family: var(--bs-body-font-family); color: var(--texto); background: #fff; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .titulo-seccion { font-weight: 500; letter-spacing: -.01em; }
::selection { background: var(--rojo); color: #fff; }

/* ---------- encabezado ---------- */
.encabezado { background: var(--rojo); }
.encabezado .navbar { padding-top: .55rem; padding-bottom: .55rem; }
.encabezado .navbar-brand img { height: 46px; }
.encabezado .nav-link { color: #fff !important; font-size: .82rem; font-weight: 500; letter-spacing: .02em; padding: .5rem .7rem !important; position: relative; }
.encabezado .nav-link::after { content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .2rem; height: 2px; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.encabezado .nav-link:hover::after, .encabezado .nav-link.active::after { transform: scaleX(1); }
.encabezado .dropdown-toggle::after { display: none; }
.encabezado .dropdown-menu { border-radius: 0; border: 0; border-top: 3px solid var(--azul); box-shadow: var(--sombra); padding: .4rem 0; }
.encabezado .dropdown-item { font-size: .9rem; padding: .5rem 1.2rem; }
.encabezado .dropdown-item:hover { background: var(--fondo-suave); color: var(--rojo); }
@media (min-width: 992px) {
  .encabezado .dropdown { position: relative; }
  .encabezado .dropdown-menu { width: auto !important; min-width: 15rem; top: 100%; left: 0; margin-top: 0; }
  .encabezado .dropdown:hover > .dropdown-menu, .encabezado .dropdown:focus-within > .dropdown-menu { display: block; }
}
@media (max-width: 991.98px) {
  .encabezado .navbar-collapse { padding: .5rem 0 1rem; }
  .encabezado .nav-link { font-size: 1rem; }
  .encabezado .nav-link::after { display: none; }
  .encabezado .dropdown-menu { background: var(--rojo-oscuro); box-shadow: none; border: 0; }
  .encabezado .dropdown-item { color: #fff; }
}

/* ---------- botones ---------- */
.btn { border-radius: 0; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 500; padding: .7rem 1.4rem; }
.btn .bi-arrow-up-right { margin-left: .4rem; display: inline-block; transition: transform .25s; }
.btn:hover .bi-arrow-up-right { transform: translate(3px, -3px); }
.btn-rojo { --bs-btn-bg: var(--rojo); --bs-btn-border-color: var(--rojo); --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--rojo-oscuro); --bs-btn-hover-border-color: var(--rojo-oscuro); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--rojo-oscuro); --bs-btn-active-border-color: var(--rojo-oscuro); }
.btn-azul { --bs-btn-bg: var(--azul); --bs-btn-border-color: var(--azul); --bs-btn-color: #fff;
  --bs-btn-hover-bg: #041e50; --bs-btn-hover-border-color: #041e50; --bs-btn-hover-color: #fff; }
.btn-blanco { --bs-btn-bg: #fff; --bs-btn-border-color: #fff; --bs-btn-color: var(--rojo);
  --bs-btn-hover-bg: transparent; --bs-btn-hover-border-color: #fff; --bs-btn-hover-color: #fff; }
.btn-linea { --bs-btn-bg: transparent; --bs-btn-border-color: #fff; --bs-btn-color: #fff;
  --bs-btn-hover-bg: #fff; --bs-btn-hover-border-color: #fff; --bs-btn-hover-color: var(--rojo); }
.btn-oscuro { --bs-btn-bg: #1b1b1f; --bs-btn-border-color: #1b1b1f; --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--azul); --bs-btn-hover-border-color: var(--azul); --bs-btn-hover-color: #fff; }

/* ---------- portada ---------- */
.portada { position: relative; background: #3a0a2c; overflow: hidden; }
.portada .carousel-item img { width: 100%; height: 78vh; min-height: 460px; max-height: 820px; object-fit: cover; }
/* duotono rojo-morado como el sitio original */
.portada .carousel-item::after, .cabecera-pagina .carousel-item::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(60,20,90,.05) 0%, rgba(120,10,60,.12) 50%, rgba(150,0,30,.38) 100%); }
.portada-texto { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; pointer-events: none; }
.portada-texto * { pointer-events: auto; }
.portada-titulo { color: #fff; text-transform: uppercase; font-weight: 400; font-size: clamp(1.9rem, 4.3vw, 4.4rem); line-height: 1; width: fit-content; max-width: 100%; margin-left: auto; text-align: left; text-shadow: 0 4px 30px rgba(60,0,30,.35); }
.portada-sub { color: #fff; font-weight: 500; font-size: clamp(1rem, 1.6vw, 1.35rem); margin-left: auto; width: fit-content; }
.buscador-portada { max-width: 34rem; margin: 0 auto 2.5rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); border-radius: 2rem; }
.buscador-portada .form-control { border-radius: 2rem 0 0 2rem; padding: .8rem 1.4rem; border: 0; }
.buscador-portada .btn { border-radius: 0 2rem 2rem 0; background: #fff; color: var(--azul); border: 0; }
.portada .carousel-indicators { z-index: 3; margin-bottom: 1.5rem; }
.portada .carousel-indicators [data-bs-target] { width: 34px; height: 3px; }

.cabecera-pagina { position: relative; background: #3a0a2c; color: #fff; overflow: hidden; }
.cabecera-pagina .carousel-item img { width: 100%; height: 440px; object-fit: cover; }
.cabecera-pagina .cabecera-texto { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 1rem; }
.cabecera-pagina h1 { font-size: clamp(1.7rem, 3.6vw, 3rem); max-width: 26ch; margin: 0 auto; text-shadow: 0 4px 24px rgba(40,0,20,.45); }
.cabecera-simple { background: linear-gradient(120deg, var(--rojo) 0%, var(--rojo-oscuro) 60%, #6a1550 100%); color: #fff; padding: 3.2rem 0 2.8rem; position: relative; overflow: hidden; }
.cabecera-simple::after { content: ""; position: absolute; right: -80px; top: -60px; width: 360px; height: 360px; background: url("../uploads/2022/04/actividades.jpg") 85% center / cover; opacity: .22; border-radius: 50%; }
.cabecera-simple .container { position: relative; z-index: 1; }
.cabecera-simple h1 { font-size: clamp(1.6rem, 3.4vw, 2.6rem); max-width: 30ch; }
.cabecera-simple .breadcrumb a, .cabecera-simple .breadcrumb-item.active, .cabecera-simple .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.85); }

/* ---------- bloques de color ---------- */
.bloque { padding: 5rem 0; position: relative; }
.bloque-rojo { background: var(--rojo); color: #fff; }
.bloque-rojo a:not(.btn) { color: #fff; }
.bloque-azul { background: var(--azul); color: #fff; }
.bloque-azul a:not(.btn) { color: #fff; }
.bloque-gris { background: var(--fondo-suave); }
.titulo-seccion { font-size: clamp(1.6rem, 2.8vw, 2.3rem); margin-bottom: 1.6rem; }
.bloque-rojo .titulo-seccion, .bloque-azul .titulo-seccion { color: #fff; }
.titulo-seccion.con-linea::after { content: ""; display: block; width: 3.5rem; height: 4px; background: var(--rojo); margin-top: .7rem; }
.bloque-rojo .titulo-seccion.con-linea::after, .bloque-azul .titulo-seccion.con-linea::after { background: #fff; }
.bloque-rojo .contenido, .bloque-azul .contenido { color: rgba(255,255,255,.95); }
.etiqueta-seccion { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; font-weight: 500; opacity: .85; margin-bottom: .6rem; }

.logos-instituciones img { max-height: 104px; width: auto; background: #fff; padding: .45rem; box-shadow: 0 6px 18px rgba(0,0,0,.15); }

/* imagen con marco desplazado */
.foto-marco { position: relative; }
.foto-marco::before { content: ""; position: absolute; inset: 22px -22px -22px 22px; border: 2px solid rgba(255,255,255,.55); z-index: 0; }
.foto-marco img { position: relative; z-index: 1; width: 100%; box-shadow: var(--sombra); }

/* bloque del Seminario: fotografía a todo lo ancho */
.bloque-spec { min-height: 560px; display: flex; align-items: center; color: #fff; background: #2a3d8f center / cover no-repeat; }
.bloque-spec::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,20,90,.55) 0%, rgba(20,20,90,.05) 70%); }
.bloque-spec .container { position: relative; }
.bloque-spec h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 400; line-height: 1.05; max-width: 14ch; margin-bottom: 1.6rem; }

/* Meridiano 105° */
.meridiano-imagen { background: #fff; padding: 1.2rem; box-shadow: var(--sombra); }
.meridiano-imagen img { width: 100%; display: block; }

/* Repositorio con la hoja de maple */
.bloque-repositorio { min-height: 600px; display: flex; align-items: center; background: var(--lila) right center / cover no-repeat; color: #fff; }
.bloque-repositorio::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(120,40,110,.25), rgba(0,0,0,0) 60%); }
.bloque-repositorio .container { position: relative; }
.bloque-repositorio h2 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 500; }
.bloque-repositorio .contenido { max-width: 34rem; font-size: 1.1rem; text-shadow: 0 1px 8px rgba(80,0,50,.25); }
.cifras { display: flex; flex-wrap: wrap; gap: 2.5rem; margin: 1.8rem 0 2rem; }
.cifras div { line-height: 1.1; }
.cifras strong { display: block; font-size: 2.6rem; font-weight: 500; }
.cifras span { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; opacity: .9; }

/* ---------- carteles de eventos ---------- */
.tarjeta-evento { border: 0; border-radius: 0; height: 100%; background: transparent; color: inherit; position: relative; transition: transform .3s ease; }
.tarjeta-evento:hover { transform: translateY(-6px); }
.tarjeta-evento .imagen-marco { position: relative; overflow: hidden; aspect-ratio: 3 / 4; background: #2d0a1a; box-shadow: 0 10px 26px rgba(0,0,0,.22); }
/* el cartel se ve completo; detrás, una versión difuminada rellena el espacio sobrante */
.tarjeta-evento .imagen-marco::before { content: ""; position: absolute; inset: -20px; background: var(--img) center / cover no-repeat; filter: blur(16px) brightness(.75) saturate(1.2); }
.tarjeta-evento .imagen-marco img { position: relative; width: 100%; height: 100%; object-fit: contain; transition: transform .6s ease; }
.tarjeta-evento:hover .imagen-marco img { transform: scale(1.06); }
.tarjeta-evento .sin-cartel { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 1.4rem;
  color: #fff; background: linear-gradient(160deg, rgba(6,44,116,.88), rgba(215,7,29,.82)), url("../uploads/2022/04/actividades.jpg") 70% center / cover; }
.tarjeta-evento .sin-cartel .tipo { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; }
.tarjeta-evento .sin-cartel .nombre { font-size: 1.3rem; line-height: 1.2; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.tarjeta-evento .sin-cartel .bi { font-size: 2rem; opacity: .8; }
.tarjeta-evento .velo { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 1rem; z-index: 2;
  background: linear-gradient(0deg, rgba(215,7,29,.92) 0%, rgba(215,7,29,.45) 50%, rgba(215,7,29,0) 100%);
  color: #fff; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; opacity: 0; transition: opacity .35s ease; }
.tarjeta-evento .velo span { display: inline-block; transform: translateY(12px); transition: transform .35s ease; }
.tarjeta-evento:hover .velo { opacity: 1; }
.tarjeta-evento:hover .velo span { transform: none; }
.tarjeta-evento .card-body { padding: 1rem 0 .5rem; }
.tarjeta-evento .categoria { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--rojo); font-weight: 500; }
.tarjeta-evento .card-title { font-size: 1.02rem; line-height: 1.3; margin: .35rem 0 .5rem; font-weight: 500; }
.tarjeta-evento .card-title a { color: inherit; text-decoration: none; transition: color .2s; }
.tarjeta-evento .card-title a::after { content: ""; position: absolute; inset: 0; z-index: 3; }
.tarjeta-evento:hover .card-title a { color: var(--rojo); }
.tarjeta-evento .fecha { font-size: .82rem; color: var(--gris); }
.tarjeta-evento .flecha { display: inline-block; font-size: 1.2rem; margin-top: .3rem; transition: transform .25s; }
.tarjeta-evento:hover .flecha { transform: translate(4px, -4px); }
.bloque-rojo .tarjeta-evento .categoria, .bloque-azul .tarjeta-evento .categoria,
.bloque-rojo .tarjeta-evento .fecha, .bloque-azul .tarjeta-evento .fecha { color: rgba(255,255,255,.8); }
.bloque-rojo .tarjeta-evento:hover .card-title a, .bloque-azul .tarjeta-evento:hover .card-title a { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

/* fila deslizable de carteles */
.carril { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 1.6rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .5rem .2rem 1.2rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.6) transparent; scroll-behavior: smooth; }
.carril > * { scroll-snap-align: start; }
@media (min-width: 992px) { .carril { grid-auto-columns: calc((100% - 4.8rem) / 4); } }
.carril-flechas .btn { padding: .45rem .8rem; }

/* ---------- personas ---------- */
.autora { display: grid; grid-template-columns: 1fr; margin-bottom: 4.5rem; }
@media (min-width: 992px) {
  .autora { grid-template-columns: 1.55fr 1fr; }
  .autora.invertida { grid-template-columns: 1fr 1.55fr; }
  .autora.invertida .autora-foto { order: 2; }
}
.autora-foto { min-height: 440px; background: #222 center 25% / cover no-repeat; filter: grayscale(.2); transition: filter .6s; }
.autora:hover .autora-foto { filter: none; }
.autora-panel { background: var(--azul); color: #fff; padding: 2.5rem; display: flex; flex-direction: column; justify-content: center; }
.autora-panel h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.autora-panel .nacimiento { opacity: .85; margin-bottom: 1.6rem; }
.autora-bio { grid-column: 1 / -1; padding: 2rem 0 0; font-size: 1.05rem; line-height: 1.75; columns: 2 320px; column-gap: 3rem; }

.integrante { height: 100%; }
.integrante .foto { aspect-ratio: 4 / 3; background: #333 center 25% / cover no-repeat; box-shadow: var(--sombra); margin-bottom: 1.3rem; transition: transform .5s ease; }
.integrante:hover .foto { transform: scale(1.02); }
.integrante h3 { font-size: 1.35rem; }
.integrante .bio { font-size: .96rem; line-height: 1.65; }
.integrante .bio.recortada { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.btn-ver-mas { background: none; border: 0; padding: 0; color: #fff; text-decoration: underline; text-underline-offset: 4px; font-size: .9rem; }

.institucion { display: block; text-decoration: none; color: #fff; height: 100%; }
.institucion .foto { aspect-ratio: 1; background: #fff; overflow: hidden; box-shadow: var(--sombra); }
.institucion .foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.institucion:hover .foto img { transform: scale(1.07); }
.institucion .nombre { display: block; margin-top: .9rem; font-size: 1rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255,255,255,.4); transition: text-decoration-color .2s; }
.institucion:hover .nombre { text-decoration-color: #fff; }

/* ---------- contenido de texto ---------- */
.contenido { font-size: 1.05rem; line-height: 1.75; }
.contenido img { max-width: 100%; height: auto; }
.contenido p { margin-bottom: 1rem; }
.contenido a { word-break: break-word; }
.ficha { border-left: 4px solid var(--rojo); background: var(--fondo-suave); padding: 1.25rem 1.5rem; }
.ficha dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gris); font-weight: 500; }
.ficha dd { margin-bottom: .9rem; }
.cartel-evento { width: 100%; box-shadow: var(--sombra); transition: transform .5s ease, box-shadow .3s; }
.cartel-evento:hover { transform: scale(1.02); box-shadow: 0 18px 44px rgba(0,0,0,.3); }
.etiqueta { display: inline-block; font-size: .8rem; background: var(--fondo-suave); color: var(--azul); padding: .25rem .7rem; margin: 0 .25rem .4rem 0; text-decoration: none; border-radius: 1rem; transition: background .2s, color .2s; }
.etiqueta:hover { background: var(--azul); color: #fff; }
.columnas-lista ul { columns: 2; }

/* ---------- filtros y listados ---------- */
.filtros { background: var(--fondo-suave); padding: 1.25rem; }
.filtros .form-control, .filtros .form-select { border-radius: 0; }
.lista-tesis .list-group-item { border-left: 0; border-right: 0; padding: 1.15rem 0; background: transparent; transition: padding-left .25s, background .25s; }
.lista-tesis .list-group-item:hover { padding-left: .8rem; background: var(--fondo-suave); }
.lista-tesis h3 { font-size: 1.05rem; margin: .25rem 0 .35rem; }
.lista-tesis h3 a { text-decoration: none; }
.lista-tesis .meta { font-size: .88rem; color: var(--gris); }
.badge-grado { background: var(--azul); font-weight: 500; }
.nav-pestanas .nav-link { border-radius: 0; color: var(--azul); font-weight: 500; }
.nav-pestanas .nav-link.active { background: var(--rojo); color: #fff; }
.pagination .page-link { color: var(--azul); border-radius: 0 !important; }
.pagination .active > .page-link { background: var(--rojo); border-color: var(--rojo); color: #fff; }

/* ---------- formulario de contacto ---------- */
.form-contacto .form-control { border-radius: 0; padding: .75rem 1rem; }
.form-contacto.en-rojo .form-control { background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.7); color: #fff; padding-left: 0; padding-right: 0; }
.form-contacto.en-rojo .form-control::placeholder { color: rgba(255,255,255,.75); }
.form-contacto.en-rojo .form-control:focus { box-shadow: none; border-bottom-color: #fff; border-bottom-width: 2px; }
.campo-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- pie ---------- */
.pie { background: var(--azul); color: rgba(255,255,255,.85); }
.pie-banner { display: block; width: 100%; max-width: 220px; box-shadow: var(--sombra); }
.pie h2 { color: #ff6b7a; font-size: 1.05rem; font-weight: 500; margin-bottom: 1rem; }
.pie a { color: #fff; text-decoration: none; }
.pie a:hover { text-decoration: underline; text-underline-offset: 4px; }
.pie-ligas li { margin-bottom: .45rem; }
.pie-escudos img { height: 64px; width: auto; }
.pie-legal { background: #041f52; color: rgba(255,255,255,.6); }

/* clases que deja el editor del panel */
.contenido .ql-align-center { text-align: center; }
.contenido .ql-align-right { text-align: right; }
.contenido .ql-align-justify { text-align: justify; }
.contenido iframe.ql-video { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; margin: 1rem 0; }
.contenido .ql-indent-1 { padding-left: 3em; }
.contenido .ql-indent-2 { padding-left: 6em; }

/* =================== Animaciones =================== */
.encabezado, .encabezado .navbar, .encabezado .navbar-brand img { transition: all .3s ease; }
.encabezado.compacto { box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.encabezado.compacto .navbar { padding-top: .2rem; padding-bottom: .2rem; }
.encabezado.compacto .navbar-brand img { height: 38px; }
.btn { transition: transform .2s ease, background-color .2s, color .2s, border-color .2s; }
.btn:hover { transform: scale(.96); }
.pie-red i, .bi-facebook, .bi-youtube { display: inline-block; transition: transform .2s ease; }
a:hover > .bi-facebook, a:hover > .bi-youtube, .pie-red:hover i { transform: scale(1.25); }

.portada .carousel-item img, .cabecera-pagina .carousel-item img { transform: scale(1); transition: transform 9s ease-out; }
.portada .carousel-item.active img, .cabecera-pagina .carousel-item.active img { transform: scale(1.08); }
.carousel-fade .carousel-item { transition-duration: 1.2s; }
.portada-titulo, .portada-sub { animation: entrarDerecha 1.2s ease both; }
.portada-sub { animation-delay: .35s; }
.buscador-portada { animation: entrarArriba 1s ease both; }
.cabecera-pagina h1, .cabecera-simple h1 { animation: entrarArriba 1s ease both; }

.logos-instituciones img { transition: transform .3s ease; }
.logos-instituciones img:hover { transform: translateY(-6px) scale(1.04); }
.foto-marco::before { transition: inset .5s ease; }
.foto-marco:hover::before { inset: 12px -12px -12px 12px; }
.bloque-spec, .bloque-repositorio { background-attachment: fixed; }
@media (hover: none), (max-width: 991.98px) { .bloque-spec, .bloque-repositorio { background-attachment: scroll; } }
.meridiano-imagen { transition: transform .5s ease; }
.meridiano-imagen:hover { transform: rotate(-1deg) scale(1.02); }

.revelar { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.revelar.visible { opacity: 1; transform: none; }
@keyframes entrarDerecha { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes entrarArriba { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: none; } }

@media (max-width: 767.98px) {
  .bloque { padding: 3.5rem 0; }
  .portada .carousel-item img { height: 70vh; }
  .portada-titulo, .portada-sub { margin-left: 0; }
  .autora-foto { min-height: 320px; }
  .autora-panel { padding: 1.8rem; }
  .bloque-spec { min-height: 420px; }
  .bloque-repositorio { min-height: 480px; background-position: 70% center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .revelar { opacity: 1; transform: none; }
  .bloque-spec, .bloque-repositorio { background-attachment: scroll; }
}

/* menú en pantallas medianas: todo en una línea */
.encabezado .nav-link { white-space: nowrap; }
@media (min-width: 992px) and (max-width: 1199.98px) {
  .encabezado .navbar-brand img { height: 38px; }
  .encabezado .nav-link { font-size: .74rem; padding: .5rem .45rem !important; }
  .encabezado .nav-link::after { left: .45rem; right: .45rem; }
}

/* ---------- encabezado con imagen (páginas internas) ---------- */
.cabecera-imagen { position: relative; overflow: hidden; color: #fff; min-height: 380px; display: flex; align-items: flex-end; padding: 6rem 0 3rem; background: #3a0a2c; }
.cabecera-imagen::before { content: ""; position: absolute; inset: 0; background: var(--img) center / cover no-repeat; transform: scale(1.05); animation: acercar 14s ease-out both; }
.cabecera-imagen.difuminada::before { inset: -40px; filter: blur(22px) saturate(1.3); }
.cabecera-imagen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, rgba(215,7,29,.92) 0%, rgba(160,15,70,.75) 45%, rgba(80,30,120,.45) 100%); }
.cabecera-imagen .container { position: relative; z-index: 1; }
.cabecera-imagen h1 { font-size: clamp(1.7rem, 3.6vw, 3rem); max-width: 28ch; margin: 0; text-shadow: 0 4px 24px rgba(40,0,20,.35); animation: entrarArriba 1s ease both; }
.cabecera-imagen .breadcrumb a, .cabecera-imagen .breadcrumb-item.active, .cabecera-imagen .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.85); }
.cabecera-imagen .datos { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; margin-top: 1.2rem; font-size: .95rem; opacity: .95; }
@keyframes acercar { from { transform: scale(1.18); } to { transform: scale(1.05); } }

/* ---------- piezas de las páginas internas ---------- */
.destacado { display: grid; grid-template-columns: 1fr; background: var(--azul); color: #fff; height: 100%; box-shadow: var(--sombra); overflow: hidden; }
@media (min-width: 768px) { .destacado { grid-template-columns: 2fr 3fr; } }
.destacado .cartel { min-height: 280px; position: relative; overflow: hidden; background: #2d0a1a; }
.destacado .cartel::before { content: ""; position: absolute; inset: -20px; background: var(--img) center / cover; filter: blur(14px) brightness(.7); }
.destacado .cartel img { position: relative; width: 100%; height: 100%; object-fit: contain; transition: transform .6s; }
.destacado:hover .cartel img { transform: scale(1.05); }
.destacado .texto { padding: 2rem; display: flex; flex-direction: column; }
.destacado h3 { font-size: 1.3rem; }

.panel-filtros { background: #fff; color: var(--texto); padding: 1.5rem; box-shadow: var(--sombra); margin-top: -4.5rem; position: relative; z-index: 2; }
.panel-filtros .form-control, .panel-filtros .form-select { border-radius: 0; border-color: #d9d6e0; }
.panel-filtros .form-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gris); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-block; padding: .35rem .9rem; border: 1px solid rgba(255,255,255,.6); color: #fff; text-decoration: none; font-size: .82rem; border-radius: 2rem; transition: background .2s, color .2s; }
.chip:hover, .chip.activo { background: #fff; color: var(--rojo); }
.bloque:not(.bloque-rojo):not(.bloque-azul) .chip { border-color: var(--rojo); color: var(--rojo); }
.bloque:not(.bloque-rojo):not(.bloque-azul) .chip:hover, .bloque:not(.bloque-rojo):not(.bloque-azul) .chip.activo { background: var(--rojo); color: #fff; }

.tarjeta-tesis { background: #fff; padding: 1.4rem 1.5rem; height: 100%; border-top: 4px solid var(--rojo); box-shadow: 0 6px 20px rgba(20,10,40,.08); position: relative; transition: transform .3s, box-shadow .3s; display: flex; flex-direction: column; }
.tarjeta-tesis:hover { transform: translateY(-5px); box-shadow: var(--sombra); }
.tarjeta-tesis .meta-superior { display: flex; justify-content: space-between; gap: .5rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gris); }
.tarjeta-tesis h3 { font-size: 1.05rem; line-height: 1.35; margin: .7rem 0; flex-grow: 1; }
.tarjeta-tesis h3 a { color: var(--texto); text-decoration: none; }
.tarjeta-tesis h3 a::after { content: ""; position: absolute; inset: 0; }
.tarjeta-tesis:hover h3 a { color: var(--rojo); }
.tarjeta-tesis .autor { font-size: .88rem; color: var(--gris); }
.tarjeta-tesis .tipo-traduccion { border-top-color: var(--azul); }

.ficha-tesis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px; background: #e6e3ec; border: 1px solid #e6e3ec; }
.ficha-tesis div { background: #fff; padding: 1.1rem 1.3rem; }
.ficha-tesis dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--rojo); font-weight: 500; margin-bottom: .3rem; }
.ficha-tesis dd { margin: 0; }
.ficha-tesis .ancho { grid-column: 1 / -1; }

.datos-evento { background: var(--fondo-suave); padding: 1.5rem; border-left: 4px solid var(--rojo); }
.datos-evento dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gris); }
.datos-evento dd { margin-bottom: 1rem; }
.cartel-pegajoso { position: sticky; top: 90px; }
.contenido-evento p strong:first-child { color: var(--rojo); font-weight: 500; }
.contenido-evento .ratio, .contenido-evento iframe { box-shadow: var(--sombra); }

.tarjeta-contacto { background: #fff; color: var(--texto); padding: 2.5rem; box-shadow: var(--sombra); height: 100%; }
.dato-contacto { display: flex; gap: 1rem; margin-bottom: 1.6rem; }
.dato-contacto .bi { font-size: 1.4rem; width: 3rem; height: 3rem; flex: 0 0 3rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.15); }
.mapa { border: 0; width: 100%; min-height: 320px; filter: grayscale(.3); }

.volumen { display: block; background: #fff; padding: .8rem; box-shadow: var(--sombra); transition: transform .4s; }
.volumen:hover { transform: translateY(-6px) rotate(-1deg); }
.volumen img { width: 100%; }
.banda-textil { height: 90px; background: url("../uploads/2022/04/home-meridiano-scaled.jpg") center / auto 100% repeat-x #fff; }
.cabecera-imagen:has(+ .bloque .panel-filtros) { padding-bottom: 7rem; }
