/**
 * ailhj-post-slider.css - 文章列表横向滚动组件样式
 */

/* ========== 组件整体 ========== */
.ailhj-post-slider {
}
.widget_ailhj_widget_post_slider {
  margin-bottom: 40px;
}
/* ========== 头部区域 ========== */
.ailhj-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.ailhj-slider-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ailhj-slider-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--main-color);
  margin: 0;
}

.ailhj-slider-tags {
  display: flex;
  align-items: center;
}

.ailhj-slider-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  border-radius: 20px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ailhj-slider-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(238, 90, 36, 0.3);
  color: #fff;
}

.ailhj-tags-list {
  position: relative;
  height: 18px;
  line-height: 18px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

.ailhj-tag-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(18px);
  transition: all 0.3s ease;
}

.ailhj-tag-item.active {
  opacity: 1;
  transform: translateY(0);
}

.ailhj-tag-arrow {
  width: 12px;
  height: 12px;
  fill: currentColor;
  opacity: 0.8;
  flex-shrink: 0;
}

.ailhj-slider-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 滚动通知 */
.ailhj-slider-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--muted-bg-color);
  border-radius: 20px;
  font-size: 13px;
  color: var(--muted-color);
  min-width: 350px;
  overflow: hidden;
}

.ailhj-notice-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ailhj-notice-icon svg {
  font-size: 14px;
  color: var(--ailhj-red);
}

.ailhj-notice-list {
  position: relative;
  height: 20px;
  line-height: 20px;
  overflow: hidden;
  flex: 1;
}

.ailhj-notice-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.ailhj-notice-item.active {
  opacity: 1;
  transform: translateY(0);
}

.ailhj-notice-item a {
  color: var(--muted-color);
  text-decoration: none;
}

.ailhj-notice-item a:hover {
  color: var(--ailhj-blue);
}

/* 更多链接 */
.ailhj-slider-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--muted-color);
  background: var(--muted-bg-color);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.ailhj-slider-more:hover {
  color: #fff;
  background: var(--ailhj-blue);
}

.ailhj-slider-more i {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.ailhj-slider-more:hover i {
  transform: translateX(2px);
}

/* ========== 文章列表容器 ========== */
.ailhj-slider-container {
  position: relative;
  background: var(--main-bg-color);
  padding: 20px;
  border-radius: 12px;
}

.ailhj-slider-track {
  display: grid;
  gap: 16px;
}

/* ========== 文章卡片 ========== */
.ailhj-post-card {
  background: transparent;
  overflow: hidden;
  transition: all 0.3s ease;
  padding: 0;
}

.ailhj-post-card:hover {
  transform: translateY(-4px);
}

.ailhj-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* 缩略图 - 保持正方形比例 */
.ailhj-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* 现代浏览器：保持 1:1 正方形比例 */
  overflow: hidden;
}

/* 备用方案：兼容不支持 aspect-ratio 的旧浏览器 */
@supports not (aspect-ratio: 1 / 1) {
  .ailhj-card-thumb {
    padding-bottom: 100%; /* 高度 = 宽度的 100%，形成正方形 */
    height: 0;
  }
  
  .ailhj-card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
  }
}

.ailhj-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.ailhj-card-price-tag {
  position: absolute;
  left: 0;
  top: 0;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  border-radius: 8px 0 8px 0;
}

/* 卡片内容 */
.ailhj-card-body {
  padding-top: 12px;
}

.ailhj-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--main-color);
  line-height: 1.5;
  height: 42px;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 元信息 */
.ailhj-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted-color);
}

.ailhj-meta-author {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ailhj-meta-author img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.ailhj-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ailhj-meta-views,
.ailhj-meta-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ailhj-meta-views i,
.ailhj-meta-time i {
  font-size: 12px;
}

/* ========== 响应式优化 ========== */
@media (max-width: 768px) {
  .ailhj-slider-header {
    align-items: flex-start;
    gap: 12px;
  }
  body{
    padding-bottom: 20px;
  }
  .ailhj-slider-right {
    justify-content: space-between;
  }
  .ailhj-slider-notice {
    display: none;
  }
  .ailhj-slider-header{
    margin-bottom: 10px;
  }
  
  /* 移动端：移除容器背景，恢复卡片独立样式 */
  .ailhj-slider-container {
    background: transparent;
    padding: 0;
  }
  
  .ailhj-post-card {
    background: var(--main-bg-color);
    padding: 10px;
    border-radius: 8px;
  }
}

@media (max-width: 480px) {
  .ailhj-slider-title {
    font-size: 18px;
  }

  .ailhj-card-body {
    padding: 10px 0;
  }

  .ailhj-card-title {
    font-size: 13px;
  }
  
  .ailhj-slider-track {
    display: grid;
    gap: 8px !important;
  }
}
