/* ============================================
   Single Case Study
   ============================================ */

/* ---------- Hero ---------- */
.cs-hero {
  position: relative;
  padding-block: 56px 72px;
  overflow: hidden;
  /* Mặc định nền tối + lưới */
  background:
    radial-gradient(620px 320px at 88% 0%, rgba(132, 191, 43, 0.2), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--night);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

/* Khi có ảnh thumb, dùng lớp phủ màu tối đè lên ảnh để tăng độ tương phản cho chữ */
.cs-hero--has-thumb {
  padding-bottom: 150px;
  background-blend-mode: overlay;
  background-color: rgba(15, 31, 61, 0.85); /* Điều chỉnh độ mờ tối tùy ý bạn */
}

.cs-hero .container {
  position: relative;
  z-index: 2;
}

.cs-hero__eyebrow {
  color: var(--lucky-bright);
}
.cs-hero__title {
  margin-bottom: 2rem;
  font: 700 clamp(30px, 4.6vw, 54px)/1.1 var(--font-display);
  letter-spacing: -0.025em;
  color: #fff;
}

.cs-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem 2.5rem;
  margin: 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--night-line);
}
.cs-stats__item dt {
  margin-bottom: 0.5rem;
  color: var(--night-muted);
  text-transform: uppercase;
}
.cs-stats__item dd {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: #fff;
}

.cs-article__meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font: 500 0.8125rem var(--font-mono);
  color: var(--bap-muted);
}
.cs-hero__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
}
.cs-hero__top .eyebrow {
  margin-bottom: 0;
}
.cs-hero__byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  font: 500 0.8125rem var(--font-mono);
  color: var(--night-muted);
}
.cs-hero__byline span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.cs-hero__byline svg {
  color: var(--lucky-bright);
}

/* ---------- Main ---------- */

.cs-hero {
  padding-block: 56px 72px;
}
.cs-main {
  padding-top: 56px;
  padding-bottom: 88px;
}

.cs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 3rem;
  align-items: start;
}

/* ---------- Article ---------- */
.cs-article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.cs-article__content {
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--bap-navy);
}
.cs-article__content > * + * {
  margin-top: 1.25rem;
}
.cs-article__content > p:first-of-type {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--bap-muted);
}
.cs-article__content h2,
.cs-article__content h3 {
  margin-top: 2.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.cs-article__content h2 {
  font-size: 1.75rem;
}
.cs-article__content h2::before {
  content: "";
  display: block;
  width: 32px;
  height: 3px;
  margin-bottom: 0.875rem;
  background: var(--lucky);
}
.cs-article__content h3 {
  font-size: 1.375rem;
}
.cs-article__content a {
  color: var(--bap);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cs-article__content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}
.cs-article__content ul {
  display: grid;
  gap: 0.5rem;
  padding-left: 0;
  list-style: none;
}
.cs-article__content ul li {
  position: relative;
  padding-left: 22px;
}
.cs-article__content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.9em;
  width: 10px;
  height: 2px;
  background: var(--lucky);
}
.cs-article__content blockquote {
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--lucky);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--lucky-soft);
  font-size: 1.125rem;
  font-weight: 500;
}

/* ---------- Share ---------- */
.cs-share {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bap-line);
}
.cs-share .mono-label {
  margin-right: 0.25rem;
  text-transform: uppercase;
  color: var(--bap-muted);
}
.cs-share__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--bap-line);
  border-radius: 50%;
  background: #fff;
  color: var(--bap-navy);
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s,
    transform 0.2s;
}
.cs-share__btn:hover {
  border-color: var(--lucky);
  color: var(--bap);
  transform: translateY(-2px);
}
.cs-share__tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  background: var(--night);
  color: #fff;
  font: 500 0.75rem var(--font-mono);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 4px);
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.cs-share__copy.is-copied .cs-share__tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Prev / Next */
/* Pager Navigation (Prev / Next) */
.cs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.cs-pager__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: all 0.25s ease;
}

.cs-pager__item:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -15px rgba(15, 123, 222, 0.15);
}

.cs-pager__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg);
}

.cs-pager__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.cs-pager__item:hover .cs-pager__thumb img {
  transform: scale(1.05);
}

.cs-pager__text {
  min-width: 0;
  flex: 1;
}

.cs-pager__text .mono-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.cs-pager__title {
  margin: 0 0 4px 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cs-pager__text .desc {
  margin: 0;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Nút Next đảo ngược giao diện */
.cs-pager__item--next {
  grid-column: 2;
  flex-direction: row-reverse;
  text-align: right;
}

/* Responsive cho màn hình nhỏ */
@media (max-width: 768px) {
  .cs-pager {
    grid-template-columns: 1fr;
  }
  .cs-pager__item--next {
    grid-column: 1;
  }
}

/* ---------- Sidebar ---------- */
.cs-sidebar {
  display: grid;
  gap: 1.25rem;
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}

.cs-widget .cs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cs-widget .mono-label {
  margin-bottom: 0;
}

.cs-widget .cs-see-all {
  font-size: 13px;
  font-weight: 500;
  color: var(--bap);
  text-decoration: none;
}

.cs-widget .cs-see-all:hover {
  text-decoration: underline;
}

.cs-widget .cs-item {
  display: flex;
  align-items: center;
  gap: 14px;

  text-decoration: none;
  color: inherit;
  padding: 12px 0;
  transition:
    background 0.2s,
    color 0.2s;
}
.cs-widget .cs-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: #e8f1fd;
  color: var(--bap);
  font-size: 20px;
  transition:
    background 0.2s,
    color 0.2s;
}

 .cs-widget .cs-item .title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
 }

.cs-widget .cs-item:hover .cs-icon {
  background: var(--bap);
  color: #fff;
}

.cs-widget .cs-text strong {
  display: block;
  font-size: 16px;
  line-height: 1.3;
  color: #0f1f3d;
}

.cs-widget .cs-text p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: #4a5d7e;
}
.cs-widget .cs-text p:first-child {
  font-weight: 500;
  font-size: 15px;
}

.cs-widget .cs-item:hover strong {
  color: var(--bap);
}

/* Nhiều item thì có đường kẻ ngăn cách */
.cs-widget .cs-item + .cs-item {
  border-top: 1px solid #e6ebf3;
}

/* ----------------- */
.cs-widget:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--bap-line);
}
.cs-placeholder {
  padding: 1rem;
  border: 1px dashed var(--bap-line);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  text-align: center;
  color: var(--bap-muted);
}
.cs-cta-card {
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-md);
  background:
    radial-gradient(
      260px 160px at 100% 0%,
      rgba(132, 191, 43, 0.28),
      transparent 70%
    ),
    var(--night);
  color: #fff;
}
.cs-cta-card .mono-label {
  color: var(--lucky-bright);
  text-transform: uppercase;
}
.cs-cta-card .h-card {
  margin-bottom: 1.25rem;
  font-size: 1.3rem;
  color: #fff;
}
.cs-cta-card .btn {
  width: 100%;
}


/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .cs-layout {
    grid-template-columns: 1fr;
  }
  .cs-sidebar {
    position: static;
  }
}
@media (max-width: 768px) {
  .cs-hero {
    padding-block: 40px 56px;
  }
  .cs-hero--has-thumb {
    padding-bottom: 110px;
  }
  .cs-cover {
    margin-top: -70px;
    aspect-ratio: 16 / 10;
  }
  .cs-pager {
    grid-template-columns: 1fr;
  }
  .cs-pager__item--next {
    grid-column: auto;
  }
}
