/* ==========================================================================
   Firefly Hexo Theme - banner.css
   Wallpaper / banner display styles (ported from Firefly).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Wallpaper Wrapper
   -------------------------------------------------------------------------- */

#wallpaper-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--banner-height) + var(--banner-height-extend));
  overflow: hidden;
  z-index: 0;
}

/* --------------------------------------------------------------------------
   Banner Image Slides
   -------------------------------------------------------------------------- */

.banner-image-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  width: 100%;
  height: 100%;
}

.banner-image-slide picture,
.banner-image-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-image-slide.active {
  opacity: 1;
}

/* Ken Burns effect on the active slide */
.banner-image-slide.active {
  animation: ken-burns 20s ease-in-out infinite alternate;
}

@keyframes ken-burns {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}

/* --------------------------------------------------------------------------
   Dim Overlay
   -------------------------------------------------------------------------- */

#banner-dim-container {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

/* Stronger dim for readability when text is placed over the banner */
#banner-dim-container.strong-dim {
  background: rgba(0, 0, 0, 0.45);
}

/* --------------------------------------------------------------------------
   Banner Overlay Container (text / content over banner)
   -------------------------------------------------------------------------- */

#banner-overlay-container {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 2rem;
  padding-bottom: 120px;
  text-align: center;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Home Text (displayed on homepage in banner area)
   -------------------------------------------------------------------------- */

.home-text-title {
  font-size: var(--home-text-title-size, 3.8rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: white;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.15);
}

.home-text-subtitle {
  font-size: var(--home-text-subtitle-size, 1.5rem);
  font-weight: 400;
  min-height: 1.2em;
  opacity: 0.9;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

/* Typewriter cursor effect for subtitle */
.home-text-subtitle .typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: white;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink-cursor 0.8s step-end infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --------------------------------------------------------------------------
   Post Meta Overlay (post pages in banner mode)
   -------------------------------------------------------------------------- */

.banner-post-meta {
  width: 100%;
  max-width: 820px;
}

.banner-post-meta h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  color: white;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.banner-post-meta .meta-info {
  display: flex;
  gap: 1rem;
  align-items: center;
  opacity: 0.8;
  font-size: 0.875rem;
  flex-wrap: wrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.banner-post-meta .meta-info time,
.banner-post-meta .meta-info .word-count,
.banner-post-meta .meta-info .reading-time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.banner-post-meta .meta-info .divider {
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

/* Post meta overlay (simplified layout used in banner) */
.post-meta-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 820px;
}

.post-meta-overlay .post-meta-title {
  font-size: var(--banner-post-title-size, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.25;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.post-meta-overlay .post-meta-info {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.875rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.post-meta-overlay .post-meta-info span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.post-meta-overlay .post-meta-info span i {
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Fullscreen Mode
   -------------------------------------------------------------------------- */

.wallpaper-fullscreen {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 100vh !important;
  z-index: 0;
}

.wallpaper-fullscreen #banner-overlay-container {
  display: flex !important;
}

/* --------------------------------------------------------------------------
   Overlay Mode (wallpaper covers entire viewport behind content, blurred)
   -------------------------------------------------------------------------- */

.wallpaper-overlay {
  position: fixed !important;
  inset: 0 !important;
  height: 100vh !important;
  z-index: -1;
}

.wallpaper-overlay img,
.wallpaper-overlay .banner-image-slide {
  filter: blur(var(--overlay-blur, 10px)) brightness(0.7);
  opacity: var(--overlay-opacity, 0.8);
}

.wallpaper-overlay #banner-dim-container {
  background: rgba(0, 0, 0, 0.25);
}

.wallpaper-overlay #banner-overlay-container {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Transparent wallpaper body class
   -------------------------------------------------------------------------- */
.wallpaper-transparent #main-content-wrapper {
  top: 5.5rem !important;
}

/* --------------------------------------------------------------------------
   No-banner-layout (solid background, no wallpaper)
   -------------------------------------------------------------------------- */
.no-banner-layout #wallpaper-wrapper {
  display: none !important;
}

.no-banner-layout #main-content-wrapper {
  top: 5.5rem !important;
}

/* --------------------------------------------------------------------------
   Responsive: Banner heights & text sizes
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  #banner-overlay-container {
    padding: 1rem;
    padding-bottom: 70px;
  }

  .home-text-title {
    font-size: 1.75rem;
  }

  .home-text-subtitle {
    font-size: 1rem;
  }

  .banner-post-meta h1 {
    font-size: 1.5rem;
  }

  .banner-post-meta .meta-info {
    font-size: 0.8125rem;
    gap: 0.5rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .home-text-title {
    font-size: 2.5rem;
  }

  .home-text-subtitle {
    font-size: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   Banner Slide Transitions
   -------------------------------------------------------------------------- */

/* Fade transition between slides */
.banner-image-slide.fade-out {
  opacity: 0;
}

.banner-image-slide.fade-in {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Scroll Down Indicator (optional, on homepage banner)
   -------------------------------------------------------------------------- */

.scroll-down-indicator {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: rgba(255, 255, 255, 0.7);
  animation: bounce-down 2s ease-in-out infinite;
  cursor: pointer;
  background: none;
  border: none;
}

.scroll-down-indicator svg {
  width: 1.5rem;
  height: 1.5rem;
}

@keyframes bounce-down {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-8px);
  }
  60% {
    transform: translateX(-50%) translateY(-4px);
  }
}

/* --------------------------------------------------------------------------
   Banner Transition: hide wallpaper wrapper when no banner
   -------------------------------------------------------------------------- */

.no-banner-layout #wallpaper-wrapper {
  display: none;
}

.enable-banner #wallpaper-wrapper {
  display: block;
}

/* --------------------------------------------------------------------------
   Page Title Overlay & Subtitles (Archive, Category, Tag etc.)
   -------------------------------------------------------------------------- */

.page-title-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 820px;
}

.page-title-overlay .page-title {
  font-size: var(--banner-post-title-size, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.25;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.page-title-overlay .page-subtitle {
  font-size: 1.1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  margin-top: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.25rem 1rem;
  border-radius: var(--radius-full, 999px);
  display: inline-block;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
  .page-title-overlay .page-title {
    font-size: 1.75rem;
  }
  .page-title-overlay .page-subtitle {
    font-size: 0.9rem;
    padding: 0.15rem 0.75rem;
  }
}