/* =====================================================
   VARIÁVEIS GLOBAIS (Paleta unificada)
   ===================================================== */
:root {
    --color-primary:   #aa3131;
    --color-dark:      #881f1f;
    --color-footer:    #cb0c0c;
    --color-secondary: #6b3a3a;
    --color-bg:        #f9f9f9;
}

/* =====================================================
   BASE
   ===================================================== */
html { height: 100%; }

body {
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--color-bg);
    transition: background-color 0.3s;
    color: #000;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =====================================================
   TOPO
   ===================================================== */
.top-bar {
    background: var(--color-primary);
    padding: 6px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.top-bar a {
    color: #fff;
    text-decoration: none;
    font-size: 12px;
}

.accessibility-shortcuts,
.contact-info,
.social-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.contact-info i { color: #fff; }

.contact-text {
    font-size: 12px;
    color: #fff;
}

.social-icons a {
    color: #fff;
    text-decoration: none;
}

/* =====================================================
   HEADER
   ===================================================== */
header {
    background-color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.logo-area img {
    height: 90px;
    width: auto;
    max-width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.search-box { display: flex; align-items: center; }

.search-input {
    height: 34px;
    padding: 0 10px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    outline: none;
    font-size: 13px;
    min-width: 180px;
}

.search-btn {
    height: 34px;
    padding: 0 12px;
    border: none;
    background: var(--color-primary);
    color: #fff;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.search-btn:hover { background: var(--color-dark); }

.button {
    height: 34px;
    padding: 0 10px;
    border: none;
    background: var(--color-primary);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.button:hover { background: var(--color-dark); }

.increase-btn,
.decrease-btn,
.theme-btn { background-color: var(--color-secondary); }

.light-theme-btn { background-color: #f2f2f2; color: #333; }

/* =====================================================
   NAVEGAÇÃO
   ===================================================== */
nav { background: var(--color-primary); }

nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1px;
}

nav ul li { display: flex; }

nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 10px 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 46px;
    line-height: 1.1;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

nav ul li a:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }

nav ul li a.nav-active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 700;
    border-bottom: 3px solid #fff;
    color: #fff;
}

.menu-icon {
    display: none;
    cursor: pointer;
    text-align: center;
    padding: 10px 0;
}

/* =====================================================
   LAYOUT
   ===================================================== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

.linha {
    display: flex;
    max-width: 800px;
    margin: 0 auto;
}

.coluna {
    flex: 1;
    padding: 20px;
    border: 1px solid #ccc;
}

.coluna:first-child { text-align: justify; }
.coluna + .coluna { margin-left: 20px; }

.imagem-responsiva {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =====================================================
   TEMA ESCURO
   ===================================================== */
body.dark-theme { background-color: #333; color: #fff; }
body.dark-theme .container { color: #fff; }

/* =====================================================
   LINKS
   ===================================================== */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover  { color: var(--color-footer); }
a:active { color: var(--color-secondary); }

/* =====================================================
   BOTÕES (genéricos)
   ===================================================== */
.new-button {
    display: inline-block;
    margin-left: 10px;
    margin-top: 10px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    color: #fff;
    background-color: var(--color-secondary);
    border: none;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.2s;
    vertical-align: middle;
}

.new-button:hover { background-color: var(--color-primary); color: #fff; }

/* =====================================================
   CARROSSEL (legado — mantido para compatibilidade)
   ===================================================== */
.carousel {
    position: relative;
    width: 800px;
    height: 200px;
    overflow: hidden;
    margin: 0 auto;
}

.carousel img {
    width: 100%;
    height: auto;
    position: absolute;
    top: 0; left: 0;
    transition: transform 0.5s ease-in-out;
}

.carousel img.active   { left: 0; }
.carousel img.previous { left: 100%; }
.carousel img.next     { left: -100%; }

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
}

.carousel-slide {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-slide img {
    max-height: 300px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.carousel-title {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(170, 49, 49, 0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
}

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(170, 49, 49, 0.7);
    color: #fff;
    padding: 10px;
    border: none;
    cursor: pointer;
    z-index: 1;
    transition: background 0.2s;
}

.prev:hover, .next:hover { background-color: var(--color-primary); }
.prev { left: 0; }
.next { right: 0; }

/* =====================================================
   NOTÍCIAS (listagem)
   ===================================================== */
.news {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 20px;
}

.news-item {
    position: relative;
    width: calc(33.33% - 10px);
    margin-bottom: 20px;
    background-color: #fff;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.news-item img {
    width: 100%;
    height: auto;
    margin-bottom: 10px;
    border-radius: 4px;
}

.date-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--color-primary);
    padding: 5px 10px;
    border-radius: 5px;
}

.date-overlay p { margin: 0; font-size: 14px; color: #fff; }

.news-item h3 { margin-top: 0; font-size: 18px; }
.news-item p  { margin-bottom: 10px; font-size: 14px; }

/* =====================================================
   NOTÍCIA (detalhe)
   ===================================================== */
.news-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

.news-image {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 4px;
}

.news-text {
    font-size: 16px;
    line-height: 1.6;
    text-align: justify;
}

.news-buttons { margin-top: 20px; text-align: center; }

.news-buttons button {
    margin-right: 10px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    color: #fff;
    border: none;
    border-radius: 5px;
}

.print-button {
    background-color: var(--color-primary);
    transition: background 0.2s;
}

.print-button:hover { background-color: var(--color-dark); }

.whatsapp-button {
    background-color: var(--color-secondary);
    text-decoration: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
}

/* =====================================================
   LICITAÇÕES
   ===================================================== */
.licitacoes { width: 100%; margin: 0 auto; padding: 20px; }

.licitacao {
    margin-bottom: 20px;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 4px;
    transition: box-shadow 0.2s;
}

.licitacao:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.data    { font-size: 14px; color: #666; margin-bottom: 10px; }
.titulo  { font-size: 18px; margin-bottom: 10px; cursor: pointer; }
.icone   { margin-right: 10px; }
.descricao { font-size: 16px; display: none; margin-top: 10px; }

.licitacao-detalhe {
    margin-top: 20px;
    border-top: 1px solid #ccc;
    padding-top: 20px;
}

.licitacao-detalhe h2 { margin-bottom: 10px; }

.link-documento {
    display: block;
    text-decoration: none;
    color: #333;
    margin-bottom: 5px;
}

.link-documento i { margin-right: 5px; }

/* =====================================================
   FORMULÁRIOS
   ===================================================== */
.form-group { margin-bottom: 20px; }

.form-group label { display: block; font-weight: bold; }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-group textarea { height: 150px; }

.form-group input[type="submit"] {
    background-color: var(--color-secondary);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.form-group input[type="submit"]:hover { background-color: var(--color-primary); }

/* =====================================================
   E-SIC
   ===================================================== */
.esic-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 0;
    gap: 30px;
}

.esic-text-box {
    flex: 2;
    padding: 20px;
    background-color: #f4f4f4;
    border-radius: 10px;
    text-align: justify;
}

.esic-text-box h3 { margin: 0 0 6px; }
.esic-text-box h4 { margin: 0 0 14px; color: #555; }
.esic-text-box p  { margin-bottom: 12px; }

.esic-button-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.esic-button-box a {
    display: block;
    text-align: center;
    padding: 15px;
    background-color: var(--color-primary);
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    border-radius: 25px;
    transition: background 0.2s;
}

.esic-button-box a:hover {
    background-color: var(--color-dark);
    color: #fff;
}

/* =====================================================
   CONTEÚDO INSTITUCIONAL
   ===================================================== */
.texto-institucional { line-height: 1.8; }
.texto-institucional p { margin-bottom: 16px; text-align: justify; }

/* =====================================================
   FAQ
   ===================================================== */
.faq-list { margin-top: 16px; }

.faq-item {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.faq-item:last-child { border-bottom: none; }

.faq-item h3 {
    color: var(--color-primary);
    margin-bottom: 8px;
    font-size: 17px;
}

.faq-item p { margin: 0; color: #444; }

/* =====================================================
   ORGANOGRAMA / TABELAS
   ===================================================== */
.org-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 14px;
}

.org-table th,
.org-table td {
    border: 1px solid #ccc;
    padding: 8px 12px;
    text-align: left;
}

.org-table th {
    background-color: var(--color-primary);
    color: #fff;
}

.org-table tr:nth-child(even) td { background-color: #f5f5f5; }

/* =====================================================
   MAPA (index.php)
   ===================================================== */
.mapa-section { margin: 40px auto; }

.mapa-section h3 {
    text-align: center;
    color: var(--color-primary);
    margin-bottom: 16px;
    font-size: 20px;
}

.mapa-section p {
    text-align: center;
    color: #555;
    margin-bottom: 20px;
}

.mapa-frame {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.mapa-frame iframe {
    border: 0;
    display: block;
    width: 100%;
}

/* =====================================================
   RODAPÉ
   ===================================================== */
footer {
    background-color: var(--color-footer);
    color: #fff;
    padding: 20px;
    text-align: center;
}

.footer-columns {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

.footer-column { margin-right: 20px; }
.footer-column:last-child { margin-right: 0; text-align: left; }

.footer-logo { height: 80px; }

.footer-pos {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    background-color: var(--color-primary);
    padding: 8px;
}

.footer-pos-link { color: #fff; }
.footer-pos-link a { color: #fff; text-decoration: none; }
.footer-pos-link a:hover { color: rgba(255,255,255,0.8); }

/* =====================================================
   RESPONSIVO — NOTEBOOK
   ===================================================== */
@media (max-width: 1366px) {
    .logo-area img  { height: 72px; }
    .search-input   { min-width: 140px; }
    .search-btn     { padding: 0 10px; font-size: 12px; }
    .button         { padding: 0 8px; font-size: 12px; }
    nav ul li a     { padding: 8px; font-size: 12px; min-height: 40px; }
}

/* =====================================================
   RESPONSIVO — MOBILE
   ===================================================== */
@media (max-width: 768px) {
    .top-bar { flex-direction: column; text-align: center; }

    .accessibility-shortcuts,
    .contact-info,
    .social-icons { justify-content: center; }

    header { flex-direction: column; text-align: center; padding: 15px; }

    .logo-area img { height: 90px; }

    .header-right { width: 100%; justify-content: center; }

    .search-box { width: 100%; justify-content: center; }

    .search-input { width: 100%; max-width: 220px; min-width: unset; }

    nav ul {
        flex-direction: column;
        display: none;
    }

    nav ul.show { display: flex !important; }

    nav ul li { width: 100%; }

    nav ul li a {
        justify-content: flex-start;
        min-height: auto;
        padding: 14px;
        font-size: 14px;
    }

    .menu-icon {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        padding: 10px 0;
    }

    .news-item { width: 100%; }

    .esic-layout { flex-direction: column; align-items: center; }
    .esic-text-box  { width: 100%; }
    .esic-button-box { width: 100%; align-items: center; }
    .esic-button-box a { width: 100%; box-sizing: border-box; }
}

@media (min-width: 769px) {
    .menu-icon { display: none; }
}
