/*
 * Cabecera del sitio (components/Header.astro): logo, título, buscador que aparece al desplazar (lo
 * muestra scripts/sitio.ts), menú de escritorio y menú lateral de móvil. Sustituye las reglas de la
 * cabecera que había en legado-1.css (tema hijo y Betheme) y en el CSS dinámico de Betheme.
 *
 * Los íconos (lupa, menú y cerrar) son SVG en línea (components/Icono.astro) con los trazos de los
 * glyphicons de Bootstrap 3 que se usaban antes. Miden 1em y se apoyan en la línea base, como el glifo.
 *
 * La fuente se queda mientras siga `i { font-family: 'Glyphicons Halflings' !important }` en legado-1.css:
 * las demás <i> del sitio (íconos de Betheme en el pie y en el contenido) toman de ella el alto de línea.
 */
@font-face {
  font-family: "Glyphicons Halflings";
  src: url("/legado/themes/betheme-child/fonts/glyphicons-halflings-regular.woff2") format("woff2");
}

.icono {
  position: relative;
  top: 1px;
  display: inline-block;
  width: 1em;
  height: 1em;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
}

.icono-svg {
  display: block;
  overflow: visible;
  width: 100%;
  height: 100%;
  fill: currentcolor;
}

#Header_wrapper {
  position: relative;
  background-color: #000119;
  background-position: center top;
  background-repeat: no-repeat;
}

#Header {
  position: fixed;
  z-index: 3;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 25px;
  background-color: var(--color-azul);
}

#idCheck {
  display: none;
}

.cont-elements-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100vw;
}

.log-title {
  display: flex;
  align-items: center;
}

#container_log_gral {
  float: left;
  overflow: hidden;
  background-image: url("/wp-content/uploads/2019/05/h-logo-unam.png");
  background-repeat: no-repeat;
  background-size: contain;
}

#title-text {
  display: flex;
  flex-direction: column;
}

#title-ri {
  color: var(--color-blanco);
  line-height: 1.5em;
  letter-spacing: -0.03em;
}

#title-unam {
  color: var(--color-oro);
}

#header-cont-title > a,
#sidenav-hidden a,
.container-menu-header ul > li > a {
  color: var(--color-blanco);
  text-decoration: none;
}

#header-cont-title > a:hover,
#sidenav-hidden a:hover,
.container-menu-header ul > li > a:hover {
  color: var(--color-oro);
  text-decoration: none;
}

/* Buscador: oculto hasta que el visitante pasa el buscador del hero. */
.header-cont-search {
  display: none;
  align-self: center;
  width: inherit;
}

/*
 * Mismo lenguaje que el buscador del hero (estilos/portada.css): campo blanco sin borde, esquinas de
 * 8 px, texto pizarra y botón dorado aparte. Alto y ancho máximo por escalón (--buscador-alto y
 * --buscador-ancho); el campo usa 16 px en móvil para que iOS no acerque la página al enfocarlo.
 */
#container-search {
  --buscador-alto: 38px;
  --buscador-ancho: 560px;

  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#input_search_header {
  box-sizing: border-box;
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: calc(var(--buscador-ancho) - var(--buscador-alto) - 6px);
  height: var(--buscador-alto);
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 5%);
  color: #0f172a;
  font-size: 14px;
  line-height: normal;
}

#input_search_header::placeholder {
  color: #64748b;
}

#input_search_header:focus {
  outline: 2px solid var(--color-oro);
  outline-offset: 0;
}

#button_search_header {
  top: 0;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--buscador-alto);
  height: var(--buscador-alto);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background-color: var(--color-oro);
  color: #fff;
  font-size: calc(var(--buscador-alto) * 0.42);
  cursor: pointer;
  transition: background-color 0.2s;
}

#button_search_header:hover {
  background-color: #b8920a;
}

#button_search_header:focus-visible {
  outline: 2px solid var(--color-oro);
  outline-offset: 2px;
}

/* Menú de escritorio. */
.container-menu-header ul {
  display: flex;
  margin: 0;
  padding: 0;
}

/* En la 404 la cabecera va dentro de una columna del Muffin Builder, cuya regla de listas ganaba. */
.column_column .container-menu-header ul {
  margin: 0 0 15px 30px;
}

.container-menu-header ul > li {
  list-style: none;
  transition: 0.3s;
}

/* Menú de móvil: el panel (#sidenav-hidden) y el fondo que lo cierra (#container-hidden) se abren desde
   scripts/sitio.ts cambiando su ancho. */
#mobile-icons {
  display: flex;
}

/* Botones sin estilo propio: se ven como el ícono. */
#btn-hamburguer,
#close-hamburguer {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-blanco);
  cursor: pointer;
}

#close-hamburguer {
  display: none;
}

.sidenav,
#container-hidden {
  position: fixed;
  z-index: 100;
  width: 0;
  height: 100%;
  overflow-x: hidden;
  transition: 0.5s;
}

#container-hidden {
  left: 0;
}

.sidenav {
  right: 0;
  background-color: rgb(21 26 81 / 93%);
}

.sidenav a {
  display: block;
  padding: 8px 8px 8px 30px;
  border-bottom: thin solid var(--color-blanco);
  color: var(--color-blanco);
  font-size: 19px;
  transition: 0.3s;
}

.sidenav a:hover {
  color: var(--color-oro);
}

@media screen and (min-width: 1920px) {
  #Header {
    border-top: 3px solid var(--color-oro);
  }

  .cont-elements-header {
    height: 90px;
  }

  .log-title {
    padding-left: 24px;
  }

  #container_log_gral {
    width: 67px;
    height: 80px;
  }

  #header-cont-title {
    width: 530px;
    padding: 9px 0 5px 15px;
    border-left: 2px solid var(--color-oro);
  }

  #title-ri {
    font-size: 30px;
  }

  #title-unam {
    font-size: 24px;
    line-height: 19px;
  }

  .container-menu-header ul > li > a > span {
    padding-right: 40px;
    font-size: 18px;
  }

  #container-search {
    padding: 0 6vw;
  }

}

@media screen and (min-width: 1440px) and (max-width: 1919.98px) {
  #Header {
    border-top: 2.5px solid var(--color-oro);
  }

  .cont-elements-header {
    height: 85px;
  }

  .log-title {
    padding-left: 22px;
  }

  #container_log_gral {
    width: 63px;
    height: 75px;
  }

  #header-cont-title {
    width: 490px;
    padding: 9px 0 5px 10px;
    border-left: 1.7px solid var(--color-oro);
  }

  #title-ri {
    font-size: 28px;
  }

  #title-unam {
    font-size: 22px;
    line-height: 17px;
  }

  .container-menu-header ul > li > a > span {
    padding-right: 35px;
    font-size: 16px;
  }

  #container-search {
    padding: 0 5vw;
  }

}

@media screen and (min-width: 1024px) and (max-width: 1439.98px) {
  #Header {
    border-top: 2px solid var(--color-oro);
  }

  .cont-elements-header {
    height: 80px;
  }

  .log-title {
    padding-left: 20px;
  }

  #container_log_gral {
    width: 60px;
    height: 70px;
  }

  #header-cont-title {
    width: 440px;
    padding: 10px 0 5px 12px;
    border-left: 1.4px solid var(--color-oro);
  }

  #title-ri {
    font-size: 25px;
  }

  #title-unam {
    font-size: 20px;
    line-height: 15px;
  }

  .container-menu-header ul > li > a > span {
    padding-right: 30px;
    font-size: 14px;
  }

  #container-search {
    padding: 0 2vw;
  }

}

@media screen and (min-width: 768px) and (max-width: 1023.98px) {
  #Header {
    border-top: 1.7px solid var(--color-oro);
  }

  .cont-elements-header {
    height: 75px;
  }

  .log-title {
    padding-left: 18px;
  }

  #container_log_gral {
    width: 57px;
    height: 65px;
  }

  #header-cont-title {
    width: 370px;
    padding: 10px 0 8px 11px;
    border-left: 1.2px solid var(--color-oro);
  }

  #title-ri {
    font-size: 21px;
  }

  #title-unam {
    font-size: 18px;
    line-height: 13px;
  }

  .container-menu-header ul > li > a > span {
    padding-right: 25px;
    font-size: 12px;
  }

  #container-search {
    padding: 0 1vw;
  }

}

@media screen and (min-width: 380px) and (max-width: 767.98px) and (orientation: portrait) {
  #header-cont-title {
    width: 255px;
  }

  #mobile-icons {
    padding-right: 10px;
  }
}

@media screen and (min-width: 320px) and (max-width: 379.98px) and (orientation: portrait) {
  #header-cont-title {
    width: 185px;
  }

  #mobile-icons {
    padding-right: 15px;
  }
}

@media screen and (min-width: 320px) and (max-width: 767.98px) and (orientation: portrait) {
  #Header {
    border-top: 1.4px solid var(--color-oro);
  }

  .cont-elements-header {
    height: 70px;
  }

  .log-title {
    padding-left: 16px;
  }

  #container_log_gral {
    width: 55px;
    height: 60px;
  }

  #header-cont-title {
    padding: 7px 0 7px 10px;
    border-left: 1px solid var(--color-oro);
  }

  #title-ri {
    font-size: 14px;
  }

  #mobile-icons div {
    padding-right: 8px;
    font-size: 22px;
  }

  #sidenav-hidden {
    top: 71px;
  }

  .header-cont-search {
    top: 70px;
  }

}

@media screen and (min-width: 320px) and (max-width: 767.98px) and (orientation: landscape) {
  #Header {
    border-top: 1px solid var(--color-oro);
  }

  .cont-elements-header {
    height: 50px;
  }

  .log-title {
    padding-left: 8px;
  }

  #container_log_gral {
    width: 40px;
    height: 45px;
  }

  #header-cont-title {
    width: 255px;
    padding: 5px 0 5px 8px;
    border-left: 1px solid var(--color-oro);
  }

  #title-ri {
    font-size: 14px;
  }

  #mobile-icons {
    padding-right: 10px;
  }

  #mobile-icons div {
    padding-right: 10px;
    font-size: 22px;
  }

  #sidenav-hidden {
    top: 51px;
  }

  .header-cont-search {
    top: 50px;
  }

}

@media screen and (max-width: 319.98px) {
  #Header {
    border-top: 1px solid var(--color-oro);
  }

  .cont-elements-header {
    height: 70px;
  }

  .log-title {
    padding-left: 14px;
  }

  #container_log_gral {
    width: 55px;
    height: 58px;
  }

  #header-cont-title {
    width: 155px;
    padding: 5px 0 5px 2px;
    border-left: 1px solid var(--color-oro);
  }

  #title-ri {
    font-size: 12px;
  }

  #title-unam {
    font-size: 14px;
    line-height: 9px;
  }

  #mobile-icons {
    padding-right: 15px;
  }

  #hamburguer-icons {
    padding-left: 10px;
  }

  #btn-hamburguer,
  #close-hamburguer {
    font-size: 24px;
  }

  #sidenav-hidden {
    top: 71px;
  }

  .header-cont-search {
    top: 70px;
  }

}

@media screen and (max-width: 767.98px) {
  .container-menu-header {
    display: none;
  }

  .header-cont-search {
    position: absolute;
    left: 0;
    margin: 0;
  }
}

@media screen and (min-width: 768px) {
  #mobile-icons,
  #sidenav-hidden,
  #container-hidden {
    display: none;
  }
}

/* Buscador del header: alto y ancho máximo por escalón (el diseño base está arriba). */
@media screen and (min-width: 1920px) {
  #container-search {
    --buscador-alto: 44px;
    --buscador-ancho: 680px;
  }

  #input_search_header {
    padding: 0 18px;
    font-size: 16px;
  }
}

@media screen and (min-width: 1440px) and (max-width: 1919.98px) {
  #container-search {
    --buscador-alto: 40px;
    --buscador-ancho: 560px;
  }

  #input_search_header {
    font-size: 15px;
  }
}

/*
 * Por debajo de 1200 px, entre el título y el menú el campo queda angosto (72 px a 768 y 189 a 1024):
 * pasa a un renglón propio debajo del header, como en móvil, centrado y con ancho máximo.
 */
@media screen and (min-width: 768px) and (max-width: 1199.98px) {
  .header-cont-search {
    position: absolute;
    top: 100%;
    left: 0;
    margin: 0;
  }
}

@media screen and (max-width: 1199.98px) {
  #container-search {
    --buscador-alto: 40px;
    --buscador-ancho: 100%;

    box-sizing: border-box;
    width: 100vw;
    padding: 8px 12px 10px;
    background-color: var(--color-azul);
    box-shadow: 0 2px 6px rgb(0 0 0 / 25%);
  }

  #input_search_header {
    max-width: none;
    font-size: 16px;
  }
}

@media screen and (min-width: 768px) and (max-width: 1199.98px) {
  #container-search {
    padding-right: max(24px, calc((100vw - 640px) / 2));
    padding-left: max(24px, calc((100vw - 640px) / 2));
  }
}
/*
 * Pie del sitio (components/Footer.astro). Sustituye las reglas del pie que había en legado-1.css (tema
 * hijo y Betheme) y en el CSS dinámico de Betheme. Reproduce el resultado de su cascada, en la que varias
 * reglas se pisaban con !important.
 */
#Footer {
  position: relative;
  background-color: var(--color-azul);
  background-position: center top;
  background-repeat: no-repeat;
  color: var(--color-blanco);
}

#Footer a {
  color: var(--color-blanco);
}

#Footer a:hover {
  color: var(--color-oro);
}

#Footer .container {
  width: 100vw;
  max-width: 100vw;
  margin: 0;
  padding: 0;
}

#Footer .column {
  width: 100vw;
  margin: 0;
  padding: 0;
}

#Footer .footer_action {
  background-color: var(--color-azul);
}

#Footer .footer_action .one {
  font-size: 110%;
  line-height: 180%;
  text-align: center;
}

#Footer .footer_copy {
  background-color: var(--color-azul);
  text-align: center;
}

#Footer .footer_copy .one {
  min-height: 33px;
}

#Footer .footer_copy .copyright {
  margin: 0 0 10px;
  padding: 0 12%;
}

#Footer .footer_copy .social {
  margin: 0;
}

/* Franja de logos y título. */
#top-footer {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background-image: url('/wp-content/uploads/2019/06/bg-footer.jpg');
  background-position: center;
  background-size: cover;
}

#top-footer a {
  text-decoration: none;
}

#logo-unam,
#firma-institucional,
#unam475 {
  position: relative;
  top: 0;
}

#logo-unam {
  height: 90px;
}

#firma-institucional,
#unam475 {
  height: 84px;
}

/* Enlaces (Directorio, Contacto, Normatividad). */
#links-footer {
  display: flex;
  justify-content: space-evenly;
  width: 66%;
  margin: 0 auto;
  padding: 10px 0;
}

.link-f {
  padding: 0 5vw;
  font-size: 16px;
}

.link-f a {
  text-decoration: none;
}

/* Por ancho, de mayor a menor. */
@media (min-width: 1920px) {
  #top-footer {
    height: 125px;
  }

  #logos-sdi-dgru img {
    padding: 0 30px;
  }

  #title-repo {
    font-size: 19px;
    line-height: 23px;
  }

  #logo-unam {
    padding: 0 25px 0 30px;
  }

  #firma-institucional {
    top: -10px;
    height: 65px;
    padding: 0 25px 0 0;
  }

  #unam475 {
    top: -8px;
    height: 70px;
    padding: 0;
  }
}

@media (min-width: 1440px) and (max-width: 1919.98px) {
  #top-footer {
    height: 125px;
  }

  #logos-sdi-dgru img {
    padding: 0 25px;
  }

  #title-repo {
    font-size: 18px;
    line-height: 22px;
  }

  #logo-unam {
    padding: 0 20px 0 25px;
  }

  #firma-institucional {
    top: -10px;
    height: 65px;
    padding: 0 20px 0 0;
  }

  #unam475 {
    top: -8px;
    height: 70px;
    padding: 0;
  }
}

@media (min-width: 1024px) and (max-width: 1439.98px) {
  #top-footer {
    height: 115px;
  }

  #logos-sdi-dgru img {
    padding: 0 12px;
  }

  #title-repo {
    font-size: 16px;
    line-height: 20px;
  }

  #logo-unam {
    height: 74px;
    padding: 0 12px;
  }

  #firma-institucional {
    top: -13px;
    height: 46px;
    padding: 0 12px 0 0;
  }

  #unam475 {
    top: -10px;
    height: 50px;
    padding: 0;
  }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
  #top-footer {
    height: 100px;
  }

  #logos-sdi-dgru img {
    padding: 0 8px;
  }

  #title-repo {
    font-size: 14px;
    line-height: 18px;
  }

  #logo-unam {
    height: 70px;
    padding: 0 18px 0 0;
  }

  #firma-institucional {
    top: -13px;
    height: 46px;
    padding: 0 15px 0 0;
  }

  #unam475 {
    top: -10px;
    height: 50px;
    padding: 0;
  }
}

@media (min-width: 640px) and (max-width: 767.98px) {
  #top-footer {
    height: 90px;
  }

  #logos-sdi-dgru img {
    padding: 0 5px;
  }

  #title-repo {
    font-size: 13px;
    line-height: 16px;
  }
}

/* En vertical, los logos de la UNAM toman el relleno del bloque de abajo. */
@media (min-width: 640px) and (max-width: 767.98px) and (orientation: landscape) {
  #logos-unam img {
    padding: 0 5px;
  }
}

@media (max-width: 639.98px) {
  #top-footer {
    flex-direction: column;
    justify-content: space-between;
    height: 175px;
  }
}

/* Móvil en vertical (y cualquier pantalla de menos de 320 px): logos y título en bloques. */
@media (max-width: 767.98px) and (orientation: portrait), (max-width: 319.98px) {
  #logos-unam,
  #logos-sdi-dgru {
    display: block;
    width: 100%;
  }

  #title-repo {
    display: block;
    width: 100%;
    margin-bottom: 10px;
  }

  #logo-unam {
    height: 66px;
    padding: 0 10px 0 0;
  }

  #firma-institucional {
    top: -11px;
    height: 38px;
    padding: 0 10px 0 0;
  }

  #unam475 {
    top: -10px;
    height: 40px;
    padding: 0;
  }

  #logos-sdi-dgru img {
    height: 30px;
  }
}

/*
 * Tableta y móvil en horizontal (640–959 px): los tres bloques no caben en un renglón de alto fijo y
 * los logos se cortaban arriba. Los logos van en un renglón (UNAM a la izquierda, SDI y DGRU a la
 * derecha) y el título debajo; la franja crece con su contenido.
 */
@media (min-width: 640px) and (max-width: 959.98px) {
  #top-footer {
    flex-wrap: wrap;
    height: auto;
    padding: 14px 0 10px;
    row-gap: 8px;
  }

  #logos-unam,
  #logos-sdi-dgru {
    display: block;
    width: auto;
    white-space: nowrap;
  }

  #title-repo {
    order: 1;
    flex-basis: 100%;
    margin-bottom: 0;
  }
}

/* Móvil en horizontal (320–767 px): los logos de la UNAM con el tamaño de la tableta. */
@media (min-width: 320px) and (max-width: 767.98px) and (orientation: landscape) {
  #logo-unam {
    height: 70px;
  }

  #firma-institucional {
    top: -13px;
    height: 46px;
  }

  #unam475 {
    top: -10px;
    height: 50px;
  }
}

/*
 * Móvil (menos de 640 px): la franja crece con su contenido y deja aire arriba y abajo de los logos; los
 * enlaces se reparten en el ancho y bajan de renglón si no caben.
 */
@media (max-width: 639.98px) {
  #top-footer {
    gap: 10px;
    height: auto;
    padding: 18px 0;
  }

  #title-repo {
    margin-bottom: 0;
  }

  #links-footer {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 28px;
    width: auto;
    padding: 10px 16px;
  }

  .link-f {
    padding: 0;
  }
}
/*
 * Variables de diseño del sitio (docs/11, F2). El CSS propio va fuera de la capa `legado`, así que gana
 * sin `!important`.
 *
 * Cortes de ancho del tema, que siguen usando las reglas heredadas y las propias (las media queries no
 * admiten variables): 320, 640, 768, 1024, 1440 y 1920 px.
 *
 * Sin anidamiento ni @media con rangos (`width >= …`): Vite no los traduce y los navegadores anteriores a
 * 2023 ignorarían esas reglas. Los máximos van en .98 para no dejar huecos entre rangos.
 */
:root {
  --color-azul: #151a51;
  --color-oro: #d4a806;
  --color-blanco: #fff;

  /* Esquinas de las tarjetas y cajas (cintillo, índices, recursos y contenidos destacados). */
  --radio: 6px;
}
/*
 * Estructura de las páginas (layouts/Base.astro y components/mcb/): lo que antes iba en atributos style
 * del marcado. Las secciones de WorkHub traen su propio style y no usan estas clases.
 */

/* components/mcb/Seccion.astro: el Muffin Builder quitaba el relleno de arriba y de abajo. */
.mcb-section.sin-relleno-vertical {
  padding-top: 0;
  padding-bottom: 0;
}

/* Plantilla "Página simple" del tema hijo (Directorio). */
#Content.contenido-simple {
  box-sizing: border-box;
  margin: 115px 10% 50px;
}
/*
 * Botón de subir (layouts/Base.astro). Corrige el defecto 5 de docs/11: estaba fijo y casi transparente
 * encima del contenido desde que cargaba la página. Ahora aparece solo después de bajar 600 px (la clase
 * .visible la pone scripts/sitio.ts) y se distingue como control. Oculto, no recibe clics.
 */
.boton-subir {
  position: fixed;
  z-index: 9001;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--color-oro);
  border-radius: 50%;
  color: var(--color-blanco);
  background-color: var(--color-azul);
  box-shadow: 0 2px 8px rgb(0 0 0 / 30%);
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.boton-subir.visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.boton-subir:hover,
.boton-subir:focus {
  color: var(--color-azul);
  background-color: var(--color-oro);
  text-decoration: none;
}

.boton-subir:focus-visible {
  outline: 3px solid var(--color-blanco);
  outline-offset: 2px;
}

.boton-subir-flecha {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

@media (max-width: 767.98px) {
  .boton-subir {
    right: 12px;
    bottom: 12px;
    width: 40px;
    height: 40px;
  }

  .boton-subir-flecha {
    width: 20px;
    height: 20px;
  }
}
