@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');
* 
{
    margin: 0;
    border: 0;
    padding: 0;
    font-family: var(--fonte-padrao);
}

body {
    background: #f5f6fa;
    color: #222;
}

/* Topbar */
.topbar {
    background: white;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.topbar .logo {
    font-size: 20px;
    font-weight: 700;
    color: #ff6600;
}

.topbar nav a {
    margin-left: 24px;
    color: #444;
    text-decoration: none;
    font-weight: 500;
}

/* Layout */
.layout {
    display: flex;
    padding: 20px 40px;
    gap: 32px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: #152f4d;
    padding: 35px;
    border-radius: 12px;
    height: fit-content;
    border: 1px solid #ddd;
}

.sidebar h2 {
    margin-bottom: 12px;
}

/* Accordion */
/* Botão accordion com seta à direita */
.accordion {
  text-align: left;
  font-size: 1.1rem;
  font-weight: 700;
  width: 240px;
  min-width: 240px;
  background-color: #152f4d;
  color: white;
  padding: 4px 16px;
  margin-top: 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.accordion:hover {
  color: #dbcd03;
}


.accordion.sub {
  color: white;
  display: flex;
  justify-content: space-between; /* texto à esquerda, seta à direita */
  align-items: center;
  padding: 10px 14px;
  font-size: 1rem;
  font-weight: 600;
  background-color: #152f4d;
  border-left: 4px solid #4a90e2;
  border-radius: 4px;
  margin: 6px 0 0 12px;
  cursor: pointer;
}

.accordion.sub .arrow {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 1rem;
}

.accordion.sub.active .arrow {
  transform: rotate(90deg); /* gira quando ativo */
}

.arrow::before {
  margin-left: auto;
  content: "▾"; /* seta para baixo */
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 24px;
  color: #666;
  margin-left: 8px;
}

.accordion.active .arrow::before {
  transform: rotate(180deg); /* vira para cima */
}

/* Painel colapsável com transição suave */
.panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
  margin-left: 0px;
  padding: 0; /* padding será aplicado quando aberto via conteúdo */
}

.panel.open {
  /* um valor grande para permitir crescer conforme o conteúdo */
  max-height: 400px;
  overflow-y: auto;
}


.panel label {
  display: block;
  margin: 8px;
  font-size: 14px;
}


.sidebar-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.clear-btn {
    background: #eee;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
}

.filter-btn {
    background: #7b4cff;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
}

/* Content */
.content h1 {
    margin-bottom: 16px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch; /* força altura igual */
}

/* Ajuste geral dos cards */
.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* distribui topo e rodapé */
  min-height: 290px;
  max-height: 290px;
  background: white;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid #ddd;
  box-shadow: 0 4px 8px rgba(0,0,0,0.04);

}
.card .button-row:first-of-type{
  margin-top: auto;

}
.button-row {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;       /* duas colunas iguais */
  gap: 12px;
  padding-top: 12px;
}

.visit-btn {
  /* remove flex: 1 e min/max-width */
  width: 100%;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.card .visit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}


/* Se tiver dois botões, controla o espaçamento */
.card .visit-btn + .visit-btn {
  margin-left: 8px;           /* espaçamento fixo entre eles */
}


/* Título e descrição menores */
.card h3 {
  font-size: 18px;
  line-height: 1.3;
  margin: 8px 0;
}

.card p {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 6;    /* máximo de 6 linhas */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Container das tags */
.tags {
  display: flex;
  flex-wrap: wrap;          /* quebra em várias linhas */
  gap: 6px;                 /* espaço menor entre elas *      /* controla altura total */   /* esconde excesso */
}

/* Tags mais leves e compactas */
.tags span {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eee;         /* cor neutra */
  color: #555;              /* texto discreto */         /* limite de largura */
  text-overflow: ellipsis;  /* adiciona "..." se passar do limite */
  white-space: nowrap;      /* mantém em uma linha */
}

.visit-btn {
  display: inline-block;
  margin-bottom: auto;
  padding: 8px 16px;
  background: linear-gradient(135deg, #152f4d, #4b76a7);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}
.visit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-input {
  display: none; /* esconde o checkbox */
}

.toggle-label {
  width: 50px;
  height: 26px;
  background: #ccc;
  border-radius: 50px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-ball {
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
}

.toggle-input:checked + .toggle-label {
  background: #7b4cff; /* cor quando ativo */
}

.toggle-input:checked + .toggle-label .toggle-ball {
  transform: translateX(24px); /* move a bolinha para a direita */
}

#toggle-text {
  font-size: 18px;
  font-weight: 500;
  color: white;
}
.panel.sub-panel label {
  display: block;
  font-size: 0.9rem;
  color: white;
  padding: 6px 20px;
  margin: 2px 0;
  border-bottom: 1px solid #eee;
}

.panel.sub-panel input[type="checkbox"] {
  margin-right: 8px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.pagination button {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #7b4cff, #5a2dff);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}

.pagination button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  background: linear-gradient(135deg, #5a2dff, #7b4cff);
}

.pagination button:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  box-shadow: none;
}

.tool-icon {
  width: 20px;   /* ou 24px se quiser maior */
  height: 20px;
  margin-right: 6px;
  vertical-align: middle;
}
.search-bar {
  margin: 20px 0;
  text-align: right;
  padding-right: 8px;
}

#searchInput {
  width: 300px;
  padding: 8px;
  padding-left: 18px;  /* joga o texto mais pra esquerda */
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 20px;
  outline: none;
}
.card-header {
  display: flex;
  justify-content: space-between; /* nome à esquerda, estrela à direita */
  align-items: center;
}

.editor-star {
  font-size: 18px;
  color: rgb(255, 179, 0); /* deixa dourada */
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 700;
}

/* ====================== RESPONSIVO + DRAWER ====================== */

/* Grid inteligente (funciona em todas as telas) */
.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* Botão Filtros (só aparece no mobile) */
.mobile-filters-btn {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: #1b0261;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 10px 0 20px;
  cursor: pointer;
}

/* ==================== MOBILE DRAWER ==================== */
@media (max-width: 900px) {
  .layout {
    flex-direction: column;
    padding: 15px;
    gap: 16px;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    width: 85%;
    max-width: 340px;
    height: 100vh;
    z-index: 2000;
    transition: left 0.4s ease;
    border-radius: 0 12px 12px 0;
    box-shadow: 8px 0 30px rgba(0,0,0,0.25);
    overflow-y: auto;
  }

  .sidebar.open {
    left: 0;
  }

  /* Overlay escuro */
  .filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 1999;
  }
  
  .filter-overlay.show {
    display: block;
  }

  .mobile-filters-btn {
    display: flex;
  }

  /* Cards mais confortáveis */
  .card {
    min-height: auto;
    max-height: none;
    padding: 18px;
  }

  .card p {
    -webkit-line-clamp: 5;
    font-size: 14px;
  }

  .button-row {
    flex-direction: column;
    gap: 10px;
    justify-content: stretch;
  }

  .visit-btn {
    padding: 14px;
    font-size: 15px;
  }

  .sidebar-buttons {
    flex-direction: column;
    gap: 12px;
  }
  
  .sidebar-buttons button {
    width: 100%;
    padding: 14px;
    font-size: 15.5px;
  }

  /* Accordions maiores e mais fáceis de tocar */
  .accordion {
    font-size: 1.05rem;
    padding: 14px 16px;
    width: 100%;
  }

  .panel label {
    font-size: 15px;
    padding: 10px 8px;
  }
}

/* Celulares bem pequenos */
@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
/* Força sidebar a caber na tela + scroll interno bom */
@media (max-width: 900px) {
  .sidebar {
    padding-bottom: 100px;
    height: 100dvh;                   /* dynamic viewport height — ignora barras do navegador */
    max-height: 100dvh;
    padding: 50px 15px calc(70px + env(safe-area-inset-bottom));
    box-sizing: border-box;
  }

  .sidebar > h2 {
    margin: 0 0 15px 0;
  }

  .toggle-container {
    margin: 10px 0 20px;
  }

  .filters-container {
    margin-bottom: 80px;              /* ← REDUZIDO DRASTICAMENTE (era 100px+) */
    padding-bottom: 20px;
  }

  /* Botões fixos no fundo – agora mais "colados" e visíveis */
  .sidebar-buttons {
    position: relative;
    margin: 60px 0 40px 0;           /* sobe bastante + espaço embaixo */
    padding: 16px 15px;
  }
  .sidebar-buttons button {
    padding: 12px 16px;
    font-size: 1.0rem;
    min-height: 48px;
  }

  /* Se tiver muitos filtros, permite scroll, mas prioriza botões visíveis */
  .sidebar {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));  /* + espaço extra pros botões não sumirem atrás da barra do sistema */
    padding-top: 50px;
  }
}