/* ==========================================================================
   文章详情页 / 案例页 · 相关文章（Related Articles）
   --------------------------------------------------------------------------
   为什么单独一个文件：这段样式原来写在 home-v2.css 里，而 home-v2.css 只在首页
   加载（header.blade.php 里的 @if(Request::is('/'))），文章页根本没引到它，
   模块就一直以浏览器默认的「圆点 + 蓝链接」裸奔。

   内容由 app/Helpers/publics.php::related_posts() 生成：
   优先读 related_articles_map 表（离线算好的主题相似度），
   表里没有的（刚发布的新文章）用同行业 + 同形态兜底。
   ========================================================================== */

.ws-related {
  max-width: 1206px;
  margin: 56px auto 8px;
  padding: 40px 0 0;
  border-top: 1px solid var(--ws-line, #eef0f3);
}

.ws-related-head {
  margin-bottom: 24px;
}

/* .ws-eyebrow 定义在 home-v2.css（只在首页加载），这里自带一份，
   避免文章页再出现「样式没引到」的情况。 */
.ws-related .ws-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ws-red, #e60112);
}

.ws-related .ws-eyebrow::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--ws-red-grad, linear-gradient(135deg, #f34a2f, #e60112));
}

.ws-related-tit {
  margin: 0;
  font-size: 26px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ws-ink, #1a1f2b);
}

.ws-related-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 5 条时是 2+2+1：让落单的最后一条铺满整行，避免右下角空一块 */
.ws-related-item:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.ws-related-item {
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: none;
}

.ws-related-item > a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 20px 22px;
  border: 1px solid var(--ws-line, #eef0f3);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ws-related-item > a:hover {
  border-color: rgba(230, 1, 18, 0.28);
  box-shadow: 0 10px 26px rgba(18, 28, 46, 0.07);
  transform: translateY(-2px);
}

.ws-related-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ws-ink, #1a1f2b);
  text-decoration: none;
}

.ws-related-item > a:hover .ws-related-name {
  color: var(--ws-red, #e60112);
}

.ws-related-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ws-body, #5b6470);
}

.ws-related-more {
  margin-top: auto;
  padding-top: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--ws-red, #e60112);
}

@media (max-width: 768px) {
  .ws-related {
    margin-top: 36px;
    padding-top: 28px;
  }

  .ws-related-tit {
    font-size: 21px;
  }

  .ws-related-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* 单列时不需要再铺满 */
  .ws-related-item:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .ws-related-item > a {
    padding: 16px 16px;
  }
}
