/* ============================================
   REFERENCIAS
   ============================================ */

.referencias {
    border-top: 1px solid #dddede;
    padding-top: 2rem;
    margin-top: 2rem !important;
}

.referencias .h2 {
    color: #1e1e1c;
    font-family: 'Public Sans', sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.625rem;
    text-transform: none;
}

/* Lista numerada */
.referencias .list-group-numbered {
    list-style: decimal;
    padding-left: 1.25rem;
    margin: 0;
    counter-reset: referencias-counter;
}

.referencias .list-group-numbered li {
    font-family: 'Public Sans', sans-serif;
    font-size: 0.813rem;
    font-weight: 400;
    color:#e85746 !important;
    line-height: 1.375rem;
    letter-spacing: 0;
    padding: 0.25rem 0;
    border: none;
    background: none;
}

.referencias .list-group-numbered li a {
    color: #e85746 !important;
    text-decoration: none;
    transition: color 0.2s ease;
    word-break: break-word;
}

.referencias .list-group-numbered li a:hover {
    color: #e85746;
    text-decoration: underline;
}


.referencias .list-group-numbered li a p{
    color:#e85746 !important;
}


/* Responsive */
@media (max-width: 576px) {
    .referencias .h2 {
        font-size: 1.125rem;
        line-height: 1.375rem;
    }

    .referencias .list-group-numbered li {
        font-size: 0.75rem;
        line-height: 1.25rem;
    }
}


/* ============================================
   ÍNDICE DE CONTENIDOS (TOC)
   ============================================ */

.toc-sidebar,
.toc-mobile-wrap {
    background-color: #f5f6f7;
    border-top: 1px dashed #1e1e1c;
    border-bottom: 1px dashed #1e1e1c;
    padding: 20px 16px;
    margin-bottom: 30px;
}

/* Cabecera del TOC: título + botón toggle en la misma línea */
.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0px;
    cursor: pointer;
    user-select: none;
}

.toc-title {
    color: #1e1e1c;
    font-family: 'Public Sans', sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.625rem;
    margin: 0;
}

/* Botón chevron */
.toc-toggle {
    background: none;
    border: none;
    padding: 0 0 0 8px;
    cursor: pointer;
    color: #1e1e1c;
    display: flex;
    align-items: center;
    transition: transform 0.25s ease;
}

.toc-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #1e1e1c;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.25s ease;
}

/* Estado colapsado */
.toc-sidebar.is-toc-closed .toc-toggle svg,
.toc-mobile-wrap.is-toc-closed .toc-toggle svg {
    transform: rotate(-90deg);
}

.toc-sidebar.is-toc-closed .js-toc,
.toc-sidebar.is-toc-closed .js-toc-mobile,
.toc-mobile-wrap.is-toc-closed .js-toc,
.toc-mobile-wrap.is-toc-closed .js-toc-mobile {
    display: none;
}

/* Árbol de navegación */
.js-toc {
    font-family: 'Public Sans', sans-serif;
    font-size: 0.938rem;
    line-height: 1.563rem;
}

.js-toc ol,
.js-toc ul {
    list-style: none;
    padding-left: 14px;
    margin: 0;
}

.js-toc > ol,
.js-toc > ul {
    padding-left: 0;
}

/* Links H2 */
.js-toc a {
    color: #787a7c;
    font-family: 'Public Sans', sans-serif;
    font-size: 0.938rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.563rem;
    text-decoration: none;
    display: block;
    padding: 3px 0;
    transition: color 0.2s ease;
}

/* Links H3 */
.js-toc li li a {
    font-size: 0.875rem;
    line-height: 1.375rem;
}

/* Links H4 */
.js-toc li li li a {
    font-size: 0.813rem;
    line-height: 1.25rem;
}

/* Hover */
.js-toc a:hover {
    color: #e85746;
    font-weight: 700;
}

/* Link activo (scroll spy) */
.js-toc a.is-active-link {
    color: #e85746;
    font-weight: 700;
}

/* Ocultar el indicador lateral de tocbot (barra naranja/gris) */
.js-toc .is-active-link::before,
.js-toc .toc-link::before {
    display: none !important;
}

/* Mostrar siempre todos los niveles sin colapsar */
.js-toc .is-collapsed {
    max-height: none !important;
    overflow: visible !important;
}

/* TOC móvil: oculto en desktop, visible en móvil */
.toc-mobile-wrap {
    display: none;
}

/* En móvil: mostrar el TOC inline y ocultar el del sidebar */
@media (max-width: 768px) {
    .toc-mobile-wrap {
        display: block;
        margin-top: 16px;
        margin-bottom: 24px;
    }

    .toc-sidebar {
        display: none !important;
    }
}


/*POST*/

/* Convertir la fila en flexbox: anula los floats de Bootstrap 3 y permite
   que el sidebar tenga la misma altura que la columna del artículo */
.row.mt-50 {
  display: flex !important;
  flex-wrap: wrap;
  align-items: stretch;
}

/* Evitar que Bootstrap 3 flote las columnas (los floats se ignoran en flex) */
.row.mt-50 > .content,
.row.mt-50 > .sidebar-right {
  float: none;
}

.sidebar.sidebar-right {
  display: flex;
  flex-direction: column;
}

.sidebar-with-border {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* TOC: fluye normalmente arriba, sin sticky */
.toc-sidebar {
  flex-shrink: 0;
}

/* CTA: sticky → se engancha cuando el TOC sale del viewport y sigue
   el scroll hasta el final del artículo, donde se desengancha solo */
.sidebar-with-border .wpb_wrapper {
  position: sticky;
  top: 20px; /* sobreescrito dinámicamente por post.js */
}

  @media (max-width: 768px) {
    .sidebar.sidebar-right {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto!important;
        width: 100%;
        z-index: 9999;
        align-self: auto;
        padding: 0;
    }
    .sidebar-right .wpb_wrapper p{
      font-size:16px;
      padding-left:2px;
      padding-right:2px;
    }
    .sidebar-right .wpb_wrapper p strong{
      font-size:16px!important;
    }

    .btn-contacto-popup{
      margin-top:0!important;
    }

    .wpb_wrapper > div{
      display: inline-flex;
      align-items:center;
    }
  }

  .btn-contacto-popup {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 12px 20px;
    background: #fff;
    color: #222;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, color 0.2s;
  }

  .btn-contacto-popup:hover {
    background: #222;
    color: #fff;
  }

  .modal-contacto-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999 !important;
    align-items: center;
    justify-content: center;
  }

  .modal-contacto-box {
    z-index: 1000000 !important;
  }

  .modal-contacto-overlay.active {
    display: flex;
  }

  .modal-contacto-box {
    position: relative;
    background: #fff;
    border-radius: 6px;
    padding: 40px 30px 30px;
    width: 100%;
    max-width: 520px;
    max-height: 100vh;
    margin: 20px;
  }

@media(max-width:768px){
	.modal-contacto-box {
	    overflow-y: auto;
    }
}

  .modal-contacto-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #333;
  }

  .modal-contacto-close:hover {
    color: #000;
  }

  .autor-simple-box {
    margin: 30px 0;
    padding: 15px 20px;
    background: #f9f9f9;
    border-left: 4px solid #222;
    border-radius: 6px;
    font-family: sans-serif;
    font-size: 0.95em;
    color: #333;
    display: flex;
}

.autor-simple-box p {
    margin: 5px 0;
}

.autor-simple-box a {
    color: #222;
    text-decoration: underline;
}

.autor-simple-box a:hover {
    color: #0a66c2;
}

.img-author{
  width: 6rem;

  height: auto;
  margin-right: 3rem;
  display: flex;
}

.img-author img{
  margin: auto;
  border-radius: 100px;
}