/* ===============================
   RESET E LAYOUT PRINCIPAL
================================ */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background-color: #f5f5f5;
  color: #222;
  transition: background-color 0.3s, color 0.3s;
}

body.dark {
  background-color: #121212;
  color: #ddd;
}

/* ===============================
   HEADER
================================ */
.header {
  background: #ffffffe8;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  margin-bottom: 20px;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: #FF5722;
}

.logo > a {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.logo-img {
  width: 40px;
  height: 40px;
  margin-right: 0.5rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}
/* Header user/login */
.user-area { display: flex; align-items: center; gap: 10px; margin-right: 10px; }
/* Botão Entrar moderno */
.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 9999px;
  text-decoration: none;
  color: #fff;
  border: 1px solid #FF5722;
  background: linear-gradient(135deg, #FF5722 0%, #FF8A50 100%);
  box-shadow: 0 6px 14px rgba(255, 87, 34, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, background-color 0.2s, border-color 0.2s;
}
.login-btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 10px 18px rgba(255, 87, 34, 0.4); }
.login-btn:active { transform: translateY(0); filter: brightness(0.98); }
.login-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.35); }
body.dark .login-btn { box-shadow: 0 6px 14px rgba(255, 87, 34, 0.35); }
.user-box { display:flex; align-items:center; gap:8px; }
.user-avatar { width: 28px; height: 28px; border-radius:50%; object-fit:cover; }
.user-name { font-size: 0.95rem; color:#333; }

.nav-link {
  color: #1e40af;
  text-decoration: none;
}

.dark-btn {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid #ccc;
  background-color: #f0f0f0;
  cursor: pointer;
  transition: all 0.3s;
}

.dark-btn:hover {
  background-color: #e0e0e0;
}

/* ===============================
   MAIN / COLUNA PRINCIPAL
================================ */
.layout {
  display: flex;
  max-width: 1200px;
  margin: 20px auto;
  gap: 30px;
  flex-wrap: wrap;
}

.main-news {
  flex: 1 1 700px;
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  transition: background-color 0.3s, box-shadow 0.3s;
}

body.dark .main-news {
  background-color: #1e1e1e;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
}

.news-image {
  width: 100%;
  margin: 15px 0;
  border-radius: 5px;
}

.summary {
  font-size: 1.1em;
  font-weight: 500;
  margin-bottom: 15px;
}

.content {
  line-height: 1.6;
}

/* ===============================
   SIDEBAR
================================ */
.sidebar {
  flex: 0 1 300px;
  background-color: #fff;        /* fundo branco padr«ªo */
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  transition: background-color 0.3s, box-shadow 0.3s;
}

body.dark .sidebar {
  background-color: #1e1e1e;    /* fundo escuro no dark mode */
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-item {
  margin-bottom: 15px;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s, background-color 0.3s;
}

.sidebar-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border-radius: 6px;
  transition: background-color 0.3s, color 0.3s;
}

/* Hover no item da sidebar */
.sidebar-link:hover {
  background-color: #f5f5f5; /* claro */
  color: #FF5722;
}

body.dark .sidebar-link:hover {
  background-color: #2a2a2a; /* escuro */
  color: #FF9800;
}

.sidebar-title {
  font-weight: bold;
  margin-bottom: 0.25rem;
  display: block;
}

.sidebar-img {
  width: 100%;
  border-radius: 6px;
  transition: transform 0.2s;
}

.sidebar-link:hover .sidebar-img {
  transform: scale(1.03);
}


/* ===============================
   FOOTER
================================ */
.footer { padding: 18px 16px; background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%); border-top: 1px solid #e5e7eb; color: #374151; font-size: 0.95rem; transition: background-color .3s, color .3s, border-color .3s; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2px; color: #111827; }
.footer-brand img { width: 24px; height: 24px; border-radius: 6px; }
.footer-links { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.footer-links a { color: #1f2937; text-decoration: none; font-weight: 600; padding: 6px 8px; border-radius: 8px; transition: color .2s, background-color .2s, transform .1s; }
.footer-links a:hover { color: #fff; background: #FF5722; transform: translateY(-1px); }
.footer-links .sep { color: #9ca3af; }
.footer-copy { color: #6b7280; }

body.dark .footer {background: linear-gradient(180deg, #222 0%, #000000 100%);border-color: #121212;color: #cbd5e1;}
body.dark .footer-brand { color: #e5e7eb; }
body.dark .footer-links a { color: #e5e7eb; }
body.dark .footer-links .sep { color: #94a3b8; }
body.dark .footer-copy { color: #94a3b8; }

/* ===============================
   DARK MODE
================================ */
body.dark .header {
  background-color: #1e1e1e;
  border-color: #333;
}

body.dark .dark-btn {
  background-color: #333;
  color: #ddd;
  border-color: #555;
}
/* Ad slots removed (manual ads integration for now) */
/* Category nav */
.cat-nav { max-width: 1200px; margin: 16px auto 18px; padding: 0 16px; }
.cat-list { list-style: none; padding: 0; margin: 0; display: flex; gap: 14px 16px; flex-wrap: wrap; justify-content: center; }
.cat-chip {
  padding: 10px 16px;
  border-radius: 9999px;
  border: 1px solid #2d3748;
  background: #11182700;
  color: #000000;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
}
.cat-chip:hover { background: #ff572226; transform: translateY(-1px); }
.cat-chip:focus { outline: none; box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.35); }
.cat-chip.active { background: #FF5722; color: #fff; border-color: #FF5722; box-shadow: 0 4px 10px rgba(255,87,34,0.35); }
.cat-chip.text { border: none; background: transparent; }
.cat-chip .cat-icon { font-size: 1rem; }
.cat-chip .cat-icon { font-size: 1rem; }

/* Dark mode for category chips */
body.dark .cat-chip { background: #0f172a; color: #e5e7eb; border-color: #334155; box-shadow: 0 1px 2px rgba(0,0,0,0.4); }
body.dark .cat-chip:hover { background: #1e293b; }
body.dark .cat-chip.active { background: #FF5722; color: #fff; border-color: #FF5722; box-shadow: 0 4px 10px rgba(255,87,34,0.45); }
body.dark .cat-arrow-btn { background: #111827; border-color: #334155; }
body.dark .cat-arrow-btn:hover:not(:disabled) { background: #FF5722; border-color: #FF5722; }

/* Responsivo */
@media (max-width: 1024px) {
  .carousel-track { gap: 10px; }
  .carousel-card { flex: 0 0 calc((100% - 2 * 10px) / 3); }
}
@media (max-width: 768px) {
  .cat-arrow-btn { width: 34px; height: 34px; }
  .carousel-track { gap: 10px; }
  .carousel-card { flex: 0 0 calc((100% - 10px) / 2); }
}
@media (max-width: 540px) {
  .carousel-card { flex: 0 0 100%; }
  .carousel-card .card-image img { height: 200px; }
}
/* Home layout overrides */
.layout { max-width: 1200px; margin: 20px auto; padding: 0 16px; display:block; }
.section-title { margin: 10px 0 16px; font-size: 1.4rem; }
.latest { margin-bottom: 28px; }
.search-bar {
  display: flex;
  gap: 8px;
  margin: 8px 0 18px;
}
.search-bar input[type="search"] {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2d3748;
  background: #0f172a00;
  color: #000000;
}
.search-bar button {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #2d3748;
  background: #ff572200;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.search-bar button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(255,87,34,0.35);
}
.featured { margin-bottom: 16px; }
.featured-card .card-image img { height: 320px; object-fit: cover; object-position: center 5%; width: 100%; }
.featured-card .card-content h3 { font-size: 1.6rem; }
.featured-card .news-link { display: block; }
.recent-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.categories { margin-top: 24px; }
.category-section { margin-bottom: 24px; }
.category-header { display:flex; align-items:center; justify-content: space-between; gap: 8px; }
.category-title { margin: 0 0 10px; font-size: 1.2rem; color: #1f2937; }
.cat-arrow-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #2d3748;
  background: #0f172a;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.cat-arrow-btn:hover:not(:disabled) { transform: translateY(-1px); background: #FF5722; border-color: #FF5722; box-shadow: 0 6px 16px rgba(255,87,34,0.3); }
.cat-arrow-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.carousel-viewport { overflow: hidden; width: 100%; }
.carousel-track { display: flex; gap: 12px; transition: transform 0.35s ease; will-change: transform; }
.carousel-card { flex: 0 0 calc((100% - 3 * 12px) / 4); padding: 0; }
.carousel-card .news-link { display:block; height: 100%; }
.carousel-card .card-image img { width: 100%; height: 180px; object-fit: cover; }
.category-section.full-grid .category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.category-section.full-grid .news-card .card-image img { height: 180px; object-fit: cover; }
/* ===============================
   COMPARTILHAR
================================ */
.share-section {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.share-section span {
  font-weight: bold;
}

.share-btn {
  padding: 6px 12px;
  border-radius: 4px;
  color: #fff;
  font-size: 0.9rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

.share-btn:hover {
  opacity: 0.8;
}

.share-btn.twitter { background: #090909; }
.share-btn.facebook { background: #3b5998; }
.share-btn.whatsapp { background: #25D366; }
.share-btn.linkedin { background: #0077b5; }

body.dark .share-section {
  border-color: #333;
}
/* News cards in dark mode inherit from body state */
body.dark .news-card {
  background-color: #1e1e1e00;
  color: #f0f0f0;
}
body.dark .news-card .card-content p { color: #cfcfcf; }
body.dark .news-card .card-content small { color: #b0b0b0; }
body, .news-card {
  transition: background-color 0.3s ease, color 0.3s ease;
}

