/*
Theme Name: Sinologic
Theme URI: https://sinologic.net
Author: Elio
Description: Tema oscuro estilo señal/terminal para sinologic.net. Blog de VoIP, Asterisk, SIP, Kamailio y telecomunicaciones IP.
Version: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sinologic
Tags: dark, technology, blog, voip, custom-menu, featured-images, post-formats
*/

/* ─────────────────────────────────────────────────────────────────────────
   0. LOCAL FONTS
   ───────────────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Archivo Black';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/ArchivoBlack-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo Black';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/ArchivoBlack-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ─────────────────────────────────────────────────────────────────────────
   1. CSS VARIABLES
   ───────────────────────────────────────────────────────────────────────── */
:root {
  /* Palette */
  --bg-deep:     #141820;
  --bg:          #1a1e2a;
  --surface:     #212636;
  --surface-2:   #162035;
  --surface-3:   #1d2a42;
  --border:      #1e2d47;
  --border-2:    #263a58;

  /* Text */
  --text:        #b6bfcf;
  --text-muted:  #4f6070;
  --text-dim:    #2d3d52;
  --heading:     #dde2ee;
  --heading-2:   #f0f3fa;

  /* Brand accent */
  --accent:      #00d4ff;
  --accent-dim:  rgba(0,212,255,0.10);
  --accent-glow: rgba(0,212,255,0.22);
  --accent-2:    #ff5e1a;
  --accent-2dim: rgba(255,94,26,0.12);
  --green:       #00e88a;
  --purple:      #9b8fff;

  /* Fonts */
  --font-mono:   'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-body:   'Open Sans', 'Segoe UI', sans-serif;

  /* Layout */
  --max:         1240px;
  --gap:         28px;
  --radius:      5px;
  --radius-lg:   10px;

  /* Effects */
  --shadow:      0 4px 32px rgba(0,0,0,0.55);
  --shadow-sm:   0 2px 14px rgba(0,0,0,0.35);
  --glow:        0 0 20px var(--accent-glow);
}

/* ─── Light mode overrides ────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-deep:     #f0f2f5;
  --bg:          #f7f8fa;
  --surface:     #ffffff;
  --surface-2:   #eef0f4;
  --surface-3:   #e2e5eb;
  --border:      #d0d5dd;
  --border-2:    #bcc3cf;

  --text:        #2d3748;
  --text-muted:  #6b7a8d;
  --text-dim:    #a0aab8;
  --heading:     #1a202c;
  --heading-2:   #0d1117;

  --accent:      #0094b3;
  --accent-dim:  rgba(0,148,179,0.08);
  --accent-glow: rgba(0,148,179,0.18);
  --accent-2:    #d94e15;
  --accent-2dim: rgba(217,78,21,0.08);
  --green:       #00a86b;
  --purple:      #7c6dd8;

  --shadow:      0 4px 32px rgba(0,0,0,0.08);
  --shadow-sm:   0 2px 14px rgba(0,0,0,0.06);
  --glow:        0 0 20px var(--accent-glow);
  --header-bg:   rgba(240, 242, 245, 0.90);
  --hero-img-filter:    brightness(1.0) saturate(1.0);
  --hero-overlay:       linear-gradient(to top, rgba(240,242,245,0.92) 0%, rgba(240,242,245,0.3) 50%, transparent 100%);
  --hero-title-color:   var(--heading);
  --hero-title-shadow:  0 2px 20px rgba(0,0,0,0.08);
  --hero-title-glow:    none;
}


/* ─────────────────────────────────────────────────────────────────────────
   2. RESET & BASE
   ───────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* Smooth theme transition — only active during toggle, not on page load */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.8s ease, color 0.8s ease, border-color 0.8s ease, box-shadow 0.8s ease, fill 0.8s ease !important;
}

body {
  background-color: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle noise grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  z-index: 9998;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--heading-2); }
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* WordPress admin bar offset */
.admin-bar #site-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar #site-header { top: 46px; }
}


/* ─────────────────────────────────────────────────────────────────────────
   3. TYPOGRAPHY
   ───────────────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Archivo Black', var(--font-body), sans-serif;
  color: var(--heading);
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: -0.01em;
  scroll-margin-top: 80px;
}
.admin-bar h1, .admin-bar h2, .admin-bar h3,
.admin-bar h4, .admin-bar h5, .admin-bar h6 {
  scroll-margin-top: 112px;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.15rem; }
h5, h6 { font-size: 1rem; }

p { margin-bottom: 1.25em; }
p:last-child { margin-bottom: 0; }

strong, b { color: var(--heading); font-weight: 600; }
em, i { font-style: italic; color: var(--heading); }

ul, ol {
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}
li { margin-bottom: 0.35em; }
li:last-child { margin-bottom: 0; }

blockquote {
  position: relative;
  margin: 1.75em 0;
  padding: 0;
  background: #0d1117;
  color: #c9d1d9;
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-style: normal;
  line-height: 1.7;
  border: 1px solid #30363d;
  border-radius: var(--radius);
  overflow: hidden;
}
blockquote .bq-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  font-size: 0.75em;
  color: #484f58;
}
blockquote .bq-dots span {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 5px;
}
blockquote .bq-dots span:nth-child(1) { background: #ff5f56; }
blockquote .bq-dots span:nth-child(2) { background: #ffbd2e; }
blockquote .bq-dots span:nth-child(3) { background: #27c93f; }
blockquote .bq-copy {
  background: none;
  border: 1px solid #30363d;
  color: #8b949e;
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
blockquote .bq-copy:hover {
  color: #c9d1d9;
  border-color: #58a6ff;
}
blockquote > p,
blockquote > ul,
blockquote > ol {
  padding: 0 1.2em;
  color: #c9d1d9;
}
blockquote > *:nth-child(2) {
  padding-top: 0.8em;
}
blockquote > *:last-child {
  padding-bottom: 0.8em;
}
blockquote cite {
  display: block;
  padding: 0.5em 1.2em 0.8em;
  font-size: 0.85em;
  font-family: var(--font-mono);
  font-style: normal;
  color: #7ee787;
  letter-spacing: 0.02em;
}
blockquote cite::before {
  content: '# ';
  color: #484f58;
}
[data-theme="light"] blockquote {
  background: #1a1a2e;
  border-color: #2a2a4a;
}
[data-theme="light"] blockquote .bq-bar {
  background: #12122a;
  border-color: #2a2a4a;
}
[data-theme="light"] blockquote .bq-copy {
  border-color: #2a2a4a;
  color: #7070a0;
}
[data-theme="light"] blockquote .bq-copy:hover {
  color: #c0c0e0;
  border-color: #58a6ff;
}
[data-theme="light"] blockquote > p,
[data-theme="light"] blockquote > ul,
[data-theme="light"] blockquote > ol { color: #b0b0d0; }
[data-theme="light"] blockquote cite { color: #7ee787; }

/* Inline code (not inside pre) */
code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.15em 0.45em;
  border-radius: 3px;
  color: var(--accent);
  letter-spacing: 0;
}
/* Code blocks */
pre {
  position: relative;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  margin: 1.5em 0;
}
pre .code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  font-size: 0.7em;
  color: #484f58;
}
pre .code-dots span {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 5px;
}
pre .code-dots span:nth-child(1) { background: #ff5f56; }
pre .code-dots span:nth-child(2) { background: #ffbd2e; }
pre .code-dots span:nth-child(3) { background: #27c93f; }
pre .code-copy {
  background: none;
  border: 1px solid #30363d;
  color: #8b949e;
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
pre .code-copy:hover {
  color: #c9d1d9;
  border-color: #58a6ff;
}
pre code {
  background: none !important;
  border: none !important;
  color: #c9d1d9;
}
pre code *:not([style*="color"]) {
  color: inherit;
}
pre code {
  padding: 0.8em 1.2em;
  font-size: 0.85em;
  display: block;
  line-height: 1.6;
  overflow-x: auto;
  tab-size: 4;
  -moz-tab-size: 4;
  white-space: pre;
}
[data-theme="light"] pre {
  background: #1a1a2e;
  border-color: #2a2a4a;
}
[data-theme="light"] pre .code-bar {
  background: #12122a;
  border-color: #2a2a4a;
}
[data-theme="light"] pre .code-copy {
  border-color: #2a2a4a;
  color: #7070a0;
}
[data-theme="light"] pre .code-copy:hover {
  color: #c0c0e0;
  border-color: #58a6ff;
}
[data-theme="light"] pre code { color: #b0b0d0; }
[data-theme="light"] pre code *:not([style*="color"]) { color: inherit; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9em;
  font-family: var(--font-mono);
}
thead { border-bottom: 2px solid var(--accent); }
th {
  text-align: left;
  padding: 0.6em 1em;
  color: var(--accent);
  font-size: 0.78em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
td {
  padding: 0.65em 1em;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface); }


/* ─────────────────────────────────────────────────────────────────────────
   4. LAYOUT CONTAINERS
   ───────────────────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

#page { display: flex; flex-direction: column; min-height: 100vh; }


/* ─────────────────────────────────────────────────────────────────────────
   5. SITE HEADER & NAVIGATION
   ───────────────────────────────────────────────────────────────────────── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg, rgba(6, 9, 16, 0.88));
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

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

/* Logo / Site branding */
.site-branding { flex-shrink: 0; }

.site-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.site-logo-link img {
  height: 32px;
  width: auto;
  filter: brightness(1.1) saturate(0.9);
}
.site-logo-hex {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.site-logo-link:hover .site-logo-hex {
  transform: rotate(15deg) scale(1.1);
}
.site-name {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--heading-2);
  letter-spacing: 0.02em;
}
.site-tagline { display: none; }

/* Status indicator (top-right of header) */
.header-inner::after {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--green);
  animation: blink 2.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Header search toggle */
.header-search-toggle {
  background: none;
  border: none;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  opacity: 0.65;
  transition: opacity 0.2s, background 0.2s;
  padding: 0;
  font-size: 1.1rem;
  color: var(--text);
}
.header-search-toggle:hover { opacity: 1; background: var(--accent-dim); }
.header-search-toggle[aria-expanded="true"] { opacity: 1; color: var(--accent); background: var(--accent-dim); }

/* Header search panel */
.header-search {
  max-height: 0;
  overflow: hidden;
  background: var(--surface);
  border-bottom: 1px solid transparent;
  transition: max-height 0.3s ease, border-color 0.3s;
}
.header-search.open {
  max-height: 80px;
  border-bottom-color: var(--border);
}
.header-search-form {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  gap: 12px;
}
.header-search-form input[type="search"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.header-search-form input[type="search"]:focus {
  border-color: var(--accent);
}
.header-search-form input[type="search"]::placeholder {
  color: var(--text-dim);
}
.header-search-form button {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.header-search-form button:hover {
  background: var(--accent-glow);
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: none;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  opacity: 0.65;
  transition: opacity 0.2s, background 0.2s;
  padding: 0;
}
.theme-toggle:hover { opacity: 1; background: var(--accent-dim); }
.toggle-icon::before {
  content: '☽';
  font-size: 0.9rem;
  color: var(--text);
}
[data-theme="light"] .toggle-icon::before {
  content: '☀';
  color: var(--accent-2);
}

/* Header actions group */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  flex-shrink: 0;
}

/* Shared style for all header action buttons */
.header-actions .lang-switch,
.header-actions .header-search-toggle,
.header-actions .theme-toggle,
.header-actions .header-action-btn {
  margin-left: 0;
}

/* Language switcher */
.lang-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s, transform 0.2s;
  text-decoration: none;
  font-size: 1.05rem;
}
.lang-switch:hover {
  opacity: 1;
  background: var(--accent-dim);
  transform: scale(1.1);
}

/* Easter egg terminal button */
.header-action-btn {
  background: none;
  border: none;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text);
}
.header-action-btn:hover {
  opacity: 1;
  background: var(--accent-dim);
}

/* Primary navigation */
#primary-nav { margin-left: auto; }
#primary-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  padding: 0;
  margin: 0;
}
#primary-nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.75;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s, opacity 0.2s;
  display: block;
}
#primary-nav a:hover,
#primary-nav li.current-menu-item > a,
#primary-nav li.current_page_item > a {
  color: var(--accent);
  opacity: 1;
  background: var(--accent-dim);
}

/* Dropdown */
#primary-nav li { position: relative; }
#primary-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  flex-direction: column;
  z-index: 200;
  padding: 14px 6px 6px;     /* 8px bridge + 6px inner top */
  background: transparent;
}
/* Visible dropdown box (drawn behind items) */
#primary-nav .sub-menu::before {
  content: '';
  position: absolute;
  top: 8px; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: -1;
}
#primary-nav li:hover > .sub-menu { display: flex; }
#primary-nav .sub-menu a { font-size: 0.75rem; padding: 8px 14px; white-space: nowrap; }

/* Nested sub-menus: open to the right */
#primary-nav .sub-menu li > .sub-menu {
  top: 0;
  left: 100%;
  padding: 0 0 0 8px;        /* horizontal bridge instead of vertical */
}
#primary-nav .sub-menu li > .sub-menu::before {
  top: 0;
  left: 8px;
  right: 0;
  bottom: 0;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  transition: all 0.3s;
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ─────────────────────────────────────────────────────────────────────────
   6. HERO / WAVEFORM SECTION
   ───────────────────────────────────────────────────────────────────────── */
#hero {
  position: relative;
  height: 280px;
  overflow: hidden;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

#signal-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
}

/* Scanlines */
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.04) 3px,
    rgba(0,0,0,0.04) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* Fade edges */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(to right, var(--bg-deep) 0%, transparent 15%, transparent 85%, var(--bg-deep) 100%),
    linear-gradient(to bottom, var(--bg-deep) 0%, transparent 30%, transparent 70%, var(--bg-deep) 100%);
  pointer-events: none;
  z-index: 3;
}

.hero-content {
  position: relative;
  z-index: 4;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-glow);
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent);
  animation: blink 2s infinite;
}

.hero-title {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  color: var(--heading-2);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-shadow: var(--hero-title-glow, 0 0 40px rgba(0,212,255,0.15));
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}


/* ─────────────────────────────────────────────────────────────────────────
   7. ARCHIVE / HOME LAYOUT
   ───────────────────────────────────────────────────────────────────────── */
.archive-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.archive-header {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.archive-header .page-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.archive-header .archive-description {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Posts grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  align-items: stretch;
}
.posts-grid > * {
  min-width: 0;
}


/* ─────────────────────────────────────────────────────────────────────────
   8. POST CARD (standard)
   ───────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.card:hover {
  border-color: var(--border-2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card-thumbnail {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--surface-2);
  position: relative;
}
.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: saturate(0.85) brightness(0.9);
}
.card:hover .card-thumbnail img {
  transform: scale(1.04);
  filter: saturate(1) brightness(0.95);
}

/* Placeholder when no featured image */
.card-thumbnail.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  background: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(255,255,255,0.01) 10px,
      rgba(255,255,255,0.01) 20px
    ),
    var(--surface-2);
}
.card-thumbnail.no-image::before {
  content: '[ NO SIGNAL ]';
}

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

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cat-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 3px 8px;
  background: var(--accent-dim);
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.2s;
}
.cat-label:hover { background: var(--accent-glow); color: var(--accent); }

.post-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  letter-spacing: 0.04em;
}

.card-title {
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--heading);
  margin: 0;
}
.card-title a {
  color: inherit;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a:hover { color: var(--heading-2); }

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

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.read-more {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s, gap 0.2s;
}
.read-more::after { content: '→'; transition: transform 0.2s; }
.card:hover .read-more { color: var(--accent); gap: 8px; }

.card-footer-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.reading-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  letter-spacing: 0.04em;
}
.card-comments {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.card-comments:hover {
  color: var(--accent);
}
.card-comments svg {
  opacity: 0.7;
}


/* ─── Wide card (spans 2 columns) ─────────────────────────────────────── */
.card-wide {
  grid-column: span 2;
}
.card-wide .card-thumbnail {
  height: 260px;
}
.card-wide .card-title {
  font-size: 1.3rem;
}
.card-excerpt-wide {
  -webkit-line-clamp: 3;
}
@media (max-width: 768px) {
  .card-wide {
    grid-column: span 1;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   8b. FEATURED POST CARD (full-width, first post on index)
   ───────────────────────────────────────────────────────────────────────── */
.card-featured {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  transition: border-color 0.3s;
}
.card-featured:hover {
  border-color: var(--accent);
}
.card-featured-thumb {
  overflow: hidden;
}
.card-featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s;
}
.card-featured:hover .card-featured-thumb img {
  transform: scale(1.03);
}
.card-featured-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.card-featured-title {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  line-height: 1.2;
  margin: 0;
}
.card-featured-title a {
  color: var(--heading);
  text-decoration: none;
  transition: color 0.2s;
}
.card-featured-title a:hover {
  color: var(--accent);
}
.card-featured-excerpt {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.65;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-featured-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}
.card-featured-footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.read-more-featured {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-decoration: none;
  transition: gap 0.2s;
}
.read-more-featured:hover {
  text-decoration: underline;
}
.card-featured-author {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.card-featured-author a {
  color: var(--heading);
  text-decoration: none;
}
.card-featured-author a:hover {
  color: var(--accent);
}

@media (max-width: 768px) {
  .card-featured {
    grid-template-columns: 1fr;
  }
  .card-featured-thumb {
    max-height: 220px;
  }
  .card-featured-body {
    padding: 20px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   9. SHORT POST CARD (aside / <200 words)
   ───────────────────────────────────────────────────────────────────────── */
.card-short {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  transition: border-color 0.2s, background 0.2s;
}
.card-short:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  border-left-color: var(--accent);
}

.short-meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 72px;
  padding-top: 2px;
}
.short-icon {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--accent);
  opacity: 0.6;
}
.short-date {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.4;
}

.short-body { flex: 1; min-width: 0; }

.short-title {
  font-size: 1rem;
  margin-bottom: 6px;
  font-weight: 600;
}
.short-title a { color: var(--heading); text-decoration: none; }
.short-title a:hover { color: var(--heading-2); }

.short-content {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.65;
}
.short-content a { color: var(--accent); }

/* Hide embeds/iframes inside grid cards */
.card iframe,
.card-short iframe,
.short-content .wp-block-embed,
.card-body .wp-block-embed {
  display: none;
}

.short-category {
  margin-top: 10px;
}

/* Category-specific accent colors */
.card.category-tutoriales, .card-short.category-tutoriales { border-left-color: var(--green); }
.card.category-tutoriales .cat-label, .card-short.category-tutoriales .cat-label { color: var(--green); background: rgba(0,232,138,0.1); }
.card.category-tutoriales .short-icon { color: var(--green); }

.card.category-networking, .card-short.category-networking { border-left-color: #4d9fff; }
.card.category-networking .cat-label, .card-short.category-networking .cat-label { color: #4d9fff; background: rgba(77,159,255,0.1); }

.card.category-seguridad, .card-short.category-seguridad { border-left-color: #ff4d6a; }
.card.category-seguridad .cat-label, .card-short.category-seguridad .cat-label { color: #ff4d6a; background: rgba(255,77,106,0.1); }

.card.category-opinion, .card-short.category-opinion { border-left-color: var(--purple); }
.card.category-opinion .cat-label, .card-short.category-opinion .cat-label { color: var(--purple); background: rgba(155,143,255,0.1); }

.card.category-inteligencia-artificial, .card-short.category-inteligencia-artificial { border-left-color: #ffd166; }
.card.category-inteligencia-artificial .cat-label, .card-short.category-inteligencia-artificial .cat-label { color: #ffd166; background: rgba(255,209,102,0.1); }

.card.category-productos, .card-short.category-productos { border-left-color: var(--accent-2); }
.card.category-productos .cat-label, .card-short.category-productos .cat-label { color: var(--accent-2); background: var(--accent-2dim); }


/* ─────────────────────────────────────────────────────────────────────────
   9b. MICROPOST CARD (tweet style)
   ───────────────────────────────────────────────────────────────────────── */
.card-micropost {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.card-micropost:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* Header: avatar + name + logo */
.micropost-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.micropost-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
}
.micropost-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.micropost-author {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.micropost-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--heading);
  text-decoration: none;
  line-height: 1.2;
}
.micropost-name:hover { color: var(--accent); }
.micropost-handle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.micropost-logo {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--accent);
  opacity: 0.5;
  letter-spacing: -0.05em;
}

/* Title */
.micropost-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.micropost-title a {
  color: #fff;
  text-decoration: none;
}
[data-theme="light"] .micropost-title a {
  color: #1a1a1a;
}
.micropost-title a:hover {
  color: var(--accent);
}

/* Body */
.micropost-body {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
}
.micropost-body p { margin: 0 0 8px; }
.micropost-body p:last-child { margin-bottom: 0; }
.micropost-body a { color: var(--accent); }

/* Footer: date + category */
.micropost-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}
.micropost-date {
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.micropost-sep {
  color: var(--text-dim);
}

/* Actions */
.micropost-actions {
  display: flex;
  gap: 20px;
  padding-top: 6px;
}
.micropost-action {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
a.micropost-action:hover {
  color: var(--accent);
}


/* ─────────────────────────────────────────────────────────────────────────
   9c. TERMINAL CARD (minientrada)
   ───────────────────────────────────────────────────────────────────────── */
.card-terminal {
  background: #0d1117 !important;
  border: 1px solid #30363d !important;
  border-left: 1px solid #30363d !important;
  border-radius: var(--radius-lg) !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0 !important;
  overflow: hidden;
  font-family: var(--font-mono);
}
.card-terminal:hover {
  border-color: #58a6ff !important;
  box-shadow: 0 0 12px rgba(88,166,255,0.15);
}
[data-theme="light"] .card-terminal {
  background: #1e1e2e !important;
  border-color: #383850 !important;
}
[data-theme="light"] .card-terminal:hover {
  border-color: #58a6ff !important;
}

/* Title bar */
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}
[data-theme="light"] .terminal-bar {
  background: #15151f;
}
.terminal-dots {
  display: flex;
  gap: 6px;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }
.terminal-title {
  font-size: 0.75rem;
  color: #8b949e;
  letter-spacing: 0.02em;
}

/* Body */
.terminal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Prompt line */
.terminal-prompt {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  font-size: 0.82rem;
  line-height: 1.6;
}
.prompt-user { color: #3fb950; }
.prompt-sep { color: #8b949e; }
.prompt-path { color: #58a6ff; }
.prompt-dollar { color: #8b949e; margin-right: 8px; }
.prompt-cmd { color: #c9d1d9; }

/* Output lines */
.terminal-heading {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 4px 0;
}
.terminal-heading a {
  color: #58a6ff;
  text-decoration: none;
}
.terminal-heading a:hover {
  text-decoration: underline;
}

.terminal-output {
  font-size: 0.85rem;
  color: #c9d1d9;
  line-height: 1.6;
  padding-left: 4px;
}
.terminal-output p { margin: 0 0 6px; }
.terminal-output a { color: #58a6ff; }

.terminal-date {
  font-size: 0.78rem;
  color: #8b949e;
}

.terminal-link {
  color: #3fb950 !important;
  text-decoration: none;
  cursor: pointer;
}
.terminal-link:hover {
  text-decoration: underline;
}

/* Terminal card overrides — hide old short-card elements */
.card-terminal .short-meta,
.card-terminal .short-body,
.card-terminal .short-category { display: none; }


/* ─────────────────────────────────────────────────────────────────────────
   10. PAGINATION
   ───────────────────────────────────────────────────────────────────────── */
.pagination {
  margin-top: 60px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pagination .page-numbers {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: var(--surface);
  transition: all 0.2s;
  text-decoration: none;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.pagination .page-numbers.dots { border: none; background: none; }


/* ─────────────────────────────────────────────────────────────────────────
   11. SINGLE POST LAYOUT
   ───────────────────────────────────────────────────────────────────────── */
.single-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Featured image hero */
.post-hero {
  position: relative;
  height: clamp(260px, 40vw, 440px);
  overflow: hidden;
  margin-bottom: 48px;
  background: var(--surface);
}
.post-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--hero-img-filter, brightness(0.65) saturate(0.8));
}
.post-hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-overlay, linear-gradient(to top, rgba(6,9,16,0.95) 0%, rgba(6,9,16,0.3) 50%, transparent 100%));
  z-index: 1;
}
/* Wave hero for posts without featured image */
.post-hero-wave {
  position: relative;
  height: 280px;
  overflow: hidden;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.post-hero-wave .hero-content {
  position: relative;
  z-index: 4;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
  width: 100%;
}
.post-hero-wave .hero-title {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  margin-bottom: 12px;
}
.post-hero-wave .post-meta-bar {
  justify-content: center;
}
.post-hero-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 40px;
}
.post-hero-content .post-title {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  color: var(--hero-title-color, #fff);
  margin-bottom: 12px;
  text-shadow: var(--hero-title-shadow, 0 2px 20px rgba(0,0,0,0.5));
}
.post-hero-content .post-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Single post two-column layout */
.single-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 48px;
  align-items: start;
}

/* Post content */
.post-content-area {
  min-width: 0;
}

/* No hero: show title/meta above content */
.post-intro {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.post-intro .post-title {
  margin-bottom: 16px;
}
.post-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--text);
}
.post-meta-bar .cat-label { font-size: 0.82rem; }
.post-meta-bar .sep { color: var(--text-dim); }
.post-author a { color: var(--text); }
.post-author a:hover { color: var(--accent); }
.edit-post-link { color: var(--accent); font-size: 0.82rem; }
.edit-post-link:hover { color: var(--accent-glow); }

/* Article body */
.entry-content {
  font-family: 'Open Sans', 'Segoe UI', sans-serif;
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text);
  overflow-wrap: break-word;
  word-break: break-word;
}
.entry-content > * + * { margin-top: 1.25em; }
.entry-content h2 {
  font-size: 1.55rem;
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--border);
  color: var(--heading-2);
}
.entry-content h3 {
  font-size: 1.2rem;
  margin-top: 2em;
  margin-bottom: 0.5em;
  color: var(--heading);
}
.entry-content h4 {
  font-size: 1.05rem;
  margin-top: 1.5em;
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.03em;
}
.entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-dim);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
.entry-content a:hover {
  text-decoration-color: var(--accent);
  color: var(--heading-2);
}
.entry-content img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5em auto;
}
.entry-content .wp-caption {
  margin: 1.5em auto;
  max-width: 100%;
}
.entry-content .wp-caption-text {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}
.entry-content .alignleft {
  float: left;
  margin: 0 1.5em 1em 0;
  max-width: 45%;
}
.entry-content .alignright {
  float: right;
  margin: 0 0 1em 1.5em;
  max-width: 45%;
}
.entry-content .aligncenter { margin-left: auto; margin-right: auto; }

/* Post tags */
.post-tags {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.post-tags .tags-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tag-link {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s;
}
.tag-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Post navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  margin-bottom: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.post-nav-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  display: block;
}
.post-nav-item:hover { border-color: var(--border-2); background: var(--surface-2); }
.post-nav-item.next { text-align: right; }
.post-nav-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 5px;
}
.post-nav-title {
  font-size: 0.88rem;
  color: var(--heading);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Related Posts ─────────────────────────────────────────────────── */
.related-posts {
  margin-top: 48px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.related-posts::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple, #9b8fff), var(--accent));
}
.related-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  font-weight: 600;
}
.related-icon {
  font-size: 1rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.related-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.related-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-deep);
}
.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.related-card:hover .related-thumb img {
  transform: scale(1.05);
}
.related-thumb.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-2), var(--bg-deep));
}
.related-placeholder {
  font-size: 2rem;
  color: var(--accent);
  opacity: 0.3;
}
.related-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
}
.related-cat {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.related-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-card:hover .related-title {
  color: var(--accent);
}
.related-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

@media (max-width: 768px) {
  .related-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .related-card {
    flex-direction: row;
    gap: 12px;
  }
  .related-thumb {
    width: 100px;
    min-width: 100px;
    aspect-ratio: 1;
    border-radius: var(--radius);
  }
  .related-posts {
    padding: 20px;
  }
}

/* After-post widget area */
.after-post-widgets {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}


/* ─────────────────────────────────────────────────────────────────────────
   12. TABLE OF CONTENTS (sidebar on single)
   ───────────────────────────────────────────────────────────────────────── */
.post-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.admin-bar .post-sidebar {
  top: 112px;
}

#toc-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.toc-header {
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.toc-header::before {
  content: '≡';
  font-size: 0.9rem;
}
#toc-list {
  list-style: none;
  padding: 12px 0;
  margin: 0;
  max-height: 400px;
  overflow-y: auto;
}
#toc-list li a {
  display: block;
  padding: 6px 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#toc-list li a:hover,
#toc-list li.toc-active a {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-dim);
}
#toc-list .toc-h3 a {
  padding-left: 28px;
  font-size: 0.68rem;
  color: var(--text-dim);
}
#toc-list .toc-h3 a:hover { color: var(--accent); color: var(--text-muted); }

/* Sidebar recent comments */
.sidebar-comments {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.recent-comments-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.recent-comments-list li {
  border-bottom: 1px solid var(--border);
}
.recent-comments-list li:last-child {
  border-bottom: none;
}
.recent-comments-list a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  transition: background 0.2s;
  line-height: 1.4;
}
.recent-comments-list a:hover {
  background: var(--surface-2);
}
.rc-author {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}
.rc-member-star {
  font-size: 0.65rem;
  vertical-align: middle;
}
.rc-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--heading);
  opacity: 0.6;
  margin-left: 6px;
}
.rc-excerpt {
  display: block;
  font-size: 0.78rem;
  color: var(--heading);
  margin: 4px 0 6px;
  line-height: 1.35;
}
.rc-post {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--heading);
  opacity: 0.7;
}
.rc-post::before {
  content: '→ ';
}
.recent-comments-list a:hover .rc-post {
  color: var(--accent);
  opacity: 1;
}

/* Reading progress bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  width: 0%;
  z-index: 200;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--accent-glow);
}


/* ─────────────────────────────────────────────────────────────────────────
   13. SIDEBAR WIDGETS
   ───────────────────────────────────────────────────────────────────────── */
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 350px;
}
.widget-banner {
  background: transparent;
  border: none;
  border-radius: 0;
  text-align: center;
}
.widget-banner img { max-width: 100%; height: auto; }
.widget-banner .widget-title { display: none; }
.widget-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.widget ul li {
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a {
  display: block;
  padding: 9px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.widget ul li a:hover { color: var(--accent); background: var(--accent-dim); }
.widget_recent_entries .post-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.widget_search form {
  display: flex;
  gap: 0;
  padding: 12px;
}
.widget_search input[type="search"] {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 8px 12px;
  border-radius: var(--radius) 0 0 var(--radius);
  outline: none;
}
.widget_search input[type="search"]:focus { border-color: var(--accent); }
.widget_search input[type="search"]::placeholder { color: var(--text-dim); }
.widget_search input[type="submit"] {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 8px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.05em;
}
.widget_search input[type="submit"]:hover { background: var(--accent-glow); }


/* ─────────────────────────────────────────────────────────────────────────
   14. STATIC PAGE
   ───────────────────────────────────────────────────────────────────────── */
.page-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px 24px 80px;
}
.page-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}


/* ─────────────────────────────────────────────────────────────────────────
   15. FOOTER
   ───────────────────────────────────────────────────────────────────────── */
#site-footer {
  margin-top: auto;
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  position: relative;
}

/* ── Footer columns ───────────────────────────────────────── */
.footer-columns {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 24px 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.footer-col-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col li {
  margin-bottom: 8px;
}
.footer-col a {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.footer-col a:hover {
  color: var(--accent);
}
.footer-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 8px;
}
.footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.footer-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  border: 1px solid var(--border);
}
.footer-tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0,212,255,0.06);
}
/* footer nav menu rendered as flat list */
.footer-col .menu {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col .menu li { margin-bottom: 8px; }
.footer-col .menu a {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-col .menu a:hover { color: var(--accent); }

/* ── Bottom bar ───────────────────────────────────────────── */
.footer-bottom {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--heading);
  text-decoration: none;
}
.footer-brand a:hover { color: var(--accent); }
.footer-sep { color: var(--border-2); margin: 0 8px; }
.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text);
  letter-spacing: 0.03em;
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text);
  letter-spacing: 0.04em;
}

/* Signal strength bars decoration */
.footer-signal {
  display: flex;
  align-items: center;
  gap: 8px;
}
.signal-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 18px;
}
.signal-bars .bar {
  width: 4px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  opacity: 0.25;
  animation: signal-pulse 2s ease-in-out infinite;
}
.bar-1 { height: 4px;  animation-delay: 0s; }
.bar-2 { height: 8px;  animation-delay: 0.15s; }
.bar-3 { height: 13px; animation-delay: 0.3s; }
.bar-4 { height: 9px;  animation-delay: 0.45s; }
.bar-5 { height: 5px;  animation-delay: 0.6s; }

@keyframes signal-pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.9; }
}

.footer-signal-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* ─────────────────────────────────────────────────────────────────────────
   16. COMMENTS — Chat Style
   ───────────────────────────────────────────────────────────────────────── */
.chat-area {
  margin-top: 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Chat header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.chat-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-header-icon { font-size: 1.1rem; }
.chat-header-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--heading);
}
.chat-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}
.chat-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  animation: chat-pulse 2s ease-in-out infinite;
}
@keyframes chat-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Chat messages area */
.chat-messages {
  padding: 24px 20px;
  max-height: 600px;
  overflow-y: auto;
}
.chat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Individual message */
.chat-message { list-style: none; }
.chat-message .children {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 50px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Bubble layout */
.chat-bubble {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 85%;
}
.chat-bubble-author {
  flex-direction: row-reverse;
  margin-left: auto;
}
.chat-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}
.chat-avatar img {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  object-fit: cover;
  display: block;
}

/* Bubble body */
.chat-bubble-body {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
  min-width: 0;
}
.chat-bubble-author .chat-bubble-body {
  background: var(--accent-dim);
  border-color: rgba(0,212,255,0.15);
  border-bottom-right-radius: 4px;
}
.chat-bubble:not(.chat-bubble-author) .chat-bubble-body {
  border-bottom-left-radius: 4px;
}

/* Bubble header */
.chat-bubble-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-bottom: 4px;
}
.chat-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}
.chat-star {
  font-size: 0.8rem;
  margin-left: 2px;
}
.chat-username {
  width: 100%;
  margin-top: -2px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
}
.chat-author-badge {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bg-deep);
  background: var(--accent);
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}
.chat-member-badge {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bg-deep);
  background: #34d399;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}

/* Bubble text */
.chat-text p {
  font-size: 0.95rem;
  color: #fff;
  line-height: 1.6;
  margin: 0;
}
[data-theme="light"] .chat-text p {
  color: #1a1a1a;
}
.chat-text p + p { margin-top: 6px; }

/* Comment reactions — below the bubble */
/* ── Reaction system ───────────────────────────────────── */

/* Row: bubble + trigger side by side */
.chat-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-row-author {
  flex-direction: row-reverse;
}

/* Heart trigger */
.reaction-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  flex-shrink: 0;
  filter: grayscale(1);
  opacity: 0;
  transition: opacity 0.2s, filter 0.2s, transform 0.2s;
  align-self: center;
}
.chat-row:hover .reaction-trigger,
.reaction-trigger.reacted {
  opacity: 0.5;
}
.reaction-trigger:hover,
.reaction-trigger.reacted {
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.2);
}

/* Picker — floating horizontal bar */
.reaction-picker {
  display: none;
  position: absolute;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 6px 8px;
  gap: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
  z-index: 60;
  white-space: nowrap;
  animation: rp-pop 0.15s ease-out;
}
.reaction-picker.open { display: inline-flex; }

.rp-emoji {
  background: none;
  border: none;
  font-size: 1.5rem;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.12s, transform 0.12s;
  padding: 0;
  line-height: 1;
}
.rp-emoji:hover {
  background: var(--accent-dim);
  transform: scale(1.3);
}

@keyframes rp-pop {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* Active reactions (below bubble) */
.chat-active-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 56px;
  margin-top: 2px;
  min-height: 0;
}
.chat-active-reactions:empty { display: none; }
.chat-reactions-right {
  padding-left: 0;
  padding-right: 56px;
  justify-content: flex-end;
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.reaction-pill:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}
.reaction-pill.mine {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.reaction-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--heading);
  font-weight: 600;
}

/* Bubble footer */
.chat-bubble-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.chat-time {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}
.chat-bubble-footer .comment-reply-link {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.chat-bubble-footer .comment-reply-link:hover {
  color: var(--accent);
}

/* Empty state */
.chat-empty {
  padding: 48px 24px;
  text-align: center;
}
.chat-empty-graphic {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}
.chat-empty-bubble {
  font-size: 2rem;
  display: inline-block;
  animation: chat-float 3s ease-in-out infinite;
}
.chat-empty-b2 { animation-delay: 0.5s; }
.chat-empty-b3 { animation-delay: 1s; }
@keyframes chat-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.chat-empty-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.1rem;
  color: var(--heading);
  margin: 0 0 8px;
}
.chat-empty-sub {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Telegram CTA */
.chat-telegram {
  border-top: 1px solid var(--border);
  background: rgba(0,136,204,0.08);
}
.chat-telegram a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #29b6f6;
  text-decoration: none;
  transition: background 0.2s;
}
.chat-telegram a:hover {
  background: rgba(0,136,204,0.12);
}
.chat-telegram-icon {
  font-size: 1rem;
}

/* Chat input area — Telegram style */
.chat-input-area {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  padding: 12px 16px;
}
.chat-input-area .comment-respond {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}
/* Hide any leftover URL field */
.chat-input-area .comment-form-url,
.comment-form-url {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
/* reCAPTCHA v3 badge — compact, bottom-left */
.grecaptcha-badge {
  visibility: hidden !important;
}
.chat-input-area::after {
  content: 'Protegido por reCAPTCHA';
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.5;
  padding: 4px 0 0;
}
.chat-input-area .comment-reply-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 6px 14px;
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0;
  line-height: 1;
}
.chat-replying {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}
.chat-input-area .comment-reply-title small {
  margin-left: auto;
}
.chat-input-area .comment-reply-title small a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
.chat-input-area .comment-reply-title small a:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

/* Guest fields row */
.chat-fields {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.chat-fields input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--heading);
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 8px 14px;
  outline: none;
  transition: border-color 0.2s;
}
.chat-fields input:focus { border-color: var(--accent); }

/* Auth tip — subtle register nudge */
.chat-auth-tip {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--text);
  opacity: 0.5;
  text-align: center;
  line-height: 1.5;
}
.chat-auth-tip a {
  color: var(--accent);
  text-decoration: none;
}
.chat-auth-tip a:hover { text-decoration: underline; }

/* Input bar — Telegram style */
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 6px 6px 6px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.chat-input-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}
.chat-input-avatar {
  flex-shrink: 0;
  align-self: center;
}
.chat-input-avatar img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: block;
}
.chat-emoji-toggle {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  align-self: center;
  transition: transform 0.15s;
  line-height: 1;
  opacity: 0.6;
}
.chat-emoji-toggle:hover {
  transform: scale(1.15);
  opacity: 1;
}
.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--heading);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 6px 0;
  outline: none;
  resize: none;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.5;
  overflow-y: auto;
}
.chat-send-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-deep);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.chat-send-btn svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}
.chat-send-btn:hover {
  opacity: 0.85;
  transform: scale(1.08);
}

/* Emoji panel */
.chat-emoji-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  z-index: 100;
  animation: emoji-in 0.15s ease;
}
@keyframes emoji-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-emoji-item {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s, transform 0.15s;
  line-height: 1;
}
.chat-emoji-item:hover {
  background: var(--surface-2);
  transform: scale(1.2);
}

/* Bubble entrance animation */
.chat-message {
  animation: bubble-in 0.3s ease;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bubble hover glow */
.chat-bubble-body {
  transition: box-shadow 0.2s;
}
.chat-bubble:hover .chat-bubble-body {
  box-shadow: 0 2px 12px rgba(0,212,255,0.08);
}

/* Pagination inside chat */
.chat-messages .nav-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}
.chat-messages .nav-links a {
  color: var(--accent);
  text-decoration: none;
}

/* Hide default WP comment form elements we replaced */
.chat-input-area .comment-form-comment { margin: 0; }
.chat-input-area .comment-form-comment label { display: none; }
.chat-input-area .form-submit { display: none; }
.chat-input-area .comment-form label { display: none; }
.chat-input-area .comment-form p.comment-notes { display: none; }
.chat-input-area .comment-form p.logged-in-as { display: none; }


/* Mobile */
@media (max-width: 480px) {
  .chat-bubble { max-width: 95%; }
  .chat-message .children { margin-left: 24px; }
  .chat-fields { flex-direction: column; }
  .chat-messages { padding: 16px 12px; }
  .chat-input-area { padding: 10px; }
  .chat-emoji-panel { grid-template-columns: repeat(6, 1fr); }
  .chat-active-reactions { padding-left: 24px; }
  .chat-reactions-right { padding-right: 24px; }
}


/* ─────────────────────────────────────────────────────────────────────────
   17. SEARCH & 404
   ───────────────────────────────────────────────────────────────────────── */
.search-wrap, .error-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}
.error-code {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 12vw, 9rem);
  color: var(--border);
  display: block;
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: -0.05em;
}
.error-title {
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: var(--heading);
}
.error-text {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 11px 24px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s;
}
.btn:hover { background: var(--accent-glow); color: var(--accent); }
.btn-create { border-color: var(--green); color: var(--green); background: rgba(0,232,138,0.08); }
.btn-create:hover { background: rgba(0,232,138,0.18); color: var(--green); }

.search-results-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.search-query { color: var(--accent); }
.search-form-wrap {
  display: flex;
  max-width: 500px;
  margin: 32px auto 0;
}
.search-form-wrap input[type="search"] {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 12px 16px;
  border-radius: var(--radius) 0 0 var(--radius);
  outline: none;
}
.search-form-wrap input[type="search"]:focus { border-color: var(--accent); }
.search-form-wrap input[type="submit"] {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  transition: background 0.2s;
}
.search-form-wrap input[type="submit"]:hover { background: var(--accent-glow); }


/* ─────────────────────────────────────────────────────────────────────────
   18. NO POSTS / CONTENT NONE
   ───────────────────────────────────────────────────────────────────────── */
.no-results {
  text-align: center;
  padding: 80px 24px;
  grid-column: 1 / -1;
}
.no-results p {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}


/* ─────────────────────────────────────────────────────────────────────────
   19. RESPONSIVE
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .single-layout { grid-template-columns: 1fr 350px; gap: 36px; }
}

@media (max-width: 900px) {
  .single-layout {
    grid-template-columns: 1fr;
  }
  .post-sidebar { position: static; }
  #toc-wrapper { display: none; } /* TOC hidden on mobile — JS-driven toggle could add it */
}

@media (max-width: 768px) {
  .posts-grid { grid-template-columns: 1fr; }
  .card-short { flex-direction: column; gap: 12px; }
  .short-meta { flex-direction: row; width: auto; }

  .card-micropost { padding: 16px; }
  .micropost-body { font-size: 0.95rem; }

  .terminal-body { padding: 12px; }
  .terminal-prompt { font-size: 0.75rem; }
  .terminal-output { font-size: 0.8rem; }

  .nav-toggle { display: flex; }
  #primary-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    z-index: 99;
    margin: 0;
  }
  #primary-nav.open { display: block; }
  #primary-nav ul { flex-direction: column; gap: 2px; }
  #primary-nav a { font-size: 0.85rem; padding: 10px 14px; }
  #primary-nav .sub-menu {
    position: static;
    display: block;
    border: none;
    box-shadow: none;
    padding: 0 0 0 12px;
    background: none;
  }
  #primary-nav .sub-menu::before { display: none; }

  .header-inner { position: relative; }
  .header-inner::after { display: none; }

  #hero { height: 200px; }
  .hero-title { font-size: 1.6rem; }

  .post-hero { min-height: 200px; height: auto; }
  .post-hero-content { position: relative; inset: auto; padding: 60px 20px 24px; padding-bottom: 24px; }
  .post-hero img { position: absolute; inset: 0; width: 100%; height: 100%; }
  .post-hero-overlay { position: absolute; inset: 0; }
  .post-hero-wave { height: auto; min-height: 180px; }
  .post-hero-wave .hero-content { padding: 24px 20px; }

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

  .footer-columns { grid-template-columns: repeat(2, 1fr); gap: 32px; padding: 40px 20px 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; padding: 16px 20px; }
}

@media (max-width: 480px) {
  .container, .archive-wrap, .single-wrap, .page-wrap { padding-left: 16px; padding-right: 16px; }
  .card-body { padding: 16px; }
  .card-footer { padding: 10px 16px; }
  .hero-content { padding: 0 20px; }
  .single-wrap { padding-bottom: 48px; }
  .footer-columns { grid-template-columns: 1fr; gap: 28px; }
}


/* ─────────────────────────────────────────────────────────────────────────
   SEASONAL — Christmas lights & snow
   ───────────────────────────────────────────────────────────────────────── */
.xmas-wrap {
  position: relative;
  overflow: visible;
}
.xmas-lights {
  position: absolute;
  top: -20px;
  left: -20px;
  pointer-events: none;
  z-index: 10;
  overflow: visible;
}
.xmas-cable {
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3));
}
.xmas-glow {
  animation: xmas-twinkle 1.5s ease-in-out infinite alternate;
}
@keyframes xmas-twinkle {
  0%   { opacity: 0.08; }
  100% { opacity: 0.45; }
}
/* Snowfall canvas */
.xmas-snow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}
/* Grid must allow overflow for outside bulbs */
.seasonal-christmas .posts-grid {
  overflow: visible;
}

/* ─────────────────────────────────────────────────────────────────────────
   SEASONAL — Halloween
   ───────────────────────────────────────────────────────────────────────── */

/* ── Spider webs ──────────────────────────────────────────── */
.hw-web {
  position: absolute;
  top: -2px;
  width: 70px;
  height: 70px;
  pointer-events: none;
  z-index: 5;
  opacity: 1;
}
.hw-web-left { left: -2px; }
.hw-web-right { right: -2px; left: auto; }

.hw-spider {
  position: absolute;
  font-size: 1rem;
  z-index: 6;
  animation: hw-spider-dangle 4s ease-in-out infinite alternate;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.hw-spider-left { top: 55px; left: 12px; }
.hw-spider-right { top: 55px; right: 12px; left: auto; }
.hw-spider::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.4);
  transform: translateX(-50%);
}
@keyframes hw-spider-dangle {
  0%   { transform: translateY(0) rotate(-3deg); }
  100% { transform: translateY(8px) rotate(3deg); }
}

/* ── Bats canvas ──────────────────────────────────────────── */
.hw-bats-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
}

/* ── Blood drip from headings ─────────────────────────────── */
.hw-blood-drip {
  position: absolute;
  top: 100%;
  width: 4px;
  height: 0;
  background: linear-gradient(to bottom, #8b0000, #cc0000);
  border-radius: 0 0 3px 3px;
  animation: hw-drip-fall ease-in infinite;
  opacity: 0.7;
}
.hw-blood-drip::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cc0000;
}
@keyframes hw-drip-fall {
  0%   { height: 0; opacity: 0; }
  10%  { opacity: 0.7; }
  60%  { height: var(--drip-h, 16px); opacity: 0.7; }
  80%  { height: var(--drip-h, 16px); opacity: 0.3; }
  100% { height: var(--drip-h, 16px); opacity: 0; }
}

/* ── Glowing eyes ─────────────────────────────────────────── */
.hw-eyes {
  position: absolute;
  left: -50px;
  display: flex;
  gap: 8px;
  z-index: 5;
  animation: hw-eyes-blink 6s ease-in-out infinite;
}
.hw-eye {
  width: 14px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffcc00, #ff6600);
  box-shadow: 0 0 8px #ff6600, 0 0 16px rgba(255,102,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.hw-pupil {
  width: 4px;
  height: 6px;
  border-radius: 50%;
  background: #111;
  transition: transform 0.1s ease-out;
}
@keyframes hw-eyes-blink {
  0%, 42%, 48%, 100% { transform: scaleY(1); }
  45% { transform: scaleY(0.1); }
}

/* ── Hidden pumpkins ──────────────────────────────────────── */
.hw-pumpkin {
  position: absolute;
  left: -40px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 5;
  filter: drop-shadow(0 2px 6px rgba(255,102,0,0.4));
  animation: hw-pumpkin-float 3s ease-in-out infinite alternate;
  transition: transform 0.3s;
}
.hw-pumpkin:hover {
  transform: scale(1.3) rotate(-10deg);
}
.hw-pumpkin-opened {
  animation: hw-pumpkin-pop 0.5s ease forwards;
  pointer-events: none;
}
@keyframes hw-pumpkin-float {
  0%   { transform: translateY(-2px) rotate(-3deg); }
  100% { transform: translateY(4px) rotate(3deg); }
}
@keyframes hw-pumpkin-pop {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.6) rotate(20deg); opacity: 1; }
  100% { transform: scale(0) rotate(-40deg); opacity: 0; }
}
.hw-pumpkin-bubble {
  position: absolute;
  z-index: 20;
  background: #1a0a1e;
  border: 1px solid #ff6600;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: #ffcc66;
  max-width: 300px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 12px rgba(255,102,0,0.2);
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  font-family: var(--font-mono);
}
.hw-pumpkin-bubble-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.hw-pumpkin-counter {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid #ff6600;
  border-radius: 20px;
  padding: 6px 16px;
  display: inline-block;
  margin-bottom: 20px;
}
.hw-pumpkin-counter span {
  color: #ff6600;
  font-weight: 600;
}
.hw-pumpkin-complete {
  color: #ff6600;
  border-color: #ff6600;
  animation: hw-pumpkin-glow 1s ease;
}
@keyframes hw-pumpkin-glow {
  0%   { box-shadow: 0 0 0 rgba(255,102,0,0); }
  50%  { box-shadow: 0 0 20px rgba(255,102,0,0.5); }
  100% { box-shadow: 0 0 0 rgba(255,102,0,0); }
}

/* ── Halloween cursor trail ───────────────────────────────── */
.hw-cursor-particle {
  position: absolute;
  pointer-events: none;
  z-index: 9998;
  text-shadow: 0 0 6px currentColor;
  animation: hw-particle-fade 0.7s ease-out forwards;
  user-select: none;
}
@keyframes hw-particle-fade {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--drift, 0), -25px) scale(0.2); }
}

/* ── Fog ──────────────────────────────────────────────────── */
.hw-fog {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  pointer-events: none;
  z-index: 9997;
  overflow: hidden;
}
.hw-fog-layer {
  position: absolute;
  bottom: 0;
  width: 200%;
  height: 100%;
  background: linear-gradient(to top,
    rgba(100,80,120,0.7) 0%,
    rgba(80,60,100,0.4) 40%,
    transparent 100%
  );
  animation: hw-fog-drift linear infinite;
}
.hw-fog-1 {
  animation-duration: 25s;
  opacity: 0.9;
}
.hw-fog-2 {
  animation-duration: 18s;
  animation-direction: reverse;
  opacity: 0.6;
}
@keyframes hw-fog-drift {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
[data-theme="light"] .hw-fog-layer {
  background: linear-gradient(to top,
    rgba(160,140,180,0.6) 0%,
    rgba(160,140,180,0.3) 40%,
    transparent 100%
  );
}

/* ── Card flicker ─────────────────────────────────────────── */
.hw-flicker {
  animation: hw-card-flicker 0.2s steps(2) 1;
}
@keyframes hw-card-flicker {
  0%   { opacity: 1; }
  25%  { opacity: 0.4; }
  50%  { opacity: 1; }
  75%  { opacity: 0.5; }
  100% { opacity: 1; }
}

/* ── Heading ornaments ────────────────────────────────────── */
.xmas-ornament {
  position: absolute;
  top: 100%;
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ornament-color);
  box-shadow: 0 0 6px var(--ornament-color), inset -2px -2px 4px rgba(0,0,0,0.25), inset 2px 2px 4px rgba(255,255,255,0.2);
  transform-origin: top center;
  animation: xmas-swing 3s ease-in-out infinite alternate;
  z-index: 5;
  pointer-events: none;
}
.xmas-ornament::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 1px;
  height: var(--string-len, 16px);
  background: #555;
  transform: translateX(-50%);
}
.xmas-ornament::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 5px;
  background: #aaa;
  border-radius: 2px 2px 0 0;
}
.xmas-ornament-star {
  background: none;
  box-shadow: none;
  width: auto;
  height: auto;
  font-size: 14px;
  color: #ffcc00;
  text-shadow: 0 0 8px rgba(255,204,0,0.6);
  line-height: 1;
}
.xmas-ornament-star::after { display: none; }
@keyframes xmas-swing {
  0%   { transform: rotate(-6deg); }
  100% { transform: rotate(6deg); }
}

/* ── Hidden gifts ─────────────────────────────────────────── */
.xmas-gift {
  position: absolute;
  left: -40px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.3s;
  z-index: 5;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  animation: xmas-gift-peek 2.5s ease-in-out infinite alternate;
}
.xmas-gift:hover {
  transform: scale(1.3) rotate(-10deg);
}
.xmas-gift-opened {
  animation: xmas-gift-open 0.5s ease forwards;
  pointer-events: none;
}
@keyframes xmas-gift-peek {
  0%   { transform: translateX(-3px) rotate(-5deg); }
  100% { transform: translateX(3px) rotate(5deg); }
}
@keyframes xmas-gift-open {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.8) rotate(15deg); opacity: 1; }
  100% { transform: scale(0.5) rotate(-30deg); opacity: 0; }
}
.xmas-gift-bubble {
  position: absolute;
  z-index: 20;
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--heading);
  max-width: 280px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.xmas-gift-bubble-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.xmas-gift-counter {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  display: inline-block;
  margin-bottom: 20px;
}
.xmas-gift-counter span {
  color: var(--accent);
  font-weight: 600;
}
.xmas-gift-complete {
  color: #33cc66;
  border-color: #33cc66;
  animation: xmas-gift-shine 1s ease;
}
@keyframes xmas-gift-shine {
  0%   { box-shadow: 0 0 0 rgba(51,204,102,0); }
  50%  { box-shadow: 0 0 20px rgba(51,204,102,0.4); }
  100% { box-shadow: 0 0 0 rgba(51,204,102,0); }
}

/* ── Cursor trail ─────────────────────────────────────────── */
.xmas-cursor-particle {
  position: absolute;
  pointer-events: none;
  z-index: 9998;
  color: rgba(255,255,255,0.8);
  text-shadow: 0 0 4px rgba(255,255,255,0.5);
  animation: xmas-particle-fade 0.8s ease-out forwards;
  user-select: none;
}
@keyframes xmas-particle-fade {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--drift, 0), -30px) scale(0.3);
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   20. ACCESSIBILITY & UTILITIES
   ───────────────────────────────────────────────────────────────────────── */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  clip: auto !important;
  clip-path: none;
  color: var(--accent);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 12px 20px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 1000;
}

/* WordPress image alignment */
.alignleft  { float: left;  margin: 0.5em 1.5em 1em 0; }
.alignright { float: right; margin: 0.5em 0 1em 1.5em; }
.aligncenter { display: block; margin: 1em auto; }
.alignnone  { display: inline; }

/* WordPress gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 1.5em 0; }
.gallery-item { margin: 0; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }

/* Sticky post */
.sticky .card { border-color: var(--accent); }
.sticky .card::before {
  content: '◆ FIJADO';
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding: 4px 10px;
  display: block;
  background: var(--accent-dim);
  border-bottom: 1px solid var(--border);
}


/* ─────────────────────────────────────────────────────────────────────────
   AUTHOR PAGE
   ───────────────────────────────────────────────────────────────────────── */
.author-hero {
  min-height: 280px;
  display: flex;
  align-items: center;
}
.author-hero .hero-content {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px 24px 40px;
}
.author-profile {
  display: flex;
  align-items: center;
  gap: 32px;
}
.author-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 24px rgba(0,212,255,0.15);
  object-fit: cover;
}
.author-info {
  flex: 1;
}
.author-info .hero-badge {
  margin-bottom: 8px;
}
.author-info .hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 4px;
}
.author-nickname {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  opacity: 0.8;
  margin-bottom: 10px;
}
.author-social {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.author-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--heading);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.author-social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.author-bio {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 600px;
  margin-bottom: 12px;
}
.author-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.author-stat strong {
  color: var(--accent);
  font-weight: 600;
}
.author-stat-sep {
  color: var(--border-2);
}
.author-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.author-link:hover { color: var(--accent); }

/* Author top categories */
.author-categories {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 20px 0 0;
  margin-bottom: -20px;
}
.author-cats-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.author-categories .cat-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cat-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
}

@media (max-width: 768px) {
  .author-profile {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  .author-bio { margin-left: auto; margin-right: auto; }
  .author-stats { justify-content: center; }
  .author-categories { justify-content: center; }
}


/* ─────────────────────────────────────────────────────────────────────────
   EASTER EGG TERMINAL OVERLAY
   ───────────────────────────────────────────────────────────────────────── */
#terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#terminal-overlay.open { opacity: 1; }

.terminal-window {
  width: 90vw;
  max-width: 820px;
  height: 70vh;
  max-height: 520px;
  background: #0a0e14;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(0,212,255,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s ease;
}
#terminal-overlay.open .terminal-window {
  transform: scale(1) translateY(0);
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  background: #141820;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  user-select: none;
}
.terminal-dots {
  display: flex;
  gap: 7px;
}
.terminal-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}
.terminal-dots i:nth-child(1) { background: #ff5f57; }
.terminal-dots i:nth-child(2) { background: #febc2e; }
.terminal-dots i:nth-child(3) { background: #28c840; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.05em;
}
.terminal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}
.terminal-close:hover { color: #ff5f57; }

#terminal-container {
  flex: 1;
  padding: 8px;
  overflow: hidden;
  position: relative;
}
#terminal-container .xterm,
#terminal-container .xterm-viewport,
#terminal-container .xterm-screen {
  height: 100% !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   PROFILE PAGE (/mi-cuenta)
   ───────────────────────────────────────────────────────────────────────── */
.profile-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 20px 80px;
}
.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

/* Sidebar */
.profile-sidebar {
  position: sticky;
  top: 100px;
}
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
}
.profile-avatar {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  margin: 0 auto 14px;
  object-fit: cover;
}
.profile-name {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.3rem;
  color: var(--heading-2);
  margin-bottom: 6px;
}
.profile-email {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 12px;
  word-break: break-all;
}
.profile-joined {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
}
.profile-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.profile-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
}
.profile-stat-num {
  display: block;
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.25rem;
  color: var(--accent);
}
.profile-stat-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.profile-logout {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: color 0.2s, border-color 0.2s;
}
.profile-logout:hover {
  color: var(--accent-2);
  border-color: var(--accent-2);
}

/* Main content */
.profile-main { min-width: 0; }
.profile-message {
  background: var(--surface-2);
  border-left: 3px solid var(--green);
  color: var(--heading-2);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
  font-family: var(--font-mono);
  margin-bottom: 24px;
}
.profile-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}
.profile-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.profile-section-icon {
  font-size: 1.2rem;
}
.profile-section-header h3 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.15rem;
  color: var(--heading-2);
  letter-spacing: 0.03em;
}

/* Profile form */
.profile-form { }
.pf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pf-group {
  margin-bottom: 18px;
}
.pf-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}
.pf-group input,
.pf-group textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--heading-2);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s;
}
.pf-group input:focus,
.pf-group textarea:focus {
  border-color: var(--accent);
}
.pf-group textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
}
.pf-separator {
  margin: 24px 0 18px;
  padding-bottom: 0;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.pf-separator span {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
/* Avatar upload */
.pf-avatar-upload {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-lg);
}
.pf-avatar-preview img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  object-fit: cover;
  display: block;
}
.pf-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pf-avatar-actions input[type="file"] {
  display: none;
}
.pf-avatar-btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: center;
}
.pf-avatar-btn:hover {
  background: var(--accent);
  color: var(--bg-deep);
}
.pf-avatar-remove {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pf-avatar-remove input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent-2);
}
.pf-avatar-hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.pf-submit {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #141820;
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  padding: 11px 28px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.pf-submit:hover {
  background: #00b8db;
  box-shadow: 0 0 16px rgba(0,212,255,0.25);
}

/* Comments list */
.profile-comments {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-comment-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s;
}
.profile-comment-card:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}
.pcc-post {
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.pcc-text {
  color: var(--heading);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 8px;
}
.pcc-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
}

/* Empty state */
.profile-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--text);
  font-size: 0.95rem;
}
.pf-btn-outline {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 8px 20px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.pf-btn-outline:hover {
  background: var(--accent);
  color: var(--bg-deep);
}

/* Nav avatar (profile menu item) */
.menu-item-profile a {
  display: flex !important;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.nav-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
  .profile-sidebar {
    position: static;
  }
  .pf-row {
    grid-template-columns: 1fr;
  }
}
