/*
Theme Name: Opus Data
Theme URI: https://opusdata.blog.br
Author: Fabio Leandro Ribeiro
Author URI: https://opusdata.blog.br
Description: Tema personalizado do blog Opus Data. Dark theme com azul marinho e dourado.
Version: 1.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: opusdata
*/

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

:root {
  --bg-base:      #060d1f;
  --bg-card:      #091325;
  --bg-comment:   #0b1828;
  --bg-submenu:   #070f22;
  --accent:       #c8aa82;
  --accent-light: #e0c99a;
  --accent-dim:   rgba(200,170,130,0.30);
  --white:        #ffffff;
  --text-body:    #d8d8e8;
  --text-muted:   #8888aa;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-base);
  background-image: radial-gradient(ellipse 90% 55% at 50% 0%, #0e1e42 0%, #060d1f 68%);
  background-attachment: fixed;
  color: var(--text-body);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ============================================================
   HEADER
============================================================ */
.site-header {
  background-color: var(--bg-base);
  border-bottom: 1px solid rgba(200,170,130,0.55);
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 65px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-logo {
  font-size: 1.65rem;
  font-weight: 700;
  background: linear-gradient(90deg, #ffffff 0%, #c8aa82 55%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.header-rule { display: none; }

/* ============================================================
   NAVEGAÇÃO
============================================================ */
.main-navigation { display: flex; align-items: center; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-menu > li { position: relative; }

.nav-menu > li > a {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}
.nav-menu > li > a:hover { color: var(--accent-light); }

/* Dropdown */
.nav-menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--bg-submenu);
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  min-width: 210px;
  list-style: none;
  overflow: visible; /* visible para não cortar sub-submenus filhos */
  z-index: 200;
  padding: 4px 0;
}
/* Abertura via JS (classe .open) — mais confiável que :hover no PC */
.nav-menu > li.open > .sub-menu { display: block; }
/* Fallback CSS hover para casos sem JS */
.nav-menu > li:hover > .sub-menu { display: block; }

/* Terceiro nível: sub-submenu abre para a esquerda (menu está à direita da tela) */
.nav-menu .sub-menu li { position: relative; }
.nav-menu .sub-menu .sub-menu {
  display: none;
  position: absolute;
  top: 0;
  right: 100%;
  left: auto;
  background-color: var(--bg-submenu);
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  min-width: 210px;
  list-style: none;
  overflow: hidden;
  z-index: 300;
  padding: 4px 0;
}
.nav-menu .sub-menu li.open > .sub-menu { display: block; }

/* Seta nos itens do segundo nível que têm filhos */
.nav-menu .sub-menu .menu-item-has-children > a::after {
  content: '▸';
  font-size: 0.7rem;
  float: right;
  margin-left: 8px;
}

.nav-menu .sub-menu li a {
  display: block;
  padding: 10px 18px;
  color: var(--white);
  font-size: 0.9rem;
  transition: background 0.18s, color 0.18s;
}
.nav-menu .sub-menu li a:hover {
  background-color: var(--accent);
  color: #1a0e00;
}

/* Seta no item pai do dropdown */
.nav-menu .menu-item-has-children > a::after {
  content: '▾';
  font-size: 0.7rem;
  margin-left: 2px;
}

/* ============================================================
   CONTEÚDO PRINCIPAL
============================================================ */
.site-content {
  min-height: calc(100vh - 65px - 58px);
}

.content-wrap {
  max-width: 1260px;
  margin: 0 auto;
  padding: 52px 32px;
}

/* ============================================================
   GRID DE CARDS (Home / Archive)
============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Card */
.post-card {
  background-color: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}
.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 38px rgba(200,170,130,0.14);
}

/* Imagem com zoom no hover */
.card-image {
  width: 100%;
  height: 210px;
  overflow: hidden;
  background: linear-gradient(135deg, #0a1a3a, #0d2040);
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.post-card:hover .card-image img { transform: scale(1.07); }

/* Corpo do card */
.card-body { padding: 22px 20px 26px; }

.card-category {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 10px;
}
.card-category a { color: var(--accent); transition: color 0.2s; }
.card-category a:hover { color: var(--accent-light); }

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.45;
  margin-bottom: 10px;
}
.card-title a { color: var(--white); transition: color 0.2s; }
.card-title a:hover { color: #e8e8e8; }

.card-meta {
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 12px;
}
.card-meta a { color: var(--accent); }

.card-excerpt {
  font-size: 0.87rem;
  color: var(--text-body);
  line-height: 1.65;
}

/* ============================================================
   PAGINAÇÃO
============================================================ */
.pagination {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background-color: var(--accent);
  color: #1a0e00;
  border-color: var(--accent);
}

/* ============================================================
   TÍTULO DE ARQUIVO / CATEGORIA
============================================================ */
.archive-header {
  margin-bottom: 36px;
}
.archive-header h1 {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--white);
}

/* ============================================================
   SINGLE POST
============================================================ */
.single-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 52px 32px 64px;
}

.entry-category-tag {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 14px;
}
.entry-category-tag a { color: var(--accent); }

.entry-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 14px;
}

.entry-meta {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--accent-dim);
}
.entry-meta a { color: var(--accent); }

.entry-content {
  color: var(--text-body);
  line-height: 1.8;
  font-size: 1rem;
}
.entry-content p { margin-bottom: 18px; }
.entry-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin: 34px 0 14px;
}
.entry-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
  margin: 26px 0 10px;
}
.entry-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-light);
  margin: 20px 0 8px;
}
.entry-content a { color: #7ab8f5; text-decoration: underline; }
.entry-content a:hover { color: #a8d0ff; }
.entry-content ul, .entry-content ol {
  margin: 0 0 18px 26px;
  color: var(--text-body);
  line-height: 1.8;
}
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: 6px; }
.entry-content strong { color: var(--white); }
.entry-content em { color: inherit; }
.entry-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: rgba(200,170,130,0.06);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--accent-light);
}
.entry-content code {
  background: #0d1e38;
  color: #7ab8f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'Courier New', monospace;
}
.entry-content pre {
  background: #0d1e38;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 18px;
  border: 1px solid var(--accent-dim);
}
.entry-content pre code {
  background: none;
  padding: 0;
  font-size: 0.9em;
}
.entry-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 18px 0;
}
.entry-content figure { margin: 24px 0; }
.entry-content figcaption {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* Imagem de destaque no single */
.featured-image-single {
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 36px;
}
.featured-image-single img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   PÁGINA ESTÁTICA (Sobre, Política, etc.)
============================================================ */
.page-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 52px 32px 64px;
}
.page-wrap h1.entry-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 28px;
}
.page-wrap .entry-content { color: var(--text-body); }

/* Esconde o título H1 na página Sobre (ID 17) mas mantém no menu */
.page-id-17 .page-wrap h1.entry-title { display: none; }

/* ============================================================
   COMENTÁRIOS
============================================================ */
.comments-area {
  max-width: 780px;
  margin: 48px auto 0;
  padding: 40px 32px 64px;
  border-top: 1px solid var(--accent-dim);
}

.comments-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 28px;
}

/* Lista de comentários existentes */
.comment-list { list-style: none; margin-bottom: 36px; }
.comment-body {
  background: var(--bg-comment);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.comment-author { font-weight: 700; color: var(--accent); font-size: 0.9rem; }
.comment-metadata { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 10px; }
.comment-content p { font-size: 0.9rem; color: var(--text-body); line-height: 1.7; }

/* Formulário */
.comment-reply-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.comment-notes {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.comment-form-comment label,
.comment-form-author label,
.comment-form-email label { display: none; }

.comment-form-comment textarea,
.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
  width: 100%;
  background-color: var(--bg-comment);
  color: var(--white);
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.comment-form-comment textarea {
  min-height: 150px;
  resize: vertical;
  margin-bottom: 0;
}
.comment-form-comment textarea:focus,
.comment-form-author input:focus,
.comment-form-email input:focus {
  outline: none;
  border-color: var(--accent);
}

.comment-form-comment { margin-bottom: 16px; }

.comment-fields-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.comment-fields-row .comment-form-author,
.comment-fields-row .comment-form-email { flex: 1; }

.comment-form-url { display: none !important; }

.comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.comment-form-cookies-consent input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }

.form-submit { margin-top: 4px; }
#submit {
  background-color: var(--accent);
  color: #1a0e00;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 11px 30px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
#submit:hover { background-color: var(--accent-light); }

/* ============================================================
   404
============================================================ */
.not-found-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 100px 32px;
  text-align: center;
}
.not-found-wrap h1 {
  font-size: 6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 16px;
}
.not-found-wrap h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
}
.not-found-wrap p { color: var(--text-body); margin-bottom: 28px; }
.btn-home {
  display: inline-block;
  background-color: var(--accent);
  color: #1a0e00;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 8px;
  transition: background 0.2s;
}
.btn-home:hover { background-color: var(--accent-light); color: #1a0e00; }

/* ============================================================
   RODAPÉ
============================================================ */
.site-footer {
  background-color: var(--bg-base);
  border-top: 1px solid rgba(200,170,130,0.55);
  padding: 20px 48px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--white);
}
.site-footer a { color: var(--white); transition: color 0.2s; }
.site-footer a:hover { color: var(--accent); }
.footer-pp { color: var(--white); cursor: pointer; transition: color 0.2s; }
.footer-pp:hover { color: var(--accent); }

/* ============================================================
   NEWSLETTER
============================================================ */
.newsletter-page {
  min-height: 70vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 24px;
}
.newsletter-wrap {
  max-width: 560px;
  width: 100%;
}
.newsletter-wrap h1.entry-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}
.newsletter-lead {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 10px;
  line-height: 1.6;
}
.newsletter-benefits {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.newsletter-benefits li {
  color: var(--text-body);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.newsletter-benefits li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.newsletter-form input[type="text"],
.newsletter-form input[type="email"] {
  width: 100%;
  background-color: var(--bg-card);
  color: var(--white);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 13px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.newsletter-form input:focus {
  outline: none;
  border-color: var(--accent);
}
.newsletter-form input::placeholder { color: var(--text-muted); }
.newsletter-form button[type="submit"] {
  background-color: var(--accent);
  color: #1a0e00;
  font-size: 1rem;
  font-weight: 700;
  padding: 13px 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.01em;
}
.newsletter-form button[type="submit"]:hover { background-color: var(--accent-light); }
.newsletter-feedback {
  margin-top: 16px;
  font-size: 0.92rem;
  padding: 12px 16px;
  border-radius: 6px;
  display: none;
}
.newsletter-feedback.success {
  display: block;
  background: rgba(100, 200, 100, 0.1);
  border: 1px solid rgba(100,200,100,0.3);
  color: #90d890;
}
.newsletter-feedback.error {
  display: block;
  background: rgba(220, 80, 80, 0.1);
  border: 1px solid rgba(220,80,80,0.3);
  color: #f08888;
}
.newsletter-privacy {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: center;
}

/* ============================================================
   BOTÃO VOLTAR AO TOPO
============================================================ */
#back-to-top {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 42px;
  height: 42px;
  background-color: var(--accent);
  color: #1a0e00;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, background 0.2s;
  z-index: 999;
  text-decoration: none;
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { background-color: var(--accent-light); color: #1a0e00; }

/* ============================================================
   RESPONSIVO
============================================================ */
@media (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .site-header { padding: 0 24px; }
  .content-wrap { padding: 40px 24px; }
}
@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; }
  .site-header { padding: 0 16px; }
  .nav-menu { gap: 20px; }
  .content-wrap { padding: 28px 16px; }
  .single-wrap, .page-wrap, .comments-area { padding-left: 16px; padding-right: 16px; }
  .comment-fields-row { flex-direction: column; }
  .entry-title { font-size: 1.5rem; }
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           