/* ==========================================================================
   hero 多版本公共外壳 hero-base.css
   职责：外壳布局 / 半透明主图照片底 / 可读性纱罩 / 统一数据条 / 低调版本切换控件
   各版本的视觉与文案样式见 assets/css/hero/hero-<key>.css（按需加载，一次只加载一套）
   ========================================================================== */

.hero-pick {
  position: relative;
  overflow: hidden;
  padding: 84px 0 56px;
  background:
    radial-gradient(720px 380px at 82% 12%, rgba(200, 169, 126, 0.14), transparent 62%),
    linear-gradient(180deg, #FAF4E8 0%, #F4ECDA 100%);
}

/* 半透明主图照片铺底：具体图片由 hero-loader.js 按主题随机注入（--hero-bg / --hero-bg-pos），此处为默认兜底 */
.hero-pick::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--hero-bg, url('../../img/hero-02-reading-20260901143036.jpg'));
  background-position: var(--hero-bg-pos, center 32%);
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.24;
}

/* 可读性纱罩：左侧文字区遮得多，右侧视觉区留更多照片质感 */
.hero-pick::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg,
    rgba(250, 244, 232, 0.94) 0%,
    rgba(250, 244, 232, 0.82) 42%,
    rgba(250, 244, 232, 0.55) 72%,
    rgba(244, 236, 218, 0.45) 100%);
}

.hero-pick > .container { position: relative; z-index: 3; }

/* 版本容器：默认隐藏，loader 选中后加 .is-on */
.hv { display: none; }
.hv.is-on { display: block; }

/* 版本根节点：清掉各版本自带的背景与留白，统一由外壳承载 */
.hero-pick .hroot { background: none; padding: 0; }

/* 版本自带 canvas 沉到纱罩之上、文案之下；文案浮在最上 */
.hv > canvas { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hv > *:not(canvas) { position: relative; z-index: 3; }

/* 低调版本切换控件：平时几乎隐形，hover 才显形 */
.hero-switch {
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: 4;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(94, 139, 126, 0.35);
  background: rgba(255, 253, 248, 0.5);
  color: #5E8B7E;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.28;
  transition: opacity .25s ease, background .25s ease, transform .35s ease;
}
.hero-switch:hover {
  opacity: 1;
  background: rgba(255, 253, 248, 0.95);
  transform: rotate(90deg);
}
.hero-switch:focus-visible { opacity: 1; outline: 2px solid var(--jade); outline-offset: 2px; }

@media (max-width: 860px) {
  .hero-pick { padding: 40px 0 56px; }
  .hero-pick::before { opacity: 0.4; background-position: center 25%; }
  .hero-pick::after {
    background: linear-gradient(180deg,
      rgba(250, 244, 232, 0.42) 0%,
      rgba(250, 244, 232, 0.78) 46%,
      rgba(244, 236, 218, 0.88) 100%);
  }
  .hero-switch { right: 12px; bottom: 8px; width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-switch { transition: none; }
}
