/* =============================================================
   SUMÁRIO LATERAL — todos os seletores prefixados .swop-sum-*
   para zero conflito com classes existentes (.leg_*).
   ============================================================= */

/* Botão escondido por padrão; JS mostra após detectar artigos */
.swop-sum-btn-toggle { display: none; cursor: pointer; }
.swop-sum-btn-toggle.swop-sum-disponivel { display: inline-flex; }

/* Backdrop semi-transparente atrás do drawer */
.swop-sum-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .08); /* bem leve — só pra dar foco visual sem escurecer o texto */
    z-index: 9998;
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
}
.swop-sum-backdrop.swop-sum-aberto { opacity: 1; pointer-events: auto; }

/* Drawer lateral pela DIREITA, semi-transparente para deixar ver o texto atrás */
.swop-sum-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 360px; max-width: 92vw;
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: blur(8px) saturate(1.1);
    backdrop-filter: blur(8px) saturate(1.1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, .18);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform .25s ease;
    display: flex; flex-direction: column;
    font-family: "Arial", sans-serif;
}
.swop-sum-drawer.swop-sum-aberto { transform: translateX(0); }

/* Header do drawer */
.swop-sum-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e6e6e6;
    background: #fafafa;
    flex-shrink: 0;
}
.swop-sum-drawer-header h3 {
    margin: 0; font-size: 15px; font-weight: bold;
    color: #333; letter-spacing: .3px;
}
.swop-sum-drawer-fechar {
    background: none; border: 0; cursor: pointer;
    font-size: 20px; color: #777; padding: 4px 8px;
    line-height: 1; border-radius: 4px;
    transition: background .15s, color .15s;
}
.swop-sum-drawer-fechar:hover { background: #efefef; color: #c0392b; }

/* Body do drawer (lista do sumário) */
.swop-sum-drawer-body {
    flex: 1; overflow-y: auto;
    padding: 8px 14px 18px 14px;
}
.swop-sum-lista, .swop-sum-lista ul {
    list-style: none; padding: 0; margin: 0;
}

/* Headings de seção — azul-petróleo discreto, diferente do concorrente */
.swop-sum-secao {
    font-weight: bold;
    color: #1a5490;
    font-size: 12px;
    margin: 14px 0 6px 0;
    padding: 4px 0;
    border-bottom: 1px solid #d6e2ef;
    letter-spacing: .3px;
    text-transform: none;
}
.swop-sum-secao a {
    color: inherit; text-decoration: none; display: block;
    padding: 2px 4px; border-radius: 3px;
}
.swop-sum-secao a:hover { background: #eef4fb; color: #0d3d6f; }
/* Hover nos artigos — alinhado com a paleta nova */
.swop-sum-artigo a:hover .swop-sum-artigo-badge {
    background: #1a5490; color: #fff;
}

/* Recuos por nível */
.swop-sum-nivel-0 { margin-left: 0; }
.swop-sum-nivel-1 { margin-left: 12px; }
.swop-sum-nivel-2 { margin-left: 24px; }
.swop-sum-nivel-3 { margin-left: 36px; }

/* Item de artigo — pill + preview */
.swop-sum-artigo {
    margin: 4px 0;
}
.swop-sum-artigo a {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 6px 8px; border-radius: 4px;
    color: #333; text-decoration: none;
    font-size: 12px; line-height: 1.35;
    transition: background .12s;
}
.swop-sum-artigo a:hover { background: #f4f4f4; }
.swop-sum-artigo-badge {
    flex-shrink: 0;
    background: #efefef; color: #555;
    padding: 2px 8px; border-radius: 10px;
    font-weight: bold; font-size: 11px;
    min-width: 38px; text-align: center;
    line-height: 1.5;
}
.swop-sum-artigo-preview {
    flex: 1;
    color: #666;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Mobile: drawer fullscreen */
@media (max-width: 600px) {
    .swop-sum-drawer { width: 100vw; max-width: 100vw; }
}

/* =============================================================
   FIX: links dentro do conteúdo da norma estavam invisíveis
   (sem cor distinta nem sublinhado). Acrescenta diferenciação
   visual sem afetar elementos com classes próprias do sistema
   (.leg_numero_artigo, .leg_interacao, etc).
   ============================================================= */
#conteudo_norma a:not(.leg_numero_artigo):not(.leg_interacao):not(.swop-sum-skip),
.leg_area_txt_norma a:not(.leg_numero_artigo):not(.leg_interacao):not(.swop-sum-skip) {
    color: #1565c0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .12s;
}
#conteudo_norma a:not(.leg_numero_artigo):not(.leg_interacao):not(.swop-sum-skip):hover,
.leg_area_txt_norma a:not(.leg_numero_artigo):not(.leg_interacao):not(.swop-sum-skip):hover {
    color: #0d47a1;
    text-decoration: underline;
    background: rgba(21, 101, 192, .06);
}
/* Ícone visual indicando link externo (opcional, discreto) */
#conteudo_norma a[href^="http"]:not(.leg_numero_artigo):after {
    content: "\f08e"; /* fa-external-link-alt */
    font-family: "Font Awesome 5 Free", "FontAwesome";
    font-weight: 900;
    font-size: 9px; margin-left: 4px;
    color: #999; vertical-align: super;
}
