/*
Theme Name: Uma Tag Por Dia
Description: Tema dark para blog de tecnologia e desenvolvimento
Version: 1.0
Author: Uma Tag Por Dia
Text Domain: umatagpordia
*/

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

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f7fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f2f5;
  --accent: #1a56db;
  --accent-hover: #1244b0;
  --accent-glow: rgba(26, 86, 219, 0.1);
  --text-primary: #111111;
  --text-secondary: #444444;
  --text-muted: #888888;
  --border: #e0e0e0;
  --border-accent: rgba(26, 86, 219, 0.25);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', monospace;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --max-width: 1200px;
  --sidebar-width: 320px;
  --gap: 30px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

/* ===== HEADER ===== */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.site-logo .logo-code {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1.4rem;
}

.site-logo:hover { color: var(--text-primary); }

/* Nav */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 8px;
}

.main-nav a {
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.main-nav a:hover,
.main-nav .current-menu-item a {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== LAYOUT ===== */
.site-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--gap) 20px;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--gap);
}

.content-area { min-width: 0; }

/* ===== POSTS ===== */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--gap);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.post-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.post-card .post-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.post-card .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card:hover .post-thumbnail img {
  transform: scale(1.03);
}

.post-card .post-body {
  padding: 24px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.post-meta .category-badge {
  background: var(--accent-glow);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.post-card .post-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}

.post-card .post-title a {
  color: var(--text-primary);
}

.post-card .post-title a:hover {
  color: var(--accent);
}

.post-card .post-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
}

.read-more:hover { gap: 10px; }

.read-more::after {
  content: '→';
  transition: transform 0.2s;
}

/* ===== SINGLE POST ===== */
.single-post-header {
  margin-bottom: 30px;
}

.single-post-header .post-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
}

.single-post-header .post-thumbnail {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.post-content h2, .post-content h3, .post-content h4 {
  color: var(--text-primary);
  margin: 1.8em 0 0.6em;
  font-weight: 700;
}

.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.25rem; }

.post-content p { margin-bottom: 1.2em; }

.post-content a { border-bottom: 1px solid var(--accent); }
.post-content a:hover { border-bottom-color: transparent; }

.post-content ul, .post-content ol {
  margin: 1em 0 1em 1.5em;
}

.post-content li { margin-bottom: 0.5em; }

.post-content blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  padding: 16px 20px;
  margin: 1.5em 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.post-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
}

.post-content code {
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--accent);
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

.post-content img {
  border-radius: var(--radius);
  margin: 1.5em 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.post-content th, .post-content td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}

.post-content th {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
}

/* Post tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.post-tags a {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.82rem;
}

.post-tags a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Post nav */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.post-navigation a {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s;
}

.post-navigation a:hover { border-color: var(--accent); }

.post-navigation .nav-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.post-navigation .nav-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.post-navigation .nav-next { text-align: right; }

/* ===== SIDEBAR ===== */
.sidebar .widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.sidebar .widget-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar .widget ul {
  list-style: none;
}

.sidebar .widget li {
  border-bottom: 1px solid var(--border);
}

.sidebar .widget li:last-child { border-bottom: none; }

.sidebar .widget li a {
  display: block;
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s, padding-left 0.2s;
}

.sidebar .widget li a:hover {
  color: var(--accent);
  padding-left: 6px;
}

/* Search widget */
.sidebar .search-form {
  display: flex;
}

.sidebar .search-form .search-field {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.sidebar .search-form .search-field:focus {
  border-color: var(--accent);
}

.sidebar .search-form .search-submit {
  background: var(--accent);
  border: none;
  color: var(--bg-primary);
  padding: 10px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Tag cloud */
.sidebar .tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sidebar .tagcloud a {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary) !important;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.82rem !important;
}

.sidebar .tagcloud a:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
}

/* ===== COMMENTS ===== */
.comments-area {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.comments-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.comment-list {
  list-style: none;
}

.comment-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.comment-meta .avatar {
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

.comment-author .fn {
  font-weight: 700;
  color: var(--text-primary);
}

.comment-metadata a {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.comment-content { color: var(--text-secondary); font-size: 0.95rem; }

.comment .children {
  list-style: none;
  margin-left: 30px;
  margin-top: 16px;
}

.comment-reply-link {
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 8px;
  display: inline-block;
}

/* Comment form */
.comment-respond { margin-top: 30px; }

.comment-respond .comment-reply-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.comment-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.95rem;
  margin-bottom: 14px;
  outline: none;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
}

.comment-form .submit {
  background: var(--accent);
  border: none;
  color: var(--bg-primary);
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.comment-form .submit:hover { background: var(--accent-hover); }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

/* ===== PAGE HEADER (archive, search) ===== */
.page-header {
  margin-bottom: var(--gap);
}

.page-header .page-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.page-header .page-title span { color: var(--accent); }

.page-header .archive-description {
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 40px 20px 20px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-bottom: 30px;
}

.footer-widgets .widget-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 14px;
}

.footer-widgets ul { list-style: none; }

.footer-widgets li a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 2;
}

.footer-widgets li a:hover { color: var(--accent); }

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-bottom .accent { color: var(--accent); }

/* ===== 404 ===== */
.error-404 { text-align: center; padding: 60px 0; }
.error-404 .error-code { font-size: 6rem; font-weight: 800; color: var(--accent); line-height: 1; }
.error-404 .error-title { font-size: 1.5rem; margin: 10px 0 20px; }
.error-404 .error-desc { color: var(--text-secondary); margin-bottom: 30px; }
.error-404 .search-form { max-width: 400px; margin: 0 auto; display: flex; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .site-content {
    grid-template-columns: 1fr;
  }
  .sidebar { order: 2; }
  .footer-widgets { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .header-inner { height: 56px; }
  .menu-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 10px; }
  .main-nav.active { display: block; }
  .main-nav ul { flex-direction: column; }
  .single-post-header .post-title { font-size: 1.5rem; }
  .post-navigation { grid-template-columns: 1fr; }
}

/* WP Admin bar fix */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

/* WP alignment classes */
.alignleft { float: left; margin: 0 20px 10px 0; }
.alignright { float: right; margin: 0 0 10px 20px; }
.aligncenter { display: block; margin: 0 auto 20px; }
.wp-caption { max-width: 100%; }
.wp-caption-text { color: var(--text-muted); font-size: 0.85rem; text-align: center; margin-top: 6px; }
