/* ============================================
 *  LibrePixels — Design System
 *  ============================================ */

:root {
  /* Colors */
  --bg: #f8f9fc;
  --bg-alt: #ffffff;
  --text: #0f1117;
  --text-muted: #5a6072;
  --card: #ffffff;
  --card-border: #e4e7ef;
  --accent: #0a0f1e;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #10b981;
  --header-bg: #0a0f1e;
  --hero-bg: #0f1729;
  --footer-bg: #0a0f1e;
  --footer-text: #94a3b8;

  /* Typography */
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Fira Code', monospace;

  /* Spacing */
  --radius: 10px;
  --radius-lg: 16px;
  --nav-h: 60px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
}

.dark {
  --bg: #0c0e14;
  --bg-alt: #111318;
  --text: #e8ecf3;
  --text-muted: #7a8498;
  --card: #161a22;
  --card-border: #252a35;
  --accent: #0c0e14;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: #1e3a5f;
  --header-bg: #090b10;
  --hero-bg: #090b12;
  --footer-bg: #07080d;
  --footer-text: #4a5568;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
}

/* ============ RESET & BASE ============ */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }
img { display: block; max-width: 100%; }

/* ============ NAVBAR ============ */

.navbar {
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.logo-icon { display: flex; color: var(--primary); }
.logo-text { color: #fff; }

/* Nav right */
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 7px;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-link.active { color: #fff; background: rgba(255,255,255,0.1); }

.nav-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.12);
  margin: 0 6px;
}

.nav-icon {
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  padding: 7px;
  border-radius: 7px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
.nav-icon:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* Theme toggle */
#theme-toggle {
background: transparent;
border: 1px solid rgba(255,255,255,0.15);
color: rgba(255,255,255,0.7);
padding: 6px 8px;
border-radius: 7px;
cursor: pointer;
display: flex;
align-items: center;
transition: background 0.15s, color 0.15s;
margin-left: 4px;
}
#theme-toggle:hover { background: rgba(255,255,255,0.1); color: #fff; }
.icon-moon { display: none; }
.dark .icon-sun { display: none; }
.dark .icon-moon { display: block; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.8);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ============ HERO ============ */

.hero {
  background: var(--hero-bg);
  position: relative;
  overflow: hidden;
  padding: 80px 24px 100px;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(37,99,235,0.15);
  border: 1px solid rgba(37,99,235,0.3);
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 24px;
}
.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--success); }
  50% { opacity: 0.6; box-shadow: 0 0 12px var(--success); }
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.hero-accent {
  color: var(--primary);
  position: relative;
}
.hero-accent::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  opacity: 0.6;
}

.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.5);
  margin: 0 0 36px;
  max-width: 520px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,0.4);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(37,99,235,0.5);
  transform: translateY(-1px);
  color: #fff;
}

.btn-ghost {
  color: rgba(255,255,255,0.6);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-ghost:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
  transform: translateY(-1px);
}

/* Hero decoration */
.hero-decoration { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.deco-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}
.c1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(37,99,235,0.18), transparent 70%);
  top: -200px; right: -100px;
}
.c2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(16,185,129,0.1), transparent 70%);
  bottom: -100px; left: 30%;
}
.deco-grid {
  position: absolute;
  inset: 0;
  background-image:
  linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
  linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,0.6) 30%, rgba(0,0,0,0.6) 70%, transparent);
}

/* ============ MAIN CONTAINER ============ */

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px;
  flex: 1;
}
.container--page { padding-top: 40px; }

/* ============ LIST / GRID ============ */

.section-heading {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-image-wrap { overflow: hidden; }
.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.card:hover .card-image { transform: scale(1.03); }

.card-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.card h3 a {
  text-decoration: none;
  color: var(--text);
  transition: color 0.15s;
}
.card h3 a:hover { color: var(--primary); }

.card-summary {
  margin: 0;
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ============ SINGLE POST ============ */

.post {
  max-width: 740px;
  margin: 0 auto;
}

.post h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 12px;
}

.post .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin: 0 0 40px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.post .meta::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.content {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text);
}

.content h2, .content h3, .content h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2.2em;
}
.content h2 { font-size: 1.55rem; border-bottom: 1px solid var(--card-border); padding-bottom: 8px; }
.content h3 { font-size: 1.2rem; }

.content a { color: var(--primary); }
.content a:hover { color: var(--primary-hover); }

.content pre {
  background: var(--accent);
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 1.6em 0;
  border: 1px solid rgba(255,255,255,0.06);
}

.content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
}
.content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.content blockquote {
  border-left: 3px solid var(--primary);
  margin: 1.6em 0;
  padding: 12px 20px;
  background: var(--primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
}
.content blockquote p { margin: 0; }

.content img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin: 1.6em 0;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1.6em 0;
}
.content th, .content td {
  padding: 10px 14px;
  border: 1px solid var(--card-border);
  text-align: left;
}
.content th { background: var(--card); font-weight: 600; }
.content tr:nth-child(even) td { background: var(--bg-alt); }

/* ============ IMAGES UTILITY ============ */

.center-img { text-align: center; margin: 1.6em 0; }
.center-img img { display: inline-block; max-width: 500px; width: 100%; height: auto; border-radius: var(--radius); }
.center-img-screenshot img { display: inline-block; max-width: 700px; width: 100%; height: auto; border-radius: var(--radius); }

/* ============ FOOTER ============ */

.footer {
  background: var(--footer-bg);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 20px 24px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--footer-text);
  flex-wrap: wrap;
}
.footer-logo {
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  font-size: 0.9rem;
}
.footer-sep { opacity: 0.3; }
.footer a { color: var(--footer-text); text-decoration: none; }
.footer a:hover { color: rgba(255,255,255,0.7); }

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
  .hamburger { display: flex; }

  .nav-right {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--header-bg);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 20px 20px;
    gap: 4px;
  }
  .nav-right.open { display: flex; }

  .nav-link { padding: 10px 14px; width: 100%; border-radius: 8px; }
  .nav-divider { width: 100%; height: 1px; margin: 6px 0; }
  .nav-icon, #theme-toggle { padding: 10px 14px; }

  .hero { padding: 60px 20px 80px; }
  .hero-title { font-size: 2rem; }

  .grid { grid-template-columns: 1fr; }

  .container { padding: 32px 20px; }

  .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .btn { width: 100%; justify-content: center; }
}

.lang-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9999;
  font-size: 14px;
}

.lang-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.lang-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  background: #fff;
  color: #000;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: 0.2s;
}

.lang-switch:hover {
  opacity: 0.85;
}

.lang-dismiss {
  background: none;
  border: none;
  color: #aaa;
  font-size: 16px;
  cursor: pointer;
}

/* ============ COMMENTS SECTION ============ */

.comments-section {
  max-width: 740px;
  margin: 56px auto 0;
  padding-top: 40px;
  border-top: 1px solid var(--card-border);
}

.comments-header {
  margin-bottom: 28px;
}

.comments-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

.comments-title svg {
  color: var(--primary);
  flex-shrink: 0;
}

.comments-body {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  overflow: visible;
  height: auto;
}

#cusdis_thread {
display: block;
overflow: visible;
}

#cusdis_thread iframe {
width: 100% !important;
min-width: 100% !important;
border: none !important;
display: block;
overflow: hidden;
min-height: 200px;
max-height: none !important;
}

/* Tematización del hilo de Cusdis vía variables CSS
 *  (Cusdis lee --cusdis-* del padre cuando está en modo embed) */
#cusdis_thread {
--cusdis-font-family: var(--font-body);
color-scheme: light dark;
}

.dark #cusdis_thread {
  color-scheme: dark;
}

@media (max-width: 768px) {
  .comments-section {
    margin-top: 40px;
    padding-top: 32px;
  }

  .comments-body {
    padding: 16px;
  }
}

/* — Remarkslite widget integrado al diseño de LibrePixels — */
#remarkslite-comments {
--rl-accent:    var(--primary);
--rl-radius:    var(--radius);
--rl-font:      var(--font-body);
--rl-border:    var(--card-border);
--rl-max-width: 100%;          /* el ancho lo controla .comments-body */
--rl-bg:        var(--card);
--rl-bg-input:  var(--bg);
--rl-text:      var(--text);
--rl-text-muted: var(--text-muted);
margin: 0;                     /* quita el margin:40px auto del widget */
}

/* Hereda el modo oscuro de tu clase .dark en lugar de prefers-color-scheme */
.dark #remarkslite-comments {
  --rl-border:    var(--card-border);
  --rl-bg:        var(--card);
  --rl-bg-input:  var(--bg-alt);
  --rl-text:      var(--text);
  --rl-text-muted: var(--text-muted);
  --rl-reply-line: var(--card-border);
}

#remarkslite-comments h3 {
display: none;   /* ya tienes .comments-title con ícono SVG en el HTML de Hugo */
}
