/* ═══════════════════════════════════════════════
   MPDev — Modern News Portal (DioLinux-Inspired)
   ═══════════════════════════════════════════════ */

/* ─── Theme Variables ─────────────────────── */
:root {
  --bg: #f4f4f6;
  --bg-card: #fff;
  --bg-hdr: rgba(255,255,255,.95);
  --brd: #e0e0e0;
  --txt: #1a1a2e;
  --tsec: #555;
  --tmu: #888;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent2: #06b6d4;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.1);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --bg-card: #18181b;
    --bg-hdr: rgba(9,9,11,.97);
    --brd: #27272a;
    --txt: #e4e4e7;
    --tsec: #a1a1aa;
    --tmu: #71717a;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent2: #22d3ee;
    --link: #60a5fa;
    --link-hover: #3b82f6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.5);
  }
}

.t-light {
  --bg: #f4f4f6;
  --bg-card: #fff;
  --bg-hdr: rgba(255,255,255,.95);
  --brd: #e0e0e0;
  --txt: #1a1a2e;
  --tsec: #555;
  --tmu: #888;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent2: #06b6d4;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.1);
}

.t-dark {
  --bg: #09090b;
  --bg-card: #18181b;
  --bg-hdr: rgba(9,9,11,.97);
  --brd: #27272a;
  --txt: #e4e4e7;
  --tsec: #a1a1aa;
  --tmu: #71717a;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent2: #22d3ee;
  --link: #60a5fa;
  --link-hover: #3b82f6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.5);
}

/* ─── Reset & Base ────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--txt);
  line-height: 1.6;
  transition: background .3s ease, color .3s ease;
  min-height: 100vh;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color .2s ease;
}

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

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

button {
  font-family: var(--font);
  cursor: pointer;
}

/* ─── Header ──────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-hdr);
  border-bottom: 1px solid var(--brd);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo {
  font-size: 1.35em;
  font-weight: 800;
  letter-spacing: -.5px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--tsec) !important;
  font-size: .85em;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background .2s, color .2s;
  text-decoration: none !important;
}

.nav-link:hover {
  color: var(--txt) !important;
  background: var(--brd);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--brd);
}

.lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: .85em;
  text-decoration: none !important;
  transition: background .2s;
}

.lang-link:hover {
  background: var(--brd);
}

.lang-link--active {
  background: var(--accent) !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px var(--bg-hdr), 0 0 0 4px var(--accent);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid var(--brd);
  color: var(--tsec);
  border-radius: 6px;
  font-size: .78em;
  font-weight: 600;
  transition: all .2s;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--brd);
  color: var(--txt);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 1.1em;
}

/* ─── Main Content ────────────────────────── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* ─── Hero Section (imagem full-width com texto sobreposto) ── */
.hero-section {
  margin-bottom: 40px;
}

.hero-card {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-md);
  transition: box-shadow .3s, transform .3s;
}

.hero-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.hero-link {
  display: block;
  position: relative;
  text-decoration: none !important;
  color: inherit !important;
  aspect-ratio: 21 / 9;
  min-height: 340px;
  max-height: 520px;
}

.hero-img-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--brd);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}

.hero-card:hover .hero-img {
  transform: scale(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(0,0,0,.55) 65%, rgba(0,0,0,.88) 100%);
}

.hero-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(20px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.hero-body .hero-cat {
  font-size: .72em !important;
  padding: 5px 14px !important;
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: 50px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.hero-title {
  font-size: clamp(1.4em, 3.2vw, 2.2em);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.5px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-excerpt {
  font-size: .95em;
  color: rgba(255,255,255,.88);
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
  line-height: 1.55;
  max-width: 640px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-body .card-date {
  color: rgba(255,255,255,.65);
}

/* ─── Section Header ──────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--brd);
}

.section-title {
  font-size: 1.15em;
  font-weight: 700;
  color: var(--txt);
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  flex-shrink: 0;
}

.section-date {
  font-size: .8em;
  color: var(--tmu);
  font-weight: 400;
}

/* ─── Card Grid ───────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-section {
  margin-bottom: 36px;
}

/* ─── Grid Card ───────────────────────────── */
.grid-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--brd);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
}

.grid-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  color: inherit !important;
  height: 100%;
}

.card-img-wrap {
  position: relative;
  padding-top: 56.25%; /* 16:9 */
  overflow: hidden;
  background: var(--brd);
}

.card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.grid-card:hover .card-img {
  transform: scale(1.06);
}

.card-body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-cat {
  display: inline-block;
  font-size: .7em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--accent) !important;
  padding: 3px 10px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  align-self: flex-start;
  text-decoration: none !important;
  transition: opacity .2s;
}
.card-cat:hover {
  opacity: .8;
  color: var(--accent) !important;
}

.card-title {
  font-size: .95em;
  font-weight: 600;
  line-height: 1.35;
  color: var(--txt);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s;
}

.grid-card:hover .card-title {
  color: var(--accent);
}

.card-excerpt {
  font-size: .82em;
  color: var(--tsec);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-date {
  font-size: .75em;
  color: var(--tmu);
  margin-top: auto;
}

/* ─── Load More Button ────────────────────── */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: var(--bg-card);
  border: 2px solid var(--brd);
  border-radius: 50px;
  color: var(--txt);
  font-size: .9em;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s ease;
  font-family: var(--font);
}

.load-more-btn:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-card));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.load-more-btn.loading {
  opacity: .7;
  pointer-events: none;
}

.load-more-icon {
  font-size: .85em;
  transition: transform .3s;
}

.load-more-btn:hover .load-more-icon {
  transform: translateY(2px);
}

.load-more-btn.loading .load-more-icon {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ─── Article Page ────────────────────────── */
.article-page {
  max-width: 740px;
  margin: 0 auto;
}

.article-breadcrumb {
  margin-bottom: 16px;
}

.breadcrumb-link {
  font-size: .85em;
  color: var(--tsec) !important;
  text-decoration: none !important;
  font-weight: 500;
  transition: color .2s;
}

.breadcrumb-link:hover {
  color: var(--accent) !important;
}

.article-header {
  margin-bottom: 24px;
}

.article-img-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--brd);
  position: relative;
  padding-top: 50%; /* 2:1 */
}

.article-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-meta-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.article-cat {
  font-size: .7em !important;
}

.article-date {
  font-size: .82em;
  color: var(--tmu);
}

.article-words {
  font-size: .82em;
  color: var(--tmu);
}

.article-title {
  font-size: 1.8em;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.5px;
  color: var(--txt);
}

/* Article body */
.article-body {
  font-family: var(--font);
  font-size: 1.05em;
  line-height: 1.85;
  color: var(--txt);
  padding-bottom: 20px;
}

.article-body p {
  margin-bottom: 18px;
  font-size: 1em;
}

.article-body h2 {
  font-family: var(--font);
  font-size: 1.3em;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--txt);
}

.article-body h3 {
  font-family: var(--font);
  font-size: 1.1em;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--txt);
}

.article-body strong {
  color: var(--txt);
  font-weight: 700;
}

.article-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover {
  color: var(--link-hover);
}

.article-source {
  font-family: var(--font);
  font-size: .85em;
  color: var(--tmu);
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--brd);
  border-radius: var(--radius-sm);
  margin-top: 24px;
}

.article-source a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.article-source a:hover {
  text-decoration: underline;
}

/* ─── Related Articles ────────────────────── */
.related-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 2px solid var(--brd);
}

.related-section .section-title {
  margin-bottom: 16px;
}

.card-grid--related {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid--related .card-title {
  font-size: .88em;
}

/* ─── About Page ──────────────────────────── */
.about-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 0;
}

.about-title {
  font-size: 1.8em;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -.5px;
}

.about-subtitle {
  font-size: 1.3em;
  font-weight: 700;
  margin: 28px 0 12px;
}

.about-text {
  font-size: 1em;
  line-height: 1.7;
  color: var(--tsec);
  margin-bottom: 14px;
}

.about-notice {
  margin: 20px 0;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--brd);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: .9em;
  line-height: 1.6;
  color: var(--tsec);
}

/* ─── Ads ─────────────────────────────────── */
.ad-container {
  display: flex;
  justify-content: center;
  margin: 24px 0;
  min-height: 90px;
}

.ad-placeholder {
  background: var(--bg-card);
  border: 1px dashed var(--brd);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  color: var(--tmu);
  font-size: .82em;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 24px 0;
}

.ad-placeholder span {
  font-size: .85em;
  opacity: .7;
}

/* ─── Footer ──────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--brd);
  margin-top: 48px;
  padding: 32px 24px;
  text-align: center;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: .88em;
}

.footer-links a {
  color: var(--tsec) !important;
  text-decoration: none !important;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--link) !important;
}

.footer-sep {
  color: var(--brd);
}

.footer-copy {
  font-size: .82em;
  color: var(--tmu);
  margin-bottom: 6px;
}

.footer-disclaimer {
  font-size: .78em;
  color: var(--tmu);
  opacity: .7;
}

/* ─── Utilities ───────────────────────────── */
.btn {
  background: transparent;
  border: 1px solid var(--brd);
  color: var(--tsec);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: .8em;
  font-family: var(--font);
  font-weight: 500;
  transition: all .2s;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.st {
  font-size: .8em;
  color: var(--tmu);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 20px 0 12px;
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  font-weight: 600;
}

.meta {
  font-size: .75em;
  color: var(--tmu);
}

/* ─── Responsive ──────────────────────────── */

/* Tablet: 2 cols, hero stacked */
@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid--related {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-link {
    aspect-ratio: 16 / 9;
    min-height: 280px;
  }

  .article-title {
    font-size: 1.5em;
  }

  .header-inner {
    padding: 0 16px;
  }
}

/* Mobile: 1 col */
@media (max-width: 600px) {
  .main-content {
    padding: 16px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card-grid--related {
    grid-template-columns: 1fr;
  }

  .hero-link {
    aspect-ratio: auto;
    min-height: 320px;
  }

  .hero-excerpt {
    display: none;
  }

  .section-header {
    flex-direction: column;
    gap: 4px;
  }

  .article-title {
    font-size: 1.3em;
  }

  .article-img-wrap {
    padding-top: 56.25%;
  }

  .article-body {
    font-size: .95em;
  }

  .load-more-btn {
    width: 100%;
    justify-content: center;
  }

  /* Mobile nav */
  .header-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-hdr);
    border-bottom: 1px solid var(--brd);
    padding: 12px 16px;
    gap: 4px;
    backdrop-filter: blur(12px);
  }

  .header-nav.nav-open {
    display: flex;
  }

  .header-actions {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--brd);
  }

  .menu-toggle {
    display: flex;
  }

  .site-footer {
    padding: 24px 16px;
  }
}

/* ─── Accessibility ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Focus visible */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Consent Banner (LGPD/GDPR) ────────────── */
.consent-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 560px;
  margin: 0 auto;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.consent-text {
  flex: 1 1 260px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--tsec);
}
.consent-text a {
  color: var(--link);
}
.consent-actions {
  display: flex;
  gap: 8px;
}
.consent-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brd);
  background: transparent;
  color: var(--txt);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
}
.consent-btn--ok {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.consent-btn--ok:hover {
  background: var(--accent-hover);
}
.consent-banner[hidden] {
  display: none !important;
}
