:root {
  --bg: #f5f3ee;
  --panel: #fffdf9;
  --ink: #15181d;
  --muted: #5f6672;
  --line: #e1ddd3;
  --accent: #0b6b5e;
  --accent-soft: #e7f1ee;
  --shadow: 0 10px 30px rgba(20, 24, 29, 0.08);
  --radius: 16px;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --panel: #151a21;
    --ink: #ece9e2;
    --muted: #9aa3b2;
    --line: #242b35;
    --accent: #4fd1b5;
    --accent-soft: #13312c;
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input { font: inherit; }

.wrap {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  z-index: 100;
}
.skip:focus { left: 10px; top: 10px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
}

.brand-mark { width: 34px; height: 34px; flex: none; }

.brand-name {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand-name em {
  font-style: normal;
  color: var(--accent);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}
.live i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #19a974;
  box-shadow: 0 0 0 4px rgba(25, 169, 116, 0.15);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  min-width: 230px;
}
.search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  width: 100%;
  font-size: 0.85rem;
}
.search input::placeholder { color: var(--muted); }

.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.nav::-webkit-scrollbar { display: none; }

.nav-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 13px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.nav-link:hover { color: var(--ink); }
.nav-link[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.nav-link .count {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  border-radius: 999px;
  padding: 2px 6px;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 10px 0 12px;
  flex-wrap: wrap;
}
.tabs[hidden] { display: none; }

.tab {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { border-color: var(--accent); color: var(--ink); }
.tab[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Main */
main { padding: 34px 0 60px; }

.section-head { margin-bottom: 22px; }
.section-head h1 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 60ch;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 26px;
}
.hero .media { aspect-ratio: auto; min-height: 340px; height: 100%; }
.hero .body { padding: 30px 32px; display: flex; flex-direction: column; justify-content: center; }
.hero h2 {
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.hero h2 a:hover { color: var(--accent); }
.hero p {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 1rem;
  line-height: 1.6;
}

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card .media { aspect-ratio: 16 / 9; }
.card .body { padding: 16px 17px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 {
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin: 0;
}
.card h3 a:hover { color: var(--accent); }
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .meta { margin-top: auto; }

.media {
  position: relative;
  display: block;
  background:
    radial-gradient(120% 120% at 20% 20%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 60%),
    linear-gradient(135deg, #123b36, #0b2020);
  overflow: hidden;
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.card:hover .media img { transform: scale(1.03); }
.media.no-img img { display: none; }
.media.no-img::before {
  content: attr(data-initial);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}
.hero .media.no-img::before { font-size: 7rem; }

.chip {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(10, 14, 16, 0.62);
  backdrop-filter: blur(6px);
  padding: 5px 9px;
  border-radius: 999px;
}
.chip-ia { background: #5b21b6; }
.chip-avances { background: #0b6b5e; }
.chip-salud { background: #b42318; }
.chip-economia { background: #92400e; }
.chip-curiosidades { background: #6b21a8; }
.chip-ciencia { background: #0f4c5c; }

.meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  flex-wrap: wrap;
}
.meta .src { font-weight: 700; color: var(--ink); }
.meta .dot { opacity: 0.5; }
.meta .read { margin-left: auto; color: var(--accent); font-weight: 700; }

/* Skeleton */
.skeleton {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  border-radius: var(--radius);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--panel) 65%, transparent), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.hero-skeleton { height: 340px; margin-bottom: 26px; }
.card-skeleton { height: 300px; }

/* States */
.empty, .error {
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}
.empty h2, .error h2 {
  font-family: var(--serif);
  color: var(--ink);
  margin: 0 0 8px;
  font-size: 1.4rem;
}
.empty p, .error p { margin: 0 auto; max-width: 50ch; }
.retry {
  margin-top: 16px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 700;
  cursor: pointer;
}

/* More */
.more-wrap { display: flex; justify-content: center; margin-top: 30px; }
.more {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.more:hover { border-color: var(--accent); color: var(--accent); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 38px 0 26px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 30px;
}
.footer-brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
}
.footer-brand em { font-style: normal; color: var(--accent); }
.footer-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--muted);
  margin: 0 0 10px;
}
.site-footer a {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 3px 0;
}
.site-footer a:hover { color: var(--accent); }
.footer-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
  margin: 0;
  max-width: 42ch;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 16px;
  color: var(--muted);
  font-size: 0.76rem;
}
.noscript {
  padding: 18px;
  background: #fff3cd;
  color: #664d03;
  border-radius: 10px;
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .hero .media { min-height: 260px; aspect-ratio: 16 / 9; }
  .hero .body { padding: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .wrap { width: min(100% - 28px, 1180px); }
  .header-top { align-items: flex-start; flex-direction: column; gap: 10px; }
  .header-tools { width: 100%; justify-content: space-between; }
  .search { min-width: 0; flex: 1; }
  .live { display: none; }
  .brand-name { font-size: 1.3rem; }
  main { padding-top: 24px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .hero h2 { font-size: 1.45rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .skeleton::after { animation: none; }
  .card, .media img { transition: none; }
}
