﻿/* ======================== */
/* BASE / RESETS            */
/* ======================== */
html {
    font-size: 14px;
    scroll-behavior: smooth;
    position: relative;
    min-height: 100%;
}

@media (min-width:768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
}

/* Foco padrão bootstrap (mantive) */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 .1rem #fff, 0 0 0 .25rem #258cfb;
}

/* ======================== */
/* TIPOGRAFIA               */
/* ======================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #111827;
    margin-bottom: .5rem;
}

p {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

b {
    font-weight: 600;
    color: #374151;
}

/* ======================== */
/* UTILITÁRIOS & BOTÕES     */
/* ======================== */
.main-content, .main-auth {
    padding-bottom: 4rem;
}

.navbar .nav-link[class*="active-"] {
    color: #e66a1f !important;
    font-weight: 700;
}

.btn-orange {
    background: #e66a1f;
    border-color: #e66a1f;
}

    .btn-orange:hover, .btn-orange:focus {
        background: #cf5c16;
        border-color: #cf5c16;
    }

    .btn-orange:disabled {
        background: #e6a67f;
        border-color: #e6a67f;
    }

a.link-orange {
    color: #e66a1f;
    text-decoration: none;
}

    a.link-orange:hover, a.link-orange:focus {
        color: #cf5c16;
        text-decoration: underline;
    }

.form-control:focus {
    border-color: #e66a1f;
    box-shadow: 0 0 0 .2rem rgba(230,106,31,.25);
}

.form-check-input:checked {
    background-color: #e66a1f;
    border-color: #e66a1f;
}

.form-check-input:focus {
    border-color: #e66a1f;
    box-shadow: 0 0 0 .2rem rgba(230,106,31,.25);
}

.object-fit-cover {
    object-fit: cover;
}

/* ======================== */
/* CARTÕES / ARTIGOS        */
/* ======================== */
.artigo .card {
    border-radius: .75rem;
}

.artigo {
    margin-bottom: 2.5rem !important;
}

/* Espaçamento e estilo entre blocos de secções (não mexe nos artigos) */
#seccoes > div {
    padding: 2rem !important;
    margin-bottom: 3rem !important;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

/* ======================== */
/* SIDEBAR FIXA (ELEGANTE)  */
/* ======================== */
/* Variáveis */
:root {
    --nav-h: 0px; /* se a navbar for fixed-top, mete por ex: 64px */
    --sb-w: 260px; /* largura da sidebar */
    --sb-accent: #ff7f32; /* laranja */
    --sb-accent-100: #fff6ef;
    --sb-border: #ffe0c2;
    --sb-text: #1f2937;
    --sb-link: #445065;
}
/* Container da sidebar fixa */
.sidebar-fixed {
    position: fixed;
    z-index: 1020;
    top: var(--nav-h);
    left: 0;
    bottom: 0;
    width: var(--sb-w);
    overflow-y: auto;
    background: linear-gradient(180deg,#ffffff 0%, #f8fafc 100%);
    border-right: 1px solid #e6e8ec;
    padding: 12px 10px 16px 14px;
}
/* Empurrar conteúdo para a direita da sidebar */
.main-with-sidebar {
    margin-left: var(--sb-w);
    padding-left: 1rem;
}
/* Responsivo: sidebar vira bloco */
@media (max-width:991.98px) {
    .sidebar-fixed {
        position: static;
        width: 100%;
        height: auto;
        top: 0;
    }

    .main-with-sidebar {
        margin-left: 0;
        padding-left: 0;
    }
}
/* pesquisa da sidebar */
.sidebar-sticky .input-group-text {
    background: #fff;
}

.sidebar-sticky #sidebarSearch {
    border-radius: 0 .5rem .5rem 0;
    box-shadow: none;
}

    .sidebar-sticky #sidebarSearch:focus {
        border-color: var(--sb-accent);
        box-shadow: 0 0 0 .2rem rgba(255,127,50,.25);
    }

/* Sidebar sticky dentro da coluna Bootstrap */
.sidebar-sticky {
    position: sticky;
    top: 10px; /* espaço ao topo; ajusta se quiseres */
    max-height: calc(100vh - 20px);
    overflow: auto;
    background: linear-gradient(180deg,#ffffff 0%, #f8fafc 100%);
    border-right: 1px solid #e6e8ec;
    padding: 12px 10px 16px 14px;
    border-radius: .5rem;
}
    /* Título da secção */
    .sidebar-sticky .section-btn {
        width: 100%;
        display: flex;
        align-items: center;
        gap: .6rem;
        background: var(--sb-accent-100);
        border: 1px solid var(--sb-border);
        border-left: 6px solid var(--sb-accent);
        padding: .65rem .75rem;
        border-radius: .6rem;
        color: var(--sb-text);
        font-weight: 700;
        text-align: left;
        transition: background .2s,border-color .2s,box-shadow .2s;
    }

        .sidebar-sticky .section-btn:hover,
        .sidebar-sticky .section-btn:focus {
            background: #ffedd5;
            box-shadow: 0 2px 8px rgba(255,127,50,.15);
        }
        /* Chevron ►/▼ */
        .sidebar-sticky .section-btn .chevron {
            margin-left: auto;
            width: .6rem;
            height: .6rem;
            border-right: 2px solid var(--sb-text);
            border-bottom: 2px solid var(--sb-text);
            transform: rotate(-45deg);
            transition: transform .2s ease,opacity .2s;
            opacity: .85;
        }

        .sidebar-sticky .section-btn.collapsed .chevron {
            transform: rotate(45deg);
        }

    /* Links dos artigos */
    .sidebar-sticky .item-link {
        display: flex;
        align-items: center;
        gap: .5rem;
        padding: .35rem .25rem;
        color: var(--sb-link);
        text-decoration: none;
        border-radius: .4rem;
        transition: background .15s, color .15s;
    }

        .sidebar-sticky .item-link:hover {
            background: #eef2f7;
            color: var(--sb-accent);
        }

        .sidebar-sticky .item-link.active {
            color: var(--sb-accent);
            font-weight: 600;
        }

/* ===== Sidebar minimal, clean ===== */
.sidebar-min {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    overflow: auto;
    padding: 8px 6px 12px 6px;
    border-right: 1px solid #eef0f3;
}
    /* Pesquisa simples */
    .sidebar-min .input-group-text {
        background: #fff;
    }

    .sidebar-min #sidebarSearch {
        box-shadow: none;
    }

        .sidebar-min #sidebarSearch:focus {
            border-color: #ff7f32;
            box-shadow: 0 0 0 .15rem rgba(255,127,50,.2);
        }

    /* Cabeçalho de secção (botão) */
    .sidebar-min .section-btn {
        width: 100%;
        background: transparent;
        border: 0;
        padding: .5rem 0;
        display: flex;
        align-items: center;
        gap: .5rem;
        font-weight: 700;
        color: #1f2937; /* slate-800 */
        border-bottom: 1px solid #f1f3f5;
    }

        .sidebar-min .section-btn:hover {
            color: #ff7f32;
        }
        /* caret ►/▼ só com CSS */
        .sidebar-min .section-btn .caret {
            margin-left: auto;
            width: .5rem;
            height: .5rem;
            border-right: 2px solid currentColor;
            border-bottom: 2px solid currentColor;
            transform: rotate(45deg); /* ► (fechado) */
            transition: transform .2s ease;
            opacity: .85;
        }

        .sidebar-min .section-btn:not(.collapsed) .caret {
            transform: rotate(315deg); /* ▼ (aberto) */
        }

    /* Links dos artigos */
    .sidebar-min .item-link {
        display: block;
        padding: .35rem 0;
        color: #4b5563;
        text-decoration: none;
    }

        .sidebar-min .item-link:hover {
            color: #ff7f32;
        }

        .sidebar-min .item-link.active {
            color: #ff7f32;
            font-weight: 600;
        }

/* ======================== */
/* TIPOGRAFIA DOS ARTIGOS   */
/* ======================== */
.artigo .card-title {
    font-size: clamp(1.375rem, 1.6vw + 1rem, 2rem) !important;
    line-height: 1.2;
    color: #0f172a !important;
}

.artigo .card-text {
    font-size: clamp(1.1875rem, 0.8vw + 1rem, 1.375rem) !important;
    line-height: 1.7;
    color: #374151 !important;
}

.artigo .card-body {
    font-size: clamp(1.125rem, 0.6vw + 1rem, 1.25rem) !important;
}

/* Tipografia dos artigos — mais forte e mais escura */
li.artigo .card .card-title {
    font-size: 2rem !important; /* ~32px */
    line-height: 1.2;
    color: #0f172a !important;
}

li.artigo .card .card-text,
li.artigo .card .card-text.text-muted {
    font-size: 1.375rem !important; /* ~22px */
    line-height: 1.7;
    color: #374151 !important;
}
/* Se o markup tiver fs-4 / fs-6, força por cima */
li.artigo .card .card-title.fs-4 {
    font-size: 2rem !important;
}

li.artigo .card .card-text.fs-6 {
    font-size: 1.375rem !important;
}

/* Ajuste para mobile */
@media (max-width: 576px) {
    li.artigo .card .card-title {
        font-size: 1.6rem !important;
    }
    /* ~25.6px */
    li.artigo .card .card-text {
        font-size: 1.2rem !important;
    }
    /* ~19.2px */
}

/* ======================== */
/* ESPAÇAMENTO ENTRE ARTIGOS*/
/* ======================== */
.artigos {
    display: flex;
    flex-direction: column;
    gap: 30px; /* controla o espaço vertical entre artigos */
}

/* realce ao navegar para #artigo-XX (opcional) */
.artigo-item:target {
    animation: hilite 2s;
}

@keyframes hilite {
    0% {
        background: #fff3cd;
    }

    100% {
        background: transparent;
    }
}
