/* 客户案例 module 2 · 了解同行故事，携手探索前行 (behaviour in case-stories.js).
  Heading and category tabs lead into a three-column card grid. Hovering a card
  swaps its tags and title for a summary and a "read the story" link. */
.case-stories {
  padding: 88px 0;
  background: linear-gradient(180deg, #030305 0%, #0a0812 18%, #0a0812 82%, #030305 100%);
}
@media (min-width: 768px) {
  .case-stories { margin-top: -40px; }
}
.case-stories__inner {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
}

.case-stories__head { text-align: center; }
.case-stories__title {
  margin: 0 0 18px;
  color: #f5f3fa;
  font-family: "Inter Tight", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 38px;
  font-weight: 600;
  line-height: 60px;
}
.case-stories__intro {
  margin: 0;
  color: #a09caa;
  font-size: 16px;
  line-height: 25px;
}
.case-stories__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c6b3ff;
  text-decoration: none;
  transition: color .4s;
}
.case-stories__link:hover { color: #f1ebff; }
.case-stories__link svg { width: 14px; height: 14px; transition: translate .4s; }
.case-stories__link:hover svg { translate: 4px 0; }

/* Category tabs: one row; scrolls sideways when it does not fit. */
.case-stories__tabs {
  display: flex;
  gap: 18px;
  margin: 54px 0 30px;
  padding: 0 20px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.case-stories__tabs::-webkit-scrollbar { display: none; }
/* Centred while the row fits; when it scrolls, 全部 stays reachable at the start
   (justify-content: center would push it out of reach). */
.case-stories__tab:first-child { margin-left: auto; }
.case-stories__tab:last-child { margin-right: auto; }
.case-stories__tab {
  flex: none;
  min-width: 64px;
  height: 41px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a09caa;
  font: inherit;
  font-size: 14px;
  line-height: 41px;
  cursor: pointer;
  transition: background-color .4s, color .4s;
}
.case-stories__tab:hover { background: #ffffff0f; color: #e6e3ee; }
.case-stories__tab.is-active,
.case-stories__tab.is-active:hover {
  background: #835bff2e;
  color: #d5c1ff;
  font-weight: 500;
}
.case-stories__tab:focus-visible { outline: 1px solid #c6b3ff; outline-offset: 2px; }

.case-stories__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0 0 34px;
  list-style: none;
}
.case-stories__card[hidden] { display: none; }
.case-stories__card.is-entering { animation: case-stories-in .5s cubic-bezier(.2, .7, .2, 1) both; }

.case-stories__card-link {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  border: 1px solid #ffffff12;
  border-radius: 8px;
  background: linear-gradient(180deg, #14111d 0%, #110f19 70%, #0f0d17 100%);
  box-shadow: 0 18px 40px -28px #000;
  color: inherit;
  text-decoration: none;
}
.case-stories__image {
  position: relative;
  padding-top: 48%;
  background: #0c0b12;
}
.case-stories__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
}
.case-stories__content {
  padding: 20px 20px 26px;
  transition: opacity .4s;
}
.case-stories__tags {
  display: flex;
  flex-wrap: wrap;
  margin: -4px;
}
.case-stories__tag {
  margin: 4px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 24px;
}
.case-stories__card-title {
  display: -webkit-box;
  height: 56px;
  margin: 12px 0 0;
  overflow: hidden;
  color: #f5f3fa;
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Hover layer: rises from the bottom in violet over the image. */
.case-stories__hover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 20px;
  background: linear-gradient(180deg, #835bff00 0%, #835bff03 28%, #6a47f099 51%, #4a2fc4 70%);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s, visibility .4s;
}
.case-stories__summary {
  display: -webkit-box;
  margin: 0 0 10px;
  overflow: hidden;
  color: #faf9ff;
  font-size: 14px;
  line-height: 20px;
  text-align: justify;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.case-stories__more {
  display: flex;
  align-items: center;
  color: #faf9ff;
  font-size: 14px;
  line-height: 21px;
}
.case-stories__more svg { width: 12px; height: 12px; margin-left: 6px; transition: margin-left .4s; }
.case-stories__card-link:hover .case-stories__content,
.case-stories__card-link:focus-visible .case-stories__content { opacity: 0; }
.case-stories__card-link:hover .case-stories__hover,
.case-stories__card-link:focus-visible .case-stories__hover { opacity: 1; visibility: visible; }
.case-stories__card-link:hover .case-stories__more svg { margin-left: 13px; }
.case-stories__card-link:focus-visible { outline: 1px solid #c6b3ff; outline-offset: 2px; }

/* Tag colours, one pair per category. */
.case-stories__tag--trade      { background: #ff806c1f; color: #ffa494; }
.case-stories__tag--park       { background: #2fbf8a1f; color: #6fd8ad; }
.case-stories__tag--realestate { background: #ffbd701f; color: #ffc98a; }
.case-stories__tag--property   { background: #3aa0ff1f; color: #85c8ff; }
.case-stories__tag--government { background: #ff507f1f; color: #ff93b1; }
.case-stories__tag--education  { background: #835bff2e; color: #cbb8ff; }
.case-stories__tag--finance    { background: #e6c2331f; color: #f0d77a; }

@keyframes case-stories-in {
  from { opacity: 0; translate: 0 16px; }
  to { opacity: 1; translate: 0 0; }
}

@media (max-width: 767px) {
  .case-stories { padding: 46px 0; }
  .case-stories__title { margin-bottom: 10px; font-size: 26px; line-height: 1.35; }
  .case-stories__intro { font-size: 14px; line-height: 24px; }
  .case-stories__tabs { gap: 12px; margin: 32px 0 0; padding-inline: 0; }
  .case-stories__tab:first-child { margin-left: 0; }
  .case-stories__tab { padding: 0 10px; border-radius: 4px; }
  .case-stories__grid { grid-template-columns: 1fr; gap: 16px; padding: 16px 0 15px; }
  .case-stories__content { padding: 16px 20px 20px; }
  .case-stories__card-title { height: 84px; margin-top: 4px; -webkit-line-clamp: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .case-stories__card.is-entering { animation: none; }
  .case-stories__content,
  .case-stories__hover,
  .case-stories__more svg,
  .case-stories__link svg { transition: none; }
}
