/* ==================================================
   VARIÁVEIS
================================================== */
:root {
    --primary: #2d7a64;
    --primary-light: rgba(45, 122, 100, 0.08);

    --bg: #ffffff;
    --card-bg: #ffffff;
    --search-bg: #f5f7f8;

    --text: #222222;
    --text-light: #666666;

    --border: #ededed;
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
    --bg: #121212;
    --card-bg: #1e1e1e;
    --search-bg: #2a2a2a;

    --text: #ffffff;
    --text-light: #aaaaaa;

    --border: #2c2c2c;
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* ==================================================
   RESET
================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: "Segoe UI", Roboto, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

/* ==================================================
   ANIMAÇÕES
================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================================================
   CONTROLE DE TELAS
================================================== */
.view {
    display: none;
    min-height: 100vh;
    padding-bottom: 90px;
    animation: fadeIn 0.25s ease;
}

.view.active {
    display: block;
}

/* ==================================================
   HEADER
================================================== */

header {
    position: sticky;
    top: 0;
    z-index: 50;
    transition: transform 0.3s ease;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 8px 10px; /* antes era 20px 16px */
    min-height: 90px;  /* antes era 150px */

    background: var(--bg);
    border-bottom: none;
}
.header-hidden {
    transform: translateY(-100%);
}
.logo-area {
    flex: 1;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.logo {
    width: 200px;
    max-width: 90%;
    height: auto;

    display: block;
    object-fit: contain;
}

.tagline {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    text-align: center;
    line-height: 1.2;
}

.logo-area-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
    padding: 25px 0;
}

/* ==================================================
   BOTÕES
================================================== */

.icon-btn,
.back-btn {
    display: flex;
    align-items: center;

    border: none;
    background: none;

    cursor: pointer;
}

.icon-btn {
    position: absolute;
    left: 20px;
    top: 35px;

    font-size: 28px;
    color: var(--primary);
}

.back-btn {
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

/* ==================================================
   BUSCA
================================================== */
.search-bar {
    display: flex;
    align-items: center;

    margin: 15px;
    padding: 12px 18px;

    background: var(--search-bg);
    border: 1px solid transparent;
    border-radius: 20px;
}

.search-bar i {
    font-size: 16px;
    color: var(--text-light);
}

.search-bar input {
    flex-grow: 1;

    margin-left: 12px;

    border: none;
    outline: none;
    background: none;

    font-size: 15px;
    color: var(--text);
}

/* ==================================================
   TÍTULOS DE SEÇÃO
================================================== */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 10px 15px 15px;

    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.section-title span {
    width: 3.5px;
    height: 16px;

    background: var(--primary);
    border-radius: 2px;
}

/* ==================================================
   CARDS DE NOTÍCIAS
================================================== */
.news-grid {
    padding: 0 15px;
}

.news-card {
    overflow: hidden;

    margin-bottom: 20px;

    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;

    box-shadow: var(--shadow);
}

.news-card img {
    width: 100%;
    height: 210px;

    display: block;
    object-fit: cover;
}

.card-body {
    padding: 16px;
}

.cat-tag {
    display: inline-block;

    margin-bottom: 10px;
    padding: 3px 8px;

    background: var(--primary);
    color: #fff;

    font-size: 9.5px;
    font-weight: bold;
    text-transform: uppercase;

    border-radius: 4px;
}

.news-card h3 {
    margin-bottom: 8px;

    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.news-card p {
    margin-bottom: 12px;

    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-light);
}

.card-footer {
    display: flex;
    justify-content: space-between;

    padding-top: 12px;

    font-size: 11px;
    color: var(--text-light);

    border-top: 1px solid var(--border);
}

/* ==================================================
   ESTADO VAZIO DA BUSCA
================================================== */
.search-empty-state {
    padding: 50px 20px;
    text-align: center;
    color: var(--text-light);
}

.search-empty-state i {
    margin-bottom: 15px;

    font-size: 45px;
    color: var(--primary);

    opacity: 0.8;
}

.search-empty-state h3 {
    margin-bottom: 5px;

    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.search-empty-state p {
    font-size: 14px;
}

/* ==================================================
   CATEGORIAS
================================================== */
.categories-list {
    padding: 0 15px;
}

.cat-item {
    display: flex;
    align-items: center;

    margin-bottom: 14px;
    padding: 16px;

    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;

    box-shadow: var(--shadow);
    cursor: pointer;
}

.cat-icon {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-right: 15px;
    flex-shrink: 0;

    background: var(--primary-light);
    border-radius: 10px;

    color: var(--primary);
    font-size: 20px;
}

.cat-info {
    flex-grow: 1;
    padding-right: 8px;
}

.cat-info h3 {
    margin-bottom: 3px;

    font-size: 15.5px;
    font-weight: 700;
}

.cat-info p {
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text-light);
}

.arrow {
    color: var(--primary);
    font-size: 13px;
    opacity: 0.6;
}

/* ==================================================
   CONFIGURAÇÕES
================================================== */
.settings-container,
.about-container {
    padding: 20px 15px;
}

.settings-container h2,
.about-container h2 {
    margin-bottom: 4px;

    font-size: 22px;
    font-weight: 700;
}

.settings-subtitle {
    margin-bottom: 22px;

    font-size: 13.5px;
    color: var(--text-light);
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 16px;

    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;

    box-shadow: var(--shadow);
    cursor: pointer;

    transition: all 0.2s ease;
}

.setting-card-left {
    display: flex;
    align-items: center;
    gap: 14px;

    font-size: 15.5px;
    font-weight: 600;
}

.sun-icon {
    color: #ffb703;
}

.moon-icon {
    color: #9bb1ff;
}

.check-icon {
    color: var(--primary);
    opacity: 0;
    transform: scale(0.6);

    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.setting-card.active {
    background: var(--primary-light);
    border-color: var(--primary);
}

.setting-card.active .check-icon {
    opacity: 1;
    transform: scale(1);
}

.about-container p {
    margin-top: 12px;

    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-light);
}

/* ==================================================
   NAVEGAÇÃO INFERIOR
================================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;

    width: 100%;
    height: 76px;

    display: flex;
    justify-content: space-around;
    align-items: center;

    background: var(--card-bg);
    border-top: 1px solid var(--border);

    z-index: 100;
}

.bottom-nav button {
    width: 22%;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;

    background: none;
    border: none;

    color: #a2a2a2;
    font-size: 11px;
    font-weight: 500;

    cursor: pointer;
}

.bottom-nav button.active {
    color: var(--primary);
    font-weight: 600;
}

.bottom-nav i {
    font-size: 20px;
}

/* ==================================================
   MENU LATERAL
================================================== */
.side-menu {
    position: fixed;
    top: 0;
    left: -280px;

    width: 280px;
    height: 100%;

    padding: 20px;

    background: var(--card-bg);
    box-shadow: var(--shadow);

    z-index: 200;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-menu.active {
    left: 0;
}

.menu-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.menu-header button {
    border: none;
    background: none;

    font-size: 22px;
    color: var(--text-light);

    cursor: pointer;
}

.menu-content {
    display: flex;
    flex-direction: column;
}

.menu-nav-btn {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 8px;

    border: none;
    border-radius: 8px;
    background: none;

    text-align: left;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text);

    cursor: pointer;
}

.menu-nav-btn:active {
    background: var(--search-bg);
}

/* ==================================================
   OVERLAY
================================================== */
#overlay {
    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    display: none;

    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(1px);

    z-index: 150;
}

.sub-header {
    min-height: auto !important;
    padding: 10px 15px !important;
}
.category-link {
    cursor: pointer;
    white-space: nowrap;
    background: none !important;
    width: auto !important;
    height: auto !important;
}

.category-link:hover{
    color: var(--primary);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-link:hover,
.category-link:active {
    color: var(--primary);
}

.settings-group{
    margin-top:20px;
}

.group-title{
    font-size:13px;
    font-weight:700;
    color:var(--primary);
    margin-bottom:10px;
}

.settings-card-large{
    background:var(--card-bg);
    border:1px solid var(--border);
    border-radius:18px;
    overflow:hidden;
    box-shadow:var(--shadow);
}

.settings-row{
    padding:18px;
}

.settings-row p{
    margin-top:4px;
    color:var(--text-light);
    font-size:13px;
}

.theme-switch{
    display:flex;
    margin-top:15px;
    border:1px solid var(--border);
    border-radius:12px;
    overflow:hidden;
}

.theme-btn{
    flex:1;
    padding:12px;
    border:none;
    background:transparent;
    color:var(--text);
    font-weight:600;
    transition:.25s;
}

.theme-btn.active{
    background:var(--primary);
    color:white;
}

.settings-option{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:18px;
    border-bottom:1px solid var(--border);
}

.settings-option:last-child{
    border-bottom:none;
}

.settings-option p{
    font-size:13px;
    color:var(--text-light);
    margin-top:4px;
}

.login-container{
    max-width:500px;
    margin:auto;
    padding:20px;
}

.back-btn{
    display:inline-flex;
    align-items:center;
    gap:10px;

    text-decoration:none;
    color:var(--primary);

    font-weight:600;
    margin-bottom:20px;
}

.login-logo{
    text-align:center;
    margin-bottom:25px;
}

.login-header{
    text-align:center;
    margin-bottom:25px;
}

.login-icon{
    width:80px;
    height:80px;

    margin:auto;
    margin-bottom:15px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:50%;

    background:rgba(46,125,102,.1);
    color:var(--primary);

    font-size:32px;
}

.login-card{
    background:var(--card-bg);

    border:1px solid var(--border);

    border-radius:20px;

    padding:20px;

    box-shadow:var(--shadow);
}

.login-card label{
    display:block;
    margin:15px 0 8px;
    font-weight:600;
}

.input-group{
    display:flex;
    align-items:center;
    gap:12px;

    padding:15px;

    border:1px solid var(--border);
    border-radius:12px;
}

.input-group input{
    flex:1;

    border:none;
    outline:none;

    background:none;

    color:var(--text);
}

.login-btn{
    width:100%;

    margin-top:20px;
    padding:15px;

    border:none;
    border-radius:12px;

    background:var(--primary);
    color:white;

    font-size:16px;
    font-weight:700;
}

.security-box{
    display:flex;
    gap:15px;

    margin-top:25px;
}

.security-box i{
    color:var(--primary);
    font-size:24px;
}

.news-full img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.news-full-content {
    padding: 16px;
}

.news-full-content h1 {
    font-size: 20px;
    margin: 10px 0;
}

.news-full-content p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dark);
}

.meta {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 10px;
}

/* ========== PADRÃO MOBILE (bottom-nav visível, header desktop escondido) ========== */
.desktop-header {
  display: none;   /* escondido no mobile */
}


.bottom-nav {
  display: flex;   /* visível no mobile */
}

.view {
  padding-top: 16px;  /* espaço pequeno, sem header fixo */
}

/* ========== DESKTOP (≥1024px) ========== */
@media screen and (min-width: 1024px) {

/* Esconde o header antigo da home no desktop */
.main-header {
  display: none;
}
  /* Esconde a bottom-nav no desktop */
  .bottom-nav {
    display: none;
  }

  /* Mostra o cabeçalho desktop */
  .desktop-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow);
  }

  .menu-hamburger, .search-icon {
    background: none;
    border: none;
    font-size: 26px;
    color: var(--primary);
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    transition: background 0.2s;
  }

  .menu-hamburger:hover, .search-icon:hover {
    background: var(--search-bg);
  }

  .desktop-logo img {
    height: 48px;
    width: auto;
  }

  /* Menu lateral (já existe no CSS, mas garantimos que apareça) */
  .side-menu {
    display: flex;   /* mostrar no desktop */
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    background: var(--card-bg);
    z-index: 1100;
    transition: left 0.3s;
    padding: 24px;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
  }

  .side-menu.active {
    left: 0;
  }

  #overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
    display: none;
  }

  #overlay.active {
    display: block;
  }

  /* Ajuste do conteúdo para não ficar atrás do header fixo */
  .view {
    padding-top: 90px;
  }

  /* Demais estilos desktop (cards horizontais) que você já tem continuam */
}
.noticia-subtitulo {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-light);
    margin: 8px 0 12px 0;
    line-height: 1.4;
}