/* elhubnoticias 🗞️ — estilo editorial oscuro, home en mosaico */
:root {
  --bg: #101418;
  --bg-card: #171d24;
  --bg-card-hover: #1c242d;
  --border: #26303b;
  --text: #e8ecf1;
  --text-dim: #93a1b0;
  --accent: #4fa3ff;
  --star-off: #3a4654;
  --star-on: #ffb42e;
  --explore: #38c98b;
  --warn: #ff8a5c;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.5;
}

a { color: inherit; }

/* ---------- Header ---------- */
.site-header {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 16px 0;
  text-align: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: -0.5px;
}
.brand-clip { font-size: 1.8rem; }
.brand-name em { color: var(--accent); font-style: normal; }
.tagline {
  color: var(--text-dim);
  font-style: italic;
  margin-top: 4px;
  font-size: 0.95rem;
}
.cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 10px;
  margin: 18px 0 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
}
.cats a {
  text-decoration: none;
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 999px;
}
.cats a:hover { color: var(--text); }
.cats a.active { background: var(--accent); color: #0b1016; font-weight: 600; }
.admin-link { font-size: 1rem; opacity: 0.7; }
.prefs-link { border: 1px solid var(--border); border-radius: 999px; }
.prefs-link.prefs-on { border-color: var(--explore); color: var(--explore); }

/* ---------- Preferencias ---------- */
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.source-check {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}
.source-check:hover { border-color: var(--accent); }
.source-check input { accent-color: var(--accent); }
.balance-grid { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.balance-grid label {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 4px 10px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.balance-grid label > span { grid-column: 1 / -1; }
.balance-grid input[type="range"] { width: 100%; accent-color: var(--accent); }
.balance-grid output { text-align: right; color: var(--accent); font-weight: 600; }
.prefs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.prefs-actions .admin-hint { margin: 0; flex-basis: 100%; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.btn-ghost:hover { border-color: var(--warn); color: var(--warn); }

/* ---------- Mosaico ---------- */
.mosaic {
  max-width: 1180px;
  margin: 20px auto 40px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-flow: dense;
  gap: 14px;
}
.empty { grid-column: 1 / -1; color: var(--text-dim); text-align: center; padding: 40px 0; }

.tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.tile:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  border-color: #33404e;
}
.tile.explored { border-left: 3px solid var(--explore); }

.tile--hero { grid-column: span 4; }
.tile--big  { grid-column: span 3; }
.tile--std  { grid-column: span 2; }
.tile--text { grid-column: span 2; justify-content: center; }

.tile-img { display: block; line-height: 0; }
.tile-img img {
  width: 100%;
  object-fit: cover;
  display: block;
}
.tile--hero .tile-img img { height: 340px; }
.tile--big  .tile-img img { height: 210px; }
.tile--std  .tile-img img { height: 150px; }

.tile-body {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.tile--hero .tile-body { padding: 18px 20px 14px; }

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.76rem;
  color: var(--text-dim);
}
.source { font-weight: 600; color: var(--accent); }
.dot { opacity: 0.5; }
.chip {
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 0.7rem;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip-explore { border-color: var(--explore); color: var(--explore); }

.tile h2 { font-size: 1.05rem; line-height: 1.3; font-weight: 700; }
.tile--hero h2 { font-size: 1.55rem; }
.tile--big h2 { font-size: 1.2rem; }
.tile h2 a { text-decoration: none; }
.tile h2 a:hover { color: var(--accent); text-decoration: underline; }

.summary { color: var(--text-dim); font-size: 0.92rem; }
.tile--hero .summary { font-size: 1rem; }

.also-in {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.76rem;
  color: var(--text-dim);
}
.also-in a { color: var(--accent); }

/* ---------- Rating ---------- */
.rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}
.star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--star-off);
  padding: 0 1px;
  transition: color 0.1s, transform 0.1s;
}
.star:hover { transform: scale(1.2); }
.stars:hover .star { color: var(--star-on); }
.star:hover ~ .star { color: var(--star-off) !important; }
.star.on { color: var(--star-on); }
.rating-info {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ---------- Admin ---------- */
.admin {
  max-width: 900px;
  margin: 20px auto 40px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: system-ui, -apple-system, sans-serif;
}
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto; /* tablas anchas scrollean dentro del panel, no la página */
}
.panel h2 { font-size: 1.05rem; margin-bottom: 12px; font-family: Georgia, serif; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.stat-n { display: block; font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.stat-l { font-size: 0.75rem; color: var(--text-dim); }
.admin-line { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 12px; }
.admin-line .ok { color: var(--explore); }
.admin-line .warn { color: var(--warn); }
.admin-hint { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 10px; }

.btn {
  background: var(--accent);
  color: #0b1016;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.5; cursor: wait; }
.btn-sm { padding: 3px 10px; font-size: 0.75rem; }

.weights-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.weights-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.weights-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 6px 10px;
  width: 100px;
}

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table a { color: var(--accent); text-decoration: none; }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-on {
  color: var(--explore);
  background: rgba(56, 201, 139, 0.12);
  border: 1px solid rgba(56, 201, 139, 0.45);
}
.badge-off {
  color: var(--warn);
  background: rgba(255, 138, 92, 0.10);
  border: 1px solid rgba(255, 138, 92, 0.45);
}
.rep-bar {
  display: inline-block;
  width: 70px;
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}
.rep-bar span { display: block; height: 100%; background: var(--star-on); border-radius: 999px; }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1180px;
  margin: 0 auto 30px;
  padding: 14px 16px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.ia-status { margin-top: 4px; opacity: 0.8; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .mosaic { grid-template-columns: repeat(4, 1fr); }
  .tile--hero { grid-column: span 4; }
  .tile--big { grid-column: span 2; }
}
@media (max-width: 640px) {
  .mosaic { grid-template-columns: 1fr; }
  .tile--hero, .tile--big, .tile--std, .tile--text { grid-column: auto; }
  .tile--hero .tile-img img { height: 220px; }
  .brand { font-size: 1.5rem; }
  .tile--hero h2 { font-size: 1.25rem; }
}
