/*
  SOSAbuelos.es — Estilo EL PAÍS
  Serio, minimalista, periodístico.
*/

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

:root {
  --bg: #fff;
  --bg-alt: #f7f7f7;
  --text: #111;
  --text-light: #555;
  --text-muted: #888;
  --border: #ddd;
  --border-light: #eee;
  --accent: #0066cc;
  --accent-dark: #004080;
  --green: #1a7a3a;
  --red: #c0392b;
  --font-body: Georgia, 'Times New Roman', Times, serif;
  --font-title: Georgia, 'Times New Roman', Times, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--text);
}

h1 { font-size: 2rem; line-height: 1.25; margin-bottom: 16px; }
h2 { font-size: 1.4rem; line-height: 1.3; margin: 32px 0 10px; }
h3 { font-size: 1.15rem; margin: 24px 0 8px; }

p { margin-bottom: 16px; }

.wrap { max-width: 940px; margin: 0 auto; padding: 0 20px; }

/* ─── Header ─── */
.site-header {
  border-bottom: 2px solid #111;
  padding: 12px 0;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-family: var(--font-title);
  font-size: 1.06rem;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.site-logo:hover { color: #111; text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-size: 1.2rem;
  cursor: pointer;
  color: #111;
  font-family: var(--font-ui);
}
.nav-menu {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  font-family: var(--font-ui);
}
.nav-menu a {
  color: var(--text-light);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-right: 1px solid var(--border-light);
}
.nav-menu a:last-child { border-right: none; }
.nav-menu a:hover, .nav-menu a.activo {
  color: #111;
  text-decoration: none;
}

/* ─── Breadcrumb ─── */
.breadcrumb {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 14px 0 4px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb span { color: var(--text-muted); }

/* ─── Artículo ─── */
article {
  max-width: 700px;
  margin: 0 auto;
}
article .meta {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
article h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  margin-bottom: 8px;
}
article .subhead {
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 24px;
}

article img {
  width: 100%;
  height: auto;
  margin: 20px 0;
  border: none;
}
article .img-caption {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: -16px 0 20px;
  text-align: right;
}

/* ─── Cajas ─── */
.product-card {
  border: 1px solid var(--border);
  padding: 24px;
  margin: 24px 0;
}
.product-card .price {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  color: #111;
  margin: 4px 0 12px;
}
.product-card .price small {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* ─── Pros y contras ─── */
.pros-contras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
  font-family: var(--font-ui);
  font-size: 0.88rem;
}
.pros, .contras {
  padding: 14px 16px;
}
.pros {
  border: 1px solid var(--green);
  background: #f0faf3;
}
.contras {
  border: 1px solid var(--red);
  background: #fdf2f0;
}
.pros h4, .contras h4 {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  margin-top: 0;
}
.pros ul, .contras ul { list-style: none; }
.pros li { padding: 3px 0; }
.pros li::before { content: "✓ "; color: var(--green); font-weight: 700; }
.contras li { padding: 3px 0; }
.contras li::before { content: "✗ "; color: var(--red); font-weight: 700; }

/* ─── Tabla ─── */
.tabla-wrap { overflow-x: auto; margin: 20px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  border: 1px solid var(--border);
}
th {
  background: #111;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
}
td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
}
tr:nth-child(even) td { background: var(--bg-alt); }
tr:last-child td { border-bottom: none; }

/* ─── Cita ─── */
blockquote {
  border-left: 3px solid var(--accent);
  padding: 10px 18px;
  margin: 20px 0;
  font-style: italic;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ─── Nota ─── */
.nota {
  border: 1px solid var(--border);
  padding: 14px 18px;
  margin: 18px 0;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  background: var(--bg-alt);
}
.nota strong { color: var(--text); }

/* ─── Grid de noticias dentro del artículo ─── */
.noticias-grid {
  margin: 28px 0;
  padding: 20px 24px 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.noticias-banner {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 16px;
  display: block;
}
.noticias-grid-titulo {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.noticias-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.noti-card {
  display: flex;
  gap: 12px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.noti-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.noti-card-img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.noti-card-body {
  padding: 10px 10px 10px 0;
  min-width: 0;
}
.noti-card-fecha {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 2px;
}
.noti-card h3 {
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0 0 3px;
  line-height: 1.3;
}
.noti-card h3 a {
  color: var(--text);
  text-decoration: none;
}
.noti-card h3 a:hover {
  color: var(--accent);
}
.noti-card p {
  font-size: 0.75rem;
  color: var(--text-light);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.noti-fuente {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin: 16px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.noti-fuente a {
  color: var(--text-muted);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .noticias-cards {
    grid-template-columns: 1fr;
  }
  .noticias-grid {
    padding: 16px;
  }
  .noti-card-img {
    width: 80px;
    height: 80px;
  }
}

/* ─── Afiliados Amazon ─── */
.afiliado-box {
  background: #f0f7f4;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 20px;
  margin: 28px 0;
}
.afiliado-box h3 {
  font-family: var(--font-title);
  font-size: 1rem;
  margin: 0 0 6px;
  color: var(--text);
}
.afiliado-box > p {
  font-size: 0.82rem;
  color: var(--text-light);
  margin: 0 0 14px;
}
.afiliado-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.afiliado-item:last-of-type {
  border-bottom: none;
}
.btn-afiliado {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-afiliado:hover {
  background: #1a5a3a;
}
.afiliado-desc {
  font-size: 0.75rem;
  color: var(--text-light);
}
.afiliado-legal {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}
.btn-afiliado-sm {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 5px;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-afiliado-sm:hover {
  background: #1a5a3a;
}
.tabla-alt-economicas {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.82rem;
}
.tabla-alt-economicas th {
  background: var(--bg-alt);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid var(--border);
}
.tabla-alt-economicas td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.tabla-alt-economicas tr:hover td {
  background: var(--bg-alt);
}

.aviso-afiliado {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 20px;
  border-top: 1px solid var(--border-light);
  margin-top: 10px;
}

@media (max-width: 640px) {
  .afiliado-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ─── Veredicto ─── */
.veredicto {
  border: 2px solid #111;
  padding: 20px;
  margin: 28px 0;
}
.veredicto h3 {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0;
  margin-bottom: 8px;
}

/* ─── Etiqueta ─── */
.tag {
  display: inline-block;
  font-family: var(--font-ui);
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag-rec { background: var(--green); color: #fff; }
.tag-pop { background: var(--accent); color: #fff; }

/* ─── Footer ─── */
.site-footer {
  border-top: 2px solid #111;
  margin-top: 50px;
  padding: 28px 0 20px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.site-footer .wrap {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.site-footer h4 {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.site-footer a { color: var(--accent); font-size: 0.8rem; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 4px; }
.footer-bot {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── Volver arriba ─── */
.volver-arriba {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: #fff;
  color: #111;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(14px);
  transition: all 0.25s;
  font-family: var(--font-ui);
}
.volver-arriba.visible { opacity: 1; transform: translateY(0); }
.volver-arriba:hover { background: var(--bg-alt); }

/* ─── Imagen hero ─── */
.img-hero {
  margin: 20px 0;
  width: 100%;
  height: 320px;
  object-fit: cover;
  background: var(--bg-alt);
}

/* ─── Relacionados ─── */
.rel-list {
  list-style: none;
  margin: 12px 0 0;
  font-family: var(--font-ui);
}
.rel-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}
.rel-list li:last-child { border-bottom: none; }
.rel-list a { font-size: 0.9rem; }

/* ─── Responsive ─── */
@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--border);
    padding: 8px 16px;
    z-index: 50;
    margin-top: 8px;
  }
  .nav-menu.abierto { display: flex; }
  .nav-menu a { border-right: none; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
  .nav-menu a:last-child { border-bottom: none; }
  .pros-contras { grid-template-columns: 1fr; }
  .img-hero { height: 200px; }
  h1 { font-size: 1.5rem; }
  article h1 { font-size: 1.4rem; }
  body { font-size: 16px; }
}
