/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Fondo y superficies */
  --bg:           #ffffff;
  --surface-muted:#f6f5f3;
  --line:         #e4e1db;
  --line-soft:    #eeece8;

  /* Texto */
  --text:         #111218;
  --muted:        #6b7280;
  --muted-dark:   #4b5563;

  /* Header oscuro */
  --header-bg:    #0f1117;
  --header-text:  #f1f0ee;
  --header-muted: #9ca3af;

  /* Acento neutro (sólo para detalles sin tema) */
  --accent:       #374151;
  --accent-soft:  #f3f4f6;

  /* Sombras */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 2px 10px rgba(0,0,0,.04);
  --shadow:     0 2px 8px rgba(0,0,0,.07), 0 4px 20px rgba(0,0,0,.05);
  --shadow-md:  0 6px 20px rgba(0,0,0,.10), 0 12px 36px rgba(0,0,0,.07);

  --radius-xl:   16px;
  --radius-lg:   12px;
  --radius-pill: 999px;
  --font:        system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --max-w:       1200px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Header (sticky navbar) ───────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #0f1117;
  border-bottom: 1px solid rgba(255,255,255,.07);
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  min-height: 60px;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  flex-shrink: 0;
  letter-spacing: -.03em;
  box-shadow: 0 0 20px rgba(99,102,241,.35);
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-text strong {
  font-size: 1.05rem;
  line-height: 1.1;
  color: #f1f0ee;
  font-weight: 700;
  letter-spacing: -.01em;
}

.brand-text span {
  color: #6b7280;
  font-size: 0.72rem;
  letter-spacing: .01em;
}

/* ── Hero section ─────────────────────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(160deg, #0f1117 0%, #141824 100%);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 36px 24px 32px;
  text-align: center;
}

.hero-inner {
  max-width: 560px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 14px;
}

.eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  flex-shrink: 0;
}

.hero-section h1 {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.03em;
  color: #f1f0ee;
  margin-bottom: 10px;
}

.hero-desc {
  font-size: clamp(.85rem, 1.4vw, .97rem);
  color: rgba(241,240,238,.55);
  line-height: 1.65;
  margin-bottom: 18px;
}

/* Search */
.search-wrap {
  position: relative;
  max-width: 400px;
  width: 100%;
  margin: 0 auto 0;
}

.search-wrap input {
  width: 100%;
  padding: 11px 44px 11px 20px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-pill);
  color: #f1f0ee;
  font-family: var(--font);
  font-size: .92rem;
  outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
}

.search-wrap input::placeholder { color: rgba(241,240,238,.38); }

.search-wrap input:focus {
  border-color: #6366f1;
  background: rgba(255,255,255,.11);
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}

.search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  stroke: rgba(241,240,238,.4);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

/* Hero stats */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 28px;
}

.hero-stat strong {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.02em;
  display: block;
}

.hero-stat span {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

.hero-stat-divider {
  width: 1px;
  height: 36px;
  background: var(--line);
  flex-shrink: 0;
}

/* ── Main ─────────────────────────────────────────────────────────────────── */
.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

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

/* Card */
.card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px 24px 24px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .2s, transform .2s, border-color .2s;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--card-color, var(--accent));
}

/* Icon box */
.card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  flex-shrink: 0;
  font-size: 1.55rem;
  transition: transform .2s;
  /* Color de fondo: versión muy suave del color de la card */
  background: color-mix(in srgb, var(--card-color, var(--accent)) 12%, white);
}
.card:hover .card-icon-wrap { transform: scale(1.08); }

/* Imagen opcional */
.card-media {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 18px;
  background: var(--surface-muted);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.card:hover .card-media img { transform: scale(1.04); }

/* Badge */
.card-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--muted-dark);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  width: fit-content;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 8px;
  letter-spacing: -.01em;
}

.card-desc {
  font-size: .875rem;
  color: var(--muted-dark);
  line-height: 1.62;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 18px;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .84rem;
  font-weight: 700;
  color: var(--card-color, var(--accent));
  margin-top: auto;
  transition: gap .18s;
}
.card-cta svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s;
}
.card:hover .card-cta     { gap: 9px; }
.card:hover .card-cta svg { transform: translateX(3px); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-state h2 { font-size: 1.3rem; color: var(--text); margin-bottom: 8px; font-weight: 700; }

/* No results */
.no-results { text-align: center; padding: 40px; color: var(--muted); font-size: .95rem; }

/* ── AdSense slots ────────────────────────────────────────────────────────── */
.ad-top,
.ad-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px 24px;
}
.ad-top    { padding-top: 20px; }
.ad-bottom { padding-bottom: 20px; }

.ad-ingrid {
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 120px;
  background: var(--surface-muted);
  border: 1px dashed var(--line);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  background: #0f1117;
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 36px 24px;
  text-align: center;
}
.footer-inner { max-width: 600px; margin: 0 auto; }

.logo-sm {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -.01em;
  color: #f1f0ee;
}

.logo-sm .brand-mark-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  flex-shrink: 0;
}

.site-footer p      { color: #6b7280; font-size: .875rem; margin-top: 6px; }
.footer-copy        { margin-top: 20px; font-size: .75rem; opacity: .6; color: #6b7280; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .cards-grid     { grid-template-columns: 1fr; gap: 14px; }
  .main-content   { padding: 24px 16px 48px; }
  .hero-section   { padding: 20px 16px 18px; }
  .brand-text     { display: none; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

[hidden] { display: none !important; }

/* ── Sticky sidebar ads ────────────────────────────────────────────────────── */
.ad-sidebar {
  position: fixed;
  top: 120px;
  width: 160px;
  z-index: 10;
}
.ad-sidebar-left  { left:  max(8px, calc(50% - 620px - 176px)); }
.ad-sidebar-right { right: max(8px, calc(50% - 620px - 176px)); }
/* Solo se muestran si hay al menos 160px de margen a cada lado */
@media (max-width: 1520px) { .ad-sidebar { display: none; } }

/* ── Cookie banner ─────────────────────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  inset: auto 16px 16px 16px;
  z-index: 999;
}
.cookie-content {
  width: min(860px, 100%);
  margin-left: auto;
  background: #0f1117;
  border: 1px solid #2a2d35;
  color: #f1f0ee;
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
}
.cookie-content strong { display: block; font-size: .95rem; margin-bottom: 4px; }
.cookie-content p { margin: 4px 0 0; font-size: .85rem; color: rgba(241,240,238,.75); line-height: 1.5; }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; align-items: center; }
.cookie-btn-accept {
  background: #f1f0ee; color: #0f1117;
  border: none; border-radius: 8px;
  padding: 9px 18px; font-size: .88rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.cookie-btn-reject {
  background: transparent; color: rgba(241,240,238,.7);
  border: 1px solid rgba(241,240,238,.25); border-radius: 8px;
  padding: 9px 18px; font-size: .88rem;
  cursor: pointer; white-space: nowrap;
}
@media (max-width: 640px) {
  .cookie-content { flex-direction: column; align-items: flex-start; }
}
