/* ============================================================
   IAMANOS.COM — Blog & Post Styles
   Seamless extension of the main site design language.
   Covers: blog.html (listing) + post.html (detail)
   ============================================================ */

/* ── ACTIVE NAV LINK ── */
.nav-links a.active { color: var(--blue-light); }


/* ══════════════════════════════════════════════════════════
   BLOG HERO
══════════════════════════════════════════════════════════ */
.blog-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 100px;
  background: var(--bg);
  overflow: hidden;
  text-align: center;
}

/* Particle canvas (same as main hero) */
.blog-hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Grid overlay — identical to .hero-grid-overlay */
.blog-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37,99,235,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
  pointer-events: none;
}

/* Subtle radial bloom behind the headline */
.blog-hero::after {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(37,99,235,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.blog-hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.blog-hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.1;
  margin: 14px 0 20px;
  letter-spacing: -0.02em;
}

.blog-hero p {
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* ── Search bar ── */
.blog-search-wrap {
  position: relative;
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
}

.blog-search-wrap svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s;
}

#blog-search {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 40px;
  padding: 15px 22px 15px 50px;
  font-size: 0.95rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

#blog-search:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.14), 0 8px 32px rgba(37,99,235,0.08);
  background: var(--bg-card-hover);
}

#blog-search:focus + svg,
.blog-search-wrap:focus-within svg {
  color: var(--blue-light);
}

/* Override SVG order — it comes before input in DOM */
.blog-search-wrap svg { z-index: 1; }

#blog-search::placeholder { color: var(--text-muted); opacity: 0.7; }


/* ══════════════════════════════════════════════════════════
   FILTERS BAR
══════════════════════════════════════════════════════════ */
.blog-filters-bar {
  position: sticky;
  top: 72px;
  z-index: 100;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
  transition: background 0.3s;
}

.blog-filters-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Pills styled like .section-tag from site.css */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.pill:hover {
  border-color: rgba(37,99,235,0.5);
  color: var(--text);
  background: rgba(37,99,235,0.06);
  box-shadow: 0 0 0 1px rgba(37,99,235,0.2);
}

.pill.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
}

.blog-count {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.04em;
}


/* ══════════════════════════════════════════════════════════
   BLOG MAIN / GRID
══════════════════════════════════════════════════════════ */
.blog-main {
  padding: 64px 0 120px;
  background: var(--bg);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 60px;
}


/* ══════════════════════════════════════════════════════════
   POST CARD
══════════════════════════════════════════════════════════ */
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition:
    border-color 0.3s,
    box-shadow 0.35s,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  animation: cardIn 0.45s ease both;
  will-change: transform;
  transform-style: preserve-3d;
}

/* Top blue accent line — animates in on hover */
.post-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0;
  transition: opacity 0.35s;
  z-index: 2;
}

/* Cursor-following shimmer (uses --gx, --gy set by site.js) */
.post-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--gx, 50%) var(--gy, 50%),
    rgba(96,165,250,0.1) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 0;
}

.post-card:hover {
  border-color: var(--border);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.45),
    0 24px 64px rgba(0,0,0,0.3),
    0 0 0 1px rgba(37,99,235,0.1);
  transform: translateY(-6px);
}

.post-card:hover::before { opacity: 1; }
.post-card:hover::after  { opacity: 1; }

/* ── Card image ── */
.post-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  display: block;
}

.post-card:hover .post-card-img img {
  transform: scale(1.06);
}

.post-card-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-card) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Subtle grid pattern on placeholder */
.post-card-img-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37,99,235,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

.post-card-img-placeholder svg {
  width: 40px;
  height: 40px;
  color: rgba(37,99,235,0.35);
  position: relative;
  z-index: 1;
}

/* ── Card body ── */
.post-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Category badges */
.post-card-cats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cat-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-light);
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.22);
  padding: 3px 9px;
  border-radius: 12px;
  transition: background 0.2s, border-color 0.2s;
}

.post-card:hover .cat-badge {
  background: rgba(37,99,235,0.16);
  border-color: rgba(37,99,235,0.4);
}

/* Card title */
.post-card-title {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.post-card:hover .post-card-title {
  color: #fff;
}

/* Excerpt */
.post-card-excerpt {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Bottom meta row */
.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  gap: 8px;
}

.post-card-date {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.post-card-read {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.post-card-arrow {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue-light);
  margin-left: auto;
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
}

.post-card:hover .post-card-arrow {
  transform: translateX(4px);
  color: #fff;
}


/* ══════════════════════════════════════════════════════════
   SKELETON LOADING
══════════════════════════════════════════════════════════ */
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.post-card.skeleton {
  pointer-events: none;
  animation: none;
  min-height: 360px;
}

.post-card.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255,255,255,0.03) 38%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 62%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  z-index: 3;
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(255,255,255,0.04);
}

.skeleton-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sk-line {
  height: 11px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
}

.sk-line--100 { width: 100%; }
.sk-line--90  { width: 90%; }
.sk-line--85  { width: 85%; }
.sk-line--80  { width: 80%; }
.sk-line--70  { width: 70%; }
.sk-line--60  { width: 60%; }
.sk-line--40  { width: 40%; }
.sk-line--30  { width: 30%; }


/* ══════════════════════════════════════════════════════════
   NO RESULTS
══════════════════════════════════════════════════════════ */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 100px 24px;
  color: var(--text-muted);
}

.no-results-icon {
  font-size: 3.2rem;
  margin-bottom: 20px;
  display: block;
  opacity: 0.7;
}

.no-results h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.no-results p {
  font-size: 0.92rem;
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.6;
}

.no-results.hidden { display: none; }


/* ══════════════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════════════ */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  gap: 6px;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.page-btn:hover {
  border-color: var(--blue);
  color: var(--text);
  background: rgba(37,99,235,0.06);
  transform: translateY(-1px);
}

.page-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 4px 20px rgba(37,99,235,0.4);
}

.page-btn.dots {
  pointer-events: none;
  width: auto;
  padding: 0 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 400;
}

.page-prev,
.page-next {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}


/* ══════════════════════════════════════════════════════════
   POST DETAIL — HERO
══════════════════════════════════════════════════════════ */
.post-hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  padding-top: 80px; /* nav height */
  padding-bottom: 72px;
  overflow: hidden;
  background: var(--bg);
}

/* Neural network canvas (shows when no featured image or beneath it) */
.post-hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

/* Featured image as full-bleed background */
.post-hero-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-color: transparent;
  filter: brightness(0.35) saturate(0.9);
  transition: opacity 0.6s ease;
  z-index: 1;
}

/* Fallback gradient when no image — blue bloom */
.post-hero-image:not([style*="background-image"])::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 30% 40%, rgba(37,99,235,0.22) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 75% 60%, rgba(96,165,250,0.10) 0%, transparent 60%);
}

/* Strong gradient overlay — solid at bottom, transparent at top */
.post-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.98) 0%,
    rgba(0,0,0,0.88) 25%,
    rgba(0,0,0,0.55) 60%,
    rgba(0,0,0,0.15) 100%
  );
  z-index: 2;
}

/* Grid overlay on post hero */
.post-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37,99,235,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 90% 90% at 50% 80%, black, transparent);
  pointer-events: none;
  z-index: 3;
}

.post-hero-inner {
  position: relative;
  z-index: 4;
  width: 100%;
  max-width: 900px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.45);
  margin-bottom: 18px;
}

.breadcrumb a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--blue-light); }

/* Post category badges in hero */
.post-cats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

/* Post title */
.post-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}

/* Post meta */
.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.83rem;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
}

.meta-sep { opacity: 0.35; }


/* ══════════════════════════════════════════════════════════
   POST LAYOUT (2-column: article + sidebar)
══════════════════════════════════════════════════════════ */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 60px;
  padding-top: 60px;
  padding-bottom: 100px;
  align-items: start;
}


/* ══════════════════════════════════════════════════════════
   POST ARTICLE
══════════════════════════════════════════════════════════ */
.post-article {
  min-width: 0; /* prevent grid overflow */
}

/* Loading skeleton lines */
.post-content-loading {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-content-loading .sk-line {
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
}


/* ══════════════════════════════════════════════════════════
   POST CONTENT (typography)
══════════════════════════════════════════════════════════ */
.post-content {
  max-width: 720px;
  font-size: 1.05rem;
  line-height: 1.85;
  color: rgba(240,240,240,0.88);
}

/* Headings */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--text);
  font-weight: 800;
  line-height: 1.25;
  margin: 2.2em 0 0.7em;
}

.post-content h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  border-left: 3px solid var(--blue);
  padding-left: 16px;
  margin-left: -19px; /* align text to left edge */
}

.post-content h3 {
  font-size: 1.2rem;
  color: var(--blue-light);
  font-weight: 700;
}

.post-content h4 {
  font-size: 1.03rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* Paragraphs */
.post-content p {
  margin-bottom: 1.3em;
}

/* Links */
.post-content a {
  color: var(--blue-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(96,165,250,0.4);
  transition: color 0.2s, text-decoration-color 0.2s;
}

.post-content a:hover {
  color: #fff;
  text-decoration-color: rgba(255,255,255,0.6);
}

/* Lists */
.post-content ul,
.post-content ol {
  padding-left: 0;
  margin-bottom: 1.3em;
  list-style: none;
}

.post-content ul li,
.post-content ol li {
  padding-left: 26px;
  position: relative;
  margin-bottom: 0.55em;
  color: rgba(240,240,240,0.82);
}

/* Arrow bullets — same as .check-list in site.css */
.post-content ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.9em;
  line-height: inherit;
}

.post-content ol {
  counter-reset: ol-counter;
}

.post-content ol li {
  counter-increment: ol-counter;
}

.post-content ol li::before {
  content: counter(ol-counter) '.';
  position: absolute;
  left: 0;
  color: var(--blue-light);
  font-weight: 700;
  font-size: 0.85em;
  line-height: inherit;
}

/* Strong / em */
.post-content strong {
  color: #fff;
  font-weight: 700;
}

.post-content em {
  color: var(--blue-light);
  font-style: italic;
}

/* Blockquote */
.post-content blockquote {
  border-left: 3px solid var(--blue);
  padding: 20px 24px;
  margin: 32px 0;
  background: rgba(37,99,235,0.07);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.75;
  box-shadow: 0 4px 24px rgba(37,99,235,0.06);
  position: relative;
}

.post-content blockquote::before {
  content: '"';
  position: absolute;
  top: -4px;
  left: 20px;
  font-size: 3rem;
  font-weight: 900;
  color: rgba(37,99,235,0.25);
  line-height: 1;
  font-style: normal;
}

.post-content blockquote p {
  margin: 0;
}

/* Inline code */
.post-content code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.87em;
  background: rgba(37,99,235,0.12);
  border: 1px solid rgba(37,99,235,0.18);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--blue-light);
}

/* Code blocks */
.post-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  overflow-x: auto;
  font-size: 0.88rem;
  margin: 28px 0;
  line-height: 1.7;
  position: relative;
}

.post-content pre::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), rgba(37,99,235,0.2), transparent);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: rgba(240,240,240,0.85);
}

/* Images */
@keyframes imgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post-content img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 28px 0;
  border: 1px solid var(--border-subtle);
  display: block;
  animation: imgFadeIn 0.5s ease both;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.post-content th {
  background: rgba(37,99,235,0.12);
  border: 1px solid var(--border);
  padding: 11px 15px;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-light);
}

.post-content td {
  border: 1px solid var(--border-subtle);
  padding: 10px 15px;
  color: var(--text-muted);
  line-height: 1.55;
}

.post-content tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}

.post-content tr:hover td {
  background: rgba(37,99,235,0.04);
  color: var(--text);
  transition: background 0.15s, color 0.15s;
}

/* Horizontal rule */
.post-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 40px 0;
}


/* ══════════════════════════════════════════════════════════
   POST CTA BOX
══════════════════════════════════════════════════════════ */
.post-cta-box {
  margin-top: 64px;
  padding: 48px 40px;
  background: linear-gradient(135deg, rgba(37,99,235,0.1) 0%, rgba(37,99,235,0.04) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Decorative top line */
.post-cta-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
}

/* Subtle radial glow behind */
.post-cta-box::after {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(37,99,235,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.post-cta-box .section-tag {
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.post-cta-box h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 800;
  margin: 0 0 12px;
  position: relative;
  z-index: 1;
}

.post-cta-box p {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

.post-cta-box .btn-primary {
  position: relative;
  z-index: 1;
}

.post-cta-box.hidden { display: none; }


/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.post-sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-height: calc(100vh - 120px);
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 24px;
  overflow: hidden;
  position: relative;
}

/* Subtle top accent on sidebar widgets */
.sidebar-widget::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37,99,235,0.35), transparent);
}

.sidebar-widget h5 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 16px;
}

.toc-widget.hidden { display: none; }


/* ── Reading progress bar (top of sidebar) ── */
.toc-widget {
  position: relative;
}

.toc-widget::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 2px;
  width: calc(var(--reading-progress, 0) * 1%);
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  border-radius: 0 1px 1px 0;
  transition: width 0.15s linear;
}

/* ── Table of contents ── */
.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  scrollbar-width: thin;
  scrollbar-color: rgba(37,99,235,0.3) transparent;
}

.toc-nav::-webkit-scrollbar {
  width: 3px;
}

.toc-nav::-webkit-scrollbar-track {
  background: transparent;
}

.toc-nav::-webkit-scrollbar-thumb {
  background: rgba(37,99,235,0.3);
  border-radius: 2px;
}

.toc-item {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 10px 7px 12px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.25s, background 0.2s, padding-left 0.25s;
  line-height: 1.45;
  word-break: break-word;
}

.toc-item:hover {
  color: var(--text);
  background: rgba(37,99,235,0.05);
  border-left-color: rgba(37,99,235,0.4);
}

.toc-item.active {
  color: var(--blue-light);
  border-left-color: var(--blue);
  background: rgba(37,99,235,0.08);
  font-weight: 600;
  padding-left: 16px;
  text-shadow: 0 0 12px rgba(96,165,250,0.3);
}

.toc-item--h3 {
  padding-left: 22px;
  font-size: 0.78rem;
}

.toc-item--h3.active {
  padding-left: 26px;
}

/* ── Sidebar CTA widget ── */
.sidebar-cta {
  text-align: center;
}

.sidebar-cta-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--blue-light);
  filter: drop-shadow(0 0 12px rgba(96,165,250,0.3));
}

.sidebar-cta h5 {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  margin-bottom: 8px;
}

.sidebar-cta p {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.55;
}

.sidebar-cta .btn-primary {
  width: 100%;
  justify-content: center;
}


/* ══════════════════════════════════════════════════════════
   RELATED POSTS
══════════════════════════════════════════════════════════ */
.related-section {
  padding: 100px 0;
  background: var(--bg-2);
  border-top: 1px solid var(--border-subtle);
}

.related-section.hidden { display: none; }

/* Override grid to always be 3 cols (responsive handles breakpoints) */
.related-grid {
  grid-template-columns: repeat(3, 1fr) !important;
}


/* ══════════════════════════════════════════════════════════
   RESPONSIVE — 1024px (tablet)
══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .blog-hero {
    min-height: auto;
    padding: 130px 0 80px;
  }

  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .post-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 48px;
  }

  .post-sidebar {
    position: static;
    max-height: none;
  }

  /* Hide TOC on tablet — clutters single-column layout */
  .toc-widget {
    display: none !important;
  }

  .post-content h2 {
    margin-left: 0;
  }
}


/* ══════════════════════════════════════════════════════════
   RESPONSIVE — 768px (mobile)
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Blog hero */
  .blog-hero {
    min-height: auto;
    padding: 110px 0 60px;
  }

  .blog-hero h1 {
    font-size: clamp(1.9rem, 8vw, 2.6rem);
  }

  .blog-hero p {
    font-size: 0.95rem;
  }

  /* Filters bar — stack vertically */
  .blog-filters-bar .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Grid — single column */
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .related-grid {
    grid-template-columns: 1fr !important;
  }

  .blog-main {
    padding: 48px 0 80px;
  }

  /* Post hero */
  .post-hero {
    min-height: 380px;
    padding-bottom: 48px;
  }

  .post-title {
    font-size: clamp(1.4rem, 6vw, 1.9rem);
  }

  .post-meta {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Post layout */
  .post-layout {
    padding-top: 36px;
    padding-bottom: 60px;
  }

  /* Content */
  .post-content {
    font-size: 1rem;
    line-height: 1.8;
  }

  .post-content h2 {
    font-size: 1.2rem;
    padding-left: 14px;
    margin-left: 0;
  }

  .post-content h3 {
    font-size: 1.05rem;
  }

  .post-content pre {
    padding: 16px;
    font-size: 0.82rem;
  }

  .post-content blockquote {
    padding: 16px 18px;
  }

  .post-cta-box {
    padding: 32px 20px;
    margin-top: 48px;
  }

  /* Related posts */
  .related-section {
    padding: 64px 0;
  }

  /* Pagination */
  .page-btn {
    min-width: 40px;
    height: 40px;
    font-size: 0.82rem;
  }
}


/* ══════════════════════════════════════════════════════════
   UTILITY — ensure card shimmer works even without images
══════════════════════════════════════════════════════════ */
.post-card.skeleton .skeleton-img {
  display: block;
}

.post-card.skeleton .skeleton-body {
  display: flex;
}


/* ══════════════════════════════════════════════════════════
   WORDPRESS / ELEMENTOR CONTENT COMPATIBILITY
   Full reset to render WP content correctly in dark theme.
   Handles: ai-article-wrapper (104), Elementor (375), fullHTML (20)
══════════════════════════════════════════════════════════ */

/* ── CSS Variable Bridge ──────────────────────────────── */
#post-content {
  --bg-primary:            var(--bg);
  --bg-secondary:          var(--bg-card);
  --bg-card:               var(--bg-card);
  --text-primary:          var(--text);
  --text-secondary:        var(--text-muted);
  --text-muted:            var(--text-muted);
  --accent-color:          var(--blue);
  --accent-light:          var(--blue-light);
  --primary-color:         var(--blue);
  --secondary-color:       var(--blue-light);
  --border-color:          rgba(255,255,255,0.08);
  --card-bg:               var(--bg-card);
  --heading-color:         var(--text);
  --link-color:            var(--blue-light);
  --e-global-color-primary:   var(--blue);
  --e-global-color-secondary: var(--blue-light);
  --e-global-color-text:      var(--text);
  --e-global-color-accent:    var(--blue);
  color: var(--text);
}

/* ── ELEMENTOR LAYOUT RESET ───────────────────────────── */
/* Force ALL Elementor containers/columns to full-width block layout */
#post-content [class*="elementor"],
#post-content [class*="e-con"],
#post-content .e-con-inner {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  float: none !important;
  position: static !important;
  flex: none !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Restore sensible padding only on actual text widget containers */
#post-content .elementor-widget-container {
  padding: 0 !important;
}

/* Elementor rows (flex containers) → vertical stack */
#post-content .elementor-row,
#post-content .elementor-container,
#post-content .elementor-section-wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}

/* ── AI-ARTICLE-WRAPPER RESET ─────────────────────────── */
/* The outer card wrapper — reset all decoration */
#post-content .ai-article-wrapper {
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  box-shadow: none !important;
}

/* Stats grid inside ai-article-wrapper (3-column numbers) */
#post-content .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 24px 0;
}
#post-content .stat-item {
  background: var(--bg-card) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 12px !important;
  padding: 16px !important;
  text-align: center;
}
#post-content .stat-val {
  display: block;
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  color: var(--blue-light) !important;
}
#post-content .stat-label {
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
}

/* Tag pills inside ai-article-wrapper (article-specific tags, not categories) */
#post-content .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 24px;
}
#post-content .meta-row .tag,
#post-content .tag-pill,
#post-content .article-tag {
  background: rgba(37,99,235,0.12) !important;
  color: var(--blue-light) !important;
  border: 1px solid rgba(37,99,235,0.25) !important;
  padding: 4px 12px !important;
  border-radius: 99px !important;
  font-size: 0.76rem !important;
  font-weight: 500;
}

/* Badge pills ("Actualización Diaria de IA" etc.) */
#post-content .hero-badge,
#post-content .update-badge,
#post-content .article-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px !important;
  background: rgba(96,165,250,0.1) !important;
  border: 1px solid rgba(96,165,250,0.2) !important;
  border-radius: 99px !important;
  color: var(--blue-light) !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  margin-bottom: 20px;
}

/* Info/warning/note boxes inside posts */
#post-content .info-box,
#post-content .tip-box,
#post-content .warning-box,
#post-content .note-box,
#post-content .highlight-box,
#post-content .callout {
  border-left: 3px solid var(--blue);
  background: rgba(37,99,235,0.07) !important;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px !important;
  margin: 24px 0;
  color: var(--text) !important;
}

/* Key points / bullet sections */
#post-content .key-points,
#post-content .takeaways,
#post-content .summary-box {
  background: var(--bg-card) !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
  border-radius: 12px;
  padding: 24px !important;
  margin: 28px 0;
}

/* ── ELEMENTOR WIDGET TYPES ───────────────────────────── */
#post-content .elementor-heading-title {
  color: var(--text) !important;
  font-family: inherit !important;
}
#post-content .elementor-text-editor,
#post-content .elementor-widget-text-editor {
  color: var(--text) !important;
  line-height: inherit !important;
}
#post-content .elementor-button {
  display: inline-flex;
  align-items: center;
  background: var(--blue) !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 10px 24px !important;
  font-family: inherit !important;
  font-weight: 600 !important;
  border: none !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.2s;
}
#post-content .elementor-button:hover {
  background: var(--blue-light) !important;
}
#post-content .elementor-divider-separator {
  border-top: 1px solid rgba(255,255,255,0.08) !important;
}
#post-content .elementor-icon-list-items {
  list-style: none !important;
  padding: 0 !important;
}
#post-content .elementor-icon-list-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  padding: 6px 0 !important;
  color: var(--text) !important;
}
#post-content .elementor-icon-list-icon {
  color: var(--blue-light) !important;
  flex-shrink: 0;
}

/* ── TABLES ───────────────────────────────────────────── */
#post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}
#post-content thead {
  background: rgba(37,99,235,0.12);
}
#post-content th {
  color: var(--blue-light);
  font-weight: 700;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}
#post-content td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--text);
  vertical-align: top;
}
#post-content tr:last-child td { border-bottom: none; }
#post-content tr:nth-child(even) td {
  background: rgba(255,255,255,0.015);
}

/* ── FIGURES AND MEDIA ───────────────────────────────── */
#post-content figure {
  margin: 28px 0;
}
#post-content figcaption {
  font-size: 0.81rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}
#post-content .elementor-widget-image img,
#post-content .wp-block-image img,
#post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* ── WP BLOCKS ────────────────────────────────────────── */
#post-content .wp-block-group,
#post-content .wp-block-group__inner-container {
  background: transparent !important;
  padding: 0 !important;
}
#post-content .wp-block-pullquote {
  border-top: 3px solid var(--blue);
  border-bottom: 3px solid var(--blue);
  padding: 24px 0;
  margin: 32px 0;
  text-align: center;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--blue-light);
}
#post-content .wp-block-separator {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 32px 0;
}
#post-content .wp-block-quote {
  border-left: 3px solid var(--blue);
  padding: 12px 20px;
  margin: 24px 0;
  color: rgba(255,255,255,0.8);
  font-style: italic;
}
#post-content .wp-block-code code {
  background: var(--bg-card) !important;
  color: var(--blue-light) !important;
  display: block;
  padding: 20px !important;
  border-radius: 8px !important;
  overflow-x: auto;
  font-size: 0.88rem;
}

/* ── COMPARISON / VERSUS TABLES (common in AI posts) ─── */
#post-content .vs-table,
#post-content .comparison-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}
#post-content .vs-col {
  background: var(--bg-card) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 12px;
  padding: 20px !important;
}

/* ── TIMELINE / NUMBERED LISTS (common in AI articles) ── */
#post-content .timeline-item,
#post-content .step-item {
  display: flex !important;
  gap: 16px !important;
  margin: 20px 0 !important;
  align-items: flex-start !important;
}
#post-content .step-number,
#post-content .timeline-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--blue) !important;
  border-radius: 50%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff !important;
}

/* ── OVERRIDE ALL INLINE BACKGROUND COLORS ─────────────
   (JS already strips them, but this acts as CSS safety net) */
#post-content [style*="background-color"] {
  background-color: transparent !important;
}
#post-content [style*="background:#"],
#post-content [style*="background: #"] {
  background: transparent !important;
}

/* Restore backgrounds on stat-item and callout boxes */
#post-content .stat-item,
#post-content .info-box,
#post-content .callout,
#post-content .key-points,
#post-content .sidebar-note {
  background: var(--bg-card) !important;
}

/* ── OVERRIDE ALL INLINE COLORS ON TEXT ──────────────── */
#post-content p[style*="color"],
#post-content li[style*="color"],
#post-content span[style*="color:#0"],
#post-content span[style*="color: #0"],
#post-content h2[style*="color"],
#post-content h3[style*="color"] {
  color: inherit !important;
}

/* ── LINKS IN CONTENT ─────────────────────────────────── */
#post-content a {
  color: var(--blue-light);
  text-decoration: none;
  border-bottom: 1px solid rgba(96,165,250,0.3);
  transition: border-color 0.2s, color 0.2s;
}
#post-content a:hover {
  color: #fff;
  border-bottom-color: var(--blue-light);
}
