/* =========================================================
   WikiMeteo.es — HOME
   Layout principal + tarjetas
   Tonos más suaves y alegres
   ========================================================= */

.wm-body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

/* Fondo general */

[data-theme="light"] .wm-body {
  background:
    radial-gradient(900px 500px at -10% -10%, #e7f6ff 0, transparent 55%),
    radial-gradient(800px 500px at 120% -20%, #f3e9ff 0, transparent 60%),
    linear-gradient(180deg, #f3f7fd 0, #e8edf7 100%);
  color: #04101c;
}

[data-theme="dark"] .wm-body {
  background:
    radial-gradient(900px 500px at -10% -10%, #182334 0, transparent 55%),
    radial-gradient(800px 500px at 120% -20%, #201b2f 0, transparent 60%),
    radial-gradient(circle at 50% 120%, #0b1017 0, #05070b 70%);
  color: #e6f1ff;
}

.wm-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 22px 52px;
}

/* HERO */

.wm-hero {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.6fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 36px;
}

.wm-hero-text {
  display: flex;
  flex-direction: column;
  gap: 14px; /* un pelín menos de separación */
}

/* Badge superior “WikiMeteo.es by JDServer.es …” */

.wm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;          /* antes 0.78rem */
  letter-spacing: 0.12em;      /* antes 0.16em (más estrecho) */
  text-transform: uppercase;
  border: 1px solid rgba(90, 115, 150, 0.3);
  white-space: nowrap;         /* quepa en una línea en escritorio */
}

[data-theme="light"] .wm-badge {
  background: rgba(255, 255, 255, 0.9);
  color: #445067;
}

[data-theme="dark"] .wm-badge {
  background: rgba(10, 13, 20, 0.9);
  color: #c5d3eb;
}

.wm-hero-title {
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

[data-theme="light"] .wm-hero-title {
  color: #061321;
}

[data-theme="dark"] .wm-hero-title {
  color: #f2f6ff;
}

.wm-hero-subtitle {
  max-width: 560px;
  font-size: 0.98rem;
  line-height: 1.5;
  opacity: 0.86;
}

[data-theme="light"] .wm-hero-subtitle {
  color: #344154;
}

[data-theme="dark"] .wm-hero-subtitle {
  color: #c3d0e7;
}

/* Botones hero */

.wm-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.wm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition:
    transform 0.12s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease,
    color 0.16s ease;
}

.wm-btn-primary {
  background: linear-gradient(135deg, #38cfff, #2ab6f5);
  color: #031019;
  box-shadow:
    0 16px 30px rgba(56, 207, 255, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.7);
}

.wm-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 20px 36px rgba(56, 207, 255, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.9);
}

.wm-btn-ghost {
  background: transparent;
  border: 1px solid rgba(116, 136, 170, 0.55);
  color: inherit;
}

[data-theme="light"] .wm-btn-ghost {
  background: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .wm-btn-ghost {
  background: rgba(8, 12, 20, 0.75);
}

.wm-btn-ghost:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.95);
}

/* Banda "WikiMeteo.es by JDServer.es" (por si la usamos en otro lugar) */

.wm-origin,
.wm-origin-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.7);
  white-space: nowrap;
}

[data-theme="light"] .wm-origin,
[data-theme="light"] .wm-origin-bar {
  background: rgba(255, 255, 255, 0.9);
  color: #374151;
}

[data-theme="dark"] .wm-origin,
[data-theme="dark"] .wm-origin-bar {
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}

.wm-origin a,
.wm-origin-bar a {
  text-decoration: none;
  font-weight: 600;
}

.wm-origin a:hover,
.wm-origin-bar a:hover {
  text-decoration: underline;
}

/* Visual hero */

.wm-hero-visual {
  display: flex;
  justify-content: flex-end;
}

.wm-hero-card {
  width: 100%;
  max-width: 340px;
  border-radius: 28px;
  padding: 20px 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow:
    0 24px 60px rgba(4, 7, 13, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.07);
}

[data-theme="light"] .wm-hero-card {
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.35), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(120, 220, 255, 0.3), transparent 55%),
    #141824;
}

[data-theme="dark"] .wm-hero-card {
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.12), transparent 55%),
    radial-gradient(circle at 95% 100%, rgba(88, 148, 255, 0.32), transparent 55%),
    #0d111a;
}

/* Logo tipo icono iOS grande */

.wm-hero-logo {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.18);
}

.wm-hero-mini {
  font-size: 0.82rem;
  line-height: 1.5;
  opacity: 0.9;
  color: #e7f4ff;
}

/* KPIs dentro de hero */

.wm-hero-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  max-width: 280px;      /* centramos todo el bloque */
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.wm-hero-kpis li {
  list-style: none;
  padding: 10px 10px 9px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 14, 0.75);
  border: 1px solid rgba(163, 184, 216, 0.4);
}

.kpi-label {
  display: block;
  font-size: 0.7rem;
  opacity: 0.7;
  color: #c3d3ee;
}

.kpi-value {
  display: block;
  margin-top: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
}

/* La fecha suele ocupar más: la hacemos un poco más contenida */
.kpi-value-date {
  font-size: 0.9rem;
  line-height: 1.15;
}

/* Secciones genéricas */

.wm-section {
  margin-top: 22px;
}

.wm-section-header {
  margin-bottom: 14px;
}

.wm-section-title {
  font-size: 1.3rem;
  font-weight: 600;
}

[data-theme="light"] .wm-section-title {
  color: #101827;
}

[data-theme="dark"] .wm-section-title {
  color: #f0f5ff;
}

.wm-section-subtitle {
  margin-top: 2px;
  font-size: 0.9rem;
  max-width: 620px;
  line-height: 1.45;
}

[data-theme="light"] .wm-section-subtitle {
  color: #4b5565;
}

[data-theme="dark"] .wm-section-subtitle {
  color: #c0cce4;
}

/* Tarjetas categorías */

.wm-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.wm-category-card {
  border-radius: 22px;
  padding: 14px 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow:
    0 14px 30px rgba(15, 23, 42, 0.28),
    0 0 0 1px rgba(148, 163, 184, 0.18);
}

[data-theme="light"] .wm-category-card {
  background: linear-gradient(145deg, #ffffff, #f2f5fb);
}

[data-theme="dark"] .wm-category-card {
  background: linear-gradient(145deg, #111827, #0b1120);
}

.wm-category-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

[data-theme="light"] .wm-category-chip {
  background: rgba(15, 23, 42, 0.04);
  color: #4b5563;
}

[data-theme="dark"] .wm-category-chip {
  background: rgba(15, 23, 42, 0.9);
  color: #d1d5db;
}

.wm-category-title {
  font-size: 1rem;
  font-weight: 600;
}

[data-theme="light"] .wm-category-title {
  color: #111827;
}

[data-theme="dark"] .wm-category-title {
  color: #f9fbff;
}

.wm-category-desc {
  font-size: 0.86rem;
  line-height: 1.5;
}

[data-theme="light"] .wm-category-desc {
  color: #4b5563;
}

[data-theme="dark"] .wm-category-desc {
  color: #c7d2e6;
}

.wm-category-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.wm-category-count {
  opacity: 0.8;
}

[data-theme="light"] .wm-category-count {
  color: #4b5563;
}

[data-theme="dark"] .wm-category-count {
  color: #d1d5e5;
}

.wm-category-link {
  font-weight: 500;
  text-decoration: none;
  font-size: 0.82rem;
}

[data-theme="light"] .wm-category-link {
  color: #0ea5e9;
}

[data-theme="dark"] .wm-category-link {
  color: #38cfff;
}

.wm-category-link:hover {
  text-decoration: underline;
}

/* Artículos destacados + lista */

.wm-article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.wm-article-card {
  border-radius: 22px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow:
    0 14px 32px rgba(15, 23, 42, 0.3),
    0 0 0 1px rgba(148, 163, 184, 0.18);
}

[data-theme="light"] .wm-article-card {
  background: linear-gradient(145deg, #ffffff, #f4f7fd);
}

[data-theme="dark"] .wm-article-card {
  background: linear-gradient(145deg, #0f172a, #020617);
}

.wm-article-tagline {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

[data-theme="light"] .wm-article-tagline {
  color: #4b5563;
}

[data-theme="dark"] .wm-article-tagline {
  color: #cbd5f5;
}

.wm-article-title {
  font-size: 0.98rem;
  font-weight: 600;
}

[data-theme="light"] .wm-article-title {
  color: #111827;
}

[data-theme="dark"] .wm-article-title {
  color: #f9fafb;
}

.wm-article-summary {
  font-size: 0.86rem;
  line-height: 1.5;
}

[data-theme="light"] .wm-article-summary {
  color: #4b5563;
}

[data-theme="dark"] .wm-article-summary {
  color: #cbd5e1;
}

.wm-article-footer {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.wm-article-meta {
  opacity: 0.8;
}

[data-theme="light"] .wm-article-meta {
  color: #4b5563;
}

[data-theme="dark"] .wm-article-meta {
  color: #cbd5f5;
}

.wm-article-link {
  text-decoration: none;
  font-weight: 500;
}

[data-theme="light"] .wm-article-link {
  color: #0284c7;
}

[data-theme="dark"] .wm-article-link {
  color: #38bdf8;
}

.wm-article-link:hover {
  text-decoration: underline;
}

/* Lista de últimos artículos */

.wm-article-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wm-article-list-item {
  border-radius: 16px;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(148, 163, 184, 0.18);
}

[data-theme="light"] .wm-article-list-item {
  background: #ffffff;
}

[data-theme="dark"] .wm-article-list-item {
  background: #020617;
}

.wm-article-list-title {
  font-size: 0.9rem;
  font-weight: 500;
}

[data-theme="light"] .wm-article-list-title {
  color: #111827;
}

[data-theme="dark"] .wm-article-list-title {
  color: #e5e7eb;
}

.wm-article-list-meta {
  font-size: 0.78rem;
  margin-top: 2px;
}

[data-theme="light"] .wm-article-list-meta {
  color: #6b7280;
}

[data-theme="dark"] .wm-article-list-meta {
  color: #cbd5e1;
}

.wm-article-list-link {
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 500;
}

[data-theme="light"] .wm-article-list-link {
  color: #0284c7;
}

[data-theme="dark"] .wm-article-list-link {
  color: #38bdf8;
}

.wm-article-list-link:hover {
  text-decoration: underline;
}

/* Ecosistema JDServer */

.wm-section-soft {
  margin-top: 26px;
}

.wm-ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.wm-ecosystem-card {
  border-radius: 22px;
  padding: 14px 16px 13px;
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(148, 163, 184, 0.16);
}

[data-theme="light"] .wm-ecosystem-card {
  background: linear-gradient(140deg, #ffffff, #f5f7fd);
}

[data-theme="dark"] .wm-ecosystem-card {
  background: linear-gradient(140deg, #020617, #020617);
}

.wm-ecosystem-card h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 6px;
}

[data-theme="light"] .wm-ecosystem-card h3 {
  color: #111827;
}

[data-theme="dark"] .wm-ecosystem-card h3 {
  color: #e5e7eb;
}

.wm-ecosystem-card p {
  font-size: 0.86rem;
  line-height: 1.5;
}

[data-theme="light"] .wm-ecosystem-card p {
  color: #4b5563;
}

[data-theme="dark"] .wm-ecosystem-card p {
  color: #cbd5e1;
}

/* ====== NUEVAS TARJETAS DE RED (KPIs latest.json) ====== */

.wm-network-grid {
  /* reutiliza la grid del ecosistema; aquí podríamos
     ajustar densidad si lo ves necesario */
}

.wm-network-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wm-network-header {
  margin-bottom: 2px;
}

.wm-network-city {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.8;
}

[data-theme="light"] .wm-network-city {
  color: #6b7280;
}

[data-theme="dark"] .wm-network-city,
[data-theme="auto"] .wm-network-city {
  color: #cbd5e1;
}

.wm-network-station {
  font-size: 0.98rem;
  font-weight: 600;
}

[data-theme="light"] .wm-network-station {
  color: #111827;
}

[data-theme="dark"] .wm-network-station,
[data-theme="auto"] .wm-network-station {
  color: #e5e7eb;
}

.wm-network-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 4px;
}

.wm-network-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wm-network-kpi dt {
  font-size: 0.72rem;
  opacity: 0.8;
}

[data-theme="light"] .wm-network-kpi dt {
  color: #6b7280;
}

[data-theme="dark"] .wm-network-kpi dt,
[data-theme="auto"] .wm-network-kpi dt {
  color: #cbd5e1;
}

.wm-network-kpi dd {
  font-size: 0.9rem;
  font-weight: 600;
}

[data-theme="light"] .wm-network-kpi dd {
  color: #111827;
}

[data-theme="dark"] .wm-network-kpi dd,
[data-theme="auto"] .wm-network-kpi dd {
  color: #f9fafb;
}

.wm-network-link {
  margin-top: 6px;
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

[data-theme="light"] .wm-network-link {
  color: #0284c7;
}

[data-theme="dark"] .wm-network-link,
[data-theme="auto"] .wm-network-link {
  color: #38bdf8;
}

.wm-network-link:hover {
  text-decoration: underline;
}

.wm-network-error {
  margin-top: 4px;
  font-size: 0.76rem;
  opacity: 0.8;
}

/* ====== Mini webcams en tarjetas de la red (versión Apple-ish) ====== */

.wm-network-webcams{
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.wm-network-webcam-pill{
  flex: 0 0 auto;
  width: 120px;      /* antes 84px */
  height: 68px;      /* antes 48px */
  border-radius: 18px;  /* antes 999px, ahora más “cuadra” */
  overflow: hidden;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-1);
  background: rgba(0,0,0,0.04);
}

.wm-network-webcam-pill img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

[data-theme="light"] .wm-network-error {
  color: #b91c1c;
}

[data-theme="dark"] .wm-network-error,
[data-theme="auto"] .wm-network-error {
  color: #fecaca;
}

/* ============================
   Tema AUTO = usar modo oscuro
   (por si alguna otra parte del ecosistema lo pone)
   ============================ */

[data-theme="auto"] .wm-body {
  background:
    radial-gradient(900px 500px at -10% -10%, #182334 0, transparent 55%),
    radial-gradient(800px 500px at 120% -20%, #201b2f 0, transparent 60%),
    radial-gradient(circle at 50% 120%, #0b1017 0, #05070b 70%);
  color: #e6f1ff;
}

[data-theme="auto"] .wm-badge,
[data-theme="auto"] .wm-origin,
[data-theme="auto"] .wm-origin-bar {
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
}

/* (resto de reglas auto = mismas que dark, por seguridad) */

[data-theme="auto"] .wm-hero-title {
  color: #f2f6ff;
}

[data-theme="auto"] .wm-hero-subtitle {
  color: #c3d0e7;
}

[data-theme="auto"] .wm-hero-card {
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.12), transparent 55%),
    radial-gradient(circle at 95% 100%, rgba(88, 148, 255, 0.32), transparent 55%),
    #0d111a;
}

[data-theme="auto"] .wm-hero-mini {
  color: #e7f4ff;
}

[data-theme="auto"] .wm-hero-kpis li {
  background: rgba(3, 7, 14, 0.75);
  border-color: rgba(163, 184, 216, 0.4);
}

[data-theme="auto"] .wm-section-title {
  color: #f0f5ff;
}

[data-theme="auto"] .wm-section-subtitle {
  color: #c0cce4;
}

[data-theme="auto"] .wm-category-card {
  background: linear-gradient(145deg, #111827, #0b1120);
}

[data-theme="auto"] .wm-category-chip {
  background: rgba(15, 23, 42, 0.9);
  color: #d1d5db;
}

[data-theme="auto"] .wm-category-title {
  color: #f9fbff;
}

[data-theme="auto"] .wm-category-desc {
  color: #c7d2e6;
}

[data-theme="auto"] .wm-category-count {
  color: #d1d5e5;
}

[data-theme="auto"] .wm-category-link {
  color: #38cfff;
}

[data-theme="auto"] .wm-article-card {
  background: linear-gradient(145deg, #0f172a, #020617);
}

[data-theme="auto"] .wm-article-tagline {
  color: #cbd5f5;
}

[data-theme="auto"] .wm-article-title {
  color: #f9fafb;
}

[data-theme="auto"] .wm-article-summary {
  color: #cbd5e1;
}

[data-theme="auto"] .wm-article-meta {
  color: #cbd5f5;
}

[data-theme="auto"] .wm-article-link {
  color: #38bdf8;
}

[data-theme="auto"] .wm-article-list-item {
  background: #020617;
}

[data-theme="auto"] .wm-article-list-title {
  color: #e5e7eb;
}

[data-theme="auto"] .wm-article-list-meta {
  color: #cbd5e1;
}

[data-theme="auto"] .wm-article-list-link {
  color: #38bdf8;
}

[data-theme="auto"] .wm-ecosystem-card {
  background: linear-gradient(140deg, #020617, #020617);
}

[data-theme="auto"] .wm-ecosystem-card h3 {
  color: #e5e7eb;
}

[data-theme="auto"] .wm-ecosystem-card p {
  color: #cbd5e1;
}

/* Responsive */

@media (max-width: 900px) {
  .wm-main {
    padding-inline: 18px;
  }

  .wm-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .wm-hero-visual {
    justify-content: flex-start;
  }

  .wm-hero-card {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .wm-main {
    padding: 18px 18px 42px;
  }

  .wm-hero-title {
    font-size: 1.8rem;
  }

  .wm-hero-subtitle {
    font-size: 0.9rem;
  }

  .wm-hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  /* En móvil: badge más pequeñito pero en una sola línea */
  .wm-badge {
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    padding: 3px 8px;
    white-space: nowrap;
  }
}
