/* =========================================================================
   Perspicia Blog — sistema visual (misma marca que la web Astro).
   Tinta / Papel / Ámbar / Cian · General Sans / Switzer / IBM Plex Mono.
   ========================================================================= */

:root {
  --ink: #15171e;
  --ink-deeper: #101218;
  --panel: #1b1e27;
  --panel-2: #2c313d;
  --paper: #f6f6f2;
  --paper-2: #f1f1ec;
  --white: #ffffff;
  --amber: #e8a33d;
  --amber-hover: #f0b056;
  --teal: #1fb6c9;
  --border-light: #e4e4dc;
  --border-dark: rgba(255, 255, 255, 0.08);
  --text-muted: #aeb4bf;
  --text-nav: #c7cbd3;
  --text-footer: #8a93a1;
  --text-faint: #5b6573;
  --font-display: "General Sans", system-ui, sans-serif;
  --font-body: "Switzer", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --maxw: 1240px;
  --pad-x: clamp(18px, 4vw, 40px);
  --ease-focus: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--amber); color: var(--ink); }
*:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 3px; }
@keyframes psBlurIn { 0% { filter: blur(14px); opacity: 0; } 100% { filter: blur(0); opacity: 1; } }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); }
.eyebrow { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-faint); }
.mono { font-family: var(--font-mono); }
.visually-hidden { position: absolute; 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: 12px; top: -48px; z-index: 100; background: var(--amber); color: var(--ink); font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 10px; text-decoration: none; transition: top 0.2s ease; }
.skip-link:focus { top: 12px; }

/* ---- Botones ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-family: var(--font-body); font-weight: 600; font-size: 15px; padding: 13px 24px; border-radius: 11px; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.btn-amber { background: var(--amber); color: var(--ink); }
.btn-amber:hover { background: var(--amber-hover); }
.btn-ghost-dark { background: transparent; color: var(--paper); border-color: #3a404d; }
.btn-ghost-dark:hover { border-color: var(--teal); }
.btn-ghost-light { background: transparent; color: var(--ink); border-color: var(--border-light); }
.btn-ghost-light:hover { border-color: var(--ink); }
.btn-sm { padding: 10px 16px; font-size: 14px; }

/* ============================ HEADER ============================ */
.bhead { position: sticky; top: 0; z-index: 60; background: rgba(21, 23, 30, 0.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border-dark); }
.bhead-bar { max-width: var(--maxw); margin: 0 auto; padding: 14px var(--pad-x); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; flex: none; }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.025em; color: var(--paper); line-height: 1; }
.bnav { display: flex; align-items: center; gap: 7px; }
.bnav-links { display: none; list-style: none; margin: 0; padding: 0; align-items: center; gap: 4px; }
.bnav-links a { display: inline-block; color: var(--text-nav); text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 12px; border-radius: 8px; transition: color 0.2s ease; white-space: nowrap; }
.bnav-links a:hover { color: var(--paper); }
.bnav-links a.is-active { color: var(--amber); }
.bnav-cta { display: inline-flex; align-items: center; gap: 8px; background: var(--amber); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 18px; border-radius: 10px; white-space: nowrap; transition: background 0.2s ease; }
.bnav-cta:hover { background: var(--amber-hover); }
.bnav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; background: transparent; border: 1px solid #3a404d; border-radius: 10px; color: var(--paper); cursor: pointer; }
.bmobile { background: rgba(21, 23, 30, 0.97); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border-dark); }
.bmobile[hidden] { display: none; }
.bmobile ul { list-style: none; margin: 0 auto; padding: 6px var(--pad-x) 18px; max-width: var(--maxw); display: flex; flex-direction: column; gap: 2px; }
.bmobile a { display: block; color: var(--text-nav); text-decoration: none; font-size: 16px; font-weight: 500; padding: 13px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.bmobile a.is-active { color: var(--amber); }
.bmobile .m-cta { margin-top: 14px; background: var(--amber); color: var(--ink); font-weight: 600; text-align: center; border-radius: 10px; border-bottom: none; padding: 14px; }
@media (min-width: 880px) {
  .bnav-links { display: flex; }
  .bnav-toggle, .bmobile { display: none !important; }
}
@media (max-width: 559px) { .bnav-cta { display: none; } }

/* ============================ FOOTER ============================ */
.bfoot { background: var(--ink-deeper); color: var(--text-muted); padding: clamp(48px, 6vw, 68px) var(--pad-x) 40px; }
.bfoot-inner { max-width: var(--maxw); margin: 0 auto; }
.bfoot-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; margin-bottom: 44px; }
.bfoot-brand { flex: 1 1 280px; min-width: 0; }
.bfoot-tagline { font-size: 15.5px; line-height: 1.6; color: var(--text-footer); max-width: 280px; margin: 16px 0 18px; }
.bfoot-contact { font-family: var(--font-mono); font-size: 13px; line-height: 1.9; color: var(--text-footer); }
.bfoot-contact a { color: var(--text-nav); text-decoration: none; }
.bfoot-contact a:hover { color: var(--amber); }
.bfoot-cols { display: flex; gap: clamp(32px, 6vw, 72px); flex-wrap: wrap; }
.bfoot-col { display: flex; flex-direction: column; gap: 12px; }
.bfoot-col .col-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 2px; }
.bfoot-col a { color: var(--text-muted); text-decoration: none; font-size: 15px; }
.bfoot-col a:hover { color: var(--paper); }
.bfoot-bottom { border-top: 1px solid var(--border-dark); padding-top: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

/* ============================ HERO (índice) ============================ */
.blog-hero { background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.blog-hero .glow { position: absolute; top: -30%; right: -6%; width: 680px; height: 680px; border-radius: 50%; background: radial-gradient(circle, rgba(31,182,201,0.1) 0%, rgba(31,182,201,0) 62%); pointer-events: none; }
.blog-hero .inner { max-width: var(--maxw); margin: 0 auto; padding: clamp(48px, 7vw, 88px) var(--pad-x) clamp(36px, 5vw, 56px); position: relative; z-index: 2; }
.blog-hero .eyebrow { color: var(--teal); margin-bottom: 18px; }
.blog-hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 5.4vw, 58px); line-height: 1.04; letter-spacing: -0.025em; margin: 0 0 18px; max-width: 760px; }
.blog-hero p { font-size: clamp(17px, 1.8vw, 21px); line-height: 1.55; color: var(--text-muted); max-width: 620px; margin: 0; }

/* chips de categoría */
.cat-bar { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.cat-chip { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-nav); border: 1px solid var(--panel-2); border-radius: 20px; padding: 7px 14px; text-decoration: none; transition: border-color 0.2s, color 0.2s; }
.cat-chip:hover, .cat-chip.is-active { border-color: var(--amber); color: var(--paper); }

/* ============================ GRID DE POSTS ============================ */
.post-section { background: var(--paper); padding: clamp(44px, 6vw, 80px) 0; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 24px; }
.post-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--border-light); border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform 0.25s var(--ease-focus), box-shadow 0.25s, border-color 0.25s; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -22px rgba(21,23,30,0.3); border-color: var(--ink); }
.post-card .cover { aspect-ratio: 16 / 9; background: var(--paper-2); object-fit: cover; width: 100%; }
.post-card .cover-fallback { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #15171e, #1b1e27); display: grid; place-items: center; }
.post-card .body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.post-card .pmeta { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--text-faint); text-transform: uppercase; margin-bottom: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.post-card .pmeta .cat { color: var(--amber); }
.post-card h2 { font-family: var(--font-display); font-weight: 600; font-size: 21px; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 10px; }
.post-card p { font-size: 15px; line-height: 1.55; color: var(--text-faint); margin: 0 0 18px; flex: 1; }
.post-card .more { font-family: var(--font-mono); font-size: 13px; color: var(--amber); }
.empty { text-align: center; color: var(--text-faint); padding: 40px 0; }

/* paginación */
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 44px; font-family: var(--font-mono); font-size: 14px; }
.pager a, .pager span { padding: 9px 14px; border-radius: 9px; border: 1px solid var(--border-light); text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--ink); }
.pager .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pager .disabled { opacity: 0.4; }

/* ============================ ARTÍCULO ============================ */
.article-hero { background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.article-hero .inner { max-width: 820px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--pad-x) clamp(28px, 4vw, 44px); position: relative; z-index: 2; }
.back-link { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--text-footer); text-decoration: none; margin-bottom: 22px; }
.back-link:hover { color: var(--amber); }
.article-meta { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.04em; color: var(--text-muted); text-transform: uppercase; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.article-meta a { color: var(--teal); text-decoration: none; }
.article-hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 4.6vw, 50px); line-height: 1.06; letter-spacing: -0.025em; margin: 0 0 16px; animation: psBlurIn 1s var(--ease-focus) both; }
.article-hero .lead { font-size: clamp(17px, 1.8vw, 20px); line-height: 1.55; color: var(--text-muted); max-width: 640px; margin: 0; }
.article-cover { max-width: 980px; margin: clamp(-30px, -3vw, -20px) auto 0; padding: 0 var(--pad-x); position: relative; z-index: 3; }
.article-cover img { width: 100%; border-radius: 16px; border: 1px solid var(--border-light); box-shadow: 0 30px 80px -40px rgba(0,0,0,0.5); aspect-ratio: 16 / 9; object-fit: cover; }

.article-body { max-width: 720px; margin: 0 auto; padding: clamp(36px, 5vw, 56px) var(--pad-x) 0; }
.article-body > * { margin-left: auto; margin-right: auto; }
.article-body p, .article-body li { font-size: 18px; line-height: 1.7; color: #3c4250; }
.article-body p { margin: 0 0 20px; }
.article-body h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.01em; color: var(--ink); margin: 44px 0 14px; line-height: 1.2; }
.article-body h3 { font-family: var(--font-display); font-weight: 600; font-size: 21px; color: var(--ink); margin: 32px 0 10px; }
.article-body h4 { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink); margin: 26px 0 8px; }
.article-body ul, .article-body ol { margin: 0 0 22px; padding-left: 24px; }
.article-body li { margin: 0 0 9px; }
.article-body strong { color: var(--ink); }
.article-body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 2px; }
.article-body blockquote { margin: 26px 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--amber); font-family: var(--font-display); font-weight: 500; font-size: clamp(19px, 2.2vw, 24px); line-height: 1.45; letter-spacing: -0.01em; color: var(--ink); }
.article-body code { font-family: var(--font-mono); font-size: 0.92em; background: var(--paper-2); border: 1px solid var(--border-light); border-radius: 5px; padding: 1px 6px; }
.article-body .bl-pre { background: var(--ink); color: #e7e9ee; border-radius: 12px; padding: 18px 20px; overflow-x: auto; margin: 0 0 24px; }
.article-body .bl-pre code { background: none; border: none; padding: 0; color: inherit; font-size: 14px; line-height: 1.6; }
.article-body .bl-fig { margin: 28px 0; }
.article-body .bl-fig img { width: 100%; border-radius: 12px; border: 1px solid var(--border-light); }
.article-body hr { border: none; border-top: 1px solid var(--border-light); margin: 36px 0; }

/* ============================ COMPARTIR ============================ */
.article-foot { max-width: 720px; margin: 0 auto; padding: clamp(40px, 5vw, 60px) var(--pad-x) 0; }
.share { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 24px 0; border-top: 1px solid var(--border-light); }
.share .label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-right: 4px; }
.share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 11px; background: var(--white); border: 1px solid var(--border-light); color: var(--ink); text-decoration: none; cursor: pointer; transition: transform 0.2s var(--ease-focus), border-color 0.2s, background 0.2s, color 0.2s; }
.share-btn:hover { transform: translateY(-2px); border-color: var(--ink); }
.share-btn svg { width: 19px; height: 19px; }
.share-btn.copied { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ============================ PESTAÑAS ============================ */
.tabs { max-width: 720px; margin: 12px auto 0; padding: 0 var(--pad-x) clamp(56px, 7vw, 88px); }
.tabbar { display: flex; gap: 6px; border-bottom: 1px solid var(--border-light); margin-bottom: 28px; }
.tab { appearance: none; background: none; border: none; cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--text-faint); padding: 14px 16px; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.2s, border-color 0.2s; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--amber); }
.tab .count { font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); margin-left: 4px; }
.tab-panel[hidden] { display: none; }

/* recomendados */
.reco-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 18px; }
.reco { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--white); border: 1px solid var(--border-light); border-radius: 14px; overflow: hidden; transition: transform 0.25s var(--ease-focus), box-shadow 0.25s, border-color 0.25s; }
.reco:hover { transform: translateY(-3px); box-shadow: 0 16px 36px -22px rgba(21,23,30,0.3); border-color: var(--ink); }
.reco .rcover { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--paper-2); }
.reco .rcover-fb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #15171e, #1b1e27); }
.reco .rbody { padding: 16px 18px 18px; }
.reco .rcat { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--amber); margin-bottom: 8px; }
.reco h3 { font-family: var(--font-display); font-weight: 600; font-size: 16.5px; line-height: 1.3; letter-spacing: -0.01em; margin: 0; }

/* ============================ COMENTARIOS ============================ */
.comment-list { display: flex; flex-direction: column; gap: 18px; margin-bottom: 36px; }
.comment { background: var(--white); border: 1px solid var(--border-light); border-radius: 14px; padding: 20px 22px; }
.comment .chead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.comment .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--amber); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; flex: none; }
.comment .cname { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); }
.comment .cdate { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.comment .cbody { font-size: 15.5px; line-height: 1.6; color: #3c4250; margin: 0; white-space: pre-line; }
.comments-empty { color: var(--text-faint); font-size: 15.5px; margin-bottom: 32px; }

.comment-form { background: var(--paper-2); border: 1px solid var(--border-light); border-radius: 16px; padding: clamp(22px, 3vw, 30px); }
.comment-form h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin: 0 0 6px; }
.comment-form .sub { font-size: 14px; color: var(--text-faint); margin: 0 0 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink); margin-bottom: 7px; }
.field .opt { color: #9aa0aa; font-weight: 400; }
.input, .textarea { width: 100%; background: var(--white); border: 1px solid #d8d8ce; border-radius: 10px; color: var(--ink); font-family: var(--font-body); font-size: 15px; padding: 13px 15px; outline: none; transition: border-color 0.15s; }
.textarea { resize: vertical; min-height: 120px; }
.input:focus, .textarea:focus { border-color: var(--teal); }
.row-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.captcha-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.captcha-q { font-family: var(--font-mono); font-size: 18px; color: var(--ink); background: var(--white); border: 1px solid var(--border-light); border-radius: 10px; padding: 11px 14px; white-space: nowrap; }
.captcha-row .field { margin-bottom: 0; flex: 1 1 120px; }
.form-note { font-size: 12.5px; line-height: 1.5; color: #9aa0aa; margin: 14px 0 0; }
.form-msg { font-size: 14px; line-height: 1.5; border-radius: 9px; padding: 12px 14px; margin: 0 0 18px; }
.form-msg.ok { color: #1f6f4a; background: #e7f5ee; border: 1px solid #bfe3cf; }
.form-msg.err { color: #b23b2e; background: #fbe9e6; border: 1px solid #f1c9c2; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ============================ NOTAS / CTA finales ============================ */
.blog-cta { background: var(--ink); color: var(--paper); padding: clamp(48px, 7vw, 80px) var(--pad-x); text-align: center; }
.blog-cta h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 3.4vw, 36px); letter-spacing: -0.02em; margin: 0 0 14px; }
.blog-cta p { color: var(--text-muted); font-size: 17px; line-height: 1.6; max-width: 480px; margin: 0 auto 26px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
