/* ==========================================================================
   JOYBEAN — Case studies
   Listing grid plus a long-form case study detail page.
   Loaded by page-case-studies.html and single-case-study.html.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Case study listing
   -------------------------------------------------------------------------- */

.case-list {
  padding-top: 0;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.case-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.case-card:hover {
  border-color: #f0cdc9;
  box-shadow: var(--shadow-sm);
  transform: translateY(-4px);
}

.case-media {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #f5f0eb;
}

.case-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}

.case-card:hover .case-media img {
  transform: scale(1.05);
}

.case-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px;
}

.case-industry {
  align-self: flex-start;
  padding: 5px 12px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-body h2 {
  margin: 12px 0 10px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.case-body > p {
  display: -webkit-box;
  margin: 0 0 20px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.case-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 800;
}

.case-more span {
  transition: transform 0.25s ease;
}

.case-card:hover .case-more span,
.case-product-card:hover .case-more span {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Case study detail — hero copy
   -------------------------------------------------------------------------- */

.case-hero .page-hero-content {
  max-width: 900px;
}

.case-hero-intro p {
  max-width: 780px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.78;
}

.case-hero-intro p + p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 15.5px;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Detail gallery (Swiper)
   -------------------------------------------------------------------------- */

.case-gallery-section {
  padding-top: 0;
}

.case-gallery-wrap {
  max-width: 860px;
  margin-inline: auto;
}

.case-gallery-swiper {
  overflow: hidden;
  background: #f5f0eb;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.case-gallery-swiper .swiper-slide {
  aspect-ratio: 1 / 1;
  background: #f5f0eb;
}

.case-gallery-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-gallery-swiper .swiper-button-prev,
.case-gallery-swiper .swiper-button-next {
  --swiper-navigation-size: 15px;
  width: 42px;
  height: 42px;
  margin-top: -21px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.case-gallery-swiper .swiper-button-prev:hover,
.case-gallery-swiper .swiper-button-next:hover {
  color: #fff;
  background: var(--primary);
}

.case-gallery-swiper .swiper-button-prev {
  left: 16px;
}

.case-gallery-swiper .swiper-button-next {
  right: 16px;
}

.case-gallery-swiper .swiper-pagination {
  bottom: 16px;
}

.case-gallery-swiper .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  opacity: 0.75;
  transition: width 0.25s ease, background-color 0.25s ease, opacity 0.25s ease;
}

.case-gallery-swiper .swiper-pagination-bullet-active {
  width: 22px;
  background: var(--primary);
  border-radius: 999px;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Highlight cards
   -------------------------------------------------------------------------- */

.case-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 920px;
  margin: 0 auto;
}

.case-highlight {
  padding: 26px 22px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.case-highlight strong {
  display: block;
  color: var(--primary);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.case-highlight span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.case-gallery-section .case-highlights {
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Challenge / solution / results
   -------------------------------------------------------------------------- */

.case-story {
  max-width: 880px;
  margin-inline: auto;
}

.case-block + .case-block {
  margin-top: 46px;
}

.case-block h2 {
  margin: 0 0 16px;
  padding-left: 16px;
  font-size: clamp(1.4rem, 2.3vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  border-left: 4px solid var(--primary);
}

.case-block > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.82;
}

.case-block > p:last-child {
  margin-bottom: 0;
}

.case-story .check-list {
  margin-top: 18px;
}

.case-story .check-list strong {
  color: var(--ink);
}

.case-quote {
  margin: 30px 0 0;
  padding: 26px 30px;
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: 0 18px 18px 0;
}

.case-quote p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15.5px;
  font-style: italic;
  line-height: 1.8;
}

.case-quote footer {
  margin-top: 12px;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Photo grid
   -------------------------------------------------------------------------- */

.case-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.case-photo {
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f5f0eb;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.case-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}

.case-photo:hover img {
  transform: scale(1.05);
}

/* --------------------------------------------------------------------------
   Specifications
   -------------------------------------------------------------------------- */

.case-spec-wrap {
  max-width: 900px;
  margin-inline: auto;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
}

.case-spec-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.case-spec-table th,
.case-spec-table td {
  padding: 17px 24px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.case-spec-table tr:last-child th,
.case-spec-table tr:last-child td {
  border-bottom: 0;
}

.case-spec-table th {
  width: 24%;
  color: var(--ink);
  background: #faf7f4;
  font-size: 13px;
  font-weight: 750;
}

.case-spec-table td {
  color: var(--muted);
  font-size: 13.8px;
  line-height: 1.68;
}

/* --------------------------------------------------------------------------
   FAQ (static cards)
   -------------------------------------------------------------------------- */

.case-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 960px;
  margin-inline: auto;
}

.case-faq-item {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.case-faq-item h3 {
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.45;
}

.case-faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13.8px;
  line-height: 1.75;
}

/* --------------------------------------------------------------------------
   Explore products
   -------------------------------------------------------------------------- */

.case-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 960px;
  margin-inline: auto;
}

.case-product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.case-product-card:hover {
  border-color: #f0cdc9;
  box-shadow: var(--shadow-sm);
  transform: translateY(-4px);
}

.case-product-media {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #f5f0eb;
}

.case-product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}

.case-product-card:hover .case-product-media img {
  transform: scale(1.05);
}

.case-product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 26px;
}

.case-product-body h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.case-product-body > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1000px) {
  .case-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (max-width: 760px) {
  .case-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .case-body {
    padding: 20px;
  }

  .case-highlights {
    grid-template-columns: 1fr;
  }

  .case-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .case-faq-grid,
  .case-products {
    grid-template-columns: 1fr;
  }

  .case-gallery-swiper .swiper-button-prev,
  .case-gallery-swiper .swiper-button-next {
    width: 36px;
    height: 36px;
    margin-top: -18px;
  }

  .case-gallery-swiper .swiper-button-prev {
    left: 10px;
  }

  .case-gallery-swiper .swiper-button-next {
    right: 10px;
  }

  .case-block h2 {
    padding-left: 13px;
  }

  .case-quote {
    padding: 22px 22px;
  }
}

@media (max-width: 560px) {
  .case-spec-table th,
  .case-spec-table td {
    padding: 14px 16px;
  }

  .case-product-body {
    padding: 20px;
  }
}
