﻿/* =====================================================
   🌐 BASE GLOBAL
   ===================================================== */

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: 'Inter', system-ui, sans-serif;
    background-color: #faf9f6;
    overflow-x: hidden;
    overflow-y: auto;
}

/* =====================================================
   🎯 VARIÁVEIS TUAB
   ===================================================== */

:root {
    --tuab-marrom: #5e2b1f;
    --tuab-verde: #2b7a3f;
    --tuab-dourado: #c7a150;
    --tuab-claro: #faf9f6;
}

/* =====================================================
   🧭 NAVBAR (MENU HÍBRIDO CORRIGIDO)
   ===================================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 64px;
    z-index: 1050;
    background: linear-gradient(90deg, #8b4c2b 0%, #3d8044 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: visible !important; /* 🔑 evita sumiço do menu */
}

/* LOGO */
.navbar-brand {
    color: #fff !important;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .navbar-brand img {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: 2px solid #f8e3b0;
        background: #fff;
    }

/* =====================================================
   🧭 MENU DESKTOP
   ===================================================== */

.navbar-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; /* ✅ AGORA PODE QUEBRAR */
    gap: 12px;
}


    .navbar-nav .nav-item {
        white-space: nowrap;
    }

.navbar .nav-link {
    color: #fff !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 6px 8px;
    line-height: 1.1;
}

.navbar-nav {
    max-width: 100%;
}



/* =====================================================
   ☰ BOTÃO OFFCANVAS
   ===================================================== */

.navbar-toggler {
    border: none;
    background: transparent;
    color: #fff;
}

/* =====================================================
   🔀 CONTROLE DE BREAKPOINT (CORREÇÃO DEFINITIVA)
   ===================================================== */

/* 👉 DESKTOP (>= 992px) */
@media (min-width: 992px) {
    .navbar-nav {
        display: flex !important;
    }

    .navbar-toggler {
        display: none !important;
    }
}

/* 👉 MOBILE (< 992px) */
@media (max-width: 991.98px) {
    #menuDesktop {
        display: none !important;
    }

    .navbar-toggler {
        display: block !important;
    }
}

/* =====================================================
   🧾 SUBTÍTULO
   ===================================================== */

.app-subtitle {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    height: 36px;
    text-align: center;
    font-size: 1rem;
    font-style: italic;
    font-weight: 700;
    background-color: #fff;
    color: var(--tuab-marrom);
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =====================================================
   📄 MAIN
   ===================================================== */

main {
    padding-top: 120px; /* navbar + subtitle */
    padding-bottom: 60px; /* footer */
    min-height: 100vh;
}

/* =====================================================
   🔻 FOOTER
   ===================================================== */

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    text-align: center;
    background-color: var(--tuab-claro);
    font-size: 0.9rem;
    border-top: 1px solid #ddd;
    color: var(--tuab-marrom);
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =====================================================
   🏠 HOME / INÍCIO
   ===================================================== */

.inicio-container {
    width: 100%;
    min-height: calc(100vh - 120px - 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 5vw;
    box-sizing: border-box;
}

    .inicio-container h1 {
        color: #1e2a35;
        font-weight: 800;
        font-size: clamp(1.6rem, 4vw, 2.2rem);
        line-height: 1.3;
        text-transform: uppercase;
        margin-bottom: 24px;
    }

    .inicio-container img {
        width: clamp(160px, 40vw, 260px);
        height: auto;
        border-radius: 20px;
        box-shadow: 0 6px 20px rgba(0,0,0,0.15);
        margin-bottom: 30px;
    }

/* =====================================================
   🎨 BOTÕES TUAB
   ===================================================== */

.btn-tuab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: clamp(1rem, 3vw, 1.1rem);
    border-radius: 30px;
    padding: 12px 24px;
    text-decoration: none;
    transition: all 0.25s ease-in-out;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    min-width: 220px;
}

.btn-verde {
    border: 2px solid #2b7a3f;
    color: #2b7a3f;
    background-color: #fff;
}

    .btn-verde:hover {
        background-color: #2b7a3f;
        color: #fff;
    }

/* =====================================================
   📱 RESPONSIVO HOME
   ===================================================== */

@media (max-width: 768px) {
    .inicio-container {
        justify-content: flex-start;
        padding-top: 20px;
    }

        .inicio-container img {
            width: 70vw;
            max-width: 240px;
        }

        .inicio-container h1 {
            font-size: 1.4rem;
        }
}

/* ✅ Se a tela for "grande", mas com pouco espaço (zoom alto),
   troca para hamburguer antes de quebrar */
@media (max-width: 1200px) {
    .navbar-nav.d-lg-flex {
        display: none !important;
    }

    .navbar-toggler {
        display: block !important;
    }
}
@media (max-width: 1300px) {
    .navbar-nav.d-lg-flex {
        display: none !important;
    }

    .navbar-toggler {
        display: block !important;
    }
}

/* =====================================================
   📱 OFFCANVAS TUAB (MOBILE MENU)
   ===================================================== */

.tuab-offcanvas {
    background: linear-gradient(180deg, #8b4c2b 0%, #3d8044 100%);
    color: #fff;
    border-right: 2px solid rgba(255,255,255,0.15);
}

    /* Cabeçalho do offcanvas */
    .tuab-offcanvas .offcanvas-header {
        background: rgba(0,0,0,0.12);
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }

    /* Título */
    .tuab-offcanvas .offcanvas-title {
        color: #fff;
        font-weight: 800;
    }

        .tuab-offcanvas .offcanvas-title small {
            display: block;
            font-weight: 500;
            opacity: 0.85;
        }

    /* Botão X branco */
    .tuab-offcanvas .btn-close {
        filter: invert(1);
        opacity: 0.9;
    }

    /* Links do menu */
    .tuab-offcanvas .nav-link {
        color: #fff !important;
        font-weight: 600;
        padding: 12px 12px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        gap: 10px;
        transition: 0.2s ease-in-out;
    }

        /* Hover/Toque */
        .tuab-offcanvas .nav-link:hover,
        .tuab-offcanvas .nav-link:focus {
            background: rgba(255,255,255,0.14);
        }

    /* Linhas separadoras */
    .tuab-offcanvas hr {
        border-color: rgba(255,255,255,0.25);
    }

    /* Submenus recolhíveis */
    .tuab-offcanvas .collapse .nav-link {
        padding-left: 18px;
        font-weight: 500;
        opacity: 0.95;
    }

    /* Ícone de seta (chevron) */
    .tuab-offcanvas .bi-chevron-down {
        color: rgba(255,255,255,0.9);
    }
    /* =====================================================
   📱 OFFCANVAS — MENU EM COLUNA (UM ABAIXO DO OUTRO)
   ===================================================== */

    .tuab-offcanvas .navbar-nav {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    /* Cada item ocupa 100% da largura */
    .tuab-offcanvas .nav-item,
    .tuab-offcanvas .nav-link {
        width: 100% !important;
    }

    /* Remove qualquer layout em linha */
    .tuab-offcanvas .nav-link {
        justify-content: flex-start !important;
        text-align: left !important;
        white-space: normal !important;
    }

        .tuab-offcanvas .nav-link.d-flex {
            justify-content: flex-start !important;
            gap: 10px;
        }

    .tuab-offcanvas .collapse .navbar-nav {
        padding-left: 14px;
    }

    .tuab-offcanvas .collapse .nav-link {
        font-size: 0.95rem;
        opacity: 0.95;
    }

/* =====================================================
   ✅ DROPDOWNS DO MENU (DESKTOP) - TUAB STYLE
   ===================================================== */

.navbar .dropdown-menu {
    margin-top: 10px !important; /* dá "respiro" pra não ficar colado */
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(20, 20, 20, 0.92); /* fundo escuro elegante */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
    min-width: 220px;
    top: 100% !important;
}

    /* itens do dropdown */
    .navbar .dropdown-menu .dropdown-item {
        color: #fff !important;
        font-weight: 600;
        border-radius: 10px;
        padding: 10px 12px;
    }

        /* hover bonito */
        .navbar .dropdown-menu .dropdown-item:hover {
            background: rgba(255,255,255,0.14);
        }

    /* evita quebrar texto */
    .navbar .dropdown-menu .dropdown-item {
        white-space: nowrap;
    }

/* =====================================================
   ✅ CORREÇÃO DEFINITIVA DROPDOWN DESKTOP (não empurra nada)
   ===================================================== */

/* Faz o dropdown "flutuar" e não bagunçar a navbar */
.navbar .dropdown {
    position: relative !important;
}

.navbar .dropdown-menu {
    position: absolute !important;
    top: calc(100% + 10px) !important; /* abre abaixo com espaço */
    left: 0 !important;
    transform: none !important;
    margin: 0 !important;
    min-width: 220px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(15, 15, 15, 0.95);
    box-shadow: 0 15px 35px rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.12);
    z-index: 9999 !important; /* fica por cima sempre */
}

    /* Itens do dropdown */
    .navbar .dropdown-menu .dropdown-item {
        color: #fff !important;
        font-weight: 600;
        padding: 10px 12px;
        border-radius: 12px;
    }

        /* Hover elegante */
        .navbar .dropdown-menu .dropdown-item:hover {
            background: rgba(255,255,255,0.14);
        }

/* Desktop menu: nunca quebra linha */
#menuDesktop {
    flex-wrap: nowrap !important;
    overflow: hidden; /* impede descer */
}

    /* Não deixar texto quebrar */
    #menuDesktop .nav-link {
        white-space: nowrap;
    }

/* ✅ GARANTE QUE O DROPDOWN DO BOOTSTRAP FUNCIONE */
.navbar,
.navbar * {
    pointer-events: auto;
}

    /* ✅ Dropdown precisa aparecer acima de tudo */
    .navbar .dropdown-menu {
        z-index: 99999 !important;
    }

/* ✅ Não pode cortar dropdown */
.navbar {
    overflow: visible !important;
}

.navbar-nav {
    overflow: visible !important;
}

/* =====================================================
   ✅ FIX TINYMCE / EDITOR (altura correta)
   ===================================================== */

.editor-container {
    width: 100%;
    min-height: 520px; /* ✅ altura mínima */
    max-height: 70vh; /* ✅ não explode em telas pequenas */
    overflow: auto;
    border-radius: 12px;
}

/* TinyMCE iframe tem que ocupar o container */
.tox-tinymce {
    width: 100% !important;
    min-height: 520px !important;
}

/* Mobile */
@media (max-width: 768px) {
    .editor-container {
        min-height: 60vh;
        max-height: 75vh;
    }

    .tox-tinymce {
        min-height: 60vh !important;
    }
}

/* Botão fixo embaixo */
.botao-fixo {
    position: sticky;
    bottom: 10px;
    padding-top: 10px;
}
