@import url("https://fonts.googleapis.com/css2?family=Anton&display=swap");

:root {
  --curso-azul: #2C5697;
}


h1,
h2,
h3,
h4,
h5,
h6,
.title,
.subtitle {
  font-family: "Anton", sans-serif;
  color: #000 !important;
}

.title span,
.subtitle span {
  color: #000 !important;
}


/* Ritmo vertical global */
body {line-height: 1.65; }

p {margin-bottom: 0.8rem; }

ul,
ol {
  margin-top: 0.5rem;
  margin-bottom: 0.8rem;
}

li {
  margin-bottom: 0.45rem;
}

/* Separación entre secciones de todos los niveles */
.section {
  margin-bottom: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.25;
  margin-bottom: 0.3rem;
}

h1 { margin-top: 0.5rem; }
h2 { margin-top: 0.7rem; }
h3 { margin-top: 0.6rem; }
h4,
h5,
h6 { margin-top: 0.7rem; }

/* Evita el espacio de anclaje calculado con la altura de la barra */
.section h1,
.section h2,
.section h3,
.section h4,
.section h5,
.section h6 {
  padding-top: 0 !important;
  scroll-margin-top: 70px;
  clear: both;
}

.section h1 { margin-top: 0.5rem !important; }
.section h2 { margin-top: 0.7rem !important; }
.section h3 { margin-top: 0.6rem !important; }
.section h4,
.section h5,
.section h6 { margin-top: 0.7rem !important; }

/* Mantiene la navegación en una fila y evita una altura exagerada */
.navbar .container,
.navbar .container-fluid {
  width: 100%;
  max-width: none;
}

.navbar-nav > li > a {
  padding-left: 10px;
  padding-right: 10px;
}

/* Evita espacio excesivo al comienzo del documento */
.main-container > .section:first-child > :first-child,
.section > h1:first-child,
.section > h2:first-child,
.section > h3:first-child {
  margin-top: 0;
}

/* Las imágenes conservan su proporción y no desbordan el contenido */
.main-container img {
  display: block;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center;
  clip-path: none !important;
}

.main-container .figure,
.main-container p:has(> img) {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Identidad visual de cada módulo */
.main-container:has(.title span[style*="#F6A623"]) { --module-color: #F6A623; }
.main-container:has(.title span[style*="#E85A67"]) { --module-color: #E85A67; }
.main-container:has(.title span[style*="#3498C9"]) { --module-color: #3498C9; }
.main-container:has(.title span[style*="#476885"]) { --module-color: #476885; }
.main-container:has(.title span[style*="#67C1A8"]) { --module-color: #67C1A8; }

/* Banner principal de cada página con esquinas redondeadas */
.main-container #header + p > img,
.main-container img[src^="img/modulo"]:not([src*="modulos."]) {
  border-radius: 18px;
}

/* Títulos de nivel 1, alineados con la identidad visual de curso018 */
.main-container .section > h1 {
  padding-bottom: 0.55rem;
  color: var(--curso-azul) !important;
  border-bottom: 4px solid var(--curso-azul);
}

/* Botones de descarga con contraste alto y estados de interacción visibles */
.download-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.2rem;
  border: 2px solid var(--curso-azul);
  border-radius: 7px;
  color: #fff;
  background-color: var(--curso-azul);
  box-shadow: 0 2px 5px rgba(36, 50, 71, 0.18);
  font: inherit;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease, transform 0.18s ease;
}

.download-button:hover {
  border-color: #1D3B69;
  color: #fff;
  background-color: #1D3B69;
  box-shadow: 0 4px 9px rgba(36, 50, 71, 0.25);
  transform: translateY(-1px);
}

.download-button:focus,
.download-button:focus-visible {
  outline: 3px solid #F6A623;
  outline-offset: 3px;
}

.download-button:active {
  background-color: #163052;
  transform: translateY(0);
}

.download-button:disabled {
  border-color: #9CA8B7;
  color: #F7F7F7;
  background-color: #6B7787;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Tablas, gráficos y bloques de código */
table,
.figure,
pre,
blockquote {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* Caja para notas y fórmulas importantes */
.note-box {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem 1rem;
  border: 3px solid var(--module-color, #E85A67);
  border-radius: 6px;
  background: #fff;
}

.note-box-title {
  margin-bottom: 0.65rem;
  font-family: "Anton", sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--module-color, #E85A67);
}

.note-box > :last-child {
  margin-bottom: 0;
}

/* Índice lateral flotante */
.tocify-item {
  line-height: 1.4;
}

.tocify-item a {
  display: block;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.tocify-subheader .tocify-item a {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}


@media (max-width: 767px) {
  .section { margin-bottom: 0; }
  h1 { margin-top: 0.5rem; }
  h2 { margin-top: 0.6rem; }
}


/* Tablas y banners alineados con el curso018 */
:root {
  --curso-fondo: #F7F7F7;
  --curso-borde: #DDE3EA;
}

/* Banners de apertura */
.main-container img[src^="img/estadistica."],
.main-container img[src^="img/modulo"],
.main-container img[src^="img/guia"],
.main-container img[src^="img/codigo"],
.main-container img[src^="img/recurso"],
.main-container img[src^="img/monitoria"],
.main-container img[src^="img/proyecto."] {
  display: block;
  max-width: 100% !important;
  height: auto !important;
  margin-right: auto !important;
  margin-left: auto !important;
  border-radius: 12px !important;
  clip-path: inset(0 round 12px) !important;
}

/* Tablas */
.main-container table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--curso-borde);
  border-radius: 8px;
  overflow: hidden;
}
.main-container thead {
  color: #fff;
  background: var(--module-color, #2C5697);
}
.main-container th { font-weight: 700; }
.main-container th,
.main-container td {
  padding: .75rem .9rem !important;
  vertical-align: top !important;
}
.main-container tbody tr:nth-child(even) {
  background: var(--curso-fondo);
}

@media (max-width: 767px) {
  .main-container table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }
}


/* Imágenes de contenido con esquinas redondeadas, como en curso018 */
.main-container .figure img,
.main-container .figure-img,
.main-container p > img:only-child {
  border-radius: 8px !important;
  clip-path: inset(0 round 8px);
}


/* Fila horizontal de logotipos de paquetes. */
.main-container .package-logo-row {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  width: 100%;
  margin: 1.4rem 0 2rem;
  overflow-x: auto;
}

.main-container .package-logo-row img {
  display: inline-block;
  flex: 0 0 auto;
  width: auto !important;
  height: 82px !important;
  margin: 0 !important;
  object-fit: contain !important;
}
