body {
  font-family: 'Lato', sans-serif;
  font-size: 18px;
}

.page h1 {
  color: var(--h1-color);
}
.page h2 {
  color: var(--h2-color);
  font-size: 140%;
}
a {
  color: var(--link-text-color);
}

.note {
  border-left: 4px solid var(--note-color);
  color: var(--note-text-color);
}

.num_block {
  border-left: 4px solid #16a085;
}
.num_block[prefix="Teorema"] {
  border-left: 4px solid #2ecc71;
}
.num_block[prefix="Lema"] {
  border-left: 4px solid #f39c12;
}

.image_expand {
  -webkit-box-shadow: 5px 5px 10px 0px rgba(0,0,0,0.5);
  -moz-box-shadow: 5px 5px 10px 0px rgba(0,0,0,0.5);
  box-shadow: 5px 5px 10px 0px rgba(0,0,0,0.5);
}

.interactive {
  text-align: center;
  border: 1px solid var(--interactive-border-color);
  border-radius: 2px;
  background: var(--interactive-color);
}
.image_link {
  border: 2px solid var(--image-border-color);
}

li {
  padding: 0 0 0.4em 0;
}

code, code_math {
  display: inline;
}
code, pre, code_math {
  font-family: 'UbuntuMono', monospace;
  font-size: 107%;
  color: #27ae60;
}
xmp {
  font-family: 'UbuntuMono', monospace;
  font-size: 107%;
  color: #e67e22;
  border: 1px solid #e67e22;
}

.katex {
  font-size: 110% !important;
}

.cover_title {
  position: absolute;
  top: 595px;
  left: 57px;
  right: 0px;
  color: #0089cd;
  font-size: 350%;
  text-align: center;
  text-shadow: 1px 2px rgba(0,0,0,0.15);
}
.cover_subtitle {
  position: absolute;
  left: 57px;
  right: 0px;
  bottom: 45px;
  text-align: center;
  color: #0089cd;
  font-size: 220%;
  text-shadow: 1px 2px rgba(0,0,0,0.15);
}

.chap_text {
  position: absolute;
  right: var(--page-right-margin);
  top: 200px;
  color: #0089cd;
  font-size: 500%;
  text-shadow: 1px 2px rgba(0,0,0,0.15);
}
.chap_name {
  position: relative;
  display: table-cell;
  vertical-align: middle;
  text-align: center;
  left: 58px;
  width: 582px;
  top: 395px;
  height: 170px;
  color: #0089cd;
  font-size: 250%;
  text-shadow: 1px 2px rgba(0,0,0,0.15);
}

table {
  border-collapse: collapse;
  border: 1px solid var(--text-color);
}
table td {
  border: 1px solid var(--text-color);
}

body.dark .invertcolor {
  filter: invert(1) hue-rotate(180deg);
}

.boxblue {
  margin-left: auto;
  margin-right: auto;
  border: 1px solid #000099;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
  background-color: var(--popup-bib-info-background);
  text-shadow: 1px 1px rgba(0, 0, 0, 0.15);
  padding: 20px;
  border-radius: 12px;
  width: 90%;
}
.boxblack {
  margin-left: auto;
  margin-right: auto;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
  background-color: rgba(0, 0, 0, 0.2);
  text-shadow: 1px 1px rgba(0, 0, 0, 0.15);
  padding: 8px;
  padding-left: 15px;
  padding-right: 15px;
  border-radius: 12px;
  width: 90%;
}
.boxclear {
  margin-left: auto;
  margin-right: auto;
  border: 1px solid #000099;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
  background-color: rgba(39, 102, 7, 0.2);
  text-shadow: 1px 1px rgba(0, 0, 0, 0.15);
  padding: 20px;
  border-radius: 12px;  
  width: 101%;
  height: 103%;
}
/* tooltip personalizado para zhema   color: var(--h1-color); /* Color normal 222 
 "Lato" sans-serif*/

.tooltip {
  position: relative;
  display: inline; /* Cambiado de inline-block a inline para evitar el salto */
  cursor: pointer; /* Cursor normal pero clickeable */
  transition: color 0.3s ease; /* Transición suave del color */
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
  overflow: hidden;
  color: var(--h2-color); /*color de la palaba */
  text-shadow: 1px 1px rgba(0, 0, 0, 0.15);
}

.tooltip hr {
  border: 0;
  height: 1px;
  background-color: #ccc;
  margin: 10px 0;
}

/* Cambio de color al pasar el cursor */
.tooltip:hover {
  color: var(--h1-color); /* Color azul estilo Wikipedia */
}

/* Estilos base comunes TEXTO*/
.tooltip_top_left,
.tooltip_top_right,
.tooltip_bottom_left,
.tooltip_bottom_right {
  position: absolute;
  visibility: hidden;
  width: 280px;
  background-color: #abc1b2;
  padding: 12px;
  border: 1px solid #a2a9b1;
  border-radius: 5px;
  box-shadow: 1 1px 3px rgba(0, 0, 0, 0.2);
  font-size: 0.7em; /*tamaño de la letra*/
  z-index: 1000;
}

/* Variantes de posición vertical margin seapra la linea*/
.tooltip_top_left,
.tooltip_top_right {
  bottom: 100%;
  margin-bottom: 10px;
}

.tooltip_bottom_left,
.tooltip_bottom_right {
  top: 100%;
  margin-top: 10px;
}

/* Posición horizontal */
.tooltip_top_left,
.tooltip_bottom_left {
  right: 0;
}

.tooltip_top_right,
.tooltip_bottom_right {
  left: 0;
}

/* Flechas base */
.tooltip_top_left::before,
.tooltip_top_right::before,
.tooltip_bottom_left::before,
.tooltip_bottom_right::before {
  content: "";
  position: absolute;
  border: 6px solid transparent;
}

/* Flechas para tooltips superiores */
.tooltip_top_left::before,
.tooltip_top_right::before {
  bottom: -12px;
  border-top-color: #a2a9b1;
}

/* Flechas para tooltips inferiores */
.tooltip_bottom_left::before,
.tooltip_bottom_right::before {
  top: -12px;
  border-bottom-color: #a2a9b1;
}

/* Posición horizontal de las flechas */
.tooltip_top_left::before,
.tooltip_bottom_left::before {
  right: 15px;
}

.tooltip_top_right::before,
.tooltip_bottom_right::before {
  left: 15px;
}

/* Mostrar el tooltip */
.tooltip:hover .tooltip_top,
.tooltip:hover .tooltip_top_left,
.tooltip:hover .tooltip_top_right,
.tooltip:hover .tooltip_bottom_left,
.tooltip:hover .tooltip_bottom_right {
  visibility: visible;
}
/* Estilos base con soporte para imagen */
.tooltip_top_left,
.tooltip_top_right,
.tooltip_bottom_left,
.tooltip_bottom_right {
  position: absolute;
  visibility: hidden;
  width: 280px;
  background-color: #fbfefc;
  border: 2px solid #009933;
  padding: 8px 12px;

  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  font-size: 90%px;
  line-height: 1.4;  
  text-shadow: 1px 1px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
  word-wrap: break-word;
  color: black; /*color del texto */
}

/* Contenedor para la imagen */

/* Estilos para el contenido con imagen */
.tooltip-content {
  overflow: hidden; /* Limpia el float */
}

/* Clearfix para el contenedor */
.tooltip-content::after {
  content: "";
  display: table;
  clear: both;
}

/* FUNCIONA CORRECTAMENTE Tooltip específico para imágenes */
.tooltip_image {
  position: absolute;
  visibility: hidden;
  background-color: #fbfefc;
  border: 2px solid #009933;
  padding: 8px; /* Aumentado un poco el padding para dar espacio */

  border-radius: 3px;
  z-index: 1000;
  font-size: 14px;
  flex-shrink: 0;
  color: black; /*color del texto */

}

/* Estilos de la imagen   */

.tooltip_image img {
  width: 280px;
  object-fit: fill; /* o contain, fill, etc. */
  display: block;
  margin: auto; /* Centra la imagen */
  border-radius: 2px;

}

/* Posicionamiento vertical */
.tooltip_image.top_left,
.tooltip_image.top_right {
  bottom: 100%;
  margin-bottom: 5px;
}

.tooltip_image.bottom_left,
.tooltip_image.bottom_right {
  top: 100%;
  margin-top: 5px;
}

/* Posicionamiento horizontal */
.tooltip_image.top_left,
.tooltip_image.bottom_left {
  right: 0;
}

.tooltip_image.top_right,
.tooltip_image.bottom_right {
  left: 0;
}

/* Flechas */
.tooltip_image::before {
  content: "";
  position: absolute;
  border: 6px solid transparent;
}

/* Posiciones de flechas */
.tooltip_image.top_left::before,
.tooltip_image.top_right::before {
  bottom: -12px;
  border-top-color: #a2a9b1;
}

.tooltip_image.bottom_left::before,
.tooltip_image.bottom_right::before {
  top: -12px;
  border-bottom-color: #a2a9b1;
}

.tooltip_image.top_left::before,
.tooltip_image.bottom_left::before {
  right: 15px;
}

.tooltip_image.top_right::before,
.tooltip_image.bottom_right::before {
  left: 15px;
}

/* Mostrar tooltip */
.tooltip:hover .tooltip_image {
  visibility: visible;
}
