/*
 Theme Name:   Astra Pançudinhus
 Theme URI:    https://pancudinhus.com
 Description:  Tema filho do Astra para o projeto Pançudinhus
 Author:       Manuel Antonio
 Author URI:   https://pancudinhus.com
 Template:     astra
 Version:      1.0.0

 OBS: Fontes (Google Fonts) foram movidas para wp_enqueue no functions.php
 (remova o @import do arquivo para melhorar performance).
*/

/* ============================
   00 - Reset / Notas importantes
   Linha explicativa: anotações gerais e recomendações.
   ================================================================== */
/* Recomendo manter este arquivo limpo; fonts carregadas via functions.php */

/* ============================
   01 - Tipografia e cores base
   Linha explicativa: define fontes, cores e estilos globais.
   ================================================================== */
body { /* corpo geral */
  font-family: 'Nunito', sans-serif; /* carregada via functions.php */
  background-color: #FFF8EE;
  color: #2E2E2E;
  line-height: 1.7;
  letter-spacing: 0.3px;
}

/* Títulos principais e post titles */
h1, h2, h3, .post-title {
  font-family: 'Baloo 2', cursive; /* display font */
  color: #2E2E2E;
}

/* Links padrão */
a { 
  color: #7B1E1E; /* vinho clássico */
  transition: color 0.2s ease-in-out;
}
a:hover { 
  color: #A32A2A; /* vinho mais claro no hover */
}

/* ============================
   02 - Componentes (cards, botões, tags)
   Linha explicativa: estilos reutilizáveis para pequenos componentes.
   ================================================================== */
.card { /* uso genérico */
  background: #FFF4E0;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.search-button { /* botão de busca estilizado */
  background-color: #FFC94B;
  border-radius: 30px;
  color: #2E2E2E;
  transition: background 0.2s ease, transform 0.15s ease;
}
.search-button:hover { background-color: #B6E2D3; }

.tag { /* badges de categoria */
  background-color: #FF6F61;
  color: #fff;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.8em;
}

/* ============================
   03 - Menu principal / navbar
   Linha explicativa: barra de topo, links e estados (hover / ativo).
   ================================================================== */
.navbar, .main-header, .site-header {
  background-color: #FFD875; /* fundo do header */
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 10px 0;
}

/* Links do menu — fonte Baloo para personalidade */
.navbar a, .main-header a, .site-header a, .menu a {
  font-family: 'Baloo 2', cursive;
  font-size: 1.125rem;
  font-weight: 600;
  color: #4A2E05;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border-radius: 12px;
}

/* hover e ativo do menu */
.navbar a:hover, .main-header a:hover, .site-header a:hover, .menu a:hover {
  background-color: #FFA860;
  color: #fff;
}
.navbar a.active, .menu a.current-menu-item {
  background-color: #FFB45C;
  color: #fff;
}

/* espaçamento entre itens do menu (flex) */
.navbar ul, .menu ul {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ============================
   04 - Fundo com padrão "patinhas" do conteúdo
   Linha explicativa: padrão repetido aplicado apenas ao conteúdo principal.
   ================================================================== */
body.blog #content,
body.single-post #content,
body.archive #content,
body.search #content,
#content,
.site-content,
.ast-container,
.site-main {
  background-color: #efd6c2 !important; /* base do padrão */
  background-image: url("data:image/svg+xml,%3Csvg width='90' height='90' viewBox='0 0 90 90' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23d8b59c' fill-opacity='0.25'%3E%3Cpath d='M37 32c-3 2-6 4-7 8-1 3 0 7 3 8 3 2 7 0 8-3 2-3 1-7-2-10-2-2-4-3-6-3zm3 17c-2 2-3 4-3 7 0 3 2 6 5 6 3 1 6-2 6-5 1-3-1-7-4-8-2-1-4-1-4 0z'/%3E%3Ccircle cx='20' cy='30' r='6'/%3E%3Ccircle cx='55' cy='28' r='6'/%3E%3Ccircle cx='28' cy='55' r='7'/%3E%3Ccircle cx='60' cy='50' r='6'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-attachment: fixed;
}

/* ============================
   05 - Garantias do cabeçalho (sem padrão)
   Linha explicativa: impede que o padrão apareça dentro do header.
   ================================================================== */
header#masthead * {
  background-image: none !important;
  background-color: transparent !important;
}
header#masthead,
.main-header-bar,
.ast-above-header-wrap,
.ast-below-header-wrap {
  background: #F6BC57 !important;
  background-image: none !important;
}

/* ============================
   06 - Espaçamento entre header e conteúdo
   Linha explicativa: remove margens extras herdadas do tema pai.
   ================================================================== */
.site-content, .ast-container {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* ============================
   07 - Grid e layout dos cards do blog
   Linha explicativa: sistema flex responsivo (4→3→2→1) com cards independentes.
   ================================================================== */
body.blog .ast-row,
body.archive .ast-row,
body.search .ast-row {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  padding-left: 10%;
  padding-right: 10%;
  justify-content: flex-start;
  align-items: flex-start;
}
/* .comment-form .ast-row { display: block !important; }   */

.ast-separate-container .ast-article-post {
  width: auto !important;
}
/* === Cards (flex column e altura automática) === */
.ast-article-post {
  flex: 1 1 30%; width: 30%; max-width: 30%;
  background: transparent !important; margin: 0 !important; padding: 0 !important;
  box-shadow: none !important; opacity: 0; animation: fadeSlideUpShadow 0.6s ease forwards;
}
@media (min-width: 1440px) {  /* === Telas grandes – 4 colunas === */
  body.blog .ast-article-post, body.archive .ast-article-post, body.search .ast-article-post {
    flex: 1 1 22% !important; width: 22% !important; max-width: 22% !important;
  }
  body.blog .ast-row, body.archive .ast-row, body.search .ast-row {
    gap: 40px !important; padding-left: 8%; padding-right: 8%;
  }
}
@media (max-width: 1024px) {  /* === Tablets – 2 colunas === */
  .ast-row { gap: 30px !important; justify-content: flex-start; padding: 0 5%; }
  .ast-article-post { flex: 1 1 calc(50% - 15px); width: calc(50% - 15px); max-width: calc(50% - 15px); margin-bottom: 20px; }
}
@media (max-width: 600px) {   /* === Celulares – 1 coluna === */
  .ast-row { gap: 20px !important; justify-content: center; padding: 0 5%; }
  .ast-article-post { flex: 1 1 100%; width: 100%; max-width: 100%; }
}

/* ============================
   08 - Layout responsivo dos cards
   Linha explicativa: pontos de interrupção para reflow do grid.
   ================================================================== */

.ast-article-inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: #fff8e7;
  border-radius: 20px;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  margin: 0 !important;
  padding: 1.6em;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* Botões "leia mais" ficam no final do card */
.ast-article-inner .ast-post-format { margin-top: auto; }

/* Hover dos cards */
.ast-article-inner:hover {
  transform: translateY(-5px);
  box-shadow:
    0 6px 12px rgba(0,0,0,0.08),
    0 12px 24px rgba(0,0,0,0.12);
}

/* Transição suave entre cards */
.ast-row article { transition: all 0.25s ease; }

/* Animação de entrada */
@keyframes fadeSlideUpShadow {
  0% {
    opacity: 0;
    transform: translateY(20px);
    box-shadow: 0 0 0 rgba(0,0,0,0), 0 0 0 rgba(0,0,0,0);
  }
  70% {
    opacity: 1;
    transform: translateY(-5px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 4px 8px rgba(0,0,0,0.08);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 3px 6px rgba(0,0,0,0.08);
  }
}

/* Delay cascata para os primeiros 6 cards (ajustável) */
.ast-article-post:nth-child(1) { animation-delay: 0s; }
.ast-article-post:nth-child(2) { animation-delay: 0.1s; }
.ast-article-post:nth-child(3) { animation-delay: 0.2s; }
.ast-article-post:nth-child(4) { animation-delay: 0.3s; }
.ast-article-post:nth-child(5) { animation-delay: 0.4s; }
.ast-article-post:nth-child(6) { animation-delay: 0.5s; }

/* ============================
   09 - Busca personalizada (posição e aparência)
   Linha explicativa: caixa de busca flutuante adicionada via functions.php.
   ================================================================== */
.pancudinhus-busca {
  position: absolute;
  right: 30px;
  top: 105px;
  z-index: 99;
}
@media (max-width: 1024px) { .pancudinhus-busca { top: 122px; } }
@media (max-width: 600px)  { .pancudinhus-busca { top: 122px; } }

.pancudinhus-busca form {
  display: flex;
  align-items: center;
  background: #f2f2f2;
  border-radius: 40px;
  border: 2px solid #f7b04d;
  padding: 5px 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.pancudinhus-busca input[type="search"] {
  border: none; outline: none; background: transparent;
  font-size: 1rem; color: #4b3b28; padding: 4px 10px; width: 180px;
}
.pancudinhus-busca input[type="search"]::placeholder { color: #b89570; }
.pancudinhus-busca button:hover { transform: scale(1.07); opacity: 0.9; }

/* Esconde texto do botão mantendo função (alinhamento/ícone via HTML) */
.pancudinhus-busca input[type="submit"],
.pancudinhus-busca button[type="submit"] {
  color: transparent !important; background: none !important; border: none !important;
  width: 0 !important; height: 0 !important; padding: 0 !important; margin: 0 !important;
  overflow: hidden !important; position: absolute !important;
}

/* Oculta a busca duplicada na tela "Nenhum resultado" */
.search-no-results .page-content .search-form { display: none !important; }

/* ============================
   10 - Comentários (espaçamentos)
   Linha explicativa: ajustes finos para o formulário de comentários.
   ================================================================== */
#commentform p, .comment-form p {
  margin-top: 0;
  margin-bottom: 0; /* reduz espaçamento vertical */
}
#commentform .comment-form-comment, .comment-form .comment-form-comment {
  margin-top: 0;
  margin-bottom: 0;
}
#commentform .comment-form-cookies-consent, .comment-form .comment-form-cookies-consent {
  margin-top: 10px;
  margin-bottom: 10px;
}

/* ============================
   11 - Arquivos / busca: remover cabeçalhos duplicados
   Linha explicativa: escondemos cabeçalhos padrão para usar o título próprio.
   ================================================================== */
/* Oculta cabeçalhos de arquivo e busca nativos (substituídos via PHP) */
body.archive .site-content .ast-archive-description,
body.search-results header.page-header,
body.archive header.page-header {
  display: none !important;
}

/* Reduz/zera containers para evitar espaço duplicado */
body.search .site-content,
body.search-results .site-content,
body.archive .site-content,
body.search #primary.content-area,
body.search-results #primary.content-area,
body.archive #primary.content-area {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Esconde visualmente o container header das páginas de arquivo (se necessário) */
body.archive header.page-header {
  margin: 0 !important; padding: 0 !important; border: none !important;
  background: transparent !important; height: 0 !important; overflow: hidden; visibility: hidden;
}
body.archive header.page-header .ast-archive-title { display: none !important; }

/* Espaço adicional para breadcrumbs em arquivos */
body.archive .main-header-bar-breadcrumb { margin-bottom: 40px !important; }

/* Nosso título simples adicionado via PHP (controla o espaçamento) */
.pancudinhus-titulo-busca {
  padding-top: 20px !important; margin-top: 0 !important;
  padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid rgba(0,0,0,0.1);
}
@media (max-width: 600px) { .pancudinhus-titulo-busca { padding-top: 70px !important; } }
.pancudinhus-titulo-busca h2 {
  margin-top: 0 !important; margin-bottom: 0 !important; font-size: 1.6rem; font-weight: 500; color: #4b3b28;
}

/* ============================
   12 - Navegação de posts (anterior/próximo) e relacionados
   Linha explicativa: estilos para a navegação e o bloco de relacionados.
   ================================================================== */
.pancudinhos-post-nav {
  border-top: 1px solid #eee; border-bottom: 1px solid #eee;
  padding: 20px 0; margin-top: 40px; font-size: 0.9em;
}
.pancudinhos-post-nav .nav-links { display:flex; justify-content:space-between; align-items:center; }
.pancudinhos-post-nav .nav-previous, .pancudinhos-post-nav .nav-next { flex-basis:48%; }
.pancudinhos-post-nav .nav-next { text-align:right; }
.pancudinhos-post-nav .nav-title { display:block; font-weight:bold; color:#555; text-transform:uppercase; font-size:0.8em; }
.pancudinhos-post-nav .nav-link { color:#333; text-decoration:none; font-weight:500; }
.pancudinhos-post-nav .nav-link:hover { color:#c95100; text-decoration:underline; }

/* Relacionados: grid de 3 colunas que vira 1 coluna no mobile */
.pancudinhos-related-posts { margin-top:40px; padding-bottom:40px; }
.pancudinhos-related-posts h3 { text-align:center; font-size:1.8em; margin-bottom:30px; }
.related-posts-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:30px; }
.related-post-card { background:#fff8e7; border-radius:8px; box-shadow:0 4px 12px rgba(0,0,0,0.05);
  overflow:hidden; transition:all 0.3s ease; }
.related-post-card:hover { box-shadow:0 6px 20px rgba(0,0,0,0.1); transform:translateY(-5px); }
.related-post-card a { text-decoration:none; color:inherit; display:block; }
.related-post-card .related-post-thumbnail img { width:100%; height:150px; object-fit:cover; display:block; }
.related-post-card .related-post-title { font-size:1.1em; font-weight:600; padding:20px; margin:0; line-height:1.4; }

@media (max-width: 768px) {
  .related-posts-grid { grid-template-columns: 1fr; }
  .pancudinhos-post-nav .nav-links { flex-direction:column; gap:20px; }
  .pancudinhos-post-nav .nav-previous, .pancudinhos-post-nav .nav-next { flex-basis:100%; text-align:center; }
}

/* ============================
   13 - Ajuste de padding interno geral (somente nos cards de listagem)
   ================================================================== */

/* 1️⃣ Cards na listagem */
.ast-article-inner {
  padding: 2.2em !important; /* mantém o conforto apenas nos posts da listagem */
}

/* Pequena responsividade: menos padding no mobile */
@media (max-width: 768px) {
  .ast-article-inner {
    padding: 1.5em !important;
  }
}

/* ============================
   99 - Utilitários finais e fallback
   Linha explicativa: pequenas regras utilitárias e segurança visual.
   ================================================================== */
.hidden-visually { position:absolute !important; clip:rect(1px,1px,1px,1px); padding:0 !important; border:0 !important; height:1px !important; width:1px !important; overflow:hidden; }


