/* ══════════════════════════════════════════════════════════
   Blog public theme — Fintech Premium (Sprint 60)
   Prefix: .blog-*
   Dark default, light toggle via data-theme
   Linear / Stripe / Vercel aesthetic: near-black, fine grays,
   orange IO accent only, hairline borders, generous whitespace
   ══════════════════════════════════════════════════════════ */

/* ── Dark palette (default) ──────────────────────────────── */
:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --blog-accent: #ff6a00;
  --blog-accent-dark: #e85e00;
  --blog-accent-glow: rgba(255,106,0,0.10);
  --blog-bg: #08090c;
  --blog-bg-alt: #0d0e12;
  --blog-bg-card: #101116;
  --blog-bg-elevated: #16171d;
  --blog-text: #e6e7ea;
  --blog-text-muted: #8a8d96;
  --blog-border: rgba(255,255,255,0.08);
  --blog-shadow: rgba(0,0,0,0.55);
  --blog-radius: 12px;
  --blog-max-w: 1180px;
  --blog-max-w-wide: 1100px;
  --blog-font-heading: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --blog-font-body: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --blog-glow: 0 0 0 1px rgba(255,255,255,0.05), 0 4px 16px rgba(0,0,0,0.35);
  --blog-glow-hover: 0 0 0 1px rgba(255,255,255,0.12), 0 8px 24px rgba(0,0,0,0.45);
  --blog-snake-color: #fff;
  --blog-snake-tenue: rgba(255,255,255,0.12);
}

/* ── Light palette ───────────────────────────────────────── */
html[data-theme="light"] {
  color-scheme: only light;
  --blog-accent: #e85e00;
  --blog-accent-dark: #cc5200;
  --blog-accent-glow: rgba(255,106,0,0.08);
  --blog-bg: #f8f9fa;
  --blog-bg-alt: #f0f1f3;
  --blog-bg-card: #ffffff;
  --blog-bg-elevated: #ffffff;
  --blog-text: #111214;
  --blog-text-muted: #6b6e76;
  --blog-border: rgba(0,0,0,0.07);
  --blog-shadow: rgba(0,0,0,0.05);
  --blog-glow: 0 0 0 1px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.04);
  --blog-glow-hover: 0 0 0 1px rgba(0,0,0,0.10), 0 4px 16px rgba(0,0,0,0.06);
  --blog-snake-color: #000;
  --blog-snake-tenue: rgba(0,0,0,0.10);
}

/* ── Force color-scheme per data-theme ───────────────────── */
@media (prefers-color-scheme: dark) {
  html[data-theme="light"] { color-scheme: only light; }
}

/* ── Scroll behavior + anchor offset for sticky header ── */
html { scroll-behavior: smooth; touch-action: manipulation; overflow-x: clip; max-width: 100%; }
body { touch-action: manipulation; max-width: 100%; }
article.blog-post :is(h2, h3, h4)[id] { scroll-margin-top: 80px; }

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

body {
  font-family: var(--blog-font-body);
  background-color: var(--blog-bg);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.015) 0%, transparent 70%);
  color: var(--blog-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}

a { color: var(--blog-accent); text-decoration: none; transition: color 0.2s; }
a:hover { text-decoration: underline; }

/* ── Focus states ──────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--blog-accent);
  outline-offset: 2px;
}

/* ── Glass utility ─────────────────────────────────────── */
.blog-glass {
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  box-shadow: var(--blog-glow);
}

/* ── Canvas node network background (post pages only) ──── */
.blog-net-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
}

/* ── Post content panel (translucent, over network bg) ─── */
.blog-post-content {
  position: relative;
  background: rgba(8,9,12,0.62);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  padding: 2rem 2.25rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
html[data-theme="light"] .blog-post-content {
  background: rgba(248,249,250,0.68);
}
@supports not (backdrop-filter: blur(1px)) {
  .blog-post-content { background: rgba(8,9,12,0.88); }
  html[data-theme="light"] .blog-post-content { background: rgba(248,249,250,0.92); }
}

/* ── Scroll reveal animation ──────────────────────────── */
.blog-reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.blog-reveal--hidden {
  opacity: 0;
  transform: translateY(24px);
}
/* Stagger delays applied dynamically by JS in groups of 4 */

/* ══════════════════════════════════════════════════════════ */
/* ── HEADER ────────────────────────────────────────────── */
/* ══════════════════════════════════════════════════════════ */

.blog-header {
  border-bottom: 1px solid var(--blog-border);
  background: var(--blog-bg);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.3s, border-color 0.3s;
}

.blog-header-inner {
  max-width: var(--blog-max-w-wide);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.blog-site-name {
  font-family: var(--blog-font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--blog-text);
  letter-spacing: -0.02em;
}
.blog-site-name:hover { text-decoration: none; color: var(--blog-accent); }

.blog-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.blog-logo-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--blog-accent);
  transition: color 0.2s;
}
.blog-logo:hover .blog-logo-icon { color: var(--blog-accent); }

/* Niche logo inline SVG (convention: /img/{slug}-logo.svg injected inline) */
.blog-logo-inline-svg {
  display: block;
  height: 34px;
  color: var(--blog-text);
  transition: color 0.2s;
}
.blog-logo:hover .blog-logo-inline-svg { color: var(--blog-accent); }
.blog-logo-inline-svg svg {
  height: 100%;
  width: auto;
  display: block;
}

.blog-nav { display: flex; align-items: center; gap: 1.25rem; }
.blog-nav-link {
  font-size: 0.9rem;
  color: var(--blog-text-muted);
  font-weight: 500;
  transition: color 0.2s;
}
.blog-nav-link:hover { color: var(--blog-accent); text-decoration: none; }

/* ── Theme toggle ────────────────────────────────────────── */
.blog-theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  background: transparent;
  color: var(--blog-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: inherit;
  line-height: 1;
}
.blog-theme-toggle:hover {
  background: var(--blog-accent-glow);
  color: var(--blog-accent);
  border-color: var(--blog-accent);
}
.blog-theme-icon { display: flex; align-items: center; }
.blog-theme-label { white-space: nowrap; }

/* ── Main ──────────────────────────────────────────────── */

.blog-main {
  max-width: var(--blog-max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.blog-main--wide {
  max-width: var(--blog-max-w-wide);
}

/* ══════════════════════════════════════════════════════════ */
/* ── HOME ──────────────────────────────────────────────── */
/* ══════════════════════════════════════════════════════════ */

/* ── Hero ──────────────────────────────────────────────── */

.blog-hero {
  display: grid;
  grid-template-columns: 1fr 340px;
  column-gap: 48px;
  align-items: start;
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: 16px;
  padding: 64px;
  margin-bottom: 3rem;
  box-shadow: var(--blog-glow);
  position: relative;
  overflow: hidden;
}
.blog-hero-content { align-self: start; }
.blog-hero-aside   { display: flex; flex-direction: column; gap: 16px; align-self: start; }

.blog-hero-title {
  font-family: var(--blog-font-heading);
  font-size: 2.625rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: -1px;
  color: var(--blog-text);
}

.blog-hero-desc {
  font-size: 1.125rem;
  color: #8a8d96;
  line-height: 1.65;
  margin-bottom: 32px;
}

/* ── Hero author block (single-tenant) ─────────────────── */
.blog-hero-author {
  margin-top: 8px;
  max-width: 65ch;
  line-height: 1.7;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}
.blog-hero-author-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--blog-border, rgba(255,255,255,0.08));
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.blog-hero-author-photo--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blog-bg-elevated, #1e293b);
  color: var(--blog-text-muted, #94a3b8);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.03em;
}
.blog-hero-author-text { flex: 1; min-width: 0; }
.blog-hero-author-title {
  font-family: var(--blog-font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--blog-text);
  margin-bottom: 0.75rem;
}
.blog-hero-author p,
.blog-hero-author-text > p {
  font-size: 0.95rem;
  color: #8a8d96;
  margin-bottom: 16px;
  line-height: 1.7;
}
.blog-hero-author p:last-child,
.blog-hero-author-text > p:last-child { margin-bottom: 0; }
.blog-hero-author-role {
  font-size: 0.9rem;
  color: var(--blog-accent, #2DD4BF);
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.blog-hero-author-bio { font-size: 0.95rem; color: #8a8d96; line-height: 1.7; }
.blog-hero-author-bio p { margin-bottom: 0.5rem; }
.blog-hero-author-bio p:last-child { margin-bottom: 0; }

/* ── Hero latest post card (right column) ──────────────── */
.blog-hero-latest {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--blog-bg-elevated);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 24px;
  align-self: start;
}
.blog-hero-latest-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ff6a00;
  margin-bottom: 10px;
}
.blog-hero-latest-title {
  font-family: var(--blog-font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--blog-text);
}
.blog-hero-latest-title a { color: inherit; text-decoration: none; }
.blog-hero-latest-title a:hover { text-decoration: underline; }
.blog-hero-latest-date {
  font-size: 0.8rem;
  color: var(--blog-text-muted);
}
.blog-hero-latest-excerpt {
  font-size: 0.88rem;
  color: var(--blog-text-muted);
  line-height: 1.55;
}
.blog-hero-latest-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.5rem;
  padding: 12px 16px;
  background: #ff6a00;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.blog-hero-latest-btn:hover {
  background: #e85f00;
  box-shadow: 0 2px 8px rgba(255, 106, 0, 0.3);
  text-decoration: none;
}

/* ── Hero Telegram CTA ─────────────────────────────────── */
.blog-hero-tg {
  position: relative;
  padding: 24px;
  background: var(--blog-bg-elevated);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
}
.blog-hero-tg-text,
.blog-hero-tg-btn { position: relative; z-index: 1; }
.blog-hero-tg-text {
  font-size: 0.875rem;
  color: #8a8d96;
  margin: 0 0 14px;
}
.blog-hero-tg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  background: #229ED9;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, box-shadow 0.15s;
}
.blog-hero-tg-btn:hover {
  background: #1c8ec2;
  box-shadow: 0 2px 8px rgba(34, 158, 217, 0.35);
  text-decoration: none;
  color: #fff;
}

/* ── Snake border animation (Telegram cards) ─────────────── */
@media (prefers-reduced-motion: no-preference) {
  .blog-hero-tg::before,
  .blog-sidebar-tg::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 2px;
    background: conic-gradient(from var(--blog-snake-angle), transparent 0%, transparent 72%, #16567a 86%, #1d6a92 92%, transparent 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 0;
    filter: brightness(0.55) saturate(0.8);
    animation: blog-io-snake 4s linear infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .blog-hero-tg,
  .blog-sidebar-tg { border-color: rgba(22, 86, 122, 0.35); }
}

/* ── Lead form ──────────────────────────────────────────── */

.blog-lead-box {
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  box-shadow: var(--blog-glow);
  color: var(--blog-text);
  border-radius: var(--blog-radius);
  padding: 1.75rem;
}

.blog-lead-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.blog-lead-subtitle { font-size: 0.85rem; color: var(--blog-text-muted); margin-bottom: 1rem; }

.blog-lead-form { display: flex; flex-direction: column; gap: 0.6rem; }

.blog-lead-input {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  font-size: 0.9rem;
  width: 100%;
  background: var(--blog-bg-alt);
  color: var(--blog-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.blog-lead-input:focus {
  outline: none;
  border-color: var(--blog-accent);
  box-shadow: 0 0 0 3px var(--blog-accent-glow);
}
.blog-lead-input:disabled { opacity: 0.6; cursor: not-allowed; }

.blog-lead-check {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--blog-text-muted);
  cursor: default;
}
.blog-lead-check input { margin-top: 0.15rem; }

.blog-lead-btn {
  padding: 0.6rem;
  background: var(--blog-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.blog-lead-btn:hover { opacity: 0.9; }
.blog-lead-btn:active { transform: scale(0.98); }
.blog-lead-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Honeypot field — hidden from humans, bots fill it */
.blog-lead-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  tab-size: 0;
}

/* Lead result page (confirm, thanks, unsubscribe) */
.blog-lead-result {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 500px;
  margin: 0 auto;
}
.blog-lead-result h1 { font-family: var(--blog-font-heading); font-size: 2rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.02em; }
.blog-lead-result p { color: var(--blog-text-muted); margin-bottom: 1.5rem; }

/* ── Search bar ────────────────────────────────────────── */

.blog-search-bar { margin-bottom: 2.5rem; }

.blog-search-form {
  display: flex;
  gap: 0.5rem;
}

.blog-search-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid var(--blog-border);
  border-radius: 10px;
  font-size: 0.95rem;
  background: var(--blog-bg-alt);
  color: var(--blog-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.blog-search-input:focus {
  outline: none;
  border-color: var(--blog-accent);
  box-shadow: 0 0 0 3px var(--blog-accent-glow);
}

.blog-search-btn {
  padding: 0.7rem 1.5rem;
  background: var(--blog-bg-elevated);
  color: var(--blog-text);
  border: 1px solid var(--blog-border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s, border-color 0.2s;
}
.blog-search-btn:hover { border-color: var(--blog-accent); color: var(--blog-accent); }
.blog-search-btn:active { transform: scale(0.97); }

.blog-search-status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--blog-text-muted);
}
.blog-search-status a { margin-left: 0.5rem; }

/* ── Section title ─────────────────────────────────────── */

.blog-section-title {
  font-family: var(--blog-font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--blog-border);
  display: inline-block;
  letter-spacing: -0.02em;
}

/* ── Card grid ─────────────────────────────────────────── */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.blog-card {
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  background: var(--blog-bg-card);
  display: flex;
  flex-direction: column;
  box-shadow: var(--blog-glow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
  position: relative;
}
.blog-card:hover {
  border-color: rgba(255,255,255,0.14);
  box-shadow: var(--blog-glow-hover);
  transform: translateY(-2px);
}
html[data-theme="light"] .blog-card:hover {
  border-color: rgba(0,0,0,0.12);
}

.blog-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--blog-border);
}
.blog-card-media svg {
  width: 100%;
  height: 100%;
  display: block;
}
.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blog-card-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blog-text-muted);
  background: var(--blog-bg-alt);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--blog-border);
  width: fit-content;
  margin-bottom: 0.85rem;
}

.blog-card-title {
  font-family: var(--blog-font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.blog-card-title a { color: var(--blog-text); transition: color 0.2s; }
.blog-card-title a:hover { color: var(--blog-accent); text-decoration: none; }

.blog-card-excerpt {
  color: var(--blog-text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
  flex: 1;
  line-height: 1.6;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--blog-border);
}

.blog-card-date { color: var(--blog-text-muted); }
.blog-card-link { font-weight: 600; }

/* ══════════════════════════════════════════════════════════ */
/* ── POST DETAIL ───────────────────────────────────────── */
/* ══════════════════════════════════════════════════════════ */

/* ── Post hero ─────────────────────────────────────────── */

.blog-post-hero {
  position: relative;
  border-radius: var(--blog-radius);
  margin-bottom: 2.5rem;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--blog-border);
  box-shadow: var(--blog-glow);
}
html[data-theme="light"] .blog-post-hero {
  background: var(--blog-bg-card);
}
.blog-post-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.blog-post-hero-media svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
/* Featured image as hero cover (E6) */
.blog-post-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* When real cover image is present, always show it (both themes) */
.blog-post-hero--cover .blog-post-hero-media {
  display: block;
}
html[data-theme="light"] .blog-post-hero-media {
  display: none;
}
html[data-theme="light"] .blog-post-hero--cover .blog-post-hero-media {
  display: block;
}
html[data-theme="light"] .blog-post-hero--cover {
  background: var(--blog-bg-card);
}
.blog-post-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(8,9,12,0.1) 0%, rgba(8,9,12,0.5) 40%, rgba(8,9,12,0.92) 100%);
  pointer-events: none;
}
html[data-theme="light"] .blog-post-hero-overlay {
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.015) 100%);
}
.blog-post-hero-content {
  position: relative;
  z-index: 2;
  padding: 2.5rem 3rem 2.5rem;
  color: #fff;
  width: 100%;
}
html[data-theme="light"] .blog-post-hero-content { color: var(--blog-text); }

/* Breadcrumb inside hero */
.blog-breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  opacity: 0.85;
}
.blog-breadcrumb a {
  color: #fff;
  text-decoration: underline;
}
html[data-theme="light"] .blog-breadcrumb a {
  color: var(--blog-text);
}
.blog-breadcrumb-sep { margin: 0 0.35rem; }

.blog-post-title {
  font-family: var(--blog-font-heading);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.18;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
  color: #fff;
}
html[data-theme="light"] .blog-post-title {
  color: var(--blog-text);
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  opacity: 0.85;
  color: #fff;
}
html[data-theme="light"] .blog-post-meta {
  color: var(--blog-text);
}

.blog-post-readtime {
  font-size: 0.85rem;
  opacity: 0.85;
}

.blog-post-type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}
html[data-theme="light"] .blog-post-type-badge {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.08);
  color: var(--blog-text-muted);
}

/* ── Cover hero: always dark scrim + white text (both themes) ── */
/* text-shadow for legibility over busy cover images */
.blog-post-hero--cover .blog-post-title { text-shadow: 0 2px 12px rgba(0,0,0,0.45); }
.blog-post-hero--cover .blog-breadcrumb { text-shadow: 0 1px 6px rgba(0,0,0,0.4); }
.blog-post-hero--cover .blog-post-meta { text-shadow: 0 1px 6px rgba(0,0,0,0.4); }
/* Override light-theme rules: cover hero must keep dark scrim + white text */
html[data-theme="light"] .blog-post-hero--cover .blog-post-hero-overlay {
  background: linear-gradient(180deg, rgba(8,9,12,0.1) 0%, rgba(8,9,12,0.5) 40%, rgba(8,9,12,0.92) 100%);
}
html[data-theme="light"] .blog-post-hero--cover .blog-post-hero-content { color: #fff; }
html[data-theme="light"] .blog-post-hero--cover .blog-post-title { color: #fff; }
html[data-theme="light"] .blog-post-hero--cover .blog-breadcrumb { color: rgba(255,255,255,0.92); }
html[data-theme="light"] .blog-post-hero--cover .blog-breadcrumb a { color: rgba(255,255,255,0.85); }
html[data-theme="light"] .blog-post-hero--cover .blog-breadcrumb a:hover { color: #fff; }
html[data-theme="light"] .blog-post-hero--cover .blog-post-meta { color: rgba(255,255,255,0.92); }
html[data-theme="light"] .blog-post-hero--cover .blog-post-type-badge {
  color: #fff;
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}

/* ── Post author (inside hero meta) ──────────────────── */
.blog-post-author {
  font-size: 0.9rem;
  opacity: 0.9;
}
.blog-post-author-name { font-weight: 600; }

/* ── Post layout (body + sidebar) ──────────────────────── */

.blog-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2.5rem;
  align-items: start;
  max-width: 100%;
}
.blog-post-body { min-width: 0; }

/* ── TOC ───────────────────────────────────────────────── */

.blog-toc {
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  padding: 1.75rem 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--blog-glow);
}

.blog-toc-title {
  font-family: var(--blog-font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
  color: var(--blog-text);
}

.blog-toc-list {
  list-style: none;
  padding: 0;
  counter-reset: blog-toc-h2;
}

.blog-toc-list > li {
  counter-increment: blog-toc-h2;
  margin-bottom: 0.45rem;
}

.blog-toc-list > li > a::before {
  content: counter(blog-toc-h2) ". ";
  color: var(--blog-accent);
  font-weight: 600;
}

.blog-toc-sublist {
  list-style: none;
  padding-left: 1.25rem;
  margin-top: 0.35rem;
  counter-reset: blog-toc-h3;
}

.blog-toc-sublist > li {
  counter-increment: blog-toc-h3;
  margin-bottom: 0.35rem;
}

.blog-toc-sublist > li > a::before {
  content: counter(blog-toc-h2) "." counter(blog-toc-h3) " ";
  color: var(--blog-accent);
  font-weight: 600;
}

.blog-toc-sublist > li > a {
  font-size: 0.85rem;
}

/* Link hover animation in TOC */
.blog-toc-list li a {
  font-size: 0.9rem;
  color: var(--blog-text);
  text-decoration: none;
  background-image: linear-gradient(var(--blog-accent), var(--blog-accent));
  background-size: 0% 2px;
  background-position: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease, color 0.15s;
}
.blog-toc-list li a:hover {
  background-size: 100% 2px;
  color: var(--blog-accent);
  text-decoration: none;
}

/* ── Post content (reading typography) ────────────────── */

.blog-post-content {
  font-size: 1.05rem;
  line-height: 1.85;
}
.blog-post-content h2 {
  font-family: var(--blog-font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 3rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--blog-border);
  letter-spacing: -0.02em;
}
.blog-post-content h3 {
  font-family: var(--blog-font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2.25rem 0 0.75rem;
  letter-spacing: -0.02em;
}
.blog-post-content p,
.blog-post-content ul,
.blog-post-content ol,
.blog-post-content blockquote { max-width: 75ch; }
.blog-post-content p { margin-bottom: 1.1rem; }
.blog-post-content ul, .blog-post-content ol { margin: 1rem 0; padding-left: 1.5rem; }
.blog-post-content li { margin-bottom: 0.5rem; }

/* Blockquote with left accent */
.blog-post-content blockquote {
  border-left: 3px solid var(--blog-accent);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  background: var(--blog-bg-alt);
  border-radius: 0 var(--blog-radius) var(--blog-radius) 0;
  font-style: italic;
  color: var(--blog-text-muted);
}
.blog-post-content blockquote strong { font-style: normal; color: var(--blog-accent); }
.blog-post-content a { color: var(--blog-accent); text-decoration: underline; }
.blog-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--blog-radius);
  margin: 1.25rem 0;
  box-shadow: 0 4px 16px var(--blog-shadow);
}
.blog-post-content figure { margin: 1.75rem 0; }
.blog-post-content figcaption {
  font-size: 0.85rem;
  color: var(--blog-text-muted);
  font-style: italic;
  margin-top: 0.5rem;
  text-align: center;
}
.blog-post-content .blog-post-figure {
  margin: 2rem 0;
  max-width: 100%;
}
.blog-post-content .blog-post-figure img {
  display: block;
  width: 100%;
  max-width: 1280px;
  height: auto;
  margin: 0 auto;
  border-radius: var(--blog-radius);
  box-shadow: 0 4px 16px var(--blog-shadow);
}
.blog-post-content .blog-post-figure figcaption {
  max-width: 75ch;
  margin: 0.5rem auto 0;
}
.blog-post-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.75rem 0;
  box-shadow: 0 2px 8px var(--blog-shadow);
  border-radius: var(--blog-radius);
}
.blog-post-content pre {
  max-width: 100%;
  overflow-x: auto;
}
.blog-post-content img { max-width: 100%; }
.blog-post-content th, .blog-post-content td {
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--blog-border);
  text-align: left;
}
.blog-post-content th {
  background: color-mix(in srgb, var(--blog-bg-elevated) 90%, transparent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ── Sponsored disclosure ──────────────────────────────── */

.blog-sponsored {
  font-size: 0.8rem;
  color: var(--blog-text-muted);
  background: var(--blog-bg-alt);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 0.5rem;
  font-style: italic;
}

/* ── Sidebar ───────────────────────────────────────────── */

.blog-sidebar {
  position: sticky;
  top: 5rem;
  align-self: start;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--blog-border) transparent;
}

.blog-sidebar-cta-desc,
.blog-sidebar-io-desc,
.blog-sidebar-tg-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-sidebar-cta-desc { -webkit-line-clamp: 2; line-clamp: 2; }
.blog-sidebar-io-desc  { -webkit-line-clamp: 3; line-clamp: 3; }
.blog-sidebar-tg-desc  { -webkit-line-clamp: 2; line-clamp: 2; }

.blog-sidebar-cta {
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  padding: 1.75rem;
  text-align: center;
  box-shadow: var(--blog-glow);
}

.blog-sidebar-cta-title { font-family: var(--blog-font-heading); font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; }
.blog-sidebar-cta-desc { font-size: 0.85rem; color: var(--blog-text-muted); margin-bottom: 1rem; }

.blog-sidebar-cta-btn {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  background: var(--blog-bg-elevated);
  color: var(--blog-text);
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.2s, border-color 0.2s;
}
.blog-sidebar-cta-btn:hover { text-decoration: none; border-color: var(--blog-accent); color: var(--blog-accent); }

/* ── Sidebar M\u00e9todo IO ──────────────────────────────────── */
.blog-sidebar-io {
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: 14px;
  padding: 1.75rem;
  text-align: center;
  box-shadow: var(--blog-glow);
  margin-top: 1.25rem;
}
.blog-sidebar-io-title { font-family: var(--blog-font-heading); font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; }
.blog-sidebar-io-desc { font-size: 0.85rem; color: var(--blog-text-muted); margin-bottom: 1rem; line-height: 1.55; }
.blog-sidebar-io-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.65rem 1.25rem;
  background: #ff6a00;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--blog-font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
}
.blog-sidebar-io-btn:hover {
  background: #e85f00;
  box-shadow: 0 2px 8px rgba(255, 106, 0, 0.3);
}
.blog-sidebar-io-icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Sidebar Telegram CTA ──────────────────────────────── */
.blog-sidebar-tg {
  position: relative;
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: 14px;
  padding: 1.75rem;
  text-align: center;
  box-shadow: var(--blog-glow);
  margin-top: 1.25rem;
}
.blog-sidebar-tg-title,
.blog-sidebar-tg-desc,
.blog-sidebar-tg-btn { position: relative; z-index: 1; }
.blog-sidebar-tg-title { font-family: var(--blog-font-heading); font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; }
.blog-sidebar-tg-desc { font-size: 0.85rem; color: var(--blog-text-muted); margin-bottom: 1rem; }
.blog-sidebar-tg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.55rem 1.25rem;
  background: #229ED9;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.blog-sidebar-tg-btn:hover {
  background: #1b88bc;
  box-shadow: 0 2px 8px rgba(34, 158, 217, 0.35);
  text-decoration: none;
  color: #fff;
}

/* ── Ad slots ─────────────────────────────────────────── */

.blog-ad {
  position: relative;
  background: var(--blog-bg-alt);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  overflow: hidden;
  padding: 16px;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  will-change: transform;
}
.blog-ad:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}
html[data-theme="dark"] .blog-ad:hover {
  box-shadow: 0 14px 32px rgba(0,0,0,0.55);
}

.blog-ad-label {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blog-text-muted);
  padding: 0;
  font-weight: 600;
}

.blog-ad-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100px;
  border-radius: 10px;
  background: #1a1a2e;
  object-fit: contain;
  padding: 12px 16px;
  margin: 10px auto 0;
  box-sizing: border-box;
}

.blog-ad-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-top: 14px;
  padding: 0;
  color: var(--blog-text);
  line-height: 1.4;
}

.blog-ad-html { margin-top: 8px; padding: 0; font-size: 0.85rem; color: var(--blog-text); line-height: 1.55; }
.blog-ad-html p { margin: 0; }

/* Hero ad (home aside) */
.blog-hero-ad { display: flex; align-items: start; }
.blog-ad--hero { max-width: 340px; width: 100%; }

/* Sidebar ad */
.blog-ad--sidebar { margin-bottom: 1.5rem; }

/* Inline ad (in-content) */
.blog-ad--inline { margin: 1.5rem 0; }

/* Between-posts ad (home grid) */
.blog-ad--between { grid-column: 1 / -1; margin: 0.5rem 0; }

/* In-article card ad (midpoint of post) */
.blog-ad-article-wrap { margin: 2rem 0; max-width: 75ch; }
.blog-ad--article-card { border-radius: var(--blog-radius); }

/* Sidebar ad card */
.blog-sidebar-ad { margin: 1.5rem 0; }
.blog-ad-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blog-text-muted);
  background: var(--blog-bg-alt);
  border: 1px solid var(--blog-border);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  z-index: 2;
}
.blog-ad--sidebar-card { border-radius: var(--blog-radius); }

/* IO modal ad (subordinated at bottom) */
.blog-io-ad-wrap {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--blog-border);
  border-bottom: none;
  margin-top: 0.5rem;
  padding-top: 1rem;
  opacity: 0.85;
  transform: scale(0.97);
  transform-origin: top center;
}
html[data-theme="light"] .blog-io-ad-wrap {
  border-top-color: rgba(0,0,0,0.1);
}
.blog-ad--io-modal { border-radius: var(--blog-radius); }

/* Golden CTA button — .blog-ad prefix for specificity over .blog-post-content a */
.blog-ad .blog-ad-cta {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 16px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #d4af37, #f5d97a, #b8860b);
  color: #1a1205;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  z-index: 1;
}
.blog-ad .blog-ad-cta:hover {
  opacity: 0.92;
  text-decoration: none;
  color: #1a1205;
}
.blog-ad .blog-ad-cta:active { transform: scale(0.98); }

/* Snake border animation on CTA */
@media (prefers-reduced-motion: no-preference) {
  .blog-ad .blog-ad-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 2px;
    background: conic-gradient(from var(--blog-snake-angle), transparent 0%, transparent 65%, #fffbe6 78%, #fff 86%, #fffbe6 92%, transparent 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 0;
    animation: blog-io-snake 4s linear infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .blog-ad .blog-ad-cta { border: 2px solid #d4af37; }
}

/* Hero without ad — full width */
.blog-hero--full { grid-template-columns: 1fr; }

/* ── Post footer ───────────────────────────────────────── */

.blog-post-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--blog-border); }
.blog-back { color: var(--blog-accent); font-size: 0.95rem; font-weight: 500; }

/* ── Author box (post footer) ────────────────────────── */

.blog-author-box {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--blog-glow);
  transition: background 0.3s, border-color 0.3s;
}

.blog-author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--blog-bg-elevated);
  border: 1px solid var(--blog-border);
  color: var(--blog-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.15rem;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.blog-author-avatar--photo {
  object-fit: cover;
  display: block;
}

.blog-author-info { flex: 1; min-width: 0; }

.blog-author-name {
  font-family: var(--blog-font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  letter-spacing: -0.02em;
  color: var(--blog-text);
}

.blog-author-role {
  font-size: 0.85rem;
  color: var(--blog-accent);
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.blog-author-bio {
  font-size: 0.9rem;
  color: var(--blog-text-muted);
  line-height: 1.7;
}

@media (max-width: 640px) {
  .blog-author-box { flex-direction: column; align-items: center; text-align: center; }
}

/* ── Zone types ────────────────────────────────────────── */

.blog-zone { margin-bottom: 1.5rem; }

/* ── 404 ───────────────────────────────────────────────── */

.blog-not-found { text-align: center; padding: 4rem 0; }
.blog-not-found h1 { font-family: var(--blog-font-heading); font-size: 5rem; color: var(--blog-text-muted); margin-bottom: 0.5rem; font-weight: 700; letter-spacing: -0.02em; }
.blog-not-found p { color: var(--blog-text-muted); margin-bottom: 1.5rem; font-size: 1.1rem; }

/* ── Empty state ───────────────────────────────────────── */

.blog-empty { color: var(--blog-text-muted); font-style: italic; padding: 2rem 0; text-align: center; }

/* ── Footer ────────────────────────────────────────────── */

.blog-footer {
  border-top: 1px solid var(--blog-border);
  background: var(--blog-bg);
  transition: background 0.3s, border-color 0.3s;
}

.blog-footer-inner {
  max-width: var(--blog-max-w-wide);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--blog-text-muted);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.blog-footer-copy { font-size: 0.85rem; }

.blog-footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.blog-footer-links a {
  color: var(--blog-text-muted);
  font-size: 0.8rem;
  transition: color 0.2s;
}
.blog-footer-links a:hover { color: var(--blog-accent); text-decoration: none; }

/* ── Legal pages ──────────────────────────────────────── */

.blog-legal {
  max-width: 780px;
  margin: 0 auto;
}

.blog-legal-note {
  font-size: 0.8rem;
  color: var(--blog-text-muted);
  background: var(--blog-bg-alt);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  padding: 0.75rem 1.25rem;
  margin-bottom: 2rem;
  font-style: italic;
}

.blog-legal h1 {
  font-family: var(--blog-font-heading);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}
.blog-legal h2 {
  font-family: var(--blog-font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--blog-border);
  letter-spacing: -0.02em;
}
.blog-legal p { margin-bottom: 0.85rem; line-height: 1.75; }
.blog-legal ul { margin: 0.75rem 0 1rem; padding-left: 1.5rem; }
.blog-legal li { margin-bottom: 0.4rem; line-height: 1.65; }
.blog-legal a { color: var(--blog-accent); }

/* ── Cookie consent banner ────────────────────────────── */

.blog-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: var(--blog-bg-card);
  border-top: 1px solid var(--blog-border);
  box-shadow: 0 -2px 16px var(--blog-shadow);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  transition: background 0.3s, border-color 0.3s;
}

.blog-cookie-banner[hidden] { display: none; }

.blog-cookie-text {
  font-size: 0.9rem;
  color: var(--blog-text);
  margin: 0;
  max-width: 600px;
  line-height: 1.5;
}

.blog-cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.blog-cookie-accept,
.blog-cookie-reject {
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
  font-family: inherit;
  line-height: 1;
}

.blog-cookie-accept {
  background: #ff6a00;
  color: #fff;
  border-color: #ff6a00;
}
.blog-cookie-accept:hover { opacity: 0.9; }

.blog-cookie-reject {
  background: transparent;
  color: var(--blog-text-muted);
  border-color: var(--blog-border);
}
.blog-cookie-reject:hover { color: var(--blog-text); border-color: var(--blog-text-muted); }

.blog-cookie-link {
  color: var(--blog-accent);
  text-decoration: underline;
  font-weight: 500;
}
.blog-cookie-link:hover { opacity: 0.85; }

@media (max-width: 640px) {
  .blog-cookie-banner {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }
  body.blog-cookie-open .blog-scroll-progress {
    bottom: var(--blog-cookie-h, 80px);
  }
}

/* ═══════════════════════════════════════════════════════ */
/* ── Metodo IO — FAB + RSVP modal ─────────────────────── */
/* ═══════════════════════════════════════════════════════ */

/* ── Snake border animation ──────────────────────────── */
@property --blog-snake-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes blog-io-snake {
  to { --blog-snake-angle: 360deg; }
}

/* ── Overlay ─────────────────────────────────────────── */
.blog-io-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.blog-io-overlay[hidden] { display: none; }

.blog-io-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

/* ── Modal card ──────────────────────────────────────── */
.blog-io-modal {
  position: relative;
  width: 90%;
  max-width: 600px;
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  padding: 1.75rem;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 90vh;
  overflow-y: auto;
}

.blog-io-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.blog-io-brand-name {
  font-family: var(--blog-font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ff6a00;
}
.blog-io-brand-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--blog-text-muted);
  margin-top: 0.1rem;
}
.blog-io-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--blog-text-muted);
  cursor: pointer;
  padding: 0.2rem;
  transition: color 0.15s;
}
.blog-io-close:hover { color: var(--blog-text); }

/* ── Word display ────────────────────────────────────── */
.blog-io-display {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: radial-gradient(ellipse at center, var(--blog-accent-glow) 0%, transparent 70%);
  border-radius: calc(var(--blog-radius) - 4px);
}
.blog-io-word {
  font-family: var(--blog-font-heading);
  font-size: 3rem;
  font-weight: 600;
  text-align: center;
  color: var(--blog-text);
  letter-spacing: -0.02em;
  line-height: 1.1;
  overflow-wrap: break-word;
}
.blog-io-word--title {
  color: #ff6a00;
  font-size: 3.2rem;
  font-weight: 800;
}
.blog-io-word--subtitle {
  color: #ff6a00;
  font-size: 2.5rem;
  font-weight: 700;
  opacity: 0.85;
}
.blog-io-word-before, .blog-io-word-after { opacity: 0.7; }
.blog-io-word-pivot { color: #ff6a00; opacity: 1; }
.blog-io-word--title .blog-io-word-pivot,
.blog-io-word--subtitle .blog-io-word-pivot { text-decoration: underline; }

/* ── Progress bar ────────────────────────────────────── */
.blog-io-progress-bar {
  height: 4px;
  background: var(--blog-border);
  border-radius: 2px;
  overflow: hidden;
}
.blog-io-progress-fill {
  height: 100%;
  width: 0;
  background: #ff6a00;
  transition: width 0.1s linear;
}

/* ── Status text ─────────────────────────────────────── */
.blog-io-status {
  text-align: center;
  font-size: 0.78rem;
  color: var(--blog-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Controls ────────────────────────────────────────── */
.blog-io-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.blog-io-btn {
  background: none;
  border: 1px solid var(--blog-border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--blog-text);
  transition: background 0.15s, border-color 0.15s;
}
.blog-io-btn:hover { background: var(--blog-accent-glow); border-color: var(--blog-accent); }
.blog-io-btn--play {
  width: 56px;
  height: 56px;
  background: var(--blog-accent);
  border-color: var(--blog-accent);
  color: #fff;
  box-shadow: 0 0 16px var(--blog-accent-glow);
}
.blog-io-btn--play:hover { background: #e85e00; border-color: #e85e00; box-shadow: 0 0 24px rgba(255,106,0,0.25); }

/* ── Speed selector ──────────────────────────────────── */
.blog-io-speeds {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.blog-io-speed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--blog-border);
  border-radius: 6px;
  background: transparent;
  color: var(--blog-text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.blog-io-speed-name { font-weight: 600; }
.blog-io-speed-time { font-size: 0.68rem; opacity: 0.7; font-weight: 400; }
.blog-io-speed--active .blog-io-speed-time { opacity: 0.9; }
.blog-io-speed:hover { color: var(--blog-text); border-color: var(--blog-text-muted); }
.blog-io-speed--active {
  background: var(--blog-accent);
  border-color: var(--blog-accent);
  color: #fff;
  box-shadow: 0 0 8px var(--blog-accent-glow);
}

/* ── Mode toggle (Leer / Escuchar) ──────────────────── */
.blog-io-mode {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--blog-bg-alt);
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
  margin: 0 auto;
}
.blog-io-mode-btn {
  padding: 0.4rem 1.1rem;
  border: none;
  background: transparent;
  color: var(--blog-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.blog-io-mode-btn:hover { color: var(--blog-text); }
.blog-io-mode-btn--active {
  background: var(--blog-accent);
  color: #fff;
  box-shadow: 0 0 8px var(--blog-accent-glow);
}

/* ── Voice mode word display (phrase) ─────────────── */
.blog-io-word--voice {
  font-family: var(--blog-font-body);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.55;
  word-break: normal;
  color: var(--blog-text);
}
.blog-io-word--voice-title {
  font-weight: 600;
  color: #ff6a00;
}

/* ── Done state ──────────────────────────────────────── */
.blog-io-done {
  text-align: center;
  padding: 1rem 0;
}
.blog-io-done[hidden] { display: none; }
.blog-io-done-msg {
  font-family: var(--blog-font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: #ff6a00;
  margin-bottom: 0.75rem;
}
.blog-io-done-actions { display: flex; justify-content: center; gap: 0.75rem; }
.blog-io-btn-action {
  padding: 0.5rem 1.25rem;
  border: 1px solid #ff6a00;
  border-radius: 8px;
  background: #ff6a00;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.blog-io-btn-action:hover { opacity: 0.9; }
.blog-io-btn-action--close {
  background: transparent;
  color: var(--blog-text-muted);
  border-color: var(--blog-border);
}
.blog-io-btn-action--close:hover { color: var(--blog-text); border-color: var(--blog-text-muted); }

/* ── Welcome screen ─────────────────────────────────── */
.blog-io-welcome {
  text-align: center;
  padding: 1rem 0.5rem;
}
.blog-io-welcome[hidden] { display: none; }
.blog-io-welcome-title {
  font-family: var(--blog-font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: #ff6a00;
  margin-bottom: 1rem;
}
.blog-io-welcome-text {
  font-size: 0.88rem;
  color: var(--blog-text-muted);
  line-height: 1.65;
  margin-bottom: 0.75rem;
  text-align: left;
}
.blog-io-welcome-patent {
  font-size: 0.75rem;
  color: var(--blog-text-muted);
  opacity: 0.7;
  margin-top: 0.75rem;
  font-style: italic;
}
.blog-io-welcome-start {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.65rem 2rem;
  background: #ff6a00;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
}
.blog-io-welcome-start:hover { opacity: 0.9; }
.blog-io-welcome-start:active { transform: scale(0.97); }

/* ── Info panel (toggleable) ────────────────────────── */
.blog-io-info {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--blog-border);
}
.blog-io-info[hidden] { display: none; }
.blog-io-info-text {
  font-size: 0.82rem;
  color: var(--blog-text-muted);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
.blog-io-info-patent {
  font-size: 0.72rem;
  color: var(--blog-text-muted);
  opacity: 0.65;
  font-style: italic;
  margin-top: 0.5rem;
}

/* ── Header actions (info toggle + close) ───────────── */
.blog-io-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.blog-io-info-btn {
  background: none;
  border: none;
  font-size: 0.78rem;
  color: var(--blog-text-muted);
  cursor: pointer;
  padding: 0.2rem 0;
  font-family: inherit;
  text-decoration: underline;
  transition: color 0.15s;
  white-space: nowrap;
}
.blog-io-info-btn:hover { color: #ff6a00; }

/* ── Author attribution (welcome + done) ────────────── */
.blog-io-welcome-author {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--blog-bg-alt);
  border: 1px solid var(--blog-border);
  border-radius: 8px;
}
.blog-io-welcome-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ff6a00;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.blog-io-welcome-author-text {
  font-size: 0.82rem;
  color: var(--blog-text-muted);
  line-height: 1.4;
}
.blog-io-done-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.blog-io-done-author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ff6a00;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.65rem;
  flex-shrink: 0;
}
.blog-io-done-author-text {
  font-size: 0.82rem;
  color: var(--blog-text-muted);
  line-height: 1.4;
}

/* ── Author attribution (player — discrete) ──────── */
.blog-io-player-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.blog-io-player-author-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff6a00;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.55rem;
  flex-shrink: 0;
}
.blog-io-player-author-text {
  font-size: 0.75rem;
  color: var(--blog-text-muted);
}

/* ── Player wrapper (premium card) ──────────────────── */
.blog-io-player {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--blog-bg-elevated);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  padding: 1.5rem;
  box-shadow: var(--blog-glow);
}
.blog-io-player[hidden] { display: none; }

/* ── Responsive modal mobile ───────────────────────────── */
@media (max-width: 640px) {
  .blog-io-modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  .blog-io-player { padding: 1rem; }
  .blog-io-display { min-height: 110px; }
  .blog-io-word { font-size: 2rem; }
  .blog-io-word--title { font-size: 2.2rem; }
  .blog-io-word--subtitle { font-size: 1.8rem; }
  .blog-io-btn { width: 48px; height: 48px; }
  .blog-io-btn--play { width: 56px; height: 56px; }
  .blog-io-speed { padding: 0.35rem 0.65rem; }
  .blog-io-speed-time { font-size: 0.62rem; }
  .blog-io-ad-wrap { transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════ */
/* ── RELATED POSTS ──────────────────────────────────── */
/* ═══════════════════════════════════════════════════════ */

.blog-related {
  max-width: var(--blog-max-w);
  margin: 3.5rem auto 0;
  padding: 0 1.25rem 2rem;
}
.blog-related-inner {
  border-top: 1px solid var(--blog-border);
  padding-top: 2.5rem;
}
.blog-related-heading {
  font-family: var(--blog-font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blog-text);
  margin: 0 0 0.25rem;
}
.blog-related-sub {
  font-size: 0.88rem;
  color: var(--blog-text-muted);
  margin: 0 0 1.5rem;
}

/* Grid: 4 columns on wide, 2 on tablet, 1 on phone */
.blog-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

/* Card — no underline on hover (override global a:hover rule) */
.blog-related-card,
.blog-related-card:hover,
.blog-related-card:hover * {
  text-decoration: none;
}
.blog-related-card {
  display: flex;
  flex-direction: column;
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  overflow: hidden;
  color: inherit;
  box-shadow: var(--blog-glow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.blog-related-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--blog-glow-hover);
  border-color: var(--blog-accent);
}
.blog-related-card:focus-visible {
  outline: 2px solid var(--blog-accent);
  outline-offset: 2px;
}

/* Media */
.blog-related-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--blog-bg-elevated);
}
.blog-related-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blog-related-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--blog-font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--blog-text-muted);
  background: var(--blog-bg-elevated);
}

/* Body */
.blog-related-body {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}
.blog-related-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blog-text-muted);
  background: var(--blog-bg-elevated);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  width: fit-content;
}
.blog-related-title {
  font-family: var(--blog-font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--blog-text);
  margin: 0;
}
.blog-related-desc {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--blog-text-muted);
  margin: 0.15rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-related-date {
  font-size: 0.72rem;
  color: var(--blog-text-muted);
  margin-top: auto;
  padding-top: 0.35rem;
}
.blog-related-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--blog-accent);
  font-weight: 600;
  font-size: 0.8rem;
  margin-top: 0.6rem;
}
.blog-related-cta-arrow {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 1em;
}
.blog-related-card:hover .blog-related-cta-arrow {
  transform: translateX(3px);
}
.blog-related-card:hover .blog-related-cta {
  filter: brightness(1.15);
}

/* ── Related responsive ─────────────────────────────── */
@media (max-width: 900px) {
  .blog-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .blog-related { padding: 0 1rem 1.5rem; }
  .blog-related-inner { padding-top: 2rem; }
}
@media (max-width: 480px) {
  .blog-related-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════ */
/* ── THEMES (niche overrides — applied via body class) ── */
/* ═══════════════════════════════════════════════════════ */

/* ── Editorial: fintech override — force sans (no serif) ── */

.blog-theme-editorial {
  --blog-font-heading: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --blog-font-body: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
}

/* ── Minimal: sans, whitespace, sobrio ───────────────── */

.blog-theme-minimal {
  --blog-font-heading: system-ui, -apple-system, sans-serif;
  --blog-font-body: system-ui, -apple-system, sans-serif;
}
.blog-theme-minimal .blog-hero-title { font-weight: 600; }
.blog-theme-minimal .blog-post-title { font-weight: 400; font-size: 1.75rem; letter-spacing: -0.01em; }
.blog-theme-minimal .blog-card { border: none; border-bottom: 1px solid var(--blog-border); border-radius: 0; box-shadow: none; }
.blog-theme-minimal .blog-card:hover { transform: none; box-shadow: none; }
.blog-theme-minimal .blog-header { border-bottom: none; }
.blog-theme-minimal .blog-site-name { font-family: var(--blog-font-body); font-weight: 400; font-size: 1rem; letter-spacing: 0.05em; text-transform: uppercase; }

/* ── Magazine: grid de tarjetas, titulares grandes ───── */

.blog-theme-magazine {
  --blog-font-heading: system-ui, -apple-system, sans-serif;
  --blog-font-body: system-ui, -apple-system, sans-serif;
}
.blog-theme-magazine .blog-hero-title { font-size: 2.75rem; font-weight: 900; letter-spacing: -0.02em; }
.blog-theme-magazine .blog-site-name { font-weight: 800; font-size: 1.4rem; }

/* ── Tech: mono/sans, acentos ────────────────────────── */

.blog-theme-tech {
  --blog-font-heading: system-ui, -apple-system, sans-serif;
  --blog-font-body: system-ui, -apple-system, sans-serif;
  --blog-font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}
.blog-theme-tech .blog-site-name { font-family: var(--blog-font-mono); font-size: 1rem; }
.blog-theme-tech .blog-post-content code,
.blog-theme-tech .blog-post-content pre {
  font-family: var(--blog-font-mono);
  background: var(--blog-bg-alt);
  border: 1px solid var(--blog-border);
  border-radius: 4px;
  padding: 0.15em 0.4em;
}
.blog-theme-tech .blog-post-content pre { padding: 1rem; overflow-x: auto; }
.blog-theme-tech .blog-post-content pre code { border: none; padding: 0; background: none; }

/* ═══════════════════════════════════════════════════════ */
/* ── RESPONSIVE ────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .blog-hero { grid-template-columns: 1fr; padding: 48px; }
  .blog-hero-lead { max-width: 400px; }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-post-layout { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; max-height: none; overflow-y: visible; }
}

@media (max-width: 640px) {
  .blog-hero-title { font-size: 1.65rem; }
  .blog-hero { padding: 32px; }
  .blog-hero-author { flex-direction: column; align-items: center; text-align: center; }
  .blog-hero-author-photo { width: 80px; height: 80px; }
  .blog-post-hero-content { padding: 1.75rem; }
  .blog-post-title { font-size: 1.5rem; }
  .blog-main { padding: 1.5rem 1rem 3rem; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-header-inner { flex-wrap: wrap; }
  .blog-footer-links { gap: 0.75rem; }
  .blog-post-layout { display: block; }
  .blog-sidebar { width: 100%; position: static; margin-top: 2rem; max-height: none; overflow-y: visible; }
  .blog-post-content { padding: 1.25rem 1rem; }
  .blog-hero-tg-btn,
  .blog-sidebar-tg-btn { display: block; width: 100%; text-align: center; box-sizing: border-box; }
}

/* ── Scroll progress bar (post pages) ─────────────────── */

.blog-scroll-progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  background: rgba(0, 0, 0, 0.08);
  z-index: 9998;
  pointer-events: none;
}
[data-theme="dark"] .blog-scroll-progress { background: rgba(255, 255, 255, 0.10); }

.blog-scroll-progress__fill {
  height: 100%;
  width: 0;
  background: #ff6a00;
  box-shadow: 0 0 6px rgba(255, 106, 0, 0.5);
  transition: width 0.1s linear;
  will-change: width;
}
.blog-scroll-progress__fill.blog-scroll-complete {
  animation: blog-scroll-complete 0.6s ease-out;
}

@keyframes blog-scroll-complete {
  0%  { box-shadow: 0 0 6px rgba(255, 106, 0, 0.5); }
  40% { box-shadow: 0 0 16px 2px rgba(255, 106, 0, 0.95); }
  100% { box-shadow: 0 0 6px rgba(255, 106, 0, 0.5); }
}

/* Mobile: scroll bar at bottom (FAB moved to top) */
@media (max-width: 640px) {
  .blog-scroll-progress {
    bottom: 0;
  }
}

/* ── Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .blog-ad:hover { transform: none; }
}
