/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: #f4f5f7;
    color: #1a2b4a;
}

/* =============================================
   SEÇÃO PRINCIPAL (capa + formulários)
   ============================================= */
.main-section {
    max-width: 1200px;
    margin: 48px auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 64px;
    align-items: start;
}

/* --- coluna esquerda: capa --- */
.capa-col {}

.capa-wrapper {
    position: relative;
    display: inline-block;
}

.badge-ultima {
    position: absolute;
    top: -14px;
    right: -14px;
    background: #e8a000;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 20px;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(232,160,0,.35);
}

.capa-img-container {
    width: 280px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(26,43,74,.18);
    background: #e2e6ed;
}

#link-capa-pdf {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
}

.capa-img-container img#imagemCapa {
    width: 100%;
    display: block;
    min-height: 360px;
    object-fit: cover;
}

.capa-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(26, 43, 74, 0.72);
    color: #fff;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .04em;
    opacity: 0;
    transition: opacity .5s;
    text-align: center;
}

#link-capa-pdf:hover .capa-overlay {
    opacity: 1;
    transition: opacity .5s;
}

.capa-info {
    margin-top: 20px;
}

.capa-info h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a2b4a;
    margin-bottom: 4px;
}

.capa-info .edicao-meta {
    font-size: 13px;
    color: #6b7a99;
    margin-bottom: 14px;
}

.capa-downloads {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid #c9d0db;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #1a2b4a;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .2s, background .2s;
}
.btn-download:hover { border-color: #1a2b4a; background: #f4f5f7; }

/* --- coluna direita: formulários --- */
.forms-col {}

.forms-col h2 {
    font-size: 32px;
    font-weight: 800;
    color: #1a2b4a;
    line-height: 1.2;
    margin-bottom: 12px;
}

.forms-col h2 em {
    font-style: italic;
    font-weight: 800;
}

.forms-col .subtitle {
    font-size: 15px;
    color: #6b7a99;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* tabs */
.search-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background: #e8edf5;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 28px;
}

.search-tab {
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7a99;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s, color .2s;
    text-align: center;
}

.search-tab.active {
    background: #fff;
    color: #1a2b4a;
    box-shadow: 0 1px 4px rgba(26,43,74,.12);
    font-weight: 700;
}

/* painéis */
.search-panel { display: none; }
.search-panel.active { display: block; }

.field-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6b7a99;
    margin-bottom: 6px;
    display: block;
}

.field-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #c9d0db;
    border-radius: 8px;
    font-size: 15px;
    color: #1a2b4a;
    background: #fff;
    margin-bottom: 16px;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.field-input { font-weight: 500; }
.field-input:focus { border-color: #1a2b4a; box-shadow: 0 0 0 3px rgba(26,43,74,.08); }
.field-input::placeholder { color: #a8b8d8; font-weight: 400; }

.fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-buscar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #1a2b4a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 15px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: background .2s;
    text-decoration: none;
}
.btn-buscar:hover { background: #243d6a; }

/* =============================================
   SEÇÃO — Acesse por tipo
   ============================================= */
.tipos-section {
    background: #fff;
    border-top: 1px solid #e2e6ed;
    padding: 48px 0 56px;
    margin-top: 16px;
}

.tipos-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.tipos-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 32px;
}

.tipos-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: #1a2b4a;
}

.tipos-header h2 em { font-style: italic; font-weight: 700; }

.ver-todas {
    font-size: 14px;
    color: #1a2b4a;
    font-weight: 600;
    text-decoration: none;
}
.ver-todas:hover { text-decoration: underline; }

.tipos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.tipo-card {
    background: #fff;
    border: 1.5px solid #e2e6ed;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, border-color .2s;
}
.tipo-card:hover { box-shadow: 0 6px 24px rgba(26,43,74,.10); border-color: #c9d0db; }

.tipo-card-thumb {
    background: #f4f5f7;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tipo-card-thumb img {
    max-height: 140px;
    object-fit: contain;
}

.tipo-capa-img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
}

.tipo-capa-loading {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #e8eaf0 25%, #f4f5f7 50%, #e8eaf0 75%);
    background-size: 200% 100%;
    animation: tipo-shimmer 1.4s infinite;
}

@keyframes tipo-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.tipo-card-body {
    padding: 18px 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tipo-poder {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.tipo-poder.executivo  { color: #c8860a; }
.tipo-poder.legislativo { color: #5b3fa0; }
.tipo-poder.judiciario  { color: #b83232; }
.tipo-poder.municipios  { color: #1a7a5a; }

.tipo-card-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a2b4a;
    margin-bottom: 4px;
}

.tipo-edicao-meta {
    font-size: 12px;
    color: #6b7a99;
    margin-bottom: 4px;
}

.tipo-paginas-meta {
    font-size: 12px;
    color: #6b7a99;
    margin-bottom: 18px;
}

.tipo-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.btn-acessar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a2b4a;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
}
.btn-acessar:hover { background: #243d6a; }

.btn-pdf-card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid #c9d0db;
    border-radius: 7px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #1a2b4a;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .2s;
}
.btn-pdf-card:hover { border-color: #1a2b4a; }

.btn-html-card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid #c9d0db;
    border-radius: 7px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #1a2b4a;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .2s;
}
.btn-html-card:hover { border-color: #1a2b4a; }

/* =============================================
   NOTICIAS
   ============================================= */
.noticias-section {
    max-width: 1200px;
    margin: 0 auto 48px;
    padding: 40px 32px 0;
}

.noticias-section h2 {
    font-size: 24px;
    font-weight: 800;
    color: #1a2b4a;
    margin-bottom: 20px;
}

.noticias-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.noticia-card {
    background: #fff;
    border: 1.5px solid #e2e6ed;
    border-radius: 10px;
    padding: 18px;
}

.noticia-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1a2b4a;
    margin-bottom: 8px;
    line-height: 1.4;
}

.noticia-card h3 a { color: inherit; text-decoration: none; }
.noticia-card h3 a:hover { color: #243d6a; text-decoration: underline; }

.noticia-card p {
    font-size: 13px;
    color: #6b7a99;
    line-height: 1.6;
}

.mais-noticias {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1a2b4a;
    text-decoration: none;
    margin-top: 20px;
}
.mais-noticias:hover { text-decoration: underline; }

/* =============================================
   UTILITÁRIOS
   ============================================= */
.help-inline { color: red; padding: 3px; }

/* Neutraliza estilos legados do style.css que desalinham os botões da home */
#sbmt1       { margin-left: 0 !important; }
#smbt2       { float: none !important; margin-left: 0 !important; margin-top: 0 !important; }
#input2      { width: 100% !important; }

/* =============================================
   RESPONSIVE — TABLET
   ============================================= */
@media (max-width: 900px) {
    .main-section { grid-template-columns: 1fr; gap: 32px; }
    .tipos-grid { grid-template-columns: repeat(2, 1fr); }
    .noticias-grid { grid-template-columns: 1fr; }
}

/* =============================================
   RESPONSIVE — MOBILE
   ============================================= */
@media (max-width: 600px) {
    .main-section {
        padding: 0 16px;
        margin: 24px auto;
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .capa-col { display: flex; flex-direction: column; align-items: center; }
    .capa-wrapper { display: flex; justify-content: center; width: 100%; }
    .capa-img-container { width: 100%; max-width: 340px; }
    .capa-info { width: 100%; max-width: 340px; text-align: center; }
    .capa-downloads { justify-content: center; }

    .forms-col h2 { font-size: 26px; text-align: center; }
    .forms-col .subtitle { text-align: center; font-size: 14px; }

    .search-tabs {
        display: flex;
        flex-direction: row;
        gap: 0;
        border-radius: 10px;
        overflow: hidden;
    }
    .search-tab { font-size: 12px; padding: 9px 6px; }

    .fields-row { grid-template-columns: 1fr 1fr; gap: 8px; }

    .tipos-inner { padding: 0 16px; }
    .tipos-section { padding: 32px 0 40px; }
    .tipos-header { flex-direction: column; gap: 8px; align-items: flex-start; }
    .tipos-header h2 { font-size: 22px; }

    .tipos-grid { grid-template-columns: 1fr; gap: 16px; }
    .tipo-card { flex-direction: column; }
    .tipo-card-thumb { width: 100%; height: 180px; }
    .tipo-card-body { padding: 16px 18px 20px; }

    .noticias-section { padding: 24px 16px 0; }
    .noticias-section h2 { font-size: 20px; }
}
