/* 防止横向滚动条 */
html,
body {
  overflow-x: hidden;
}

/* 首页 Hero */
.hero {
  position: relative !important;
  isolation: isolate;

  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;

  min-height: calc(100vh - 64px) !important;

  padding-left: max(32px, calc((100vw - 1120px) / 2)) !important;
  padding-right: max(32px, calc((100vw - 1120px) / 2)) !important;

  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;

  box-sizing: border-box !important;
  overflow: hidden !important;

  --hero-bg-opacity: 1;
  --hero-bg-blur: 0px;
  --hero-text-opacity: 1;
  --hero-text-y: 0px;
}

/* 背景图层 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;

  background-image:
    linear-gradient(
      90deg,
      rgba(0, 12, 32, 0.58) 0%,
      rgba(0, 12, 32, 0.38) 32%,
      rgba(0, 12, 32, 0.08) 62%,
      rgba(0, 12, 32, 0.02) 100%
    ),
    linear-gradient(
      180deg,
      rgba(0, 12, 32, 0.05) 0%,
      rgba(255, 255, 255, 0.10) 65%,
      rgba(255, 255, 255, 0.88) 100%
    ),
    url("/img/index_bg.jpg");

  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;

  opacity: var(--hero-bg-opacity);
  filter: blur(var(--hero-bg-blur)) saturate(1.08) contrast(1.04);
  transform: scale(1.04);
  will-change: opacity, filter, transform;
}

/* Hero 文字 */
.hero .title,
.hero .description {
  position: relative;
  z-index: 1;

  opacity: var(--hero-text-opacity);
  transform: translateY(var(--hero-text-y));
  will-change: opacity, transform;
}

.hero .title {
  color: rgba(235, 248, 255, 0.95) !important;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.35),
    0 8px 32px rgba(0, 20, 60, 0.55);
}

.hero .description {
  color: #ffffff !important;
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.42),
    0 10px 36px rgba(0, 20, 60, 0.68);
}

/* 默认情况下，所有文章列表都正常显示 */
.section-title,
.post-list {
  opacity: 1;
  transform: none;
}

/* 只在首页启用 Latest Posts 的滚动淡入效果 */
body:has(.hero) #main-content > .container > .section-title,
body:has(.hero) #main-content > .container > .post-list {
  opacity: var(--home-content-opacity, 1);
  transform: translateY(var(--home-content-y, 0px));
  transition: opacity 0.12s linear, transform 0.12s linear;
  will-change: opacity, transform;
}

/* Giscus comments layout fix */
.giscus-comments {
  width: min(100% - 48px, 860px);
  margin: 96px auto 72px auto;
  padding-top: 40px;
  border-top: 1px solid rgba(120, 150, 180, 0.22);
  box-sizing: border-box;
}

.giscus-comments h2 {
  font-size: 24px;
  font-weight: 650;
  color: var(--color-text-primary);
}

/* Giscus iframe */
.giscus-comments .giscus,
.giscus-comments iframe {
  width: 100% !important;
}

/* Prevent footer from sticking too close to comments */
footer {
  margin-top: 80px;
}