@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg:       #f0f4f8;
  --surface:  #ffffff;
  --surface2: #f8fafc;
  --surface3: #eef2f7;
  --accent:   #2563eb;
  --accent2:  #1d4ed8;
  --accent-soft: #eff6ff;
  --teal:     #0891b2;
  --green:    #16a34a;
  --orange:   #ea580c;
  --purple:   #7c3aed;
  --text:     #0f172a;
  --text2:    #475569;
  --muted:    #94a3b8;
  --border:   #e2e8f0;
  --border2:  #cbd5e1;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:    0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.06);
  --max:      1120px;
  --radius:   12px;
  --radius-sm: 6px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── READING PROGRESS ── */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  z-index: 9999; width: 0; transition: width .1s linear;
}

/* ── HEADER ── */
header {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 0 1.5rem; height: 64px;
  display: flex; align-items: center; gap: 2rem;
}
.logo {
  font-size: 1.2rem; font-weight: 800;
  color: var(--accent); letter-spacing: -.02em;
  display: flex; align-items: center; gap: .3rem;
}
.logo-icon {
  width: 28px; height: 28px;
  background: var(--accent); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .9rem;
}
.logo span { color: var(--text2); font-weight: 500; }
nav { display: flex; gap: .25rem; margin-left: auto; }
nav a {
  font-size: .875rem; font-weight: 500; color: var(--text2);
  padding: .4rem .75rem; border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
nav a:hover { background: var(--surface3); color: var(--text); }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #0284c7 100%);
  color: #fff;
  padding: 4rem 1.5rem 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.08) 1px, transparent 0);
  background-size: 28px 28px;
}
.hero-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: .3rem .9rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: 1.25rem;
  backdrop-filter: blur(4px);
}
.hero h1 {
  font-size: 2.4rem; font-weight: 800;
  line-height: 1.15; letter-spacing: -.03em;
  margin-bottom: 1rem;
}
.hero h1 em { font-style: normal; color: #93c5fd; }
.hero p { font-size: 1.05rem; opacity: .85; line-height: 1.6; }
.hero-stats {
  display: flex; gap: 2rem; justify-content: center;
  margin-top: 2rem; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 1.5rem; font-weight: 800; }
.hero-stat span { font-size: .8rem; opacity: .75; }

/* ── SEARCH ── */
.search-wrap {
  max-width: var(--max); margin: 0 auto;
  padding: 2rem 1.5rem 0;
}
.search-box {
  display: flex; align-items: center; gap: .75rem;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); padding: .6rem 1rem;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: var(--shadow-sm);
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.search-icon { color: var(--muted); font-size: 1.1rem; flex-shrink: 0; }
.search-box input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: .95rem; font-family: inherit; color: var(--text);
}
.search-box input::placeholder { color: var(--muted); }

/* ── CONTAINER ── */
.container { max-width: var(--max); margin: 0 auto; padding: 1.75rem 1.5rem 3rem; }

/* ── CATEGORY COLORS ── */
.cat-Recomendaciones { --cat: var(--accent); }
.cat-Componentes     { --cat: var(--teal); }
.cat-Almacenamiento  { --cat: var(--orange); }
.cat-Por-Carrera     { --cat: var(--purple); }
.cat-Consejos        { --cat: var(--green); }
.cat-Comparativas    { --cat: #dc2626; }

/* ── SECTION HEADER ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-title {
  font-size: 1rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: .6rem;
}
.section-title::before {
  content: ''; display: block;
  width: 4px; height: 1.1em; background: var(--accent); border-radius: 2px;
}
.article-count {
  font-size: .8rem; color: var(--muted);
  background: var(--surface3); padding: .2rem .6rem;
  border-radius: 999px; font-weight: 500;
}

/* ── GRID ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1.25rem; }

/* ── CARD ── */
.card {
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s;
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
  border-top: 3px solid var(--cat, var(--accent));
}
.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.card-tag {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--cat, var(--accent));
  margin-bottom: .6rem;
}
.card-title {
  font-size: 1rem; font-weight: 700; line-height: 1.4;
  margin-bottom: .6rem; color: var(--text);
  flex: 1;
}
.card-title a:hover { color: var(--accent); }
.card-excerpt {
  font-size: .855rem; color: var(--text2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: .9rem;
}
.card-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .75rem; color: var(--muted);
  padding-top: .75rem; border-top: 1px solid var(--border);
  margin-top: auto;
}
.card-meta-mins {
  background: var(--surface3); padding: .15rem .5rem;
  border-radius: 999px; font-weight: 500;
}
.card-arrow { color: var(--accent); font-size: .9rem; }

/* ── ARTÍCULO ── */
.article-layout {
  display: grid; grid-template-columns: 1fr 290px;
  gap: 3rem; max-width: var(--max); margin: 0 auto; padding: 2.5rem 1.5rem;
}
@media (max-width: 820px) { .article-layout { grid-template-columns: 1fr; gap: 2rem; } }

.article-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.article-tag {
  display: inline-block;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--accent);
  background: var(--accent-soft); padding: .25rem .65rem;
  border-radius: 999px; margin-bottom: .85rem;
}
.article-title {
  font-size: 2rem; font-weight: 800; line-height: 1.2;
  letter-spacing: -.03em; margin-bottom: .85rem; color: var(--text);
}
.article-meta {
  display: flex; align-items: center; gap: 1rem;
  font-size: .82rem; color: var(--muted); flex-wrap: wrap;
}
.article-meta span { display: flex; align-items: center; gap: .3rem; }
.mins-badge {
  background: var(--surface3); color: var(--text2);
  padding: .2rem .6rem; border-radius: 999px; font-weight: 600;
}

.article-body { max-width: 720px; }
.article-body h2 {
  font-size: 1.3rem; font-weight: 700;
  margin: 2.25rem 0 .85rem; color: var(--text);
  padding-bottom: .5rem; border-bottom: 1px solid var(--border);
  letter-spacing: -.01em;
}
.article-body h3 { font-size: 1.05rem; font-weight: 700; margin: 1.75rem 0 .5rem; color: var(--text); }
.article-body p { margin-bottom: 1.1rem; color: var(--text2); line-height: 1.8; }
.article-body ul, .article-body ol { padding-left: 1.5rem; margin-bottom: 1.1rem; }
.article-body li { margin-bottom: .5rem; color: var(--text2); }
.article-body blockquote {
  border-left: 4px solid var(--accent); padding: 1rem 1.5rem;
  background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0; font-style: italic; color: var(--text2);
}
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.article-body strong { font-weight: 600; color: var(--text); }

/* ── KEY TAKEAWAYS ── */
.key-takeaways {
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 1px solid #bfdbfe; border-radius: var(--radius);
  padding: 1.5rem; margin: 1.75rem 0;
}
.key-takeaways h3 {
  color: var(--accent); font-size: 1rem; font-weight: 700;
  margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem;
}
.key-takeaways h3::before { content: '💡'; }
.key-takeaways ul { padding-left: 0; list-style: none; }
.key-takeaways li {
  padding: .4rem 0 .4rem 1.5rem; position: relative; color: var(--text);
}
.key-takeaways li::before {
  content: '✓'; position: absolute; left: 0;
  color: var(--accent); font-weight: 700;
}

/* ── AFFILIATE BOX ── */
.affiliate-box {
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 1.5px solid #bfdbfe; border-radius: var(--radius);
  padding: 1.5rem; margin: 2rem 0;
}
.affiliate-box h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: .4rem; }
.affiliate-box p { font-size: .875rem; color: var(--text2); margin-bottom: 1rem; }
.affiliate-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.affiliate-link {
  background: var(--accent); color: #fff;
  padding: .5rem 1.1rem; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600;
  transition: background .2s, transform .15s;
  display: inline-flex; align-items: center; gap: .4rem;
}
.affiliate-link:hover { background: var(--accent2); transform: translateY(-1px); }
.affiliate-link.secondary {
  background: transparent; color: var(--accent);
  border: 1.5px solid var(--accent);
}
.affiliate-link.secondary:hover { background: var(--accent-soft); transform: translateY(-1px); }

/* ── FAQ ── */
.faq-section { margin-top: 3rem; }
.faq-section > h2 {
  font-size: 1.3rem; font-weight: 700; margin-bottom: 1.25rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--border);
}
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: .75rem; overflow: hidden;
}
.faq-item h3 {
  font-size: .95rem; font-weight: 600; color: var(--text);
  padding: 1rem 1.25rem; cursor: pointer;
  background: var(--surface2);
}
.faq-item p {
  font-size: .875rem; color: var(--text2);
  padding: .75rem 1.25rem 1rem; border-top: 1px solid var(--border);
  margin: 0;
}

/* ── SIDEBAR ── */
.sidebar { position: sticky; top: 80px; align-self: start; }
.widget {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  margin-bottom: 1.25rem; box-shadow: var(--shadow-sm);
}
.widget h4 {
  font-size: .75rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border);
}
.related-link {
  display: flex; align-items: center; gap: .6rem;
  font-size: .855rem; color: var(--text); padding: .6rem 0;
  border-bottom: 1px solid var(--border); line-height: 1.4;
  transition: color .15s;
}
.related-link::before { content: '→'; color: var(--muted); font-size: .8rem; flex-shrink: 0; }
.related-link:last-child { border-bottom: none; }
.related-link:hover { color: var(--accent); }
.related-link:hover::before { color: var(--accent); }

/* ── FOOTER ── */
footer {
  background: var(--surface); border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.footer-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
  display: grid; grid-template-columns: 1fr auto;
  gap: 2rem; align-items: center;
}
.footer-brand .logo { margin-bottom: .5rem; }
.footer-brand p { font-size: .82rem; color: var(--muted); max-width: 380px; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { font-size: .82rem; color: var(--muted); transition: color .15s; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  text-align: center; padding: 1rem 1.5rem;
  font-size: .78rem; color: var(--muted);
}
@media (max-width: 600px) { .footer-inner { grid-template-columns: 1fr; } }

/* ── STATIC PAGES ── */
.page-content { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.page-content h1 { font-size: 1.9rem; font-weight: 800; margin-bottom: 1.5rem; letter-spacing: -.02em; }
.page-content h2 { font-size: 1.2rem; font-weight: 700; margin: 2rem 0 .75rem; }
.page-content p { margin-bottom: 1rem; color: var(--text2); }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.7rem; }
  .hero-stats { gap: 1.25rem; }
  .article-title { font-size: 1.5rem; }
  .grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
