/* =====================================================================
   layout.css — estrutura global (sidebar fixa + conteúdo) + responsivo
===================================================================== */

.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}
.app--full { display: block; }

/* ---------------------------------------------------------------- SIDEBAR */
.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    background: var(--soft-lavender);
    border-right: 1px solid var(--border);
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.sidebar__top { display: flex; flex-direction: column; gap: 22px; }

/* Breadcrumb pílula */
.crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 8px 6px 10px;
    box-shadow: var(--shadow-sm);
    font-size: 12.5px;
    color: var(--text-soft);
}
.crumb__home { display: grid; place-items: center; color: var(--text-soft); }
.crumb__home .icon { width: 15px; height: 15px; }
.crumb__path { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; }
.crumb__path a { color: var(--text-soft); }
.crumb__path a:hover { color: var(--primary); }
.crumb__sep { opacity: .5; }
.crumb__current { color: var(--primary); font-weight: 600; }
.crumb__back {
    margin-left: auto;
    display: grid; place-items: center;
    width: 26px; height: 26px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    color: var(--text-soft);
    transition: color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.crumb__back .icon { width: 14px; height: 14px; }
.crumb__back:hover { color: var(--primary); background: var(--soft-lavender); transform: translateX(-1px); }

.sidebar__head { display: flex; flex-direction: column; gap: 8px; }
.sidebar__title { font-size: 22px; color: var(--primary); font-weight: 600; }
.sidebar__desc { font-size: 13px; line-height: 1.5; color: var(--text-soft); max-width: 30ch; }

/* Rodapé da sidebar */
.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 18px; }
.sidebar__nav { display: flex; flex-direction: column; gap: 9px; }
.sidebar__link {
    font-size: 13.5px;
    color: var(--text-soft);
    width: fit-content;
    transition: color .18s var(--ease), transform .18s var(--ease);
}
.sidebar__link:hover { color: var(--primary); transform: translateX(2px); }
.sidebar__link.is-active { color: var(--primary); font-weight: 600; }

.sidebar__credit { display: flex; align-items: center; gap: 8px; }
.sidebar__mark { display: inline-flex; }
.sidebar__mark .logo--symbol { font-size: 12px; }
.sidebar__by { font-size: 11.5px; color: var(--text-soft); }
.sidebar__by b { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------------- MAIN */
.main {
    min-width: 0;
    padding: var(--main-pad-y) var(--main-pad-x) 80px;
    position: relative;
}
.main--full { padding: 0; }

.content { max-width: none; width: 100%; }   /* largura 100% (não centralizado) */
.section { margin-top: clamp(28px, 4vw, 48px); }
.section:first-child { margin-top: 0; }
#conteudo { scroll-margin-top: 24px; }

/* --------------------------------------------------------- TOGGLE / DRAWER */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px; left: 14px;
    z-index: 60;
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--white);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px;
}
.sidebar-toggle span {
    width: 18px; height: 2px; border-radius: 2px;
    background: var(--primary);
    transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(21, 15, 76, .35);
    backdrop-filter: blur(2px);
    z-index: 40;
    opacity: 0; pointer-events: none;
    transition: opacity .3s var(--ease);
}

/* ----------------------------------------------------------- RESPONSIVO */
@media (max-width: 1080px) {
    :root { --sidebar-w: 220px; }
    .sidebar__title { font-size: 20px; }
}

@media (max-width: 860px) {
    .app { grid-template-columns: 1fr; }
    .sidebar-toggle { display: flex; }
    .sidebar-overlay { display: block; }

    .sidebar {
        position: fixed;
        top: 0; left: 0;
        width: min(86vw, 320px);
        height: 100vh;
        z-index: 50;
        transform: translateX(-102%);
        transition: transform .34s var(--ease-out);
        box-shadow: var(--shadow-lg);
    }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    body.nav-open .sidebar-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    body.nav-open .sidebar-toggle span:nth-child(2) { opacity: 0; }
    body.nav-open .sidebar-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    .main:not(.main--full) { padding-top: 70px; }   /* espaço p/ o hambúrguer; home (full) não precisa */
}
