/*
Theme Name: Brasil do Trecho
Theme URI: https://brasildotrecho.com.br
Author: João Neto
Author URI: https://brasildotrecho.com.br
Description: Tema responsivo de notícias para o portal Brasil do Trecho
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: brasil-do-trecho
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f4f4f4;
  color: #222;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ===== VARIABLES ===== */
:root {
  --red: #e63946;
  --dark: #1a1a2e;
  --white: #ffffff;
  --light-gray: #f4f4f4;
  --mid-gray: #e0e0e0;
  --text: #222222;
  --text-light: #666666;
  --sidebar-width: 300px;
  --max-width: 1200px;
}

/* ===== HEADER ===== */
#header-top {
  background: var(--dark);
  color: #ccc;
  font-size: 12px;
  padding: 4px 0;
  text-align: center;
}
#site-header {
  background: var(--white);
  border-bottom: 3px solid var(--red);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-logo {
  font-size: 24px;
  font-weight: 900;
  color: var(--red);
  letter-spacing: -1px;
}
.site-logo span { color: var(--dark); }

/* ===== NAVIGATION ===== */
#main-nav {
  background: var(--dark);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}
#main-nav ul { list-style: none; display: flex; flex-wrap: wrap; }
#main-nav ul li a {
  display: block;
  padding: 12px 16px;
  color: #eee;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  transition: background .2s, color .2s;
}
#main-nav ul li a:hover,
#main-nav ul li.current-menu-item a {
  background: var(--red);
  color: var(--white);
}

/* ===== BREAKING NEWS BAR ===== */
.breaking-news {
  background: var(--red);
  color: var(--white);
  padding: 8px 0;
  overflow: hidden;
}
.breaking-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.breaking-label {
  background: var(--dark);
  padding: 2px 10px;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  border-radius: 2px;
}
.breaking-text { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== LAYOUT ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px;
}
.content-wrapper {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .content-wrapper { grid-template-columns: 1fr; }
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
  border-left: 4px solid var(--red);
  padding-left: 10px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ===== FEATURED POST (HERO) ===== */
.featured-post {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}
.featured-post img { width: 100%; height: 380px; object-fit: cover; }
.featured-post .overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  padding: 32px 20px 20px;
  color: var(--white);
}
.featured-post .overlay .category-tag {
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 2px;
  display: inline-block;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.featured-post .overlay h2 { font-size: 22px; font-weight: 800; line-height: 1.3; }
.featured-post .overlay .meta { font-size: 12px; color: #ccc; margin-top: 6px; }

/* ===== POST GRID ===== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 700px) { .posts-grid { grid-template-columns: 1fr; } }
@media (min-width: 700px) and (max-width: 900px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }

.post-card {
  background: var(--white);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  transition: transform .2s, box-shadow .2s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.post-card img { width: 100%; height: 160px; object-fit: cover; }
.post-card .card-body { padding: 12px; }
.post-card .category-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.post-card h3 { font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--text); margin-bottom: 6px; }
.post-card h3 a:hover { color: var(--red); }
.post-card .meta { font-size: 11px; color: var(--text-light); }

/* ===== SIDEBAR ===== */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget {
  background: var(--white);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.widget-header {
  background: var(--dark);
  color: var(--white);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  border-left: 4px solid var(--red);
}
.widget-body { padding: 12px; }

/* Most read list */
.most-read-list { list-style: none; }
.most-read-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--mid-gray);
}
.most-read-list li:last-child { border-bottom: none; }
.most-read-list .rank {
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.most-read-list .post-title { font-size: 13px; font-weight: 600; line-height: 1.4; }
.most-read-list .post-title a:hover { color: var(--red); }
.most-read-list .views { font-size: 11px; color: var(--text-light); }

/* Vagas list */
.vagas-list { list-style: none; }
.vagas-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--mid-gray);
  display: flex;
  align-items: center;
  gap: 8px;
}
.vagas-list li:last-child { border-bottom: none; }
.vagas-list .vaga-icon { color: var(--red); font-size: 16px; }
.vagas-list .vaga-title { font-size: 13px; font-weight: 600; line-height: 1.4; }
.vagas-list .vaga-title a:hover { color: var(--red); }
.vagas-list .vaga-date { font-size: 11px; color: var(--text-light); }

/* WhatsApp CTA */
.whatsapp-box {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: var(--white);
  border-radius: 6px;
  padding: 20px;
  text-align: center;
}
.whatsapp-box .wpp-icon { font-size: 40px; margin-bottom: 8px; }
.whatsapp-box h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.whatsapp-box p { font-size: 13px; margin-bottom: 14px; opacity: .9; }
.whatsapp-box a {
  display: inline-block;
  background: var(--white);
  color: #128C7E;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 30px;
  transition: opacity .2s;
}
.whatsapp-box a:hover { opacity: .85; }

/* ===== FOOTER ===== */
#site-footer {
  background: var(--dark);
  color: #aaa;
  text-align: center;
  padding: 20px 16px;
  font-size: 13px;
  border-top: 3px solid var(--red);
}
#site-footer a { color: var(--red); }
#site-footer .footer-links { margin-bottom: 8px; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* ===== MOBILE MENU ===== */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
}
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  #main-nav ul { display: none; flex-direction: column; width: 100%; }
  #main-nav ul.open { display: flex; }
  #main-nav ul li a { padding: 12px 16px; border-bottom: 1px solid #333; }
}

/* ===== SINGLE POST ===== */
.single-post-header { margin-bottom: 20px; }
.single-post-header h1 { font-size: 28px; font-weight: 800; line-height: 1.3; margin-bottom: 10px; }
.single-post-meta { font-size: 13px; color: var(--text-light); display: flex; gap: 16px; flex-wrap: wrap; }
.single-post-featured { width: 100%; height: 400px; object-fit: cover; border-radius: 6px; margin-bottom: 20px; }
.post-content { font-size: 16px; line-height: 1.8; color: #333; }
.post-content h2, .post-content h3 { margin: 20px 0 10px; font-weight: 700; color: var(--dark); }
.post-content p { margin-bottom: 16px; }
.post-content img { border-radius: 6px; margin: 16px auto; }

/* ===== PAGINATION ===== */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  background: var(--white);
  border: 1px solid var(--mid-gray);
  color: var(--text);
  transition: all .2s;
}
.pagination a:hover, .pagination .current {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
