/* ==========================================================================
   S4mper · hoja de estilos del rediseño 2026-10
   Paleta GitHub oscuro con acento verde. Sans para leer, mono solo para
   código, etiquetas y el wordmark. Sin decoración de terminal.
   ========================================================================== */

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2129;
  --border: #21262d;
  --border-strong: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-soft: #b1bac4;
  --accent: #3fb950;
  --accent-dim: #2ea043;
  --accent-soft: rgba(63, 185, 80, 0.12);
  --blue: #58a6ff;
  --blue-soft: rgba(88, 166, 255, 0.14);
  --red: #f85149;
  --amber: #d29922;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1120px;
  --measure: 720px;
  --gutter: 16px;
  --radius: 8px;
  --radius-sm: 5px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
}

body.lightbox-open { overflow: hidden; }

img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
code, kbd, pre, samp { font-family: var(--font-mono); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.wrap-narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.site-main { flex: 1; width: 100%; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--accent); color: #0d1117; padding: 0.5rem 0.85rem; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: 8px; text-decoration: none; }

/* --------------------------------------------------------------------------
   Cabecera
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 17, 23, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.25s var(--ease);
}
.site-header.is-compact { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
.header-inner {
  display: flex; align-items: center; gap: 1.5rem;
  height: var(--header-h);
  transition: height 0.25s var(--ease);
}
.site-header.is-compact .header-inner { height: 52px; }

.brand { display: inline-flex; align-items: center; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { font-family: var(--font-mono); font-weight: 500; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--text); }
.brand-cursor { color: var(--accent); margin-left: 1px; animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

.site-nav { display: flex; align-items: center; gap: 0.25rem; flex: 1; min-width: 0; }
.nav-link {
  position: relative; display: inline-block;
  padding: 0.45rem 0.65rem; border-radius: var(--radius-sm);
  color: var(--text-soft); font-weight: 500; font-size: 0.95rem; white-space: nowrap;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-link.is-active { color: var(--text); }
.nav-link.is-active::after {
  content: ""; position: absolute; left: 0.65rem; right: 0.65rem; bottom: 0.1rem;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.nav-link-secondary { margin-left: auto; color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 0.25rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: transparent; border: 0; color: var(--text-soft); cursor: pointer;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-toggle { display: none; }
.nav-toggle .ico-close { display: none; }
body.nav-open .nav-toggle .ico-open { display: none; }
body.nav-open .nav-toggle .ico-close { display: block; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0.5rem var(--gutter) 0.75rem;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  }
  body.nav-open .site-nav { display: flex; }
  .nav-link { padding: 0.7rem 0.5rem; font-size: 1.05rem; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav-link:last-child { border-bottom: 0; }
  .nav-link.is-active::after { display: none; }
  .nav-link.is-active { color: var(--accent); }
  .nav-link-secondary { margin-left: 0; margin-top: 0.25rem; }
}

/* --------------------------------------------------------------------------
   Botones, etiquetas, chips
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.05rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.95rem; line-height: 1.2; cursor: pointer;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
}
.btn:hover { text-decoration: none; border-color: var(--text-muted); background: var(--surface); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #06130a; }
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.02em;
  padding: 0.15rem 0.45rem; border-radius: 4px; line-height: 1.5; white-space: nowrap;
  color: var(--text-muted); background: var(--surface-2); border: 1px solid transparent;
}
a.tag:hover { text-decoration: none; border-color: var(--border-strong); color: var(--text); }
.tag-owasp { color: var(--blue); background: var(--blue-soft); }
a.tag-owasp:hover { color: var(--blue); border-color: rgba(88, 166, 255, 0.4); }
.tag-series { font-family: var(--font-sans); font-size: 0.78rem; letter-spacing: 0; white-space: normal; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 0; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-soft); background: transparent;
  font-size: 0.85rem; font-weight: 500;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.chip code { font-size: 0.75rem; color: var(--blue); }
.chip:hover { text-decoration: none; color: var(--text); border-color: var(--text-muted); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.chip.is-active code { color: var(--accent); }
.chip-count { color: var(--text-muted); font-size: 0.75rem; }

.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem;
  color: var(--text-muted); font-size: 0.85rem; margin-top: 0.45rem;
}
.post-meta time, .post-meta span { white-space: nowrap; }

/* --------------------------------------------------------------------------
   Cabeceras de página y de sección
   -------------------------------------------------------------------------- */
.page-head { padding-top: 2.75rem; padding-bottom: 1.5rem; }
.page-title { font-size: clamp(1.75rem, 3.6vw, 2.35rem); letter-spacing: -0.02em; }
.page-lead { color: var(--text-soft); font-size: 1.08rem; max-width: 62ch; margin: 0.75rem 0 0; }
.page-kicker { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.6rem; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 1.25rem; }
.section-head h2 { font-size: 1.35rem; }
.section-head .section-link { color: var(--text-muted); font-size: 0.9rem; white-space: nowrap; }
.section-head .section-link:hover { color: var(--accent); }
.home-section { padding: 2.5rem 0; border-top: 1px solid var(--border); }

/* --------------------------------------------------------------------------
   Portada
   -------------------------------------------------------------------------- */
.hero { padding-top: 3.5rem; padding-bottom: 2.75rem; }
.hero-title { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.025em; max-width: 18ch; }
.hero-title em { font-style: normal; color: var(--accent); }
.hero-lead { color: var(--text-soft); font-size: 1.15rem; max-width: 58ch; margin: 1.1rem 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.owasp-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem;
}
.owasp-cell {
  display: flex; flex-direction: column; gap: 0.35rem;
  padding: 0.95rem 1rem; min-height: 124px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), background-color 0.18s var(--ease);
}
a.owasp-cell:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.owasp-cell.is-empty { background: transparent; color: var(--text-muted); border-style: dashed; }
.owasp-code { font-family: var(--font-mono); font-size: 0.78rem; color: var(--blue); }
.owasp-cell.is-empty .owasp-code { color: var(--text-muted); }
.owasp-name { font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.owasp-count { margin-top: auto; font-size: 0.8rem; color: var(--text-muted); }
a.owasp-cell .owasp-count { color: var(--accent); }

@media (max-width: 900px) { .owasp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .owasp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; } .owasp-cell { min-height: 110px; padding: 0.8rem 0.85rem; } }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { padding: 1.35rem 0; border-top: 1px solid var(--border); }
.post-list > .post-item:first-child, .post-item:first-child { border-top: 0; padding-top: 0.25rem; }
.post-item-title { font-size: 1.3rem; line-height: 1.3; }
.post-item-title a { color: var(--text); }
.post-item-title a:hover { color: var(--accent); text-decoration: none; }
.post-excerpt { color: var(--text-soft); margin: 0.6rem 0 0; max-width: 70ch; }
.post-list-compact .post-item { padding: 0.9rem 0; }
.post-list-compact .post-item-title { font-size: 1.05rem; }

.series-list { display: grid; gap: 0.75rem; }
.series-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 1.5rem; align-items: center;
  padding: 1rem 1.15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); transition: border-color 0.18s var(--ease);
}
.series-row:hover { text-decoration: none; border-color: var(--border-strong); }
.series-row h3 { font-size: 1.05rem; }
.series-row p { margin: 0.2rem 0 0; color: var(--text-muted); font-size: 0.92rem; }
.series-progress { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); white-space: nowrap; }
.series-progress-bar { display: block; width: 120px; height: 4px; margin-top: 0.4rem; background: var(--border); border-radius: 2px; overflow: hidden; }
.series-progress-bar i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 560px) { .series-row { grid-template-columns: 1fr; } .series-progress-bar { width: 100%; } }

.about-blurb { display: flex; gap: 1.25rem; align-items: center; }
.about-blurb p { margin: 0; color: var(--text-soft); }
.about-blurb strong { color: var(--text); }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--border-strong); background: var(--surface); }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); color: var(--accent); font-weight: 500; }
.avatar-sm { width: 44px; height: 44px; font-size: 0.85rem; }
.avatar-lg { width: 120px; height: 120px; font-size: 1.6rem; }

/* --------------------------------------------------------------------------
   Páginas de sección y listas
   -------------------------------------------------------------------------- */
.active-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1rem 0 0; color: var(--text-muted); font-size: 0.9rem; }
.active-filter a { color: var(--text-muted); border-bottom: 1px dotted var(--text-muted); }
.active-filter a:hover { color: var(--text); text-decoration: none; }
.listing { padding-bottom: 3rem; }
.empty-state { padding: 2rem 0; color: var(--text-muted); }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 2rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.9rem; }
.pagination .btn { font-size: 0.9rem; padding: 0.5rem 0.85rem; }

/* --------------------------------------------------------------------------
   Artículo
   -------------------------------------------------------------------------- */
.article-header { padding-top: 2.75rem; padding-bottom: 1.75rem; }
.article-kicker { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; align-items: center; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.9rem; }
.article-kicker a { color: var(--accent); font-weight: 500; }
.article-kicker .sep { color: var(--border-strong); }
.article-title { font-size: clamp(1.85rem, 4vw, 2.6rem); letter-spacing: -0.025em; max-width: 24ch; }
.article-meta { margin-top: 1rem; font-size: 0.9rem; }
.article-summary { color: var(--text-soft); font-size: 1.1rem; margin: 1.1rem 0 0; max-width: 62ch; }

.article-layout { display: grid; grid-template-columns: minmax(0, var(--measure)) 240px; gap: 3.5rem; align-items: start; }
.article-layout.no-toc { grid-template-columns: minmax(0, var(--measure)); }
@media (max-width: 1000px) { .article-layout { grid-template-columns: minmax(0, var(--measure)); gap: 0; } .toc-desktop { display: none; } }

.meta-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.15rem; margin: 0 0 2rem;
}
.meta-box dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.45rem 1.25rem; margin: 0; font-size: 0.9rem; }
.meta-box dt { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding-top: 0.2rem; }
.meta-box dd { margin: 0; color: var(--text); display: flex; flex-wrap: wrap; gap: 0.3rem 0.5rem; align-items: center; }
.meta-box dd .tag { font-size: 0.74rem; }
.meta-box dd small { color: var(--text-muted); }
@media (max-width: 520px) { .meta-box dl { grid-template-columns: 1fr; gap: 0.15rem 0; } .meta-box dd { margin-bottom: 0.5rem; } }

/* Índice */
.toc-desktop { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; font-size: 0.86rem; padding-left: 1rem; border-left: 1px solid var(--border); }
.toc h2 { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.65rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc li.lvl-3 { padding-left: 0.85rem; }
.toc a { display: block; padding: 0.25rem 0; color: var(--text-muted); line-height: 1.35; position: relative; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.is-active { color: var(--accent); }
.toc-desktop a.is-active::before { content: ""; position: absolute; left: calc(-1rem - 1px); top: 0.2rem; bottom: 0.2rem; width: 2px; background: var(--accent); border-radius: 1px; }
.toc-mobile { display: none; margin: 0 0 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 1rem; }
.toc-mobile summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }
.toc-mobile .toc { margin-top: 0.5rem; }
@media (max-width: 1000px) { .toc-mobile { display: block; } }

/* Cuerpo */
.article-body { font-size: 1.0625rem; line-height: 1.7; color: var(--text); }
.article-body > * { margin-top: 0; margin-bottom: 1.25em; }
.article-body > :last-child { margin-bottom: 0; }
.article-body h2 { font-size: 1.6rem; margin-top: 2.4em; margin-bottom: 0.6em; padding-top: 0.2em; }
.article-body h3 { font-size: 1.2rem; margin-top: 1.9em; margin-bottom: 0.5em; }
.article-body h4 { font-size: 1.02rem; margin-top: 1.6em; margin-bottom: 0.4em; color: var(--text-soft); }
.article-body h2 + h3, .article-body h3 + h4 { margin-top: 0.75em; }
.article-body p { margin-bottom: 1.25em; }
.article-body a { text-decoration: underline; text-decoration-color: rgba(63, 185, 80, 0.4); text-underline-offset: 0.18em; }
.article-body a:hover { text-decoration-color: var(--accent); }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body li { margin-bottom: 0.4em; }
.article-body li > p { margin-bottom: 0.5em; }
.article-body hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.article-body blockquote {
  margin: 1.5em 0; padding: 0.9rem 1.15rem;
  background: var(--surface); border-left: 3px solid var(--border-strong); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-soft);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body code { font-size: 0.88em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; border: 1px solid var(--border); color: var(--text); }
.article-body pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.86rem; line-height: 1.55; }
.article-body pre code { background: none; border: 0; padding: 0; font-size: inherit; color: var(--text); }
.code-block { position: relative; margin: 1.5em 0; }
.code-block[data-lang]::before { content: attr(data-lang); position: absolute; top: 0.45rem; right: 4.6rem; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); text-transform: lowercase; }
.copy-btn {
  position: absolute; top: 0.45rem; right: 0.5rem;
  font-family: var(--font-mono); font-size: 0.72rem; padding: 0.2rem 0.5rem;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 4px; color: var(--text-muted); cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.copy-btn:hover { color: var(--text); border-color: var(--text-muted); }
.copy-btn.is-done { color: var(--accent); border-color: var(--accent); }

.post-figure { margin: 1.75em 0; }
.post-figure a.zoom { display: block; cursor: zoom-in; }
.post-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.post-figure figcaption { margin-top: 0.5rem; font-size: 0.85rem; color: var(--text-muted); text-align: center; }
.figure-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 1.75em 0; }
.figure-group .post-figure { margin: 0; }
@media (max-width: 560px) { .figure-group { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--border); border-radius: var(--radius); }
.article-body table { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin: 0; }
.article-body th, .article-body td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.article-body th { background: var(--surface); font-weight: 600; font-size: 0.85rem; color: var(--text-soft); }
.article-body tr:last-child td { border-bottom: 0; }

/* Pie del artículo */
.article-footer { padding-top: 2.5rem; padding-bottom: 3rem; display: grid; gap: 2rem; }
.disclaimer { font-size: 0.86rem; color: var(--text-muted); padding: 0.9rem 1.1rem; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }
.disclaimer strong { color: var(--text-soft); }
.disclaimer p { margin: 0; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.share span { color: var(--text-muted); font-size: 0.9rem; }

.author-card { display: flex; gap: 1rem; align-items: center; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.author-card h2 { font-size: 1rem; }
.author-card p { margin: 0.2rem 0 0; color: var(--text-soft); font-size: 0.92rem; }
.author-card a { white-space: nowrap; }

.series-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.series-nav a { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); transition: border-color 0.15s var(--ease); }
.series-nav a:hover { border-color: var(--accent); text-decoration: none; }
.series-nav a.is-next { text-align: right; align-items: flex-end; }
.series-nav small { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.series-nav span { font-weight: 500; line-height: 1.3; }
.series-nav .placeholder { border-style: dashed; color: var(--text-muted); }
@media (max-width: 560px) { .series-nav { grid-template-columns: 1fr; } .series-nav a.is-next { text-align: left; align-items: flex-start; } }

.related h2 { font-size: 1.15rem; margin-bottom: 0.75rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.related-card { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); transition: border-color 0.15s var(--ease); }
.related-card:hover { border-color: var(--accent); text-decoration: none; }
.related-card .post-meta { margin-top: auto; font-size: 0.8rem; }
.related-card strong { font-weight: 500; line-height: 1.35; }
@media (max-width: 760px) { .related-grid { grid-template-columns: 1fr; } }

.newsletter { padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.newsletter h2 { font-size: 1.15rem; }
.newsletter p { color: var(--text-soft); margin: 0.4rem 0 0; }
.newsletter-form { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.newsletter-form input { flex: 1 1 220px; padding: 0.6rem 0.8rem; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text); font: inherit; }
.newsletter-alt { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.8rem; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(1, 4, 9, 0.92); cursor: zoom-out; padding: 2rem; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--radius); border: 1px solid var(--border-strong); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.lightbox-close { position: absolute; top: 0.75rem; right: 1rem; background: none; border: 0; color: var(--text); font-size: 2rem; line-height: 1; cursor: pointer; }

/* --------------------------------------------------------------------------
   Sobre mí, guía OWASP, búsqueda, 404
   -------------------------------------------------------------------------- */
.profile { display: flex; gap: 1.75rem; align-items: center; padding-top: 2.75rem; padding-bottom: 1.5rem; }
.profile h1 { font-size: clamp(1.75rem, 3.6vw, 2.35rem); letter-spacing: -0.02em; }
.profile-role { color: var(--text-soft); font-size: 1.08rem; margin: 0.35rem 0 0; }
.profile-certs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.profile-actions { margin-top: 1rem; }
@media (max-width: 560px) { .profile { flex-direction: column; align-items: flex-start; gap: 1rem; } }
.prose { padding-bottom: 3rem; }

.owasp-index { display: grid; gap: 0.75rem; padding-bottom: 3rem; }
.owasp-entry { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem 1.5rem; padding: 1.2rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); scroll-margin-top: calc(var(--header-h) + 16px); }
.owasp-entry.is-empty { background: transparent; border-style: dashed; }
.owasp-entry .owasp-code { font-size: 0.95rem; }
.owasp-entry h2 { font-size: 1.15rem; }
.owasp-entry h2 small { display: block; font-weight: 400; color: var(--text-muted); font-size: 0.85rem; margin-top: 0.15rem; }
.owasp-entry p { color: var(--text-soft); margin: 0.5rem 0 0; font-size: 0.95rem; }
.owasp-entry ul { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; gap: 0.35rem; }
.owasp-entry li a { color: var(--text); font-weight: 500; }
.owasp-entry li a:hover { color: var(--accent); text-decoration: none; }
.owasp-entry li small { color: var(--text-muted); margin-left: 0.4rem; }
.owasp-entry .soon { margin-top: 0.75rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); }
.owasp-entry .ext { font-size: 0.82rem; color: var(--text-muted); }
@media (max-width: 560px) { .owasp-entry { grid-template-columns: 1fr; gap: 0.4rem; } }

.search-form { display: flex; gap: 0.5rem; margin: 1.25rem 0 0; max-width: 560px; }
.search-form input { flex: 1; padding: 0.65rem 0.9rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text); font: inherit; font-size: 1rem; }
.search-form input:focus { border-color: var(--accent); outline: none; }

.not-found { padding-top: 4rem; padding-bottom: 4rem; }
.not-found h1 { font-size: 2rem; }
.not-found code { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Pie
   -------------------------------------------------------------------------- */
.site-footer { margin-top: 3rem; border-top: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; padding-top: 2.5rem; padding-bottom: 2rem; }
.footer-brand .brand-mark { font-size: 1.05rem; }
.footer-tagline { color: var(--text-soft); margin: 0.4rem 0 0.6rem; }
.footer-ethics { font-size: 0.82rem; max-width: 46ch; margin: 0; }
.footer-nav { display: flex; flex-direction: column; gap: 0.35rem; }
.footer-nav h2 { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.4rem; }
.footer-nav a { color: var(--text-soft); }
.footer-nav a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1rem; padding-bottom: 1.5rem; border-top: 1px solid var(--border); font-size: 0.82rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* --------------------------------------------------------------------------
   Movimiento
   -------------------------------------------------------------------------- */
html.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
html.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .reveal { opacity: 1; transform: none; }
}
