/* ═══════════════════════════════════════════════════════════
   ZSky AI — Blog Hero Image Component
   Dark gallery aesthetic with living light
   Pure CSS, no JS dependencies
   ═══════════════════════════════════════════════════════════ */

.blog-hero {
  --glow-1: rgba(56, 189, 248, 0.12);
  --glow-2: rgba(129, 140, 248, 0.08);
  --glow-3: rgba(192, 132, 252, 0.06);
  --frame-border: rgba(255, 255, 255, 0.06);
  --frame-shine: rgba(255, 255, 255, 0.03);

  position: relative;
  margin: 2.5rem 0;
  padding: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #08080f;
  isolation: isolate;

  /* Layered glow — the "living light" effect */
  box-shadow:
    0 0 0 1px var(--frame-border),
    0 4px 24px -4px rgba(0, 0, 0, 0.6),
    0 0 40px -8px var(--glow-1),
    0 0 80px -16px var(--glow-2);

  transition:
    box-shadow 0.6s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Gradient border — thin luminous edge */
.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.25) 0%,
    transparent 40%,
    transparent 60%,
    rgba(192, 132, 252, 0.2) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
  opacity: 0.7;
  transition: opacity 0.6s;
}

/* Corner accent dots — subtle gallery markers */
.blog-hero::after {
  content: '';
  position: absolute;
  top: 12px;
  right: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.4);
  box-shadow:
    -14px 0 0 rgba(129, 140, 248, 0.3),
    -28px 0 0 rgba(192, 132, 252, 0.2);
  z-index: 4;
  pointer-events: none;
  transition: opacity 0.4s;
}

/* ── Image ───────────────────────────────────────────────── */

.blog-hero img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 19px;
  object-fit: cover;
  aspect-ratio: auto;
  /* Prevent layout shift — reserve space while loading */
  min-height: 200px;
  background: linear-gradient(135deg, #08080f 0%, #0f0f1a 100%);
  transition:
    transform 0.7s cubic-bezier(0.23, 1, 0.32, 1),
    filter 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Handle loaded state — remove min-height placeholder */
.blog-hero img[src] {
  min-height: unset;
}

/* ── Caption (slides up on hover) ────────────────────────── */

.blog-hero figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.5rem 1.5rem 1.1rem;
  background: linear-gradient(
    to top,
    rgba(3, 3, 6, 0.92) 0%,
    rgba(3, 3, 6, 0.6) 50%,
    transparent 100%
  );
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(224, 224, 236, 0.5);
  z-index: 4;
  transform: translateY(100%);
  opacity: 0;
  transition:
    transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.blog-hero figcaption span {
  color: rgba(56, 189, 248, 0.7);
}

/* ── Hover state — the image comes alive ─────────────────── */

.blog-hero:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.12),
    0 8px 32px -4px rgba(0, 0, 0, 0.7),
    0 0 60px -8px rgba(56, 189, 248, 0.2),
    0 0 120px -16px rgba(129, 140, 248, 0.12),
    0 0 160px -32px rgba(192, 132, 252, 0.08);
}

.blog-hero:hover::before {
  opacity: 1;
}

.blog-hero:hover::after {
  opacity: 0;
}

.blog-hero:hover img {
  transform: scale(1.03);
  filter: brightness(1.08) saturate(1.05);
}

.blog-hero:hover figcaption {
  transform: translateY(0);
  opacity: 1;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
  .blog-hero {
    margin: 1.5rem -0.5rem;
    border-radius: 14px;
    box-shadow:
      0 0 0 1px var(--frame-border),
      0 4px 16px -4px rgba(0, 0, 0, 0.5),
      0 0 24px -8px var(--glow-1);
  }

  .blog-hero::before {
    border-radius: 14px;
  }

  .blog-hero::after {
    top: 8px;
    right: 10px;
    width: 5px;
    height: 5px;
  }

  .blog-hero img {
    border-radius: 13px;
    min-height: 140px;
    /* Ensure images don't overflow on small screens */
    max-height: 60vh;
    object-fit: cover;
  }

  .blog-hero figcaption {
    padding: 1.5rem 1rem 0.8rem;
    font-size: 0.7rem;
    /* Always visible on mobile — no hover on touch */
    transform: translateY(0);
    opacity: 1;
  }

  /* Disable hover effects on touch devices */
  .blog-hero:hover {
    transform: none;
  }

  .blog-hero:hover img {
    transform: none;
    filter: none;
  }
}

@media (max-width: 480px) {
  .blog-hero {
    /* Full-bleed on small phones */
    margin: 1.25rem -1rem;
    border-radius: 0;
  }

  .blog-hero::before {
    border-radius: 0;
  }

  .blog-hero::after {
    display: none;
  }

  .blog-hero img {
    border-radius: 0;
    max-height: 50vh;
  }

  .blog-hero figcaption {
    padding: 1.2rem 1rem 0.7rem;
    font-size: 0.65rem;
  }
}

/* Touch device detection — disable hover on touch */
@media (hover: none) {
  .blog-hero:hover {
    transform: none;
    box-shadow:
      0 0 0 1px var(--frame-border),
      0 4px 24px -4px rgba(0, 0, 0, 0.6),
      0 0 40px -8px var(--glow-1),
      0 0 80px -16px var(--glow-2);
  }

  .blog-hero:hover::before {
    opacity: 0.7;
  }

  .blog-hero:hover::after {
    opacity: 1;
  }

  .blog-hero:hover img {
    transform: none;
    filter: none;
  }

  .blog-hero figcaption {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ── Reduced motion ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .blog-hero,
  .blog-hero img,
  .blog-hero figcaption,
  .blog-hero::before {
    transition: none;
  }

  .blog-hero:hover {
    transform: none;
  }

  .blog-hero:hover img {
    transform: none;
    filter: none;
  }

  .blog-hero figcaption {
    transform: translateY(0);
    opacity: 1;
  }
}
