/* ============================================================
   cover.css - 封面图系统
   网站：kidsshoeshop.com
   类别：C9（育儿/家庭）
   十一层结构 / 光点动画 / 产品光晕 / 三级降级 / 16:9
   生成：建站AI · 2026-10-13
   ============================================================ */

/* ===== 1. 封面容器 ===== */
.cover-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-neutral-100);
}

.cover-container img,
.cover-container svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== 2. HSL 变量默认值（C9 育儿/家庭） ===== */
:root {
  --cover-bg-h: 30;
  --cover-bg-s: 40%;
  --cover-bg-l: 94%;
  --cover-accent-h: 25;
  --cover-accent-s: 70%;
  --cover-accent-l: 60%;
}

/* ===== 3. 光点动画 ===== */
.cover-light-dot {
  animation: light-blink var(--light-duration, 2.5s) ease-in-out infinite;
  transform-origin: center;
}

.cover-light-dot:nth-child(2n) {
  --light-duration: 3s;
  animation-delay: 0.5s;
}

.cover-light-dot:nth-child(3n) {
  --light-duration: 2s;
  animation-delay: 1s;
}

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

/* ===== 4. 产品光晕 ===== */
.cover-product {
  filter: drop-shadow(0 0 24px var(--cover-glow, hsla(25, 70%, 60%, 0.4)));
}

/* ===== 5. 三级降级 ===== */
.cover-fallback-bg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg,
    hsl(var(--cover-bg-h), var(--cover-bg-s), var(--cover-bg-l)) 0%,
    hsl(var(--cover-accent-h), var(--cover-accent-s), 80%) 100%);
  border-radius: var(--radius-md);
  padding: var(--rhythm-normal);
  text-align: center;
}

.cover-fallback-bg .fallback-title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: hsl(var(--cover-accent-h), var(--cover-accent-s), 25%);
  max-width: 90%;
  line-height: var(--leading-snug);
}

/* ===== 6. 响应式 ===== */
@media (max-width: 768px) {
  .cover-container { border-radius: var(--radius-sm); }
  .cover-light-dot { display: none; }
  .cover-light-dot:nth-child(-n+3) { display: inline; }
  .cover-fallback-bg .fallback-title { font-size: var(--text-base); }
}

/* ===== 7. 文章页横幅 ===== */
.article-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--rhythm-loose);
  background: var(--color-neutral-100);
}

.article-cover img,
.article-cover svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== 8. 列表页封面 ===== */
.card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
  background: var(--color-neutral-100);
}

.card-cover img,
.card-cover svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.card:hover .card-cover img,
.card:hover .card-cover svg {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .article-cover { border-radius: var(--radius-md); }
}
