/* =========================
   THEME VARIABLES
========================= */

:root {
  --primary: #0f172a;

  --background: #f8fafc;
  --text-dark: #0f172a;
  --text-light: #f1f5f9;
  --accent: #3b82f6;
  --secondary: #ffffff;

  --border-color: #e5e7eb;
  --hover-bg: rgba(15, 23, 42, 0.04);
  --shadow-light: rgba(0, 0, 0, 0.08);
  --shadow-dark: rgba(0, 0, 0, 0.4);
}

.dark-mode {
  --background: #0b1120;
  --text-dark: #f1f5f9;
  --text-light: #f1f5f9;
  --accent: #60a5fa;
  --secondary: #1e293b;

  --border-color: #334155;
  --hover-bg: rgba(255, 255, 255, 0.03);
}

/* =========================
   RESET
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  background: var(--background);
  color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

/* =========================
   CONTAINER
========================= */

.container {
  max-width: 1200px;
  margin: auto;
  padding: 20px;
}

.container-wide {
  width: 100%;
  padding: 0;
}

/* =========================
   HEADER
========================= */

.site-header {
  background: var(--primary);
  color: var(--text-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 20px var(--shadow-light);
}

.dark-mode .site-header {
  box-shadow: 0 4px 20px var(--shadow-dark);
}

.site-header.hide {
  transform: translateY(-100%);
}

.site-header a {
  color: var(--text-light);
  text-decoration: none;
}

.site-header a:hover {
  color: var(--accent);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.main-nav a {
  font-weight: 500;
}

/* =========================
   FEATURED
========================= */

.featured {
  margin-top: 40px;
}

.featured-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.featured-post {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  background: var(--secondary);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.featured-post:hover {
  transform: translateY(-3px);
  box-shadow: 0 25px 50px var(--shadow-light);
}

.dark-mode .featured-post:hover {
  box-shadow: 0 25px 50px var(--shadow-dark);
}

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

.featured-content {
  padding: 28px;
}

.featured-content h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  line-height: 1.2;
  margin-bottom: 12px;
  transition: color 0.2s ease;
}

.featured-post:hover h2 {
  color: var(--accent);
}

/* RESPONSIVO FEATURED */
@media (max-width: 900px) {
  .featured-post {
    grid-template-columns: 1fr;
  }

  .featured-post img {
    height: 260px;
  }
}

/* =========================
   POST GRID
========================= */

.post-grid {
  margin-top: 50px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

.post-card {
  background: var(--secondary);
  padding: 22px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px var(--shadow-light);
}

.dark-mode .post-card:hover {
  box-shadow: 0 20px 40px var(--shadow-dark);
}

.post-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

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

/* =========================
   FEED
========================= */

.feed {
  margin-top: 50px;
}

.feed-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.feed-item {
  display: flex;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.feed-item:hover {
  background: var(--hover-bg);
  transform: translateY(-2px);
}

.feed-item img {
  width: 260px;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
}

.feed-content h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  margin: 8px 0;
  transition: color 0.2s ease;
}

.feed-item:hover h2 {
  color: var(--accent);
}

.category {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* RESPONSIVO FEED */
@media (max-width: 768px) {
  .feed-item {
    flex-direction: column;
  }

  .feed-item img {
    width: 100%;
    height: 200px;
  }
}

/* =========================
   AD SECTION
========================= */

.ad-section {
  margin: 60px 0;
}

.ad-container {
  background: #ffffff;
  border: 1px dashed var(--border-color);
  border-radius: 14px;
  padding: 50px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

/* =========================
   FOOTER
========================= */

.site-footer {
  background: var(--primary);
  color: var(--text-light);
  text-align: center;
  padding: 30px 0;
  margin-top: 60px;
}

main {
  flex: 1;
}

/* =========================
   LINKS GLOBAIS
========================= */

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

/* =========================
   THEME TOGGLE
========================= */

.theme-toggle {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--secondary);
  color: var(--text-dark);

  transition: background 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.08);
  background: var(--accent);
  color: var(--background);
}

.theme-toggle i {
  font-size: 18px;
  position: absolute;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.icon-sun {
  opacity: 0;
  transform: scale(0.8);
}

.dark-mode .icon-moon {
  opacity: 0;
  transform: scale(0.8);
}

.dark-mode .icon-sun {
  opacity: 1;
  transform: scale(1);
}