/* ═══════════════════════════════════════════════════════════════
   BLOG — Estilo cinematográfico (sistema visual de la homepage)
   Mihari Intelligence | blog/index.html + blog/post.html
   ═══════════════════════════════════════════════════════════════ */

/* ─── Layout de página ─── */
.blog-cin {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 168px clamp(22px, 4vw, 70px) 110px;
}

/* Campo de olas animadas (mismo sistema del home): fijo, a todo lo ancho y alto */
.blog-cin .mihari-wave-field,
.post-cin-host .mihari-wave-field {
  position: fixed;
  inset: 0;
  z-index: -1;
}
.blog-cin .mihari-wave-field.mw-in,
.post-cin-host .mihari-wave-field.mw-in { opacity: .8; }

/* Lienzo de malla animada (mismo efecto que la portada), fijo a toda la ventana */
.post-cin-host > .mihari-mesh-wave {
  position: fixed;
  inset: 0;
  transform: none;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: .6;
}

/* ─── Encabezado ─── */
.blog-cin-head {
  position: relative;
  text-align: center;
  max-width: 880px;
  margin: 0 auto 44px;
}
.blog-cin-head .cin-kicker { margin-bottom: 14px; }
.blog-cin-head h1 {
  font-family: Orbitron, sans-serif;
  font-size: clamp(38px, 5.4vw, 72px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  color: var(--text);
}
.blog-cin-head h1 em { font-style: normal; color: var(--cyan); }
.blog-cin-head .cin-intro {
  max-width: 640px;
  margin: 0 auto;
  font-size: 18px;
  color: var(--muted);
}

/* Entrada escalonada del encabezado */
.blog-cin-head > * {
  opacity: 0;
  animation: blogRise .8s cubic-bezier(.2,.7,.25,1) forwards;
}
.blog-cin-head > *:nth-child(1) { animation-delay: .05s; }
.blog-cin-head > *:nth-child(2) { animation-delay: .18s; }
.blog-cin-head > *:nth-child(3) { animation-delay: .32s; }
@keyframes blogRise {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}

/* ─── Filtros (chips de cristal) ─── */
.blog-cin-filters {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 52px;
  opacity: 0;
  animation: blogRise .8s cubic-bezier(.2,.7,.25,1) .45s forwards;
}
.blog-cin-filters .filter-btn {
  border: 1px solid rgba(96, 190, 226, .30);
  border-radius: 999px;
  background: linear-gradient(165deg, rgba(11, 34, 49, .72), rgba(4, 15, 24, .85));
  color: #9fd8ec;
  padding: 10px 20px;
  font-size: 12.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease, background .25s ease;
}
.blog-cin-filters .filter-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(27, 228, 255, .7);
  color: #eafcff;
  box-shadow: 0 8px 20px rgba(0,0,0,.35), 0 0 18px rgba(0, 213, 255, .22);
}
.blog-cin-filters .filter-btn.active {
  background: linear-gradient(135deg, rgba(27, 228, 255, .24), rgba(8, 123, 173, .34));
  border-color: rgba(27, 228, 255, .85);
  color: #d9f8ff;
  box-shadow: 0 0 22px rgba(0, 213, 255, .28), inset 0 0 12px rgba(27, 228, 255, .10);
}

/* ─── Grid de publicaciones ─── */
.blog-cin-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 26px;
}

/* Tarjetas de publicación (salida de blog-list.js) */
.blog-post-card {
  border-radius: 20px;
  border: 1px solid rgba(79, 206, 240, .16);
  background: linear-gradient(155deg, rgba(10, 30, 44, .82), rgba(3, 13, 21, .92));
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255,255,255,.04);
  overflow: hidden;
  opacity: 0;
  transform: translateY(38px) scale(.96);
  animation: blogCardIn .65s cubic-bezier(.2,.7,.25,1) forwards;
  animation-delay: calc(var(--i, 0) * 85ms);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
@keyframes blogCardIn {
  to { opacity: 1; transform: none; }
}
.blog-post-card:hover {
  transform: translateY(-6px);
  border-color: rgba(27, 228, 255, .55);
  box-shadow: 0 24px 48px rgba(0, 0, 0, .45), 0 0 30px rgba(0, 213, 255, .16);
}
.blog-post-card-link { display: block; height: 100%; }

.blog-post-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid rgba(79, 206, 240, .14);
}
.blog-post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.2,.7,.25,1), filter .5s ease;
}
.blog-post-card:hover .blog-post-card-image img {
  transform: scale(1.05);
  filter: brightness(1.08);
}

.blog-post-card-content { padding: 22px 24px 24px; }
.blog-post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.blog-post-card-tag {
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #8fe9ff;
  border: 1px solid rgba(27, 228, 255, .30);
  background: rgba(27, 228, 255, .08);
  border-radius: 999px;
  padding: 4px 11px;
}
.blog-post-card-tag.date {
  color: var(--muted);
  border-color: rgba(140, 180, 205, .22);
  background: transparent;
}
.blog-post-card-title {
  font-family: Orbitron, sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 10px;
}
.blog-post-card-excerpt {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #7fa9bd;
  border-top: 1px solid rgba(79, 206, 240, .12);
  padding-top: 14px;
}
.blog-post-card-meta .read-arrow {
  color: #8fe9ff;
  font-weight: 600;
  letter-spacing: .6px;
  transition: transform .25s ease;
}
.blog-post-card:hover .read-arrow { transform: translateX(5px); }

/* ─── Loading / empty ─── */
.blog-cin-loading, .blog-cin-empty {
  position: relative;
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}
.loading-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid rgba(27, 228, 255, .15);
  border-top-color: var(--cyan);
  animation: blogSpin .9s linear infinite;
}
@keyframes blogSpin { to { transform: rotate(360deg); } }

/* ═══════════════ PÁGINA DE POST (blog/post.html) ═══════════════ */
.blog-post-page { display: block; }
.post-cin {
  max-width: 1120px;
  margin: 0 auto;
  padding: 150px clamp(20px, 4vw, 60px) 100px;
  animation: blogRise .8s cubic-bezier(.2,.7,.25,1) both;
}

/* Hero del post */
.post-hero {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(79, 206, 240, .18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  min-height: 380px;
  display: flex;
  align-items: flex-end;
}
.post-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 11, 17, .25) 0%, rgba(3, 11, 17, .82) 62%, rgba(3, 11, 17, .96) 100%);
}
.post-hero-content { position: relative; padding: 40px clamp(24px, 4vw, 54px) 34px; }
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #9fd8ec;
  border: 1px solid rgba(96, 190, 226, .35);
  border-radius: 999px;
  padding: 8px 16px;
  background: rgba(4, 15, 24, .55);
  backdrop-filter: blur(8px);
  margin-bottom: 20px;
  transition: border-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.post-back:hover {
  border-color: rgba(27, 228, 255, .75);
  color: #fff;
  box-shadow: 0 0 18px rgba(0, 213, 255, .25);
}
.post-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.post-hero-tags .blog-post-card-tag { font-size: 11px; }
.post-hero-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #8fe9ff;
  border: 1px solid rgba(27, 228, 255, .35);
  background: rgba(4, 15, 24, .55);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 6px 14px;
}
.post-hero-content h1 {
  font-family: Orbitron, sans-serif;
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: #fff;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .6);
}
.post-meta { font-size: 13.5px; color: #9dc4d8; letter-spacing: .4px; }
.post-meta-sep { margin: 0 8px; opacity: .5; }

/* Cuerpo del post */
.post-body-container {
  max-width: 800px;
  margin: 54px auto 0;
}
.post-body {
  font-size: 17.5px;
  line-height: 1.85;
  color: #cfe2ee;
}
.post-body h2, .post-body h3 {
  font-family: Orbitron, sans-serif;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 44px 0 16px;
}
.post-body h2 { font-size: 29px; }
.post-body h3 { font-size: 22px; color: #bfe9f8; }
.post-body p { margin: 0 0 22px; }
.post-body a { color: #5fdcff; border-bottom: 1px solid rgba(95, 220, 255, .35); }
.post-body a:hover { color: #fff; border-bottom-color: #fff; }
.post-body ul, .post-body ol { margin: 0 0 22px; padding-left: 26px; }
.post-body li { margin-bottom: 8px; }
.post-body strong { color: #eaf6fd; }
.post-body img { border-radius: 14px; max-width: 100%; }
.post-body blockquote {
  margin: 30px 0;
  padding: 18px 24px;
  border-left: 3px solid var(--cyan);
  border-radius: 0 12px 12px 0;
  background: rgba(27, 228, 255, .06);
  color: #bfe9f8;
}
.post-body code {
  font-family: ui-monospace, monospace;
  font-size: .9em;
  background: rgba(27, 228, 255, .10);
  border: 1px solid rgba(27, 228, 255, .18);
  border-radius: 6px;
  padding: 2px 7px;
  color: #a5ecff;
}
.post-body pre {
  background: linear-gradient(155deg, rgba(8, 24, 36, .95), rgba(3, 12, 19, .98));
  border: 1px solid rgba(79, 206, 240, .18);
  border-radius: 14px;
  padding: 20px 22px;
  overflow-x: auto;
}
.post-body pre code { background: none; border: none; padding: 0; }

/* Compartir */
.post-footer { margin-top: 56px; }
.post-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(79, 206, 240, .14);
  padding-top: 26px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .6px;
}
.post-share a, .post-share button {
  border: 1px solid rgba(96, 190, 226, .32);
  border-radius: 999px;
  background: linear-gradient(165deg, rgba(11, 34, 49, .78), rgba(4, 15, 24, .88));
  color: #9fdcff;
  padding: 9px 18px;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  transition: transform .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.post-share a:hover, .post-share button:hover {
  transform: translateY(-2px);
  border-color: rgba(27, 228, 255, .75);
  color: #eafcff;
  box-shadow: 0 8px 20px rgba(0,0,0,.35), 0 0 18px rgba(0, 213, 255, .22);
}

/* Error / loading del post */
.post-cin-message {
  text-align: center;
  padding: 120px 20px;
  color: var(--muted);
}
.post-cin-message h2 {
  font-family: Orbitron, sans-serif;
  color: var(--text);
  font-size: 30px;
  margin-bottom: 12px;
}

/* ─── Responsive ─── */
@media (max-width: 800px) {
  .blog-cin { padding-top: 132px; }
  .blog-cin-head h1 { font-size: clamp(30px, 8.4vw, 44px); }
  .blog-cin-grid { grid-template-columns: 1fr; }
  .post-hero { min-height: 300px; }
  .post-body { font-size: 16.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .blog-cin::before { animation: none; }
  .blog-cin-head > *, .blog-cin-filters, .blog-post-card, .post-cin { animation: none; opacity: 1; transform: none; }
}
