/*
Theme Name: Crystal Blog
Theme URI: https://crystalinformatica.com.br/
Author: Crystal Informática
Author URI: https://crystalinformatica.com.br/
Description: Tema de blog leve para a Crystal Informática. Cabeçalho cinza escuro com logotipo centralizado, redes sociais à esquerda, busca à direita; menu de categorias abaixo; home com 3 posts por categoria; páginas de categoria com 15 posts + paginação.
Version: 1.0.3
License: GNU GPL v2 or later
Text Domain: crystal-blog
*/

/* =========================
   Variáveis e reset básico
   ========================= */
:root{
  --header-bg:#5a5e66;   /* cinza mais claro para contraste do logo */
  --header-text:#ffffff;
  --nav-bg:#1f2937;
  --nav-hover:#374151;
  --text:#111827;
  --muted:#6b7280;
  --border:#e5e7eb;
  --link:#0ea5e9;
  --link-hover:#0284c7;
  --radius:8px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif;
  color:var(--text);
  background:#fff;
  line-height:1.6;
}
img{max-width:100%;height:auto;display:block}
a{color:var(--link);text-decoration:none}
a:hover{color:var(--link-hover);text-decoration:underline}

/* ============ Layout base ============ */
.container{max-width:1200px;margin:0 auto;padding:0 16px}
.section{padding:28px 0;border-bottom:1px solid var(--border)}
.section h2{margin:0 0 12px}

/* =========== Cabeçalho =========== */
.header-top{background:var(--header-bg);color:var(--header-text)}
.header-bar{
  display:flex;align-items:center;justify-content:space-between;
  gap:16px;padding:12px 0;
}
.header-left,.header-center,.header-right{display:flex;align-items:center}
.header-left{gap:10px}
.header-left a{color:#fff;opacity:.9}
.header-left a:hover{opacity:1}
.site-logo{display:flex;justify-content:center;align-items:center}
.site-logo img{max-height:48px;width:auto}

.search-form{display:flex}
.search-form input[type="search"]{
  padding:10px 12px;border:1px solid #374151;border-right:none;
  background:#111827;color:#fff;min-width:220px
}
.search-form input[type="search"]::placeholder{color:#9ca3af}
.search-form button{
  padding:10px 14px;border:1px solid #374151;background:#374151;
  color:#fff;cursor:pointer
}
.search-form button:hover{background:#4b5563}

/* =========== Navegação (desktop + mobile hambúrguer) =========== */
.nav-categories{background:var(--nav-bg)}
.nav-wrap{
  display:flex;align-items:center;justify-content:space-between;
}

/* Botão hambúrguer (mobile) */
.nav-toggle{
  display:none; /* desktop */
  background:none;border:0;color:#e5e7eb;
  padding:10px;cursor:pointer;border-radius:6px;
}
.nav-toggle:hover{background:rgba(255,255,255,.06)}

/* Lista desktop */
.cats-desktop{list-style:none;margin:0;padding:0;display:flex;gap:8px;flex-wrap:wrap}
.cats-desktop > li > a{display:block;color:#e5e7eb;padding:10px 12px;border-radius:6px}
.cats-desktop > li > a:hover{background:var(--nav-hover)}

/* Painel mobile recolhível */
.nav-panel{
  background:var(--nav-bg);
  border-top:1px solid rgba(255,255,255,.06);
  overflow:hidden;
  max-height:0;
  transition:max-height .25s ease;
}
.nav-panel.open{max-height:420px;} /* altura suficiente p/ lista */
.cats-mobile{list-style:none;margin:0;padding:8px}
.cats-mobile > li > a{
  display:block;color:#e5e7eb;padding:10px 12px;border-radius:6px
}
.cats-mobile > li > a:hover{background:var(--nav-hover)}

/* Acessibilidade (para <span class="screen-reader-text">) */
.screen-reader-text{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

/* =========== Cards/Listas =========== */
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.card{
  border:1px solid var(--border);border-radius:var(--radius);
  overflow:hidden;background:#fff;display:flex;flex-direction:column
}
.card .thumb img{width:100%;height:180px;object-fit:cover}
.card .content{padding:12px}
.card .meta{font-size:.85rem;color:var(--muted)}

.pagination{
  display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin:24px 0
}

/* =========== Post único =========== */
.post-hero{
  display:flex;justify-content:center;margin:12px 0 16px 0;
}
.post-hero-img{
  max-width:clamp(720px, 90vw, 1100px);
  width:100%;height:auto;border-radius:var(--radius);
}
.meta{color:var(--muted);margin:4px 0 0 0}

.post-content img{border-radius:var(--radius)}
.post-content h2{margin:24px 0 8px 0}
.post-content h3{margin:20px 0 6px 0}
.post-content p{margin:0 0 16px 0}
.post-content ul, .post-content ol{margin:0 0 16px 24px}

/* =========== Rodapé preto horizontal =========== */
.site-footer-dark{
  background:#000;color:#fff;padding:40px 0 0;font-size:0.95rem;
}
.footer-row{
  display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:32px;
}
.footer-col h3{
  margin:0 0 8px 0;font-size:1.1rem;font-weight:600;color:#fff;
}
.footer-col p{margin:0 0 10px 0;line-height:1.5;}
.footer-col a{color:#fff;opacity:.85}
.footer-col a:hover{opacity:1;text-decoration:underline}

.footer-bottom{
  border-top:1px solid rgba(255,255,255,.1);
  text-align:center;padding:16px 0;margin-top:24px;
  font-size:0.85rem;color:#aaa;
}

/* ============= Responsivo ============= */
@media (max-width:900px){
  .grid{grid-template-columns:1fr 1fr}
  .footer-row{grid-template-columns:1fr 1fr}
}
@media (max-width:640px){
  .header-bar{flex-direction:column;gap:8px}
  .search-form input[type="search"]{min-width:0;width:100%}
  .grid{grid-template-columns:1fr}
  .site-logo img{max-height:40px}
  .post-hero-img{max-width:100%}

  /* Mobile: mostra hambúrguer + painel; esconde lista horizontal */
  .nav-toggle{display:inline-flex;align-items:center}
  .cats-desktop{display:none}
  .nav-panel{max-height:0} /* inicia recolhido */
}
/* ===== Footer: ordem no mobile ===== */
@media (max-width: 640px){
  /* empilha as colunas */
  .footer-row{
    display:flex;
    flex-direction:column;
    gap:24px;
  }

  /* ordem desejada */
  .footer-col.about{ order: 1; }
  .footer-col:nth-of-type(2){ order: 2; } /* Produtos */
  .footer-col:nth-of-type(3){ order: 3; } /* Serviços + Atendimento */
  .footer-col:nth-of-type(4){ order: 4; } /* Localização */

  /* refinamentos visuais no mobile */
  .footer-col h3{ margin-bottom:6px; }
  .footer-col p, .footer-list li{ line-height:1.55; }
  .about img{ max-height:36px; }       /* logo menor no mobile */
  .site-footer-dark{ padding-top:24px; }
}
@media (max-width: 640px){
  .footer-col{ border-top:1px solid rgba(255,255,255,.1); padding-top:12px; }
  .footer-col.about{ border-top:0; padding-top:0; }
}
