/* ===================================================
   CASE STUDY — Shared Styles
   12-column grid: text in right 5 cols, images below
   =================================================== */

/* ---------- PROGRESS BAR ---------- */
.cs-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 99;
  pointer-events: none;
}

.cs-progress__bar {
  height: 100%;
  width: 0;
  will-change: width;
}

.cs-progress--purple .cs-progress__bar {
  background: #8523F7;
}

.cs-progress--blue .cs-progress__bar {
  background: #0067EF;
}

/* ---------- STICKY NAV (case study pages) ---------- */
body.cs-page .nav {
  position: fixed;
  transform: none !important;
}

@media (max-width: 640px) {
  .cs-progress {
    top: 57px;
  }
}

/* ---------- 12-COL GRID SYSTEM ---------- */
.cs-grid {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--side-padding);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 24px;
}

/* Text block: right-aligned in columns 8-12 */
.cs-grid__right {
  grid-column: 8 / 13;
}

/* Full width: spans all 12 columns */
.cs-grid__full {
  grid-column: 1 / 13;
}

/* Left 7 columns (for titles) */
.cs-grid__left {
  grid-column: 1 / 7;
}

/* ---------- HERO ---------- */
.cs-hero {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 160px var(--side-padding) 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 24px;
}

.cs-hero__left-mask,
.cs-hero__right-mask {
  overflow: hidden;
}

.cs-hero__left-mask {
  grid-column: 1 / 7;
}

.cs-hero__right-mask {
  grid-column: 8 / 13;
}

.cs-hero__left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cs-hero__title {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--color-black);
}


.cs-hero__right {
  grid-column: 8 / 13;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cs-hero__description {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: #666;
}

.cs-hero__meta {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.cs-meta-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-meta-item__label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--color-black);
}

.cs-meta-item__value {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: #666;
}

.cs-meta-item__value ul {
  list-style: disc;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-hero__link {
  font-family: var(--font-body);
  font-size: 15px;
  color: #8523F7;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  padding-bottom: 2px;
  align-self: flex-start;
}

.cs-hero__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: #8523F7;
  transition: width 0.4s ease;
}

.cs-hero__link:hover::after {
  width: 100%;
}

.cs-hero__link-icon {
  width: 20px;
  height: 20px;
}

/* Hero images — full width below hero text */
.cs-hero__images {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 48px var(--side-padding) 0;
  display: flex;
  gap: 16px;
}

/* ---------- SECTIONS ---------- */
.cs-section {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 80px var(--side-padding);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 24px;
}

.cs-section__title {
  grid-column: 1 / 7;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--color-black);
  align-self: start;
}

.cs-block .cs-section__title {
  grid-column: 1 / 7;
  align-self: start;
}

/* ---------- CONTENT BLOCKS ---------- */
/* Each content block: subtitle + body in right 5 cols */
.cs-block {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--side-padding);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 24px;
  margin-bottom: 48px;
}

.cs-block__content-mask {
  grid-column: 8 / 13;
}

.cs-block .cs-section__title {
  overflow: hidden;
}

.cs-block__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-block__subtitle {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--color-black);
  line-height: 1.3;
}

.cs-block__body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: #444;
}

.cs-block__highlight {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 400;
  color: #8523F7;
  line-height: 1.2;
}

/* ---------- IMAGE PLACEHOLDERS ---------- */
.cs-img {
  background: var(--color-gray);
  border-radius: var(--radius-sm);
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 14px;
  font-family: var(--font-body);
}

.cs-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cs-img--auto {
  display: block;
  overflow: visible;
  background: none;
  border-radius: 0;
}

.cs-img--auto img {
  height: auto;
  object-fit: contain;
  display: block;
}

.cs-img--crop {
  background: none;
  border-radius: 0;
  overflow: hidden;
  margin-bottom: -5%;
}

.cs-img--crop img {
  height: auto;
  object-fit: contain;
  display: block;
}

.cs-img--tall { aspect-ratio: 3 / 4; }
.cs-img--wide { aspect-ratio: 16 / 9; }
.cs-img--square { aspect-ratio: 1 / 1; }
.cs-img--hero { aspect-ratio: 4 / 3; }

/* Image rows — full width, below content */
.cs-images {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--side-padding);
  display: grid;
  gap: 16px;
  margin-bottom: 48px;
}

.cs-images--1 { grid-template-columns: 1fr; }
.cs-images--2 { grid-template-columns: 1fr 1fr; }
.cs-images--3 { grid-template-columns: 1fr 1fr 1fr; }
.cs-images--7-5 { grid-template-columns: 7fr 5fr; }
.cs-images--4-8 { grid-template-columns: 4fr 8fr; }
.cs-images--2x2 { grid-template-columns: 1fr 1fr; }

/* ---------- DIVIDER ---------- */
.cs-divider {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--side-padding);
}

.cs-divider__line {
  border: none;
  border-top: 1px solid #e8e8e8;
}

/* ---------- TAGS ---------- */
.cs-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cs-tag {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--color-gray);
  color: var(--color-black);
}

/* ---------- NEXT WORK ---------- */
.cs-next-wrapper {
  padding: 0 16px;
  max-width: var(--container-max);
  margin: 0 auto 24px;
}

.cs-next {
  padding: 12px;
  background: var(--color-gray);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
  cursor: pointer;
}

.cs-next__left {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.cs-next__bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 12px 12px;
}

.cs-next__label {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 400;
  color: var(--color-black);
  transition: color 0.3s ease;
}

.cs-next__arrow {
  display: inline-flex;
}

.cs-next__arrow img {
  width: 64px;
  height: 64px;
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* Hover on entire next block */
.cs-next:hover .cs-next__label {
  color: var(--color-accent);
}

.cs-next:hover .cs-next__arrow img {
  transform: translateX(20px);
  filter: brightness(0) saturate(100%) invert(37%) sepia(93%) saturate(1352%) hue-rotate(346deg) brightness(101%) contrast(101%);
}

.cs-next__card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: block;
  text-decoration: none;
  max-height: 380px;
}

.cs-next__card-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.cs-next__card-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s ease;
}

.cs-next:hover .cs-next__card-inner img {
  transform: scale(1.15);
}

.cs-next__card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-next__card-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: #fff;
}

.cs-next__card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cs-next__tag {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- RESPONSIVE — Tablet ---------- */
@media (max-width: 1024px) {
  .cs-img {
    background: none;
  }

  .cs-img img {
    height: auto;
    object-fit: contain;
  }

  .cs-img--wide,
  .cs-img--tall,
  .cs-img--square,
  .cs-img--hero {
    aspect-ratio: unset;
  }

  .cs-hero {
    grid-template-columns: 1fr;
    padding-top: 120px;
    gap: 32px 0;
  }

  .cs-hero__left-mask,
  .cs-hero__right-mask {
    grid-column: 1 / -1;
  }

  .cs-section {
    grid-template-columns: 1fr;
    padding: 60px var(--side-padding);
  }

  .cs-section__title {
    grid-column: 1 / -1;
    font-size: 36px;
    margin-bottom: 0;
  }

  .cs-block {
    grid-template-columns: 1fr;
  }

  .cs-block .cs-section__title {
    grid-column: 1 / -1;
    margin-bottom: 24px;
  }

  .cs-block__content-mask {
    grid-column: 1 / -1;
  }

  .cs-images--2,
  .cs-images--7-5,
  .cs-images--4-8,
  .cs-images--2x2 {
    grid-template-columns: 1fr;
  }

  .cs-next {
    grid-template-columns: 1fr;
  }

  .cs-next__left {
    gap: 16px;
  }

  .cs-next__label {
    font-size: 48px;
  }

  .cs-next__card {
    max-height: 350px;
  }
}

/* ---------- RESPONSIVE — Mobile ---------- */
@media (max-width: 640px) {
  .cs-hero {
    padding-top: 100px;
    gap: 24px 0;
  }

  .cs-hero__title {
    font-size: 32px;
  }

  .cs-hero__right {
    gap: 20px;
  }

  .cs-hero__meta {
    gap: 24px;
  }

  .cs-section {
    padding: 48px var(--side-padding);
  }

  .cs-section__title {
    font-size: 28px;
  }

  .cs-block {
    margin-bottom: 32px;
  }

  .cs-block__subtitle {
    font-size: 20px;
  }

  .cs-block__highlight {
    font-size: 28px;
  }

  .cs-images {
    margin-bottom: 32px;
  }

  .cs-images--2,
  .cs-images--3,
  .cs-images--7-5,
  .cs-images--4-8,
  .cs-images--2x2 {
    grid-template-columns: 1fr;
  }

  .cs-next-wrapper {
    padding: 0 8px;
  }

  .cs-next {
    padding: 8px;
    gap: 8px;
  }

  .cs-next__bottom {
    padding: 0 0 8px 8px;
  }

  .cs-next__label {
    font-size: 32px;
  }

  .cs-next__arrow img {
    width: 40px;
    height: 40px;
  }

  .cs-next__card {
    max-height: 280px;
  }

  .cs-next__card-overlay {
    padding: 16px;
    gap: 8px;
  }

  .cs-next__card-title {
    font-size: 20px;
  }

  .cs-next__tag {
    font-size: 11px;
    padding: 4px 10px;
  }
}
