/* Observatorio 2030 — estilos simples */
:root {
  --verde: #2a4f42;
  --verde-oscuro: #1a2e28;
  --terracota: #b84a32;
  --fondo: #f5f2ec;
  --tarjeta: #fff;
  --texto: #1a2420;
  --texto-suave: #4a5650;
  --borde: #cfc9bc;
  --ancho: min(52rem, 100% - 2rem);
  --nav-alto: 3.25rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-alto) + 1rem);
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  line-height: 1.6;
}

a { color: var(--terracota); }
a:hover { color: var(--verde); }

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

/* Barra de navegación */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  min-height: var(--nav-alto);
  padding: 0.5rem 1rem;
  background: var(--verde-oscuro);
  color: #fff;
  border-bottom: 3px solid #b8860b;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  text-decoration: none;
  margin-right: auto;
}

.nav-toggle {
  display: none;
  padding: 0.35rem 0.65rem;
  font-size: 1rem;
  background: #fff;
  color: var(--verde-oscuro);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #e8ebe9;
  text-decoration: none;
  border-radius: 4px;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.site-main {
  max-width: 72rem;
  margin: 0 auto;
}

/* Secciones */
section {
  padding: 2.5rem 1rem;
  border-bottom: 1px solid var(--borde);
}

.section-inner {
  max-width: var(--ancho);
  margin: 0 auto;
}

.section-head {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--borde);
}

.section-index {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: var(--verde);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.section-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--terracota);
  margin-bottom: 0.25rem;
}

.section-title {
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  color: var(--verde);
  line-height: 1.2;
}

.block-title {
  font-size: 1.1rem;
  color: var(--verde);
  margin: 1.75rem 0 0.75rem;
}

.prose {
  color: var(--texto-suave);
  margin-bottom: 1.25rem;
}

.prose p + p { margin-top: 0.75rem; }

.divider {
  border: none;
  border-top: 1px dashed var(--borde);
  margin: 1.5rem 0;
}

/* Portada */
.hero {
  background: var(--tarjeta);
}

.hero-grid {
  max-width: var(--ancho);
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .hero-grid { grid-template-columns: 1fr 240px; }
}

.hero-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--terracota);
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  color: var(--verde);
  margin-bottom: 0.35rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--texto-suave);
  margin-bottom: 0.5rem;
}

.hero-sector,
.hero-meta {
  font-size: 0.9rem;
  color: var(--texto-suave);
  margin-bottom: 0.75rem;
}

.hero-intro { margin-bottom: 1rem; }

.hero-question {
  padding: 1rem;
  background: var(--fondo);
  border-left: 4px solid var(--terracota);
  font-style: italic;
}

.hero-aside {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-panel {
  padding: 1rem;
  background: var(--verde-oscuro);
  color: #e8ebe9;
  border-radius: 6px;
  font-size: 0.9rem;
}

.hero-panel-stat {
  font-size: 2rem;
  font-weight: 700;
  color: #b8860b;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hero-chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 4px;
}

/* Tablas */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--borde);
  border-radius: 6px;
  background: var(--tarjeta);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 560px;
}

.data-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: var(--verde);
  color: #fff;
  font-size: 0.8rem;
}

.data-table td {
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--borde);
  vertical-align: top;
  color: var(--texto-suave);
}

.data-table tbody tr:nth-child(even) { background: #faf8f4; }

/* Conceptos */
.concepts-grid {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

@media (min-width: 600px) {
  .concepts-grid { grid-template-columns: repeat(2, 1fr); }
}

.concept-card {
  padding: 1rem;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-left: 4px solid var(--verde);
  border-radius: 4px;
}

.concept-card h4 {
  font-size: 0.95rem;
  color: var(--verde);
  margin-bottom: 0.35rem;
}

.concept-card p {
  font-size: 0.88rem;
  color: var(--texto-suave);
}

/* 5 V */
.fivev-list {
  list-style: none;
  margin: 1rem 0;
}

.fivev-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 4px;
}

.fivev-letter {
  font-weight: 700;
  color: var(--terracota);
  min-width: 1.25rem;
}

.fivev-body { font-size: 0.9rem; color: var(--texto-suave); }
.fivev-body strong { color: var(--verde); }

/* IA — pestañas */
.ai-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 1rem 0;
}

.ai-tab {
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 4px;
}

.ai-tab.active {
  background: var(--verde);
  color: #fff;
  border-color: var(--verde);
}

.ai-tab small {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
}

.ai-panel {
  display: none;
  padding: 1.25rem;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 6px;
  margin-bottom: 1rem;
}

.ai-panel.active { display: block; }

.ai-panel h3 { color: var(--verde); margin-bottom: 0.25rem; }

.ai-panel-teaser {
  font-size: 0.9rem;
  color: var(--terracota);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--borde);
}

.ai-details {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .ai-details { grid-template-columns: 1fr 1fr; }
  .ai-detail-wide { grid-column: 1 / -1; }
}

.ai-detail {
  padding: 0.75rem;
  background: var(--fondo);
  border-radius: 4px;
  font-size: 0.88rem;
}

.ai-detail dt {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--terracota);
  margin-bottom: 0.25rem;
}

.ai-detail dd { color: var(--texto-suave); margin: 0; }

.ai-source {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--borde);
  font-size: 0.88rem;
}

/* Viaje del dato */
.journey-timeline {
  list-style: none;
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--verde);
}

.journey-step {
  padding: 0 0 1rem 1rem;
}

.journey-label {
  font-weight: 700;
  color: var(--verde);
}

.journey-step-desc {
  font-size: 0.88rem;
  color: var(--texto-suave);
}

/* Badges y notas */
.badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0;
}

.badge {
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 4px;
}

.rgpd-note,
.ia-error-note,
.final-answer {
  padding: 1rem;
  margin-top: 1rem;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 6px;
  font-size: 0.92rem;
  color: var(--texto-suave);
}

.rgpd-note { background: var(--verde-oscuro); color: #dce3df; }
.rgpd-note strong { color: #b8860b; }

.final-answer { border-left: 4px solid #b8860b; }
.final-answer h3 { color: var(--verde); margin-bottom: 0.5rem; font-size: 1.05rem; }

/* Opiniones */
.opinions-list { list-style: none; }

.opinion-block {
  padding: 1rem 0;
  border-bottom: 1px solid var(--borde);
}

.opinion-block h4 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--texto);
}

.opinion-block p { font-size: 0.92rem; color: var(--texto-suave); }

.warning-block {
  margin-top: 1.25rem;
  padding: 1rem;
  background: #fff8f0;
  border: 1px solid var(--terracota);
  border-radius: 6px;
}

.warning-block h4 { margin-bottom: 0.5rem; }
.warning-block blockquote { font-style: italic; margin: 0.5rem 0; }

.code-block {
  padding: 1rem;
  margin: 1rem 0;
  background: #1e2a26;
  color: #c8d4cf;
  border-radius: 6px;
  font-family: Consolas, monospace;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

/* Fuentes */
.sources-list {
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 600px) {
  .sources-list { grid-template-columns: 1fr 1fr; }
}

.source-item {
  padding: 1rem;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 6px;
}

.source-item h4 { font-size: 0.95rem; color: var(--verde); margin-bottom: 0.35rem; }
.source-item p { font-size: 0.85rem; color: var(--texto-suave); margin-bottom: 0.35rem; }

.source-icon { display: none; }

/* Pie */
footer {
  padding: 2rem 1rem;
  background: var(--verde-oscuro);
  color: #c8d4cf;
  font-size: 0.88rem;
}

.footer-grid {
  max-width: var(--ancho);
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr; }
}

.footer-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.footer-credits h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #b8860b;
  margin-bottom: 0.35rem;
}

.footer-credits ul { list-style: none; }
.footer-credits code { font-size: 0.85em; }
.footer-bottom {
  max-width: var(--ancho);
  margin: 1rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
  opacity: 0.85;
}

/* Móvil: menú colapsable */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: 0.5rem;
  }

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