/* El Diario Bitcoin - sitio publico (estatico). Tema claro por defecto; oscuro con data-theme="dark". */

:root,
:root[data-theme='light'] {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eceff3;
  --border: #dfe3e9;
  --text: #12161c;
  --muted: #5a6473;
  --accent: #f59e0b;
  --accent-strong: #b45309;
  --accent-text: #1a1204;
  --up: #0a6b32;
  --down: #a11d1d;
  --head-bg: #0e131a;
  --head-text: #eaeef4;
  --head-muted: #a9b4c3;
  --shadow: 0 1px 2px rgba(16, 20, 27, 0.06), 0 8px 24px rgba(16, 20, 27, 0.06);
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0a0e13;
  --surface: #131922;
  --surface-2: #1b2430;
  --border: #263141;
  --text: #e8edf3;
  --muted: #98a5b5;
  --accent: #fbbf24;
  --accent-strong: #fbbf24;
  --up: #0a6b32;
  --down: #a11d1d;
  --head-bg: #070a0e;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---------- cabecera ---------- */
.site-head {
  position: sticky; top: 0; z-index: 30;
  background: var(--head-bg); color: var(--head-text);
}
.head-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; letter-spacing: -0.02em; }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: var(--accent-text); font-weight: 800; font-size: 20px;
}
.brand-name strong { color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: 8px; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--head-muted); font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--head-text); background: rgba(255, 255, 255, 0.08); }
.head-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.today { color: var(--head-muted); font-size: 13px; text-transform: capitalize; }
.icon-btn {
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.18); color: var(--head-text);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 17px;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
@media (max-width: 900px) { .today { display: none; } .head-inner { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; gap: 8px 12px; } .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; flex-wrap: nowrap; } }

/* ---------- ticker ---------- */
.ticker { background: var(--accent); color: var(--accent-text); overflow: hidden; border-bottom: 1px solid rgba(0, 0, 0, 0.15); }
.ticker-track { display: flex; gap: 34px; width: max-content; padding: 7px 0; animation: scroll 55s linear infinite; font-size: 13.5px; font-weight: 600; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tick { display: inline-flex; gap: 8px; white-space: nowrap; }
.tick .sym { font-weight: 800; }
.tick .up { color: var(--up); }
.tick .down { color: var(--down); }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker { overflow-x: auto; } .ticker-track { animation: none; } html { scroll-behavior: auto; } }

/* ---------- portada ---------- */
main { padding-top: 28px; padding-bottom: 24px; }
.loading { color: var(--muted); padding: 60px 0; text-align: center; grid-column: 1 / -1; }

.hero { display: grid; grid-template-columns: 260px minmax(0, 1fr) 290px; gap: 32px; align-items: start; margin-bottom: 48px; }
@media (max-width: 1020px) { .hero { grid-template-columns: 1fr; gap: 28px; } .hero .hero-main { order: -1; } }

.panel-title {
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  padding-bottom: 8px; margin-bottom: 4px; border-bottom: 2px solid var(--accent);
}
.row { display: block; padding: 12px 0; border-bottom: 1px solid var(--border); }
.row:hover .row-title { color: var(--accent-strong); }
.row-title {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14.5px; font-weight: 600; line-height: 1.35;
}
.row-meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.ranked { counter-reset: rank; }
.ranked .row { display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; }
.ranked .row::before {
  counter-increment: rank; content: counter(rank);
  font-size: 24px; font-weight: 800; line-height: 1; color: var(--accent); grid-row: span 2;
}

/* ---------- tarjetas ---------- */
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #111; }
.cover { position: absolute; inset: 0; }
.cover .photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.35s ease;
}
.card:hover .cover .photo { transform: scale(1.04); }
.cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.28), transparent 55%); pointer-events: none; }
.chip {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  background: rgba(8, 11, 15, 0.72); color: #fff; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 9px; border-radius: 6px;
}
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title {
  font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.card-excerpt {
  color: var(--muted); font-size: 15px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { color: var(--muted); font-size: 12.5px; margin-top: auto; }
.card-meta b { color: var(--text); font-weight: 700; }
.card--xl .card-title { font-size: 30px; line-height: 1.18; }
.card--xl .card-body { padding: 20px 24px 26px; }
.card--lg .card-title { font-size: 21px; }
@media (max-width: 600px) { .card--xl .card-title { font-size: 24px; } }

.section { margin-bottom: 48px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.section-head h2::before { content: ''; width: 5px; height: 24px; border-radius: 3px; background: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.grid > .card--lg { grid-column: span 2; }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } .grid > .card--lg { grid-column: auto; } }

/* ---------- pie ---------- */
.site-foot { background: var(--head-bg); color: var(--head-muted); margin-top: 24px; padding-top: 40px; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 32px; padding-bottom: 32px; }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-about { grid-column: 1 / -1; } }
.foot-title { color: var(--head-text); font-weight: 700; margin-bottom: 10px; }
.foot-grid a { display: block; padding: 3px 0; }
.foot-grid a:hover { color: var(--head-text); }
.foot-about p { max-width: 520px; }

/* Cuadro discreto: casi invisible, pegado al final del pie. */
.foot-tip { display: flex; justify-content: center; opacity: 0.85; }
.foot-tip iframe { width: 100%; max-width: 540px; height: 104px; border: 0; background: transparent; color-scheme: dark; }
.foot-legal { padding: 8px 16px 28px; font-size: 12.5px; text-align: center; }
