/* Estilos exclusivos de Documentos.html */
.documentos-page {
  background: #f6f8fc;
}

.documentos-layout {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.documentos-intro {
  background: #fff;
  border: 1px solid #d9e6f6;
  border-left: 6px solid #3366cc;
  border-radius: 8px;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.5rem;
}

.documentos-eyebrow {
  margin: 0 0 .35rem;
  color: #004884;
  font-family: "Nunito Sans", Verdana, Arial, sans-serif;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.documentos-intro h1 {
  margin: 0 0 .35rem;
  color: #1b1b1b;
  font-family: "Nunito Sans", Verdana, Arial, sans-serif;
  font-size: 2rem;
  font-weight: 800;
}

.documentos-intro p:last-child {
  max-width: 840px;
  margin: 0;
  color: #4b4b4b;
  line-height: 1.55;
}

.documentos-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.documentos-nav {
  position: sticky;
  top: 1rem;
  background: #fff;
  border: 1px solid #d9e6f6;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 72, 132, .08);
}

.documentos-nav h2 {
  margin: 0 0 .8rem;
  color: #004884;
  font-family: "Nunito Sans", Verdana, Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
}

.documentos-nav nav {
  display: grid;
  gap: .45rem;
}

.documentos-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .65rem .8rem;
  color: #004884;
  background: #f4f7fb;
  border: 1px solid transparent;
  border-left: 4px solid transparent;
  border-radius: 4px;
  text-decoration: none;
  font-family: "Nunito Sans", Verdana, Arial, sans-serif;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.2;
}

.documentos-nav a:hover,
.documentos-nav a:focus,
.documentos-nav a.is-active {
  color: #00326e;
  background: #e5eefb;
  border-color: #c9d8f2;
  border-left-color: #3366cc;
  outline: none;
}

.documentos-nav a:focus-visible {
  outline: 3px solid #000;
  outline-offset: 2px;
}

.documentos-content {
  min-width: 0;
}

.documentos-content .content-section {
  display: none;
  background: #fff;
  border: 1px solid #d9e6f6;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 72, 132, .08);
}

.documentos-content .content-section.active {
  display: block;
}

.documentos-content .content-section > h2 {
  justify-content: flex-start !important;
  margin: 0 0 1.2rem;
  color: #1b1b1b;
  font-family: "Nunito Sans", Verdana, Arial, sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
}

.documentos-content .buttons-container,
.documentos-content #formatos > p,
.documentos-content #estadistica > p,
.documentos-content #reporte > div,
.documentos-content #politica-publica > p {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: stretch;
  margin: 0;
  padding: 0;
}

.documentos-content #reporte > div:first-of-type {
  display: flex;
  justify-content: flex-start !important;
}

.documentos-page .button {
  width: auto;
  min-height: 132px;
  margin: 0 !important;
  padding: 1rem !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  color: #1b1b1b !important;
  background: #fff !important;
  border: 1px solid #cbdcf2 !important;
  border-left: 5px solid #3366cc !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 5px rgba(0, 72, 132, .10);
  text-decoration: none !important;
  text-align: center;
  font-family: "Nunito Sans", Verdana, Arial, sans-serif;
  font-size: .98rem;
  font-weight: 700;
  line-height: 1.25;
  transform: none !important;
}

.documentos-page .button:hover {
  color: #004884 !important;
  background: #eef3ff !important;
  border-color: #3366cc !important;
  transform: translateY(-2px) !important;
}

.documentos-page .button:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

.documentos-page .button img {
  width: 54px !important;
  max-width: 54px !important;
  height: 54px !important;
  object-fit: contain;
  margin: 0 auto .25rem !important;
}

.responsive-iframe {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1rem 0 1.25rem;
  background: #f6f8fc;
  border: 1px solid #d9e6f6;
  border-radius: 8px;
}

.responsive-iframe iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.documentos-content h2:not(:first-child) {
  margin-top: 1.8rem;
  color: #004884;
  font-family: "Nunito Sans", Verdana, Arial, sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
}

body.usp-high-contrast .documentos-page,
body.usp-high-contrast .documentos-intro,
body.usp-high-contrast .documentos-nav,
body.usp-high-contrast .documentos-content .content-section,
body.usp-high-contrast .documentos-page .button {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

body.usp-high-contrast .documentos-nav a,
body.usp-high-contrast .documentos-nav a.is-active {
  background: #000 !important;
  color: #ffd600 !important;
  border-color: #fff !important;
}

@media (max-width: 980px) {
  .documentos-layout {
    width: min(100% - 1rem, 100%);
    padding-top: 1rem;
  }

  .documentos-shell {
    grid-template-columns: 1fr;
  }

  .documentos-nav {
    position: static;
  }

  .documentos-nav nav {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .documentos-content .content-section {
    padding: 1rem;
  }
}

/* Visores PDF con la barra de herramientas nativa del navegador.
   El contenedor toma la proporcion real de la pagina (--pdf-page-ratio)
   para que el PDF cargue ajustado al ancho (view=FitH), sin scroll
   horizontal, y con la primera hoja bien grande. */
.responsive-iframe.pdf-frame {
  aspect-ratio: var(--pdf-page-ratio, 612 / 792);
  height: auto;
  min-height: 0;
  padding-bottom: 0;
  margin: 1rem 0 1.6rem;
  overflow: hidden;
  background: #e9eef5;
  border: 1px solid #cbdcf2;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 72, 132, 0.08);
}

.responsive-iframe.pdf-frame iframe {
  height: 100%;
  border: 0;
  border-radius: 10px;
}

@media (max-width: 980px) {
  .responsive-iframe.pdf-frame {
    aspect-ratio: auto;
    height: 72vh;
    min-height: 460px;
  }
}

body.usp-high-contrast .responsive-iframe.pdf-frame {
  background: #000 !important;
  border-color: #fff !important;
}


/* Proporcion de la pagina de cada visor PDF. Antes iba como
   style="--pdf-page-ratio: ..." en cada contenedor. */
.responsive-iframe.pdf-frame.pdf-carta          { --pdf-page-ratio: 612 / 792; }
.responsive-iframe.pdf-frame.pdf-a4-vertical    { --pdf-page-ratio: 595.32 / 841.92; }
.responsive-iframe.pdf-frame.pdf-a4-horizontal  { --pdf-page-ratio: 841.92 / 595.32; }
