/**
 * EverBloom 首页模板样式
 *
 * 作用域：所有规则限定在 .ebh-root 内，避免与主题其他页面的
 * Tailwind 预编译类、style.css 全局规则相互污染。
 */

.ebh-root {
  --EBH_INK: #171717;
  --EBH_INK_SOFT: #404040;
  --EBH_MUTED: #737373;
  --EBH_LIGHT: #a3a3a3;
  --EBH_RULE: #e5e5e5;
  --EBH_SURFACE: #fafafa;
  --EBH_RADIUS: 16px;
  background-color: #ffffff;
  color: var(--EBH_INK);
  font-family: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: visible;
}

.ebh-root *,
.ebh-root *::before,
.ebh-root *::after {
  box-sizing: border-box;
}

/* 使用 :where() 让基础重置保持 0 特异性，避免压过下方组件类的样式 */
.ebh-root :where(h1, h2, h3, h4, p, figure, blockquote) {
  margin: 0;
  font-family: inherit;
}

.ebh-root :where(h1, h2, h3) {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: inherit;
}

.ebh-root :where(a) {
  color: inherit;
  text-decoration: none;
}

.ebh-root :where(img) {
  display: block;
  max-width: 100%;
}

.ebh-root :where(ul) {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 锚点滚动时避开主题的 sticky 头部 */
.ebh-root section[id] {
  scroll-margin-top: 96px;
}

/* =========================================================
 * 通用排版与布局
 * ========================================================= */

.ebh-section {
  max-width: 72rem;
  margin-inline: auto;
  padding-block: clamp(56px, 8vw, 96px);
  padding-inline: clamp(16px, 4vw, 40px);
}

.ebh-band {
  background-color: var(--EBH_SURFACE);
  padding-block: clamp(56px, 8vw, 96px);
}

.ebh-band__inner {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

.ebh-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--EBH_LIGHT);
}

.ebh-title {
  margin-top: 12px;
  font-size: clamp(1.75rem, 4.4vw, 3rem);
  line-height: 1.1;
}

.ebh-copy {
  margin-top: 20px;
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  line-height: 1.7;
  color: var(--EBH_INK_SOFT);
}

.ebh-text-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--EBH_INK);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--EBH_LIGHT);
  transition: text-decoration-color 0.25s ease;
}

.ebh-text-link:hover {
  text-decoration-color: var(--EBH_INK);
}

.ebh-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

/* 移动端隐藏「View all / Shop all」，与设计稿一致 */
.ebh-head__link {
  display: none;
  white-space: nowrap;
}

.ebh-head--stack {
  display: block;
  max-width: 42rem;
}

.ebh-head--center {
  display: block;
  max-width: 42rem;
  margin-inline: auto;
  text-align: center;
}

/* =========================================================
 * 1) Hero
 * ========================================================= */

.ebh-hero {
  /* 首屏高度减半：上下内边距缩小为原值的一半 */
  padding: clamp(24px, 3.5vw, 48px) 16px 2px;
  text-align: center;
}

.ebh-hero__title {
  max-width: 48rem;
  margin-inline: auto;
  /* 主标题字号调小，适配较长的中文标语 */
  font-size: clamp(1.5rem, 4.5vw, 2.75rem);
  line-height: 1.25;
}

.ebh-hero__lede {
  max-width: 36rem;
  margin: clamp(12px, 1.8vw, 18px) auto 0;
  font-size: clamp(0.9375rem, 1.6vw, 1.0625rem);
  line-height: 1.6;
}

/* =========================================================
 * 2) 图片轮播（曲线遮罩 + 拖拽轨道）
 * ========================================================= */

.ebh-marquee {
  position: relative;
  overflow: hidden;
  padding-block: 16px;
  background-color: #ffffff;
}

.ebh-marquee__curve {
  position: absolute;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 10;
  pointer-events: none;
}

.ebh-marquee__curve--top {
  top: 0;
}

.ebh-marquee__curve--bottom {
  bottom: 0;
}

.ebh-marquee__curve svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ebh-marquee__track {
  display: flex;
  width: max-content;
  gap: 12px;
  padding-block: 16px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}

.ebh-marquee__track.ebh-marquee--dragging {
  cursor: grabbing;
}

.ebh-marquee__item {
  flex: 0 0 auto;
  width: 240px;
  height: 320px;
  border-radius: var(--EBH_RADIUS);
  overflow: hidden;
}

.ebh-marquee__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* =========================================================
 * 3) 首屏底部文案
 * ========================================================= */

.ebh-intro {
  max-width: 42rem;
  margin-inline: auto;
  padding: 8px 16px clamp(56px, 7vw, 80px);
  text-align: center;
}

.ebh-intro__text {
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.ebh-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 32px;
  margin-top: 24px;
}

/* =========================================================
 * 4) 品牌理念
 * ========================================================= */

.ebh-philosophy {
  display: grid;
  gap: 40px;
  align-items: center;
}

.ebh-media {
  border-radius: var(--EBH_RADIUS);
  overflow: hidden;
}

.ebh-media--4x3 {
  aspect-ratio: 4 / 3;
}

.ebh-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 可点击的媒体图片：铺满容器，保持原有裁切比例 */
.ebh-media__link {
  display: block;
  width: 100%;
  height: 100%;
}

.ebh-pillars {
  display: grid;
  gap: 40px;
  margin-top: 64px;
}

.ebh-pillar {
  border-top: 1px solid var(--EBH_RULE);
  padding-top: 24px;
}

.ebh-pillar__index {
  font-size: 14px;
  font-weight: 600;
  color: var(--EBH_MUTED);
}

.ebh-pillar__title {
  margin-top: 8px;
  font-size: 20px;
}

.ebh-pillar__copy {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--EBH_INK_SOFT);
}

/* =========================================================
 * 4.5) 设计工艺（整幅说明长图）
 * ========================================================= */

/* 该区块标题与说明文案略小于其他区块 */
#craftsmanship .ebh-title {
  font-size: clamp(1.375rem, 2.8vw, 2rem);
}

#craftsmanship .ebh-copy {
  font-size: clamp(0.875rem, 1.4vw, 1rem);
}

.ebh-craft {
  margin-top: 40px;
  border-radius: var(--EBH_RADIUS);
  overflow: hidden;
  /* 与图中米色底保持接近，图片加载前不会出现突兀的白块 */
  background-color: #f6ece2;
}

.ebh-craft img {
  display: block;
  width: 100%;
  height: auto;
}

/* =========================================================
 * 5/6) 系列与商品卡片
 * ========================================================= */

.ebh-grid {
  display: grid;
  gap: 16px;
  margin-top: 40px;
}

.ebh-grid--collections {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 博客文章：移动端单列，平板两列，桌面三列 */
.ebh-grid--posts {
  grid-template-columns: minmax(0, 1fr);
}

/* 博客文章卡片封面：固定 2:3 竖版比例 */
.ebh-card__media.ebh-media--post {
  aspect-ratio: 2 / 3;
}

/* 新品展示：复用商店页 .bw-shop-grid 网格，仅补充上间距 */
.ebh-new-arrivals-grid {
  margin-top: 40px;
}

.ebh-card {
  display: block;
}

.ebh-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--EBH_RADIUS);
  overflow: hidden;
  background-color: #ffffff;
}

.ebh-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.ebh-card:hover .ebh-card__media img,
.ebh-product:hover .ebh-card__media img {
  transform: scale(1.05);
}

.ebh-card__eyebrow {
  margin-top: 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--EBH_LIGHT);
}

.ebh-card__title {
  margin-top: 4px;
  font-size: clamp(0.95rem, 1.7vw, 1.125rem);
  transition: color 0.25s ease;
}

.ebh-card:hover .ebh-card__title {
  color: var(--EBH_MUTED);
}

.ebh-card__meta {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--EBH_MUTED);
}

.ebh-product {
  display: flex;
  flex-direction: column;
}

.ebh-product__body {
  flex: 1 1 auto; /* 撑满剩余空间，使同排卡片的按钮底部对齐 */
  margin-top: 16px;
}

.ebh-product__title {
  font-size: clamp(0.875rem, 1.6vw, 1rem);
}

.ebh-product__price {
  margin-top: 4px;
  font-size: 14px;
}

.ebh-product__price strong {
  font-weight: 600;
}

.ebh-product__price del {
  margin-left: 6px;
  font-size: 12px;
  color: var(--EBH_LIGHT);
}

.ebh-products-empty {
  padding: 24px 0;
  font-size: 14px;
  color: var(--EBH_MUTED);
}

/* 商品轮播：横向轨道；位于 .ebh-band__inner 之外，左右直接铺满屏幕宽度
 * 脚本未就绪时保留原生横向滚动作为兜底 */
.ebh-products-carousel {
  position: relative;
  margin-top: 40px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ebh-products-carousel::-webkit-scrollbar {
  display: none;
}

/* 脚本复制卡片并接管滚动后，改为隐藏溢出 */
.ebh-products-carousel--loop {
  overflow: hidden;
}

.ebh-products-track {
  display: flex;
  gap: 16px;
  width: max-content;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  will-change: transform;
}

.ebh-products-track.ebh-products--dragging {
  cursor: grabbing;
}

/* 图片不参与拖拽虚影与指针事件，保证指针事件落在轨道上 */
.ebh-products-track img {
  -webkit-user-drag: none;
  pointer-events: none;
}

/* 卡片固定宽度：轮播需要确定步进宽度，不随容器收缩 */
.ebh-products-track .ebh-product {
  flex: 0 0 auto;
  width: clamp(228px, 68vw, 280px);
}

.ebh-product__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 9999px;
  background-color: var(--EBH_INK);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ebh-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px 16px;
  border: 1px solid var(--EBH_INK);
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  color: var(--EBH_INK);
  background-color: transparent;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.ebh-btn:hover {
  background-color: var(--EBH_INK);
  color: #ffffff;
}

/* =========================================================
 * 7) 场景展示
 * ========================================================= */

.ebh-scenes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 40px;
}

.ebh-scene {
  position: relative;
  border-radius: var(--EBH_RADIUS);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.ebh-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.ebh-scene:hover img {
  transform: scale(1.05);
}

.ebh-scene__caption {
  position: absolute;
  left: 16px;
  bottom: 16px;
  color: #ffffff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.ebh-scene__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
}

.ebh-scene__title {
  font-size: 14px;
  font-weight: 600;
}

.ebh-scenes__more {
  margin-top: 32px;
  text-align: center;
}

/* =========================================================
 * 8) 用户评价
 * ========================================================= */

.ebh-reviews {
  display: grid;
  gap: 40px;
  margin-top: 48px;
}

.ebh-quote {
  border-top: 1px solid var(--EBH_RULE);
  padding-top: 24px;
}

.ebh-quote__text {
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  line-height: 1.7;
}

.ebh-quote__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.ebh-quote__avatar {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  object-fit: cover;
  flex: 0 0 auto;
}

.ebh-quote__name {
  font-size: 14px;
  font-weight: 600;
}

.ebh-quote__role {
  font-size: 12px;
  color: var(--EBH_MUTED);
}

/* =========================================================
 * 9) 品牌故事
 * ========================================================= */

.ebh-story {
  display: grid;
  gap: 40px;
  align-items: center;
}

/* 品牌起源主标题略小，避免长句换行过多 */
#story .ebh-title {
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  line-height: 1.3;
}

.ebh-media--story {
  aspect-ratio: 4 / 3;
}

.ebh-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--EBH_RULE);
}

.ebh-stat__value {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.ebh-stat__label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--EBH_MUTED);
}

/* =========================================================
 * 10) 邮件订阅
 * ========================================================= */

.ebh-newsletter {
  background-color: var(--EBH_INK);
  color: #ffffff;
  padding-block: clamp(56px, 8vw, 96px);
}

.ebh-newsletter__inner {
  max-width: 42rem;
  margin-inline: auto;
  padding-inline: 16px;
  text-align: center;
}

.ebh-newsletter__title {
  font-size: clamp(1.75rem, 4.4vw, 3rem);
  line-height: 1.1;
}

.ebh-newsletter__lede {
  margin-top: 16px;
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  line-height: 1.7;
  color: #d4d4d4;
}

.ebh-subscribe {
  max-width: 28rem;
  margin: 32px auto 0;
}

.ebh-subscribe__row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ebh-subscribe__input {
  flex: 1 1 auto;
  width: 100%;
  padding: 12px 20px;
  border: 1px solid #525252;
  border-radius: 9999px;
  background-color: transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 0.25s ease;
}

.ebh-subscribe__input::placeholder {
  color: #737373;
}

.ebh-subscribe__input:focus {
  outline: none;
  border-color: #ffffff;
}

.ebh-subscribe__btn {
  padding: 12px 24px;
  border: 0;
  border-radius: 9999px;
  background-color: #ffffff;
  color: var(--EBH_INK);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

.ebh-subscribe__btn:hover {
  background-color: #e5e5e5;
}

.ebh-subscribe__btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.ebh-subscribe__turnstile {
  margin-bottom: 12px;
}

/* 蜜罐字段移出视口，正常用户不可见 */
.ebh-honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* 主题订阅脚本输出的提示信息样式 */
.ebh-root .bw-subscribe-message {
  margin-top: 12px;
  min-height: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: #d4d4d4;
  text-align: center;
}

.ebh-root .bw-subscribe-message--success {
  color: #86efac;
}

.ebh-root .bw-subscribe-message--error {
  color: #fca5a5;
}

/* 无障碍辅助文本：仅屏幕阅读器可见 */
.ebh-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
 * 滚动显现动画
 * move-safe：仅在 JS 就绪（.ebh-reveal-enabled）时才隐藏内容，
 * 避免脚本被拦截时页面正文不可见。
 * ========================================================= */

.ebh-root.ebh-reveal-enabled .ebh-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.ebh-root.ebh-reveal-enabled .ebh-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
 * 响应式断点
 * ========================================================= */

@media (min-width: 640px) {
  .ebh-marquee__curve {
    height: 100px;
  }

  /* 博客文章：平板两列 */
  .ebh-grid--posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ebh-marquee__track {
    gap: 16px;
  }

  .ebh-marquee__item {
    width: 320px;
    height: 512px;
  }

  .ebh-head__link {
    display: inline-block;
  }

  .ebh-grid {
    gap: 24px;
    margin-top: 56px;
  }

  /* 设计工艺图片与其余版块保持一致的间距节奏 */
  .ebh-craft {
    margin-top: 56px;
  }

  /* 商品轮播：与网格保持一致的间距与卡片尺寸 */
  .ebh-products-carousel {
    margin-top: 56px;
  }

  .ebh-products-track {
    gap: 24px;
  }

  .ebh-products-track .ebh-product {
    width: 300px;
  }

  .ebh-pillars {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    margin-top: 80px;
  }

  .ebh-pillar__copy {
    font-size: 16px;
  }

  .ebh-card__meta {
    font-size: 14px;
  }

  .ebh-product__price {
    font-size: 16px;
  }

  .ebh-product__price del {
    font-size: 14px;
  }

  .ebh-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ebh-stat__label {
    font-size: 14px;
  }

  .ebh-subscribe__row {
    flex-direction: row;
  }
}

@media (min-width: 768px) {
  .ebh-philosophy {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 64px;
  }

  .ebh-scenes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 56px;
  }

  .ebh-scene--feature {
    grid-row: span 2;
    aspect-ratio: auto;
  }

  .ebh-scene--wide {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
  }

  .ebh-reviews {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    margin-top: 64px;
  }

  .ebh-story {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 64px;
  }

  /* 移动端图片在前，桌面端恢复「文案左 / 图片右」 */
  .ebh-story__media {
    margin-top: 0;
  }

  .ebh-media--story {
    aspect-ratio: 4 / 5;
  }
}

@media (min-width: 1024px) {
  .ebh-grid--collections {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  /* 博客文章：桌面三列 */
  .ebh-grid--posts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* 商品轮播：桌面端加宽卡片，露出下一张卡片提示可滑动 */
  .ebh-products-track .ebh-product {
    width: 320px;
  }

  .ebh-scene--wide {
    aspect-ratio: 21 / 9;
  }
}

/* 移动端：品牌故事图片置顶（等价于设计稿的 order 交换） */
@media (max-width: 767px) {
  .ebh-story__media {
    order: -1;
  }
}

/* 尊重系统的减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .ebh-root.ebh-reveal-enabled .ebh-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .ebh-card__media img,
  .ebh-scene img {
    transition: none;
  }
}
