/***
 * Gov.co (https://www.gov.co) - Gobierno de Colombia
 *  - Componente: barra accesibilidad
 *  - Version: 4.0.0
 */

/* Fuente iconografica */
@font-face {
    font-family: "govco-font";
    src: url("/static/fonts/govco-font-icons.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

/* WorkSans-Medium */
@font-face {
    font-family: 'WorkSans-Medium';
    src: url('/static/fonts/WorkSans-Medium.ttf');
}

/* Contenedor principal */
.content-example-barra {
  margin-left: auto;
  margin-right: auto;
}

@media only screen and (max-width: 1024px) {
    .content-example-barra,
    .scroll-to-top-btn {
        display: none !important;
    }
}

/* Barra de accesibilidad */
.barra-accesibilidad-govco {
    height: 176px;
    width: 44px;
    position: fixed;
    display: flex;
    flex-direction: column;
    right: 0;
    left: auto;
    top: 35vh;
    transform: translateY(-50%);
    background-color: #0943B5 !important;
    border-radius: 8px 0px 0px 8px;
    padding: 0;
    align-items: center;
    z-index: 99999999;
}

.barra-accesibilidad-govco button {
  background: transparent;
  width: 44px;
  height: 44px;
  border: none;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color 0.2s ease;
  padding: 0;
  margin: 0;
  outline: none;
  z-index: 1;
}

/* Redondear el botón de arriba y abajo para que encaje con el borde de la barra */
.barra-accesibilidad-govco button:first-child {
  border-radius: 8px 0 0 0;
}
.barra-accesibilidad-govco button:last-child {
  border-radius: 0 0 0 8px;
}

/* Iconos y sus tooltips */
.barra-accesibilidad-govco .icon-contraste::after,
.barra-accesibilidad-govco .icon-reducir::after,
.barra-accesibilidad-govco .icon-restablecer::after,
.barra-accesibilidad-govco .icon-aumentar::after {
    background: #fff;
    font-family: 'WorkSans-Medium', sans-serif;
    font-weight: 600;
    height: 24px;
    width: 24px;
    color: #0943B5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    position: relative;
    z-index: 2;
}

/* Ajustes finos para que los iconos no se corten */
.barra-accesibilidad-govco .icon-contraste::after { 
    font-family: "govco-font";
    font-size: 16px;
    content: "\e803"; 
}
.barra-accesibilidad-govco .icon-reducir::after { content: "A⁻"; }
.barra-accesibilidad-govco .icon-restablecer::after { content: "A"; }
.barra-accesibilidad-govco .icon-aumentar::after { content: "A⁺"; }

.barra-accesibilidad-govco span {
    position: absolute;
    background-color: #3366CC !important; /* Color oficial Gov.co para accesibilidad activa/hover */
    color: #fff;
    font-family: WorkSans-Medium, sans-serif !important;
    font-size: 15px; /* Más legible */
    font-weight: 500;
    height: 44px;
    width: 200px; /* Todos los tooltips del mismo tamaño */
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Alinear el texto a la izquierda */
    padding: 0 0 0 20px; /* Espacio a la izquierda del texto */
    border-radius: 8px 0px 0px 8px;
    right: 10px; /* Se solapa sobre el botón para unirse sin costuras */
    top: 0;
    margin: 0;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1;
    pointer-events: none;
    -webkit-font-smoothing: antialiased;
}

/* Hover and active states */
.barra-accesibilidad-govco button:hover,
.barra-accesibilidad-govco button:focus,
.active-barra-accesibilidad-govco {
    background-color: #3366CC !important;
}

.barra-accesibilidad-govco button:hover span,
.barra-accesibilidad-govco button:focus span {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure active state icons remain same color */
.active-barra-accesibilidad-govco.icon-contraste::after,
.active-barra-accesibilidad-govco.icon-reducir::after,
.active-barra-accesibilidad-govco.icon-restablecer::after,
.active-barra-accesibilidad-govco.icon-aumentar::after {
    background: #fff;
    color: #0943B5;
}

/* Scroll To Top Button Styles */
.scroll-to-top-btn {
    position: fixed;
    right: 0;
    /* La barra de accesibilidad empieza en 35vh, mide 176px, y la distancia es de 306px adicionales */
    top: calc(35vh + 176px + 306px);
    width: 58px;
    height: 54px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 99999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.scroll-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
}