/* PortalGraf Next 0.5.102 · Posición derecha reutilizable; flujo natural. */
body.pg-next.pg-sticky-header-enabled .pg-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}
/* Separación entre posiciones sin reservar alturas: vacío => sin margen. */
body.pg-next .pg-sidebar--right > :is(.pg-sidebar-sticky-position, .pg-sidebar-normal-position) {
  min-width: 0;
  margin: 0;
}
body.pg-next .pg-sidebar--right > .pg-sidebar-normal-position {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-content: start;
  row-gap: 20px;
}
body.pg-next .pg-sidebar--right > .pg-sidebar-sticky-position {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-content: start;
  row-gap: 20px;
}
body.pg-next .pg-sidebar--right > .pg-sidebar-sticky-position:empty {display:none}
/* Superficie blanca opaca uniforme; sin franja visible bajo la cabecera. */
@media (min-width:1150px) {
  body.pg-next.pg-sticky-right-position-enabled .pg-sidebar--right {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  body.pg-next.pg-sticky-right-position-enabled .pg-sidebar-sticky-position.pg-sticky-eligible {
    position: sticky;
    top: calc(var(--pg-sidebar-sticky-top, 96px) + 12px);
    align-self: stretch;
    z-index: 5;
    isolation: isolate;
    background: #fff;
  }
  /* El borde superior queda cubierto por la misma capa opaca que el módulo.
     Se evita el z-index negativo y el fondo de márgenes externos. */
  body.pg-next.pg-sticky-right-position-enabled .pg-sidebar-sticky-position.pg-sticky-eligible::before {
    content: "";
    position: absolute;
    top: -12px;
    right: 0;
    bottom: -2px;
    left: 0;
    z-index: 0;
    background: #fff;
    pointer-events: none;
  }
  body.pg-next.pg-sticky-right-position-enabled .pg-sidebar-sticky-position.pg-sticky-eligible > * {
    position: relative;
    z-index: 1;
  }

  /* La cabecera y su separación son UNA caja real de pintura. El margen
     original .85rem se convierte en padding del envoltorio, sin variar alturas.
     El acento conserva su altura original al seguir aplicado solo al h2-h6. */
  body.pg-next.pg-sticky-right-position-enabled .pg-sidebar--right.pg-next-heading-enabled
    .pg-sidebar-normal-position > .pg-module > .pg-module__heading-surface {
    position: sticky;
    top: var(--pg-next-heading-top, 400px);
    /* La union visual debe pintar por delante de la posicion superior.
       El solape blanco oculta exclusivamente la costura de redondeo (2px),
       sin alterar geometria ni introducir una sombra visible. */
    z-index: 6;
    box-shadow: 0 -3px 0 #fff;
    padding-bottom: var(--pg-next-heading-gap, .85rem);
    background: #fff;
  }
  body.pg-next.pg-sticky-right-position-enabled .pg-sidebar--right.pg-next-heading-enabled
    .pg-sidebar-normal-position > .pg-module > .pg-module__heading-surface > .pg-module__title {
    margin-bottom: 0;
  }

  /* Ocultar de una vez al agotar el contenido, sin colapsar el modulo. */
  body.pg-next.pg-sticky-right-position-enabled .pg-sidebar--right.pg-next-heading-enabled
    .pg-sidebar-normal-position > .pg-module > .pg-module__heading-surface.pg-next-heading-exhausted {
    visibility: hidden;
  }
}
@media (max-width:1149.98px) {
  body.pg-next .pg-sidebar--right {gap: 20px}
  body.pg-next .pg-sidebar-sticky-position {position: static}
}
