/* ============================================================
   全球文明史门户网站 — homepage.css
   首页专属样式：Hero 轮播区、文明区域卡片、最新文章列表
   ============================================================ */

/* ============================================================
   .hero — 全宽轮播区 (720px 高度)
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  height: 720px;
  overflow: hidden;
  margin-top: var(--header-height);
}

/* ---- 轮播幻灯片容器 ---- */
.hero__slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero__slide.active {
  opacity: 1;
}

/* ---- 深色叠加层 ---- */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(26, 14, 8, 0.45) 0%,
    rgba(26, 14, 8, 0.25) 40%,
    rgba(26, 14, 8, 0.65) 100%
  );
  pointer-events: none;
}

/* ---- 居中内容 ---- */
.hero__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  padding: var(--spacing-2xl) var(--padding-desktop);
  z-index: 2;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
  max-width: 900px;
  margin-bottom: var(--spacing-lg);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero__subtitle {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-normal);
  line-height: 1.6;
  max-width: 640px;
  margin-bottom: var(--spacing-xl);
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.hero__cta {
  padding: 14px 40px;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  background: linear-gradient(135deg, var(--gradient-from), var(--gradient-to));
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all var(--transition-base);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ---- 轮播指示点 ---- */
.hero__dots {
  position: absolute;
  bottom: var(--spacing-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--spacing-md);
  z-index: 3;
}

.hero__dot {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-base);
}

.hero__dot:hover {
  border-color: var(--color-white);
}

.hero__dot.active {
  background-color: var(--color-white);
  border-color: var(--color-white);
  transform: scale(1.2);
}

/* ---- 左右箭头 ---- */
.hero__arrows {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: var(--color-white);
  font-size: 20px;
  cursor: pointer;
  pointer-events: auto;
  transition: all var(--transition-base);
}

.hero__arrow:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.hero__arrow--prev {
  left: var(--spacing-xl);
}

.hero__arrow--next {
  right: var(--spacing-xl);
}

/* ============================================================
   .civ-zones — 文明区域卡片 (3列网格)
   ============================================================ */
.civ-zones {
  padding: var(--spacing-3xl) 0;
}

.civ-zones__heading {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.civ-zones__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.civ-zones__subtitle {
  font-size: var(--font-size-md);
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-normal);
}

/* ---- 3列网格 ---- */
.civ-zones__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
}

/* ---- 单张文明卡片 ---- */
.civ-card {
  position: relative;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-base),
              box-shadow var(--transition-base);
}

.civ-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.civ-card__image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.civ-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.civ-card:hover .civ-card__image img {
  transform: scale(1.05);
}

.civ-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 50%,
    rgba(26, 14, 8, 0.5) 100%
  );
}

.civ-card__icon {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  font-size: 20px;
  backdrop-filter: blur(2px);
}

.civ-card__body {
  padding: var(--spacing-lg);
}

.civ-card__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
  transition: color var(--transition-base);
}

.civ-card:hover .civ-card__title {
  color: var(--accent);
}

.civ-card__desc {
  font-size: var(--font-size-sm);
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.civ-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--accent);
  transition: color var(--transition-base),
              gap var(--transition-base);
}

.civ-card__link:hover {
  color: var(--accent-dark);
  gap: var(--spacing-md);
}

.civ-card__link .icon-svg {
  width: 14px;
  height: 14px;
}

/* ---- 各文明卡片顶部装饰条 ---- */
.civ-card--chinese  { border-top: 3px solid #9D2933; }
.civ-card--europe   { border-top: 3px solid #3D5A80; }
.civ-card--westasia { border-top: 3px solid #B8860B; }
.civ-card--modern   { border-top: 3px solid #34546D; }
.civ-card--japan    { border-top: 3px solid #2D5F4E; }
.civ-card--india    { border-top: 3px solid #C77A20; }

/* ============================================================
   .latest-articles — 最新文章列表
   ============================================================ */
.latest-articles {
  padding: var(--spacing-3xl) 0;
}

.latest-articles__heading {
  margin-bottom: var(--spacing-2xl);
}

.latest-articles__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.latest-articles__more {
  font-size: var(--font-size-sm);
  color: var(--accent);
  font-weight: var(--font-weight-medium);
}

.latest-articles__more:hover {
  color: var(--accent-dark);
}

/* ---- 文章列表 ---- */
.latest-articles__list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

/* ---- 单篇横向文章卡片 ---- */
.article-item {
  display: flex;
  gap: var(--spacing-lg);
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-base),
              box-shadow var(--transition-base);
}

.article-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.article-item__thumb {
  flex-shrink: 0;
  width: 240px;
  height: 160px;
  overflow: hidden;
}

.article-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.article-item:hover .article-item__thumb img {
  transform: scale(1.05);
}

.article-item__body {
  flex: 1;
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--spacing-sm);
}

.article-item__category {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--accent);
}

.article-item__category::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
}

.article-item__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-base);
}

.article-item:hover .article-item__title {
  color: var(--accent);
}

.article-item__summary {
  font-size: var(--font-size-sm);
  line-height: 1.7;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-item__meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
}

.article-item__meta-separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--color-border);
}

/* ============================================================
   响应式 — 平板 (≤1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .hero {
    height: 520px;
  }

  .hero__title {
    font-size: 32px;
  }

  .hero__subtitle {
    font-size: var(--font-size-md);
  }

  /* 文明卡片: 3列 → 2列 */
  .civ-zones__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-item__thumb {
    width: 200px;
    height: 150px;
  }
}

/* ============================================================
   响应式 — 手机 (≤768px)
   ============================================================ */
@media (max-width: 768px) {
  .hero {
    height: 420px;
  }

  .hero__title {
    font-size: 26px;
  }

  .hero__subtitle {
    font-size: var(--font-size-base);
  }

  .hero__content {
    padding: var(--spacing-xl) var(--padding-mobile);
  }

  .hero__cta {
    padding: 12px 32px;
    font-size: var(--font-size-base);
  }

  .hero__arrow {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .hero__arrow--prev { left: var(--spacing-md); }
  .hero__arrow--next { right: var(--spacing-md); }

  /* 文明卡片: 2列 → 1列 */
  .civ-zones {
    padding: var(--spacing-2xl) 0;
  }

  .civ-zones__grid {
    grid-template-columns: 1fr;
  }

  .civ-zones__title {
    font-size: 24px;
  }

  /* 文章列表卡片变为竖向 */
  .article-item {
    flex-direction: column;
  }

  .article-item__thumb {
    width: 100%;
    height: 200px;
  }

  .latest-articles {
    padding: var(--spacing-2xl) 0;
  }
}
