html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f9f9f9;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

::selection {
    color: #ffffff;
    background: #d32f2f;
}

::-moz-selection {
    color: #ffffff;
    background: #d32f2f;
}

.gh-content p {
    line-height: 1.8;
    font-size: 1.15rem;
    color: #2c2c2c;
}

.gh-content img {
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

@media (hover: hover) {
    .gh-content img:hover {
        transform: scale(1.01);
    }
}

#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    width: 0;
    height: 4px;
    background-color: #d32f2f;
    transition: width 0.1s ease-out;
}

.floating-share {
    position: fixed;
    top: 50%;
    left: 20px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: translateY(-50%);
}

.floating-share a {
    display: flex;
    width: 45px;
    height: 45px;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.floating-share a:hover {
    transform: scale(1.1);
}

.share-wa {
    background: #25d366;
}

.share-tg {
    background: #0088cc;
}

.share-fb {
    background: #1877f2;
}

@media (min-width: 768px) {
    #gh-head.gh-head {
        top: 16px !important;
        background: transparent !important;
        border: 0 !important;
        padding: 0 !important;
    }

    #gh-head .gh-head-inner {
        width: min(1200px, calc(100% - 32px));
        min-height: 68px;
        margin: 0 auto;
        padding: 0 18px;
        border: 1px solid #d6dbe4;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.95) !important;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
        backdrop-filter: blur(8px) saturate(120%);
        -webkit-backdrop-filter: blur(8px) saturate(120%);
        transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
    }

    body.is-head-hidden #gh-head .gh-head-inner {
        transform: translateY(calc(-100% - 20px)) !important;
        opacity: 0 !important;
    }

    body.is-head-revealing #gh-head .gh-head-inner,
    body.is-head-concealing #gh-head .gh-head-inner {
        opacity: 1;
    }
}

@media (max-width: 767px) {
    /* ============================================================
     * ZONA: NAVBAR MOVIL FIJO
     * Que hace: deja el header siempre visible arriba en mobile.
     * ============================================================ */
    #gh-head.gh-head {
        /* Fijamos el header para que no se oculte al hacer scroll */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 100 !important;

        /* Desactivamos animaciones de ocultar/mostrar del header */
        transform: none !important;
        transition: none !important;

        /* Estilo visual de la barra */
        top: 0 !important;
        background: #ffffff !important;
        border-bottom: 1px solid #e5e5e5 !important;
        padding: 0 !important;
    }

    #gh-head .gh-head-inner {
        /* Alto del navbar movil: lo usamos como referencia para offsets */
        width: 100% !important;
        min-height: 64px;
        padding: 0 12px;
        border: 0 !important;
        border-radius: 0 !important;
        background: #ffffff !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* ============================================================
     * ZONA: OFFSET DEL CONTENIDO
     * Que hace: evita que el contenido quede escondido debajo del
     * navbar fixed.
     * ============================================================ */
    .gh-site,
    .site-wrapper {
        padding-top: 64px !important;
    }

    /* Remove the boxed mobile burger look introduced by previous overrides. */
    #gh-head .gh-burger {
        width: 30px;
        height: 30px;
        padding: 0;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    #gh-head .gh-burger::before,
    #gh-head .gh-burger::after {
        left: 3px;
        width: 24px;
    }

    /* ============================================================
     * ZONA: MENU HAMBURGUESA MOVIL
     * Que hace: cuando el menu esta cerrado, no ocupa pantalla.
     * Solo aparece cuando body tiene la clase is-head-open.
     * ============================================================ */
    body:not(.is-head-open) #gh-head .gh-head-menu {
        display: none !important;
    }

    body.is-head-open #gh-head .gh-head-menu {
        display: block !important;
        position: fixed !important;
        top: 64px !important;
        right: 0 !important;
        left: 0 !important;
        height: calc(100dvh - 64px) !important;
        overflow-y: auto !important;
        background: #ffffff !important;
        z-index: 99 !important;
    }

    /* Cuando el menu esta abierto, bloqueamos scroll del body para UX mobile */
    body.is-head-open {
        overflow: hidden;
    }

    .floating-share {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        padding: 12px 0;
        background: rgba(255, 255, 255, 0.95);
        transform: none;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    }

    body.has-floating-share .gh-content {
        padding-bottom: 60px !important;
    }
}
