/* =====================================================
   IBGE - National Homepage Styles (nacional.css)
   Design tokens from global.css + layout variations
   ===================================================== */

/* ---- Base Wrapper ---- */
.nacional-page {
  --nacional-gap: 24px;
  --nacional-section-pad: 30px 0;
  max-width: var(--container-width, 1185px);
  margin: 0 auto;
}

/* ---- Intro Section ---- */
.nacional-intro {
  padding: 40px 0 30px;
  text-align: center;
}
.nacional-intro h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary-dark, #0c326f);
  margin-bottom: 20px;
}
.nacional-intro p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text, #515151);
  max-width: 980px;
  margin: 0 auto 16px;
}
.nacional-intro a {
  color: var(--color-primary, #1351b4);
  text-decoration: underline;
  font-weight: 600;
}

/* ---- Section Headers ---- */
.nacional-section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-blue, #345d96);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e0e0;
}

/* ---- News Feed Containers ---- */
.nacional-news-feed {
  padding: var(--nacional-section-pad);
}
.nacional-events-feed {
  padding: var(--nacional-section-pad);
}

/* ---- Variation Switcher ---- */
.nacional-switcher {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}
.nacional-switcher a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  background: #e8e8e8;
  color: #555;
  transition: background 0.2s, color 0.2s;
}
.nacional-switcher a:hover,
.nacional-switcher a.active {
  background: var(--color-primary, #1351b4);
  color: #fff;
}

/* ---- UF Tag ---- */
.uf-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary, #1351b4);
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.uf-tag-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.uf-tag-group .uf-tag {
  background: var(--color-primary-light, #1a6bc4);
}

/* =====================================================
   V1 — Classic / Default Layout
   ===================================================== */
.layout-v1 .noticias-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.layout-v1 .noticia-destaque {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  min-height: 340px;
}
.layout-v1 .noticia-destaque .uf-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
}
.layout-v1 .noticia-destaque-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  z-index: 2;
}
.layout-v1 .noticia-destaque-overlay h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}
.layout-v1 .noticia-destaque-date {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}
.layout-v1 .noticias-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.layout-v1 .noticia-side-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.layout-v1 .noticia-side-img {
  width: 190px;
  min-width: 130px;
  height: 116px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  background: #87a8c7;
}
.layout-v1 .noticia-side-date {
  color: var(--color-text-blue, #345d96);
  font-size: 15px;
  margin-bottom: 4px;
}
.layout-v1 .noticia-side-info p {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}
.layout-v1 .noticia-anterior-item {
  display: flex;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid #d0d0d0;
  align-items: flex-start;
}
.layout-v1 .noticia-anterior-img {
  width: 190px;
  min-width: 190px;
  height: 116px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  background: #a0b8ce;
}
.layout-v1 .noticia-anterior-info .loc-date {
  color: var(--color-text-blue, #345d96);
  margin-bottom: 4px;
  font-size: 13px;
}
.layout-v1 .noticia-anterior-info h4 {
  font-size: 16.8px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}
.layout-v1 .noticia-anterior-info p {
  color: #555;
  line-height: 1.5;
  font-size: 14px;
}

/* =====================================================
   V2 — Card Grid Layout
   ===================================================== */
.layout-v2 .news-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.layout-v2 .news-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.layout-v2 .news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.layout-v2 .news-card-img {
  width: 100%;
  height: 160px;
  background: #a0b8ce;
  overflow: hidden;
}
.layout-v2 .news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.layout-v2 .news-card-body {
  padding: 16px;
}
.layout-v2 .news-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.layout-v2 .news-card-date {
  font-size: 12px;
  color: #777;
}
.layout-v2 .news-card-body h4 {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.4;
  margin-bottom: 8px;
}
.layout-v2 .news-card-body p {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

.layout-v2 .events-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.layout-v2 .event-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 14px;
  border-left: 4px solid var(--color-primary);
}
.layout-v2 .event-card-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}
.layout-v2 .event-card-title {
  font-size: 14px;
  color: #333;
  font-weight: 600;
}
.layout-v2 .event-card-date {
  font-size: 12px;
  color: #777;
}

/* =====================================================
   V3 — Magazine / Editorial Layout
   ===================================================== */
.layout-v3 .magazine-header {
  text-align: center;
  padding: 30px 0;
}
.layout-v3 .magazine-header h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 400;
  color: #1a1a1a;
  margin-bottom: 12px;
}
.layout-v3 .magazine-divider {
  width: 80px;
  height: 3px;
  background: var(--color-primary);
  margin: 0 auto;
}
.layout-v3 .magazine-featured {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 32px;
  margin-top: 30px;
}
.layout-v3 .magazine-main {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  min-height: 420px;
}
.layout-v3 .magazine-main img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.layout-v3 .magazine-main .uf-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
}
.layout-v3 .magazine-main-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff;
  z-index: 2;
}
.layout-v3 .magazine-main-overlay h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}
.layout-v3 .magazine-main-overlay .date {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 8px;
}
.layout-v3 .magazine-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.layout-v3 .magazine-stack-item {
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid #eaeaea;
}
.layout-v3 .magazine-stack-item:last-child {
  border-bottom: none;
}
.layout-v3 .magazine-stack-img {
  width: 120px;
  height: 80px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  background: #87a8c7;
}
.layout-v3 .magazine-stack-info h4 {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
  margin-bottom: 4px;
}
.layout-v3 .magazine-stack-info .date {
  font-size: 12px;
  color: #777;
}
.layout-v3 .magazine-events-timeline {
  margin-top: 30px;
  padding-left: 20px;
  border-left: 2px solid var(--color-primary-lighter);
}
.layout-v3 .magazine-timeline-item {
  position: relative;
  padding-bottom: 18px;
}
.layout-v3 .magazine-timeline-item::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 4px;
  width: 12px;
  height: 12px;
  background: var(--color-primary);
  border-radius: 50%;
}
.layout-v3 .magazine-timeline-item .date {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 2px;
}
.layout-v3 .magazine-timeline-item .title {
  font-size: 14px;
  color: #333;
  font-weight: 600;
}

/* =====================================================
   V4 — Dashboard / Data-Driven Layout
   ===================================================== */
.layout-v4 .dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.layout-v4 .dashboard-stat-card {
  background: linear-gradient(135deg, #1351a0, #1a6bc4);
  color: #fff;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}
.layout-v4 .dashboard-stat-card .num {
  display: block;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}
.layout-v4 .dashboard-stat-card .label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
}
.layout-v4 .dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.layout-v4 .dashboard-table th,
.layout-v4 .dashboard-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #e8e8e8;
}
.layout-v4 .dashboard-table th {
  font-weight: 700;
  color: var(--color-text-blue);
  background: #f5f7fa;
}
.layout-v4 .dashboard-table tr:hover td {
  background: #f0f6ff;
}
.layout-v4 .dashboard-table .col-date {
  white-space: nowrap;
  width: 110px;
}
.layout-v4 .dashboard-table .col-uf {
  width: 70px;
}
.layout-v4 .dashboard-table .col-cat {
  width: 160px;
}
.layout-v4 .dashboard-events-urgent {
  background: #fff3e0;
  border-left: 4px solid #ff9800;
  padding: 16px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 12px;
}
.layout-v4 .dashboard-events-urgent .date {
  font-size: 12px;
  font-weight: 700;
  color: #e65100;
}
.layout-v4 .dashboard-mini-map {
  width: 100%;
  height: 180px;
  background: #f0f4f8;
  border-radius: 6px;
  overflow: hidden;
}
.layout-v4 .dashboard-mini-map svg {
  width: 100%;
  height: 100%;
  display: block;
}
.layout-v4 .dashboard-mini-map .brazil-state {
  cursor: pointer;
  transition: fill 0.2s;
}
.layout-v4 .dashboard-mini-map .map-label {
  font-family: var(--font-family, Arial, sans-serif);
}

/* =====================================================
   V5 — Map Interactive Layout
   ===================================================== */
.layout-v5 .brazil-map-section {
  position: relative;
  width: 100%;
  height: clamp(420px, 68vh, 640px);
  min-height: 420px;
  background: #eef3f0;
  border: 1px solid #d5dfd8;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7);
}
.layout-v5 .map-section h2 {
  text-align: center;
}
.layout-v5 .brazil-map-section .map-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: rgba(255,255,255,0.94);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 5;
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: normal;
  text-align: center;
}
.layout-v5 .brazil-map-section.has-selection .map-hint {
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
}
.layout-v5 #brazil-map-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: contain;
}
.layout-v5 #brazil-map-container svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
}
.layout-v5 div#brazil-map-tooltip.map-tooltip {
  position: fixed;
  background: rgba(12, 50, 111, 0.95);
  border: 2px solid var(--color-primary-light, #1a6bc4);
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.layout-v5 div#brazil-map-tooltip.map-tooltip.visible {
  opacity: 1;
}
.layout-v5 #brazil-map-container .brazil-state {
  fill: var(--color-primary, #1351b4);
  stroke: #fff;
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.16s ease, filter 0.16s ease;
  vector-effect: non-scaling-stroke;
}
.layout-v5 #brazil-map-container .brazil-state:hover,
.layout-v5 #brazil-map-container .brazil-state.is-hovered {
  fill: var(--color-primary-light, #1a6bc4);
}
.layout-v5 #brazil-map-container .brazil-state:focus,
.layout-v5 #brazil-map-container .brazil-state.is-active {
  outline: none;
  fill: var(--color-primary-dark, #0c326f);
  filter: drop-shadow(0 3px 6px rgba(12, 50, 111, 0.24));
}
.layout-v5 #brazil-map-container .brazil-state-hitarea {
  fill: transparent;
  stroke: none;
  cursor: pointer;
  pointer-events: fill;
  touch-action: manipulation;
}
.layout-v5 .map-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #777;
  font-size: 15px;
  text-align: center;
  padding: 40px;
}
.layout-v5 .map-selection-panel {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(19, 81, 180, 0.18);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(12, 50, 111, 0.18);
  padding: 12px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.layout-v5 .map-selection-panel.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.layout-v5 .map-selection-text {
  min-width: 0;
}
.layout-v5 .map-selection-text span {
  display: block;
  color: #5f6f7d;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.layout-v5 .map-selection-text strong {
  display: block;
  color: var(--color-primary-dark, #0c326f);
  font-size: 16px;
  line-height: 1.25;
}
.layout-v5 .map-selection-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--color-primary, #1351b4);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
}
.layout-v5 .map-selection-link:focus,
.layout-v5 .map-selection-link:hover {
  background: var(--color-primary-dark, #0c326f);
  color: #fff;
}

/* ---- V5 Feed below map ---- */
.layout-v5 .v5-feed {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 30px 0;
}

/* =====================================================
   CTA / Links
   ===================================================== */
.nacional-cta {
  text-align: center;
  padding: 20px 0;
}
.nacional-cta p {
  font-size: 15px;
  color: #666;
  margin-bottom: 8px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 960px) {
  .layout-v1 .noticias-grid,
  .layout-v2 .news-card-grid,
  .layout-v2 .events-card-grid,
  .layout-v3 .magazine-featured,
  .layout-v4 .dashboard-stats,
  .layout-v5 .v5-feed {
    grid-template-columns: 1fr;
  }
  .layout-v1 .noticia-side-item,
  .layout-v1 .noticia-anterior-item {
    flex-direction: column;
  }
  .layout-v1 .noticia-side-img,
   .layout-v1 .noticia-anterior-img {
     width: 100%;
     min-width: 0;
     height: 180px;
   }
  .layout-v3 .magazine-header h1 {
    font-size: 26px;
  }
  .layout-v4 .dashboard-table {
    font-size: 13px;
  }
  .layout-v5 .brazil-map-section {
    height: min(64vh, 520px);
    min-height: 340px;
  }
  .layout-v5 .brazil-map-section .map-hint {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
    transform: none;
    border-radius: 8px;
    font-size:unset;
    padding: 10px 12px;
  }
  .layout-v5 .brazil-map-section.has-selection .map-hint {
    transform: translateY(8px);
  }
  .nacional-intro h2 {
    font-size: 22px;
  }
}

@media (max-width: 768px) {
  .layout-v2 .news-card-grid {
    grid-template-columns: 1fr;
  }
  .layout-v4 .dashboard-stats {
    grid-template-columns: 1fr;
  }
  .layout-v4 .dashboard-table .col-cat {
    display: none;
  }
}

@media (max-width: 480px) {
  .nacional-page {
    padding: 0 12px;
  }
  .layout-v5 .brazil-map-section {
    height: 58vh;
    min-height: 330px;
  }
  .layout-v5 .map-selection-panel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    grid-template-columns: 1fr;
  }
  .layout-v5 .map-selection-link {
    width: 100%;
  }
  .layout-v3 .magazine-stack-img {
    width: 90px;
    height: 60px;
  }
}
