/* =========================================================================
   CMP · Listado de blogs
   Diseño basado en el mockup de Design Claude, adaptado a la paleta del sitio.
   Tema claro por defecto; el tema oscuro se activa con la clase .dark en <body>.
   ========================================================================= */

.blog-listado {
  --bl-bg: #e9eff9;
  --bl-bg-2: #f3f7fd;
  --bl-surface: #ffffff;
  --bl-surface-2: #f5f8fe;
  --bl-text: #1c2330;
  --bl-text-soft: #566173;
  --bl-muted: #8b94a2;
  --bl-border: rgba(24, 40, 72, .10);
  --bl-border-2: rgba(24, 40, 72, .16);
  --bl-accent: #408cd2;
  --bl-accent-ink: #22577f;
  --bl-brand: #2670b8;
  --bl-brand-soft: #4aa3e2;
  --bl-shadow: 0 6px 22px rgba(28, 55, 105, .10);
  --bl-shadow-lg: 0 20px 52px rgba(28, 55, 105, .18);
  --bl-field: #ffffff;

  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--bl-bg);
  color: var(--bl-text);
  -webkit-font-smoothing: antialiased;
}

.dark .blog-listado {
  --bl-bg: #0c121c;
  --bl-bg-2: #0f1825;
  --bl-surface: #161f2d;
  --bl-surface-2: #1c2736;
  --bl-text: #e8f0fb;
  --bl-text-soft: #a2b1c4;
  --bl-muted: #76859a;
  --bl-border: rgba(255, 255, 255, .08);
  --bl-border-2: rgba(255, 255, 255, .15);
  --bl-accent: #5aa6e8;
  --bl-accent-ink: #90c4f4;
  --bl-brand: #5aa6e8;
  --bl-brand-soft: #8cc4f3;
  --bl-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --bl-shadow-lg: 0 26px 64px rgba(0, 0, 0, .6);
  --bl-field: #0e1724;
}

.blog-listado ::selection { background: rgba(64, 140, 210, .25); }
.blog-listado * { box-sizing: border-box; }

/* ---------- Badges de tema ---------- */
.blog-listado [data-tema] { --bl-bdg-bg: rgba(64, 140, 210, .14); --bl-bdg-fg: #246199; }
.blog-listado [data-tema="Clima"] { --bl-bdg-bg: rgba(20, 150, 162, .15); --bl-bdg-fg: #0d7b85; }
.dark .blog-listado [data-tema] { --bl-bdg-bg: rgba(90, 166, 232, .20); --bl-bdg-fg: #9cccf6; }
.dark .blog-listado [data-tema="Clima"] { --bl-bdg-bg: rgba(56, 196, 206, .2); --bl-bdg-fg: #62d2db; }

/* ---------- Skins (fondo de respaldo cuando no hay imagen) ---------- */
.bl-skin { position: relative; }
.bl-skin[data-skin="radar"] { background: linear-gradient(135deg, #1f2d3c 0%, #3a2c3a 55%, #4a3324 100%); }
.bl-skin[data-skin="sat"]   { background: linear-gradient(135deg, #2a3a4f 0%, #465a70 100%); }
.bl-skin[data-skin="map"]   { background: linear-gradient(135deg, #21404a 0%, #3a5b53 100%); }
.bl-skin[data-skin="clima"] { background: linear-gradient(135deg, #5a4730 0%, #7c5a34 100%); }
.bl-skin[data-skin]::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 10px);
  pointer-events: none;
}
.bl-img-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Layout base ---------- */
.bl-wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.blog-listado a { color: inherit; }

/* ---------- Hero ---------- */
.bl-hero {
  padding: 56px 0 10px;
  background: radial-gradient(900px 320px at 80% -40%, rgba(64, 140, 210, .10), transparent 70%);
}
.bl-breadcrumb { font-size: 13px; color: var(--bl-muted); margin-bottom: 16px; }
.bl-breadcrumb .bl-here { color: var(--bl-accent); font-weight: 600; }
.bl-hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.bl-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.04;
  color: var(--bl-text);
}
.bl-hero p { margin: 16px 0 0; max-width: 600px; font-size: 17px; line-height: 1.6; color: var(--bl-text-soft); }
.bl-stats { display: flex; gap: 28px; padding-bottom: 6px; }
.bl-stat-num { font-size: 30px; font-weight: 700; color: var(--bl-accent); }
.bl-stat-num.brand { color: var(--bl-brand); }
.bl-stat-lbl { font-size: 12.5px; color: var(--bl-muted); }

/* ---------- Barra de filtros (sticky) ---------- */
.bl-tools-wrap { padding-top: 28px; }
.bl-tools {
  position: sticky;
  top: 80px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--bl-surface);
  border: 1px solid var(--bl-border);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--bl-shadow);
}
.bl-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 240px;
  background: var(--bl-field);
  border: 1px solid var(--bl-border-2);
  border-radius: 11px;
  padding: 10px 14px;
}
.bl-search input {
  border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 14.5px; color: var(--bl-text); width: 100%;
}
.bl-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bl-chip {
  font-family: inherit; cursor: pointer; font-size: 13.5px; font-weight: 600;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--bl-border-2); background: var(--bl-field); color: var(--bl-text-soft);
  transition: all .18s; display: inline-flex; align-items: center; gap: 7px;
}
.bl-chip:hover { border-color: var(--bl-accent); color: var(--bl-accent); }
.bl-chip[data-active="true"] { background: var(--bl-accent); color: #fff; border-color: var(--bl-accent); }
.bl-chip .bl-chip-count { font-size: 11.5px; opacity: .7; font-weight: 500; }

/* ---------- Main ---------- */
.bl-main { padding-top: 30px; }

/* ---------- Post destacado ---------- */
.bl-featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  background: var(--bl-surface);
  border: 1px solid var(--bl-border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--bl-shadow);
  margin-bottom: 36px;
}
.bl-featured-media {
  position: relative; min-height: 340px;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.bl-featured-body { padding: 34px 36px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.bl-featured-body h2 {
  margin: 0; font-size: clamp(24px, 2.6vw, 32px); font-weight: 700;
  line-height: 1.18; letter-spacing: -.02em; color: var(--bl-text);
}
.bl-featured-body p { margin: 0; font-size: 15.5px; line-height: 1.62; color: var(--bl-text-soft); }
.bl-meta { display: flex; gap: 13px; align-items: center; font-size: 13px; color: var(--bl-muted); }
.bl-featured-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; flex-wrap: wrap; gap: 14px; }

.bl-badge {
  font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 999px;
  background: var(--bl-bdg-bg); color: var(--bl-bdg-fg);
}
.bl-badge-abs { position: absolute; top: 18px; left: 18px; z-index: 2; }
.bl-tag-dest {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; background: rgba(64, 140, 210, .92); color: #fff;
}
.bl-imglabel {
  position: relative; z-index: 1;
  font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255, 255, 255, .72);
  background: rgba(0, 0, 0, .22); padding: 5px 11px; border-radius: 7px;
}

.bl-author { display: flex; align-items: center; gap: 11px; }
.bl-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bl-surface-2); border: 1px solid var(--bl-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--bl-accent); flex-shrink: 0;
}
.bl-author-name { font-size: 13.5px; font-weight: 600; color: var(--bl-text); }
.bl-author-esp { font-size: 12px; color: var(--bl-muted); }

.bl-btn-primary {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  font-size: 14.5px; font-weight: 600; color: #fff;
  background: linear-gradient(90deg, var(--bl-brand-soft), var(--bl-brand));
  padding: 11px 22px; border-radius: 11px; box-shadow: 0 8px 20px rgba(64, 140, 210, .32);
}

/* ---------- Encabezado de resultados ---------- */
.bl-results-head { font-size: 14.5px; color: var(--bl-text-soft); margin-bottom: 18px; }

/* ---------- Grid de cards ---------- */
.bl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; }
.bl-card {
  display: flex; flex-direction: column;
  background: var(--bl-surface); border: 1px solid var(--bl-border);
  border-radius: 18px; overflow: hidden; box-shadow: var(--bl-shadow);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.bl-card:hover { transform: translateY(-6px); box-shadow: var(--bl-shadow-lg); border-color: var(--bl-border-2); }
.bl-card-media {
  position: relative; height: 188px;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.bl-card-media .bl-badge-abs { top: 12px; left: 12px; font-size: 11.5px; padding: 5px 11px; backdrop-filter: blur(6px); }
.bl-card-media .bl-imglabel { font-size: 10.5px; }
.bl-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bl-card-body h3 { margin: 0; font-size: 17.5px; line-height: 1.32; font-weight: 600; color: var(--bl-text); }
.bl-card-body .bl-excerpt { margin: 0; font-size: 13.8px; line-height: 1.55; color: var(--bl-text-soft); flex: 1; }
.bl-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--bl-border);
}
.bl-card-foot .bl-avatar { width: 29px; height: 29px; font-size: 10.5px; }
.bl-card-foot .bl-author-name { font-size: 12.5px; font-weight: 400; color: var(--bl-text-soft); }
.bl-readmore {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--bl-accent); text-decoration: none; white-space: nowrap;
}

/* ---------- Estado vacío ---------- */
.bl-empty { text-align: center; padding: 70px 20px; color: var(--bl-text-soft); }
.bl-empty-title { font-size: 19px; font-weight: 600; color: var(--bl-text); margin-bottom: 8px; }
.bl-empty p { margin: 0 0 20px; font-size: 14.5px; }
.bl-btn-ghost {
  font-family: inherit; cursor: pointer; font-size: 14px; font-weight: 600;
  color: var(--bl-accent); background: var(--bl-surface);
  border: 1px solid var(--bl-border-2); border-radius: 11px; padding: 11px 22px;
}

/* ---------- Cargar más ---------- */
.bl-more { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 44px 0 8px; }
.bl-btn-more {
  font-family: inherit; cursor: pointer; font-size: 14.5px; font-weight: 600;
  color: var(--bl-text); background: var(--bl-surface);
  border: 1px solid var(--bl-border-2); border-radius: 13px; padding: 14px 34px;
  box-shadow: var(--bl-shadow); transition: transform .18s;
}
.bl-btn-more:hover { transform: translateY(-2px); }
.bl-more-info { font-size: 12.5px; color: var(--bl-muted); }

/* ---------- CTA suscripción ---------- */
.bl-cta-wrap { margin-top: 64px; }
.bl-cta {
  position: relative; overflow: hidden; border-radius: 24px;
  background: linear-gradient(110deg, var(--bl-brand-soft), var(--bl-brand));
  padding: 44px 40px; display: flex; align-items: center; justify-content: space-between;
  gap: 28px; flex-wrap: wrap; box-shadow: 0 18px 44px rgba(64, 140, 210, .28);
}
.bl-cta::before {
  content: ""; position: absolute; right: -40px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .14);
}
.bl-cta-text { position: relative; max-width: 520px; }
.bl-cta-text h3 { margin: 0; font-size: 25px; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.bl-cta-text p { margin: 11px 0 0; font-size: 15px; line-height: 1.55; color: rgba(255, 255, 255, .92); }
.bl-cta-form { position: relative; display: flex; gap: 10px; flex-wrap: wrap; }
.bl-cta-form input {
  border: none; outline: none; border-radius: 12px; padding: 14px 18px;
  font-family: inherit; font-size: 14.5px; min-width: 230px;
  background: rgba(255, 255, 255, .96); color: #1c2330;
}
.bl-cta-form button {
  font-family: inherit; cursor: pointer; border: none; border-radius: 12px;
  padding: 14px 26px; font-size: 14.5px; font-weight: 700;
  color: var(--bl-brand); background: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, .14);
}

/* ---------- Utilidades ---------- */
.bl-hidden { display: none !important; }
.bl-clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.bl-clamp-3 {
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

@media (max-width: 768px) {
  .bl-featured-media { min-height: 220px; }
  .bl-featured-body { padding: 26px 24px; }
}
