/* =========================================================
   ESPECIALIDADES HUB — CSS DEDICADO
   Prefixo: spechub-
========================================================= */

.spechub-body{
    --spechub-col-height: 560px;
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: 2rem;
    align-items: stretch;
    margin-top: 2rem;
}

/* SIDEBAR */
.spechub-sidebar{
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 18px 45px rgba(15, 118, 110, 0.08);
    height: var(--spechub-col-height);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.spechub-sidebar-header{
    padding: 1.25rem 1.25rem 0.5rem 1.25rem;
}

.spechub-count{
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #059669;
}

.spechub-sidebar-text{
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.35rem;
}

.spechub-search-wrapper{
    padding: 0.75rem 1.25rem 1rem 1.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.spechub-search-input{
    width: 100%;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    padding: 0.55rem 0.95rem;
    font-size: 0.9rem;
    outline: none;
}

.spechub-nav{
    overflow-y: auto;
    padding: 0.5rem 0.5rem 1rem 0.5rem;
}

/* CATEGORIA */
.spechub-cat-group{
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(243, 244, 246, 1);
    margin: 0.5rem 0.5rem 0.75rem 0.5rem;
}

.spechub-cat-toggle{
    width: 100%;
    text-align: left;
    background: #f8fafc;
    border: 0;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.spechub-cat-name{
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
}

.spechub-cat-indicator{
    width: 10px;
    height: 10px;
    border-right: 2px solid #059669;
    border-bottom: 2px solid #059669;
    transform: rotate(-45deg);
    transition: transform .18s ease;
}

/* COMEÇA FECHADO */
.spechub-sub-list{
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
    display: none !important;
}

.spechub-cat-group.is-open .spechub-sub-list{
    display: block !important;
}

.spechub-cat-group.is-open .spechub-cat-indicator{
    transform: rotate(45deg);
}

/* SUBITEM */
.spechub-sub-item{
    padding: 0.7rem 1rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background .15s ease, border-color .15s ease;
}

.spechub-sub-item + .spechub-sub-item{
    border-top: 1px solid rgba(243, 244, 246, 1);
}

.spechub-sub-title{
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.2rem;
}

.spechub-sub-excerpt{
    display: block;
    font-size: 0.78rem;
    color: #6b7280;
}

.spechub-sub-item:hover{
    background: #f9fafb;
}

.spechub-sub-item.is-active{
    background: #ecfdf3;
    border-left-color: #059669;
}

/* CONTEÚDO */
.spechub-content-area{
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 24px 50px rgba(15, 118, 110, 0.09);
    height: var(--spechub-col-height);
    overflow: hidden;
}

.spechub-panel{
    display: none;
    height: 100%;
}

.spechub-panel.is-active{
    display: block;
}

.spechub-panel-scroll{
    height: 100%;
    overflow-y: auto;
    padding: 1.75rem 1.75rem 2rem 1.75rem;
}

.spechub-panel-cat{
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #047857;
    background: #d1fae5;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-weight: 700;
}

.spechub-panel-title{
    font-size: 1.5rem;
    color: #0f172a;
    margin: 0.5rem 0 0.75rem 0;
}

.spechub-panel-body{
    font-size: 0.98rem;
    line-height: 1.6;
    color: #4b5563;
}

.spechub-panel-image-block{
    margin-top: 1.25rem;
}

.spechub-panel-image{
    width: 100%;
    display: block;
    border-radius: 1rem;
}

/* PASSO A PASSO */
.spechub-steps{
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.spechub-steps-title{
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #0f172a;
}

.spechub-steps-grid{
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

.spechub-step-card{
    background: #f8fafc;
    border: 1px solid rgba(243, 244, 246, 1);
    border-radius: 1rem;
    padding: 1rem;
}

.spechub-step-card-title{
    font-size: 0.98rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.spechub-step-card-body{
    font-size: 0.88rem;
    color: #4b5563;
    line-height: 1.5;
}

.spechub-step-card-image{
    width: 100%;
    margin-top: 0.75rem;
    border-radius: 0.75rem;
    display: block;
}

/* RESPONSIVO */
@media (max-width: 991px){
    .spechub-body{
        grid-template-columns: 1fr;
        --spechub-col-height: auto;
    }

    .spechub-sidebar,
    .spechub-content-area{
        height: auto;
    }

    .spechub-panel-scroll{
        height: auto;
        overflow: visible;
    }

    .spechub-steps-grid{
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   MODO MODAL — ESPECIALIDADES
   Mantém identificadores atuais
========================================================= */

/* Agora o body do hub vira 1 coluna (somente sidebar) */
.spechub-body{
    grid-template-columns: 1fr !important;
}

/* Esconde a área da direita (painéis) */
.spechub-content-area{
    display: none !important;
}

/* Sidebar pode ficar mais alta já que é o foco */
.spechub-sidebar{
    height: auto !important;
    max-height: none !important;
}

/* ================= MODAL ================= */

.spechub-modal{
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.spechub-modal.is-open{
    display: block;
}

.spechub-modal-backdrop{
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(6px);
}

.spechub-modal-dialog{
    position: relative;
    width: min(960px, 92vw);
    max-height: 88vh;
    margin: 6vh auto 0 auto;
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.spechub-modal-header{
    position: relative;
    padding: 1.25rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.spechub-modal-kicker{
    display: inline-block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #047857;
    background: #d1fae5;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.spechub-modal-title{
    font-size: 1.4rem;
    color: #0f172a;
    margin: 0;
    padding-right: 2.5rem;
}

.spechub-modal-close-btn{
    position: absolute;
    top: 0.9rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #f8fafc;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.spechub-modal-body{
    padding: 1.5rem 1.5rem 2rem 1.5rem;
    overflow-y: auto;
}

/* Reaproveitando o mesmo visual do painel */
.spechub-modal-body .spechub-panel-body{
    font-size: 0.98rem;
    line-height: 1.6;
    color: #4b5563;
}

.spechub-modal-body .spechub-panel-image{
    width: 100%;
    display: block;
    border-radius: 1rem;
}

/* Passo a passo dentro da modal */
.spechub-modal-body .spechub-steps-grid{
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 768px){
    .spechub-modal-dialog{
        width: 94vw;
        max-height: 90vh;
        margin-top: 4vh;
    }

    .spechub-modal-body .spechub-steps-grid{
        grid-template-columns: 1fr;
    }
}
