html {
  background: var(--info-bg);
}

:root {
  --blog-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --blog-fast: 180ms;
  --blog-medium: 320ms;
}

.blog-page {
  min-height: 100vh;
  color: var(--info-text);
  overflow-x: hidden;
}

.blog-main,
.post-page {
  padding-top: 8.75rem;
}

.blog-main {
  padding-top: 6.75rem;
}

.blog-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════
   BLOG HERO — Cinematic Immersive Background
   ═══════════════════════════════════════════════════════ */

.blog-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(640px, 72vh, 720px);
  padding: 0;
  margin-top: -6.75rem;
  overflow: hidden;
  isolation: isolate;
  background-image:
    linear-gradient(90deg,
      rgba(3, 13, 24, 0.97) 0%,
      rgba(3, 13, 24, 0.88) 32%,
      rgba(3, 13, 24, 0.45) 62%,
      rgba(3, 13, 24, 0.12) 82%,
      rgba(3, 13, 24, 0.06) 100%),
    radial-gradient(circle at 72% 48%, rgba(0, 170, 255, 0.16), transparent 42%),
    radial-gradient(circle at 30% 80%, rgba(0, 100, 200, 0.08), transparent 40%),
    url("../Imagenes/blog/FondoBlogV1.png");
  background-size: cover, cover, cover, min(1380px, 78vw) auto;
  background-position: center, center, center, right 52%;
  background-repeat: no-repeat;
}

/* Extra overlay for depth and edge vignette */
.blog-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg,
      rgba(4, 8, 14, 0.72) 0%,
      rgba(4, 8, 14, 0.08) 28%,
      rgba(4, 8, 14, 0.03) 60%,
      rgba(4, 8, 14, 0.65) 100%),
    radial-gradient(ellipse at 20% 50%, rgba(5, 10, 18, 0.35), transparent 60%);
  pointer-events: none;
}

/* Bottom edge glow line */
.blog-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 3;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(95, 201, 255, 0.25) 20%,
    rgba(95, 201, 255, 0.45) 50%,
    rgba(95, 201, 255, 0.25) 80%,
    transparent 100%);
  box-shadow: 0 0 20px rgba(95, 201, 255, 0.15), 0 0 60px rgba(95, 201, 255, 0.06);
}

/* Hero content container */
.blog-hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding-top: 10rem;
  padding-bottom: 5rem;
}

/* Ensure the shell inside hero doesn't constrain width too aggressively */
.blog-hero .blog-shell {
  width: min(1120px, calc(100% - 48px));
}

/* Kicker label */
.blog-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.25rem;
  color: var(--info-accent);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(95, 201, 255, 0.3);
  opacity: 0;
  animation: blog-cinematic-fade-in 800ms var(--blog-ease) 200ms forwards;
}

.blog-kicker::before {
  content: "";
  width: 2.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--info-accent));
  box-shadow: 0 0 10px rgba(95, 201, 255, 0.3);
}

/* Hero Title */
.blog-hero-title {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.8rem, 5.5vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--info-text);
  overflow-wrap: break-word;
  word-break: break-word;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 0 80px rgba(95, 201, 255, 0.06);
  opacity: 0;
  animation: blog-cinematic-blur-in 1200ms cubic-bezier(0.22, 1, 0.36, 1) 400ms forwards;
}

.post-hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--info-text);
  overflow-wrap: anywhere;
}

/* Glow separator line under title */
.blog-hero-separator {
  width: 64px;
  height: 3px;
  margin-top: 1.5rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--info-accent), rgba(95, 201, 255, 0.3));
  box-shadow: 0 0 16px rgba(95, 201, 255, 0.35), 0 0 40px rgba(95, 201, 255, 0.12);
  opacity: 0;
  animation: blog-cinematic-glow-in 900ms var(--blog-ease) 850ms forwards;
}

/* Hero Description */
.blog-hero-description {
  max-width: 560px;
  margin-top: 1.25rem;
  color: var(--info-text-soft);
  font-size: 1.08rem;
  line-height: 1.65;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  overflow-wrap: break-word;
  word-break: break-word;
  opacity: 0;
  animation: blog-cinematic-slide-up 900ms var(--blog-ease) 1050ms forwards;
}

/* ═══════════════════════════════════════════════════════
   CINEMATIC ANIMATIONS
   ═══════════════════════════════════════════════════════ */

@keyframes blog-cinematic-blur-in {
  0% {
    opacity: 0;
    filter: blur(16px);
    transform: scale(1.04) translateY(10px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1) translateY(0);
  }
}

@keyframes blog-cinematic-slide-up {
  0% {
    opacity: 0;
    transform: translateY(24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blog-cinematic-fade-in {
  0% {
    opacity: 0;
    transform: translateX(-12px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes blog-cinematic-glow-in {
  0% {
    opacity: 0;
    width: 0;
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    width: 64px;
  }
}

.blog-content-block {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 3rem;
}

.blog-search-section {
  padding: 0 0 36px;
  animation: blog-rise-in 560ms var(--blog-ease) 80ms both;
}

.blog-search-label {
  display: block;
  margin-bottom: 10px;
  color: var(--info-text);
  font-weight: 700;
}

.blog-search-control {
  display: flex;
  align-items: stretch;
  max-width: 680px;
  overflow: hidden;
  border: 1px solid var(--info-border);
  border-radius: 8px;
  background: var(--info-panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
  transition: border-color var(--blog-fast) ease, box-shadow var(--blog-medium) var(--blog-ease), transform var(--blog-fast) ease;
}

.blog-search-control:focus-within {
  border-color: var(--info-border-strong);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.24), 0 0 0 3px rgba(0, 174, 239, 0.08);
  transform: translateY(-1px);
}

.blog-search-input {
  width: 100%;
  min-height: 52px;
  border: 0;
  background: transparent;
  color: var(--info-text);
  outline: 0;
  padding: 0 18px;
}

.blog-search-input::placeholder {
  color: var(--info-text-muted);
}

.blog-filter-toggle {
  min-width: 98px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--info-text);
  font-weight: 800;
  transition: background var(--blog-fast) ease, color var(--blog-fast) ease;
}

.blog-filter-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
}

.blog-filter-toggle.is-active,
.blog-filter-toggle[aria-expanded="true"] {
  color: var(--info-accent);
  background: rgba(0, 174, 239, 0.1);
}

.blog-filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  max-width: 680px;
  margin-top: 12px;
  border: 1px solid var(--info-border);
  border-radius: 8px;
  background: var(--info-panel);
  padding: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
  transform-origin: top left;
  transition: opacity var(--blog-medium) var(--blog-ease), transform var(--blog-medium) var(--blog-ease);
}

.blog-filter-panel.is-opening {
  animation: blog-filter-in var(--blog-medium) var(--blog-ease) both;
}

.blog-filter-panel[hidden] {
  display: none;
}

.blog-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-filter-group span {
  color: var(--info-text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.blog-filter-button {
  min-height: 36px;
  border: 1px solid var(--info-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--info-text-soft);
  padding: 0 13px;
  font-weight: 700;
  transition: border-color var(--blog-fast) ease, color var(--blog-fast) ease, background var(--blog-fast) ease, transform var(--blog-fast) ease, box-shadow var(--blog-fast) ease;
}

.blog-filter-button:hover,
.blog-filter-button.is-active {
  border-color: var(--info-border-strong);
  background: rgba(0, 174, 239, 0.12);
  color: var(--info-accent);
}

.blog-filter-button:hover {
  transform: translateY(-1px);
}

.blog-filter-button:active {
  transform: translateY(0);
}

.blog-search-status {
  margin-top: 10px;
  color: var(--info-text-muted);
  font-size: 0.92rem;
  transition: color var(--blog-fast) ease;
}

.blog-results {
  padding-bottom: 96px;
}

.blog-post-section {
  margin-top: 34px;
  animation: blog-rise-in 560ms var(--blog-ease) 130ms both;
}

.blog-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--info-border);
  padding-bottom: 12px;
}

.blog-section-header h2 {
  margin: 0;
  color: var(--info-text);
  font-size: 1.4rem;
  line-height: 1.15;
}

.blog-section-header span {
  color: var(--info-text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 18px 0 0;
}

.blog-empty-state {
  margin-bottom: 96px;
  border: 1px solid var(--info-border);
  border-radius: 8px;
  background: var(--info-panel);
  padding: 30px;
  animation: blog-rise-in var(--blog-medium) var(--blog-ease) both;
}

.blog-empty-state h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.blog-empty-state p {
  margin: 0;
  color: var(--info-text-soft);
}

.blog-featured {
  margin-bottom: 18px;
  animation: blog-rise-in 580ms var(--blog-ease) 120ms both;
}

.blog-featured .post-card {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
}

.post-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--info-border);
  border-radius: 8px;
  background: var(--info-panel);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  isolation: isolate;
  transition: border-color var(--blog-medium) var(--blog-ease), transform var(--blog-medium) var(--blog-ease), background var(--blog-medium) var(--blog-ease), box-shadow var(--blog-medium) var(--blog-ease);
}

.post-card::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(0, 174, 239, 0.13), transparent 38%);
  content: "";
  opacity: 0;
  transition: opacity var(--blog-medium) var(--blog-ease);
}

.post-card:hover {
  border-color: var(--info-border-strong);
  background: var(--info-panel-strong);
  box-shadow: 0 30px 78px rgba(0, 0, 0, 0.28);
  transform: translateY(-5px);
}

.post-card:hover::after,
.post-card:focus-within::after {
  opacity: 1;
}

.post-card:focus-within {
  border-color: var(--info-border-strong);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.08), 0 26px 70px rgba(0, 0, 0, 0.24);
}

.post-card[hidden] {
  display: none;
}

.post-card-media {
  aspect-ratio: 16 / 10;
  background: var(--info-surface);
  overflow: hidden;
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 700ms var(--blog-ease), filter 700ms var(--blog-ease);
}

.post-card:hover .post-card-media img,
.post-card:focus-within .post-card-media img {
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.045);
}

.post-card-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  padding: 22px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 14px;
  color: var(--info-text-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.post-card h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--info-text);
  overflow-wrap: anywhere;
}

.post-card h2 a {
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: color var(--blog-fast) ease;
}

.post-card:hover h2 a,
.post-card:focus-within h2 a {
  color: var(--info-accent);
}

.post-card p {
  margin: 14px 0 22px;
  color: var(--info-text-soft);
  overflow-wrap: anywhere;
}

.post-read-more {
  margin-top: auto;
  color: var(--info-accent);
  font-weight: 700;
  transition: transform var(--blog-fast) ease, color var(--blog-fast) ease;
}

.post-read-more:hover,
.post-read-more:focus-visible {
  transform: translateX(3px);
}

.post-page {
  padding-bottom: 92px;
}

.post-hero {
  padding-bottom: 36px;
}

.post-hero h1 {
  font-size: clamp(2.25rem, 6vw, 4.8rem);
}

.post-hero .post-meta {
  margin-bottom: 18px;
}

.post-hero p {
  max-width: 760px;
  margin-top: 24px;
  color: var(--info-text-soft);
  font-size: 1.12rem;
}

.post-featured-image {
  overflow: hidden;
  margin: 10px auto 52px;
  border: 1px solid var(--info-border);
  border-radius: 8px;
  box-shadow: var(--info-shadow);
  animation: blog-rise-in 540ms var(--blog-ease) 120ms both;
}

.post-featured-image img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
}

.post-content {
  max-width: 780px;
  margin: 0 auto;
  color: var(--info-text-soft);
  font-size: 1.05rem;
  animation: blog-rise-in 540ms var(--blog-ease) 180ms both;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content figure {
  margin: 0 0 24px;
}

.post-content h2,
.post-content h3 {
  margin: 42px 0 16px;
  line-height: 1.15;
}

.post-content h2 {
  font-size: 1.85rem;
}

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

.post-content a {
  color: var(--info-accent);
  font-weight: 700;
}

.post-content ul,
.post-content ol {
  padding-left: 1.35rem;
}

.post-content blockquote {
  border-left: 3px solid var(--info-accent);
  padding-left: 20px;
  color: var(--info-text-soft);
}

.post-content figure img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.18);
}

.post-content figcaption {
  margin-top: 8px;
  color: var(--info-text-muted);
  font-size: 0.9rem;
}

.blog-page a:focus-visible,
.blog-page button:focus-visible,
.blog-search-input:focus-visible {
  outline: 2px solid var(--info-accent);
  outline-offset: 3px;
}

@keyframes blog-rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blog-filter-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — Blog Hero + Layout
   ═══════════════════════════════════════════════════════ */

@media (max-width: 1280px) {
  .blog-hero {
    min-height: clamp(600px, 70vh, 680px);
    background-size: cover, cover, cover, min(1120px, 84vw) auto;
    background-position: center, center, center, right 52%;
  }

  .blog-hero-content {
    max-width: 560px;
  }
}

@media (max-width: 1024px) {
  .blog-hero {
    min-height: clamp(560px, 68vh, 640px);
    background-size: cover, cover, cover, min(980px, 92vw) auto;
    background-position: center, center, center, right center;
  }

  .blog-hero-title {
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
    line-height: 0.96;
    max-width: 100%;
  }

  .blog-hero-content {
    max-width: 500px;
    padding-top: 9rem;
    padding-bottom: 3.5rem;
  }

  .blog-hero-description {
    font-size: 1rem;
    max-width: 100%;
  }
}

@media (max-width: 860px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blog-featured .post-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .blog-hero {
    min-height: auto;
    background-size: cover, cover, cover, min(760px, 118vw) auto;
    background-position: center, center, center, 72% center;
    background-image:
      linear-gradient(180deg,
        rgba(3, 13, 24, 0.95) 0%,
        rgba(3, 13, 24, 0.88) 35%,
        rgba(3, 13, 24, 0.72) 55%,
        rgba(3, 13, 24, 0.55) 100%),
      linear-gradient(90deg,
        rgba(3, 13, 24, 0.94) 0%,
        rgba(3, 13, 24, 0.65) 50%,
        rgba(3, 13, 24, 0.2) 100%),
      radial-gradient(circle at 72% 48%, rgba(0, 170, 255, 0.1), transparent 42%),
      url("../Imagenes/blog/FondoBlogV1.png");
  }

  .blog-hero::before {
    background:
      linear-gradient(180deg,
        rgba(4, 8, 14, 0.8) 0%,
        rgba(4, 8, 14, 0.15) 30%,
        rgba(4, 8, 14, 0.1) 60%,
        rgba(4, 8, 14, 0.7) 100%);
  }

  .blog-hero .blog-shell {
    width: calc(100% - 40px);
  }

  .blog-hero-content {
    max-width: 100%;
    padding-top: 8.5rem;
    padding-bottom: 3.5rem;
  }

  .blog-hero-title {
    font-size: clamp(2.2rem, 8vw, 3.4rem);
    line-height: 1;
    max-width: 100%;
  }

  .blog-hero-description {
    font-size: 0.98rem;
    max-width: 100%;
  }

}

@media (max-width: 620px) {
  .blog-page .info-shell,
  .blog-shell {
    width: calc(100% - 32px);
    margin-right: auto;
    margin-left: auto;
    padding-right: 0;
    padding-left: 0;
  }

  .blog-main,
  .post-page {
    padding-top: 7rem;
  }

  .blog-main {
    padding-top: 6.35rem;
  }

  .blog-hero {
    min-height: auto;
    margin-top: -6.35rem;
    background-size: cover, cover, min(620px, 136vw) auto;
    background-position: center, center, 74% center;
    background-image:
      linear-gradient(180deg,
        rgba(3, 13, 24, 0.97) 0%,
        rgba(3, 13, 24, 0.92) 40%,
        rgba(3, 13, 24, 0.8) 60%,
        rgba(3, 13, 24, 0.65) 100%),
      linear-gradient(90deg,
        rgba(3, 13, 24, 0.96) 0%,
        rgba(3, 13, 24, 0.75) 55%,
        rgba(3, 13, 24, 0.35) 100%),
      url("../Imagenes/blog/FondoBlogV1.png");
  }

  .blog-hero .blog-shell {
    width: calc(100% - 32px);
  }

  .blog-hero-content {
    padding-top: 7.5rem;
    padding-bottom: 2.75rem;
  }

  .blog-hero-title {
    font-size: clamp(1.85rem, 9vw, 2.8rem);
    line-height: 1.05;
    max-width: 100%;
  }

  .blog-kicker {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
  }

  .blog-hero-description {
    font-size: 0.92rem;
    max-width: 100%;
    line-height: 1.6;
  }

  .blog-hero-separator {
    margin-top: 1.1rem;
    width: 48px;
  }

  .blog-content-block {
    padding-top: 2.25rem;
  }

  .post-hero h1 {
    max-width: 100%;
    font-size: 1.78rem;
    line-height: 1.08;
    word-break: break-word;
  }

  .post-hero p {
    max-width: 100%;
    font-size: 1rem;
  }

  .post-card h2 {
    font-size: 1.08rem;
  }

  .post-card p {
    font-size: 0.98rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .blog-results {
    padding-bottom: 64px;
  }

  .blog-search-control {
    flex-direction: column;
  }

  .blog-filter-toggle {
    min-height: 44px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 0;
  }

  .blog-filter-panel {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .blog-hero {
    background-size: cover, cover, min(560px, 148vw) auto;
    background-position: center, center, 76% center;
  }

  .blog-hero-content {
    padding-top: 7rem;
    padding-bottom: 2.25rem;
  }

  .blog-hero-title {
    font-size: clamp(1.7rem, 8.5vw, 2.4rem);
    line-height: 1.08;
  }

  .blog-hero-description {
    font-size: 0.88rem;
    line-height: 1.55;
  }

  .blog-hero-separator {
    width: 40px;
    margin-top: 1rem;
  }

  .blog-kicker {
    font-size: 0.65rem;
  }

  .blog-kicker::before {
    width: 1.5rem;
  }
}

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