/* Modern CSS Variables for Styling */
:root {
  --primary-color: #1a73e8;
  --primary-hover: #1557b0;
  --secondary-color: #3c4043;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-color: #202124;
  --text-muted: #5f6368;
  --accent-color: #e8f0fe;
  --border-color: #dadce0;
  --success-color: #34a853;
  --ad-bg: #fafafa;
  --ad-border: #e0e0e0;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --border-radius: 8px;
  --max-width: 1100px;
  --shadow: 0 1px 3px rgba(23,23,23,0.05), 0 1px 2px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

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

/* Layout Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header & Bulletproof Responsive Navigation */
header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  position: relative;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo span {
  color: var(--secondary-color);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 20px;
  align-items: center;
}

nav a {
  color: var(--secondary-color);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

nav a:hover {
  color: var(--primary-color);
  background-color: var(--accent-color);
  text-decoration: none;
}

/* Mobile Nav Toggle Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--secondary-color);
  padding: 8px;
  border-radius: 4px;
}

.menu-toggle:hover {
  background-color: var(--bg-color);
}

/* Navigation Menu Responsive Styling */
@media (max-width: 768px) {
  .menu-toggle {
    display: block; /* Show menu toggle only on mobile */
  }

  nav ul {
    display: none; /* Hide menu items by default on mobile */
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 60px;
    left: 0;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    gap: 12px;
  }

  nav ul.active {
    display: flex; /* Toggle display via JS class injection */
  }

  nav a {
    width: 100%;
    text-align: center;
    display: block;
    padding: 12px;
  }
}

/* Main Layout Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 20px;
}

@media (min-width: 992px) {
  .main-grid {
    grid-template-columns: 2.2fr 1fr;
  }
}

/* Content Card */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden; /* Prevent child components from breaking box boundary */
}

@media (min-width: 768px) {
  .card {
    padding: 30px;
  }
}

/* Categories / Badges */
.category-badge {
  display: inline-block;
  background-color: var(--accent-color);
  color: var(--primary-color);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* Article Hero & Title */
.article-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  color: #111;
}

@media (min-width: 768px) {
  .article-title {
    font-size: 32px;
  }
}

.meta-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.meta-author {
  font-weight: 600;
  color: var(--text-color);
}

/* Article Content & Pagination */
.article-body {
  font-size: 16px;
  line-height: 1.8;
  color: #333;
}

@media (min-width: 768px) {
  .article-body {
    font-size: 18px;
  }
}

.article-body p {
  margin-bottom: 20px;
}

.article-body h2 {
  font-size: 20px;
  margin: 28px 0 16px 0;
  font-weight: 700;
  color: #111;
}

.article-body ul {
  margin-bottom: 20px;
  padding-left: 20px;
}

.article-body li {
  margin-bottom: 8px;
}

/* Sub-page Navigation */
.page-part {
  display: none;
}

.page-part.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Pagination Control Button Container */
.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 32px 0 20px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.btn-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--success-color);
  color: white;
  padding: 16px 36px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(52, 168, 83, 0.3);
  transition: all 0.2s ease;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.btn-next:hover {
  background-color: #2b8c45;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(52, 168, 83, 0.4);
  text-decoration: none;
  color: white;
}

.btn-next:active {
  transform: translateY(1px);
}

.step-indicator {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.page-numbers {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.page-num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
  background-color: var(--card-bg);
  transition: all 0.2s ease;
}

.page-num:hover {
  background-color: var(--accent-color);
  color: var(--primary-color);
}

.page-num.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Sidebar Widgets */
.sidebar-widget {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.sidebar-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  border-left: 4px solid var(--primary-color);
  padding-left: 8px;
  color: #111;
}

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

.trending-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.trending-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.trending-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--border-color);
  line-height: 1;
}

.trending-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.trending-text a {
  color: var(--text-color);
}

.trending-text a:hover {
  color: var(--primary-color);
}

/* Ad Placeholders (Fully Responsive) */
.ad-slot {
  background-color: var(--ad-bg);
  border: 2px dashed var(--ad-border);
  border-radius: var(--border-radius);
  margin: 16px 0;
  padding: 12px;
  position: relative;
  text-align: center;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  width: 100%;
}

.ad-slot::before {
  content: "PUBLICIDADE";
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.ad-slot-sidebar {
  min-height: 250px;
}

.ad-slot-header {
  margin: 12px 0;
  min-height: 90px;
}

/* Footer styling */
footer {
  background-color: #1f2022;
  color: #e8eaed;
  padding: 40px 0 20px 0;
  margin-top: 40px;
  border-top: 1px solid #3c4043;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-brand h3 {
  font-size: 18px;
  font-weight: 800;
  color: white;
  margin-bottom: 12px;
}

.footer-brand p {
  color: #9aa0a6;
  font-size: 13px;
  max-width: 320px;
}

.footer-links h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: white;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

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

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #9aa0a6;
  font-size: 13px;
}

.footer-links a:hover {
  color: white;
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid #3c4043;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #9aa0a6;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

/* Cookie consent banner (Fully Responsive) */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #202124;
  color: white;
  padding: 16px;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.15);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

@media (min-width: 768px) {
  .cookie-consent {
    flex-direction: row;
    padding: 16px 40px;
    justify-content: space-between;
    text-align: left;
  }
}

.cookie-consent p {
  font-size: 13px;
  margin: 0;
  max-width: 800px;
}

.cookie-buttons {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

@media (min-width: 768px) {
  .cookie-buttons {
    width: auto;
  }
}

.cookie-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  width: 50%;
  text-align: center;
}

@media (min-width: 768px) {
  .cookie-btn {
    width: auto;
  }
}

.cookie-btn-accept {
  background-color: var(--primary-color);
  color: white;
}

.cookie-btn-accept:hover {
  background-color: var(--primary-hover);
}

.cookie-btn-decline {
  background-color: transparent;
  color: #9aa0a6;
  border: 1px solid #5f6368;
}

.cookie-btn-decline:hover {
  color: white;
  border-color: white;
}

/* Home page hero and editorial layout */
.home-hero {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
}

@media (min-width: 992px) {
  .home-hero {
    grid-template-columns: 1.5fr 1fr;
    align-items: center;
  }
}

.hero-eyebrow {
  display: inline-block;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 18px;
  font-size: 13px;
}

.hero-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  color: #111;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 42px;
  }
}

.hero-copy {
  color: #444;
  font-size: 17px;
  max-width: 680px;
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  border: 1px solid var(--border-color);
  color: var(--secondary-color);
  background-color: #fff;
}

.btn-secondary:hover {
  background-color: var(--accent-color);
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin: 32px 0 16px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}

.section-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  max-width: 560px;
}

.hero-featured-card {
  min-height: 420px;
}

.hero-featured-card .featured-img-wrapper {
  margin-bottom: 18px;
}

.hero-featured-card .featured-title {
  font-size: 26px;
  margin-bottom: 14px;
}

.featured-excerpt {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.featured-link {
  color: var(--primary-color);
  font-weight: 700;
}

/* Featured Post Styling (Home page) */
.featured-post {
  display: block;
  color: inherit;
  margin-bottom: 24px;
}

.featured-post:hover {
  text-decoration: none;
}

.featured-post:hover .featured-title {
  color: var(--primary-color);
}

.featured-img-wrapper {
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 16px;
  aspect-ratio: 16/9;
  background-color: #eaeaea;
}

.featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.featured-post:hover .featured-img {
  transform: scale(1.02);
}

.featured-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .featured-title {
    font-size: 24px;
  }
}

/* Post list grid */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 600px) {
  .posts-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.post-card {
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: inherit;
}

.post-card:hover {
  text-decoration: none;
  box-shadow: var(--shadow-lg);
}

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

.post-card-img-wrapper {
  aspect-ratio: 16/9;
  overflow: hidden;
  background-color: #eaeaea;
}

.post-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}

.post-card-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--primary-color);
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-family: inherit;
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}
