:root {
  --primary: #00a859;
  --primary-hover: #008f4c;
  --primary-light: #e6f6ef;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
}

header {
  background-color: var(--primary);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

header h1 {
  color: #ffffff;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}

header h1 span {
  font-weight: 400;
  opacity: 0.9;
}

header h1:hover {
  opacity: 0.9;
}

.ad-container {
  max-width: 1200px;
  margin: 15px auto;
  padding: 0 20px;
  text-align: center;
  width: 100%;
}

.banner-destaque {
  max-width: 1200px;
  margin: 10px auto 20px;
  padding: 0 20px;
  width: 100%;
}

.destaque-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.destaque-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.destaque-card a {
  display: grid;
  grid-template-columns: 1fr;
  text-decoration: none;
  color: inherit;
}

.badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 20px;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.destaque-img-wrapper {
  width: 100%;
  height: 240px;
  overflow: hidden;
  background-color: var(--primary-light);
}

.destaque-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s ease, transform 0.5s ease;
}

.destaque-card:hover .destaque-img-wrapper img {
  transform: scale(1.03);
}

.destaque-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.source-tag {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.destaque-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--text-main);
  transition: opacity 0.3s ease;
}

.destaque-content p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  transition: opacity 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
  flex: 1;
  width: 100%;
}

.feed-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.4s ease;
  opacity: 0;
}

.card.visible {
  opacity: 1;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-img-wrapper {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background-color: var(--primary-light);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover img {
  transform: scale(1.05);
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 6px 0 10px;
  line-height: 1.35;
}

.card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

footer {
  background: #111827;
  color: #f9fafb;
  text-align: center;
  padding: 25px 20px;
  margin-top: auto;
  border-top: 3px solid var(--primary);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

footer p {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 8px;
}

footer .links a {
  color: var(--primary);
  margin: 0 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}

footer .links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

#loading-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.loader {
  border: 4px solid var(--primary-light);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 0.8s linear infinite;
  margin-bottom: 15px;
}

.scroll-loader {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.spinner-small {
  border: 3px solid var(--primary-light);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#loading-overlay p {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

@media (min-width: 640px) {
  .feed-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .feed-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .destaque-card a {
    grid-template-columns: 1.2fr 1fr;
  }

  .destaque-img-wrapper {
    height: 320px;
  }

  .destaque-content {
    padding: 30px;
  }

  .destaque-content h2 {
    font-size: 1.6rem;
  }
}