/* =========================================================
   Orbita Defensa — custom overrides sobre Pico.css classless
   Paleta C monocromo + acento rojo
   ========================================================= */

:root {
  --od-bg: #f1f5f9;
  --od-fg: #0f172a;
  --od-muted: #64748b;
  --od-border: #cbd5e1;
  --od-accent: #dc2626;
  --od-card: #ffffff;
  --od-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  --pico-background-color: var(--od-bg);
  --pico-color: var(--od-fg);
  --pico-primary: var(--od-fg);
  --pico-primary-hover: var(--od-accent);
  --pico-primary-focus: rgba(220, 38, 38, 0.25);
  --pico-muted-color: var(--od-muted);
  --pico-muted-border-color: var(--od-border);
  --pico-font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pico-font-size: 17px;
  --pico-line-height: 1.65;
  --pico-border-radius: 4px;
  --pico-spacing: 1.25rem;
}

/* Layout base */
body {
  background: var(--od-bg);
  color: var(--od-fg);
}

main.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* Header del sitio */
.site-header {
  background: var(--od-fg);
  color: var(--od-bg);
  border-bottom: 4px solid var(--od-accent);
  margin-bottom: 2rem;
}
.site-header nav {
  max-width: 860px;
  margin: 0 auto;
  padding: 1rem;
}
.site-header a {
  color: var(--od-bg);
  text-decoration: none;
}
.site-header a:hover {
  color: var(--od-accent);
}
.site-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.site-brand strong {
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}
.site-brand .tagline {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--od-muted);
}

/* Typography */
h1 { font-size: 2.25rem; line-height: 1.15; letter-spacing: -0.5px; }
h2 { font-size: 1.6rem; line-height: 1.2; margin-top: 2.5rem; }
h3 { font-size: 1.2rem; }
.lead { font-size: 1.15rem; color: var(--od-muted); }
.muted { color: var(--od-muted); }
code, pre, dd code { font-family: var(--od-mono); font-size: 0.95em; }

/* Breadcrumbs */
.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.88rem;
  color: var(--od-muted);
}
.breadcrumbs a {
  color: var(--od-muted);
  text-decoration: none;
}
.breadcrumbs a:hover { color: var(--od-accent); }
.breadcrumbs span[aria-current] { color: var(--od-fg); }

/* Item (ficha) */
.item-header { margin-bottom: 2rem; }
.item-type { font-size: 0.82rem; letter-spacing: 2px; margin-bottom: 0.25rem; }

.hero {
  margin: 2rem 0;
  background: var(--od-fg);
}
.hero img {
  width: 100%;
  height: auto;
  display: block;
}
.hero figcaption {
  font-size: 0.82rem;
  color: var(--od-muted);
  padding: 0.5rem 0.75rem;
  background: var(--od-card);
  border-left: 3px solid var(--od-accent);
}
.hero figcaption .credit { display: block; margin-top: 0.15rem; }

.summary {
  font-size: 1.1rem;
  border-left: 3px solid var(--od-accent);
  padding: 0 1rem;
  margin: 2rem 0;
  color: var(--od-fg);
}

.facts-table {
  background: var(--od-card);
  border: 1px solid var(--od-border);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin: 2rem 0;
}
.facts-table h3 {
  font-size: 0.82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--od-muted);
  margin: 0 0 0.75rem;
}
.facts-table dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}
.facts-table dt {
  color: var(--od-muted);
  font-size: 0.9rem;
}
.facts-table dd {
  margin: 0;
  font-size: 0.95rem;
}

/* FAQ */
.faq { margin: 2.5rem 0; }
.faq details {
  border-bottom: 1px solid var(--od-border);
  padding: 1rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
}

/* Sources, related */
.item-sources ol { padding-left: 1.25rem; font-size: 0.9rem; }
.item-related ul { padding-left: 1.25rem; }

/* Home */
.hero-home { padding: 2rem 0; text-align: left; }
.hero-home h1 { font-size: 2.6rem; }

.hub-grid, .latest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.hub-card, .card {
  background: var(--od-card);
  border: 1px solid var(--od-border);
  border-radius: 4px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--od-fg);
  transition: border-color 0.15s;
}
.hub-card:hover, .card:hover {
  border-color: var(--od-accent);
  color: var(--od-fg);
}
.hub-card strong { display: block; font-size: 1.1rem; }
.card h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }

/* Newsletter */
.newsletter-cta {
  background: var(--od-fg);
  color: var(--od-bg);
  padding: 2rem;
  border-radius: 4px;
  margin: 3rem 0;
}
.newsletter-cta h3 { margin-top: 0; color: var(--od-bg); }
.newsletter-cta p { color: #cbd5e1; }
.newsletter-cta form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin-top: 1rem;
}
.newsletter-cta input[type=email] {
  flex: 1;
  background: #1e293b;
  color: var(--od-bg);
  border: 1px solid #334155;
}
.newsletter-cta button {
  background: var(--od-accent);
  border-color: var(--od-accent);
  color: #fff;
}

/* AdSense slot visual */
.adsense-slot {
  margin: 2rem 0;
  min-height: 100px;
  background: var(--od-card);
  border: 1px dashed var(--od-border);
}

/* Footer */
.site-footer {
  background: var(--od-fg);
  color: var(--od-bg);
  padding: 3rem 1rem 2rem;
  margin-top: 4rem;
}
.footer-grid {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}
.site-footer a { color: var(--od-bg); }
.site-footer a:hover { color: var(--od-accent); }
.site-footer ul { list-style: none; padding: 0; }
.site-footer .muted { color: #94a3b8; }
.footer-copy {
  max-width: 860px;
  margin: 2rem auto 0;
  font-size: 0.82rem;
  border-top: 1px solid #334155;
  padding-top: 1rem;
}

/* =========================================================
   Responsive — breakpoints 768px (tablet/mobile) y 480px (mobile chico)
   Reglas: header en columna, facts-table apilada, tipografía y padding ajustados
   ========================================================= */
@media (max-width: 768px) {
  /* Header — colapsar a columna: brand arriba, nav links abajo
     Reset agresivo de Pico classless: nav usa flex-direction column,
     ambos ul ocupan ancho completo, se resetean negative margins y padding de li */
  header.site-header {
    margin-bottom: 1.25rem;
  }
  header.site-header nav {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }
  header.site-header nav > ul {
    width: 100%;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  header.site-header nav > ul > li {
    padding: 0;
  }
  header.site-header nav > ul:nth-of-type(2) {
    gap: 0.25rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 0.5rem;
  }
  header.site-header nav > ul:nth-of-type(2) a {
    display: inline-block;
    padding: 0.25rem 0;
    font-size: 0.95rem;
  }
  .site-brand strong { font-size: 1.1rem; }
  .site-brand .tagline { font-size: 0.72rem; }

  /* Container — padding más compacto */
  main.container {
    padding: 1.25rem 1rem 3rem;
  }

  /* Tipografía base */
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.35rem; margin-top: 2rem; }
  h3 { font-size: 1.1rem; }
  .hero-home h1 { font-size: 2.05rem; }
  .lead { font-size: 1.05rem; }

  /* Facts table — apilar dt/dd para evitar columnas apretadas */
  .facts-table {
    padding: 1rem;
  }
  .facts-table dl {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .facts-table dt {
    margin-top: 0.6rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .facts-table dt:first-of-type {
    margin-top: 0;
  }
  .facts-table dd {
    margin: 0.1rem 0 0;
    font-size: 0.98rem;
  }

  /* Summary block más compacto */
  .summary {
    font-size: 1.05rem;
    padding: 0.25rem 0.85rem;
    margin: 1.5rem 0;
  }

  /* Hero figure caption */
  .hero {
    margin: 1.25rem 0;
  }
  .hero figcaption {
    font-size: 0.78rem;
    padding: 0.5rem 0.65rem;
  }

  /* Newsletter CTA — padding razonable en mobile */
  .newsletter-cta {
    padding: 1.5rem 1.25rem;
    margin: 2rem 0;
  }
  .newsletter-cta form {
    flex-direction: column;
    align-items: stretch;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .site-footer {
    padding: 2rem 1rem 1.25rem;
  }

  /* Hub grid — ya es responsive con auto-fill, pero forzamos 2 columnas en tablet */
  .hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  /* Tipografía aún más chica */
  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.25rem; margin-top: 1.75rem; }
  .hero-home h1 { font-size: 1.8rem; }
  .lead { font-size: 1rem; }

  /* Hub grid 1 columna en mobile chico */
  .hub-grid {
    grid-template-columns: 1fr;
  }

  /* Cards más compactas */
  .hub-card, .card {
    padding: 1rem;
  }

  /* Reducir margen vertical de secciones */
  h2 { margin-top: 1.75rem; }
  .summary { margin: 1.25rem 0; }
  .facts-table { margin: 1.5rem 0; }
  .newsletter-cta { margin: 1.75rem 0; }
}

/* Not found */
.not-found { text-align: center; padding: 4rem 1rem; }
.not-found h1 { font-size: 2rem; }
