/* =====================================================================
   Case Study — single template styles (Webshape light style)
   Layout emulates the Yellowball single project page.
   Prefix: cs-  |  Reuses: body-section, body-container, title-holder,
   main-button, check-list-wrap. Uses webshape.css variables.
   ===================================================================== */

/* Section rhythm — case study sections sit tighter than standard blocks
   so consecutive media/text stack like the reference layout. */
.cs-section-tight {
  padding-top: 25px;
  padding-bottom: 25px;
}

/* Shared eyebrow / pre-title (crimson uppercase) */
.cs-eyebrow {
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 16px;
  font-weight: 300;
  margin: 0 0 18px;
}

/* Inline arrow used in buttons / labels */
.cs-arrow {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.85em;
  line-height: 1;
}

/* ---------------------------------------------------------------------
   HERO
   --------------------------------------------------------------------- */
.cs-hero {
  padding-top: 70px;
  padding-bottom: 25px;
}

.cs-hero__inner {
  max-width: 1000px;
}

.cs-hero__title {
  font-size: 60px;
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 34px;
  max-width: 20ch;
}

.cs-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cs-hero__visit {
  flex: 0 0 auto;
}

/* Service tag pills */
.cs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs-tag {
  display: inline-flex;
  align-items: center;
  background-color: var(--light);
  border: 1px solid rgba(32, 33, 50, 0.12);
  color: var(--on-blue-text);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* ---------------------------------------------------------------------
   MEDIA (rounded, like the reference 40px rounded media)
   --------------------------------------------------------------------- */
.cs-media {
  position: relative;
  width: 100%;
  margin: 0;
  border: 1px solid rgba(32, 33, 50, 0.1);
  border-radius: var(--border-radius-lg, 24px);
  overflow: hidden;
  background-color: var(--light);
}

.cs-media img,
.cs-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius-sm, 8px);
  box-shadow: 0 2px 12px 2px #00000020;
}

/* Aspect ratios */
.cs-media.wide { aspect-ratio: 16 / 9; padding: 80px; }
.cs-media.portrait { aspect-ratio: 2 / 3; }
.cs-media.square { aspect-ratio: 1 / 1; }
.cs-media.tall { aspect-ratio: 16 / 18; }

/* Two-up media grid */
.cs-media-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

/* ---------------------------------------------------------------------
   TEXT ROW (label left, content right) — Overview / Challenge / Result
   --------------------------------------------------------------------- */
.cs-text-row {
  padding-top: 45px;
  padding-bottom: 45px;
}

.cs-text-row__grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  column-gap: 60px;
  row-gap: 30px;
  align-items: start;
}

.cs-text-row__label {
  color: var(--dark-grey);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 16px;
  font-weight: 300;
  margin: 0;
  padding-top: 6px;
}

.cs-text-row__content {
  max-width: 65ch;
}

.cs-text-row__heading {
  font-size: 32px;
  font-weight: 300;
  line-height: 1.2;
  margin: 0 0 22px;
}

.cs-text-row__body {
  color: var(--color-text-muted, #5a5b6a);
}

.cs-text-row__body p:last-child {
  margin-bottom: 0;
}

.cs-text-row__list {
  margin-top: 36px;
}

/* ---------------------------------------------------------------------
   BEFORE / AFTER
   --------------------------------------------------------------------- */
.cs-beforeafter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.cs-ba-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.cs-ba-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 220px;
  background-color: var(--white);
  border: 1px solid rgba(32, 33, 50, 0.12);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Small leading dot to reinforce the before/after status */
.cs-ba-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

/* Before — understated, muted */
.cs-ba-label--before {
  background-color: var(--light-grey);
  border-color: rgba(32, 33, 50, 0.12);
  color: var(--dark-grey);
}

.cs-ba-label--before::before {
  background-color: var(--dark-grey);
}

/* After — stands out in brand crimson */
.cs-ba-label--after {
  background-color: var(--pink);
  border-color: var(--pink);
  color: var(--white);
  font-weight: 700;
}

.cs-ba-label--after::before {
  background-color: var(--white);
}

.cs-ba-col .cs-media {
  width: 100%;
}

/* ---------------------------------------------------------------------
   RESULTS — stats panel (sits under the hero showcase, before overview)
   --------------------------------------------------------------------- */
.cs-results {
  width: 100%;
  background-color: var(--light);
  border-radius: var(--border-radius-lg, 24px);
  padding: 60px;
}

.cs-results__head {
  max-width: 65ch;
  margin-bottom: 50px;
}

.cs-results__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 14px;
}

.cs-results__intro {
  color: var(--color-text-muted, #5a5b6a);
  margin: 0;
}

.cs-results__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 40px 30px;
}

.cs-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-result__figure {
  font-size: clamp(56px, 7vw, 92px);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -2px;
  color: var(--on-blue-text);
}

.cs-result__label {
  color: var(--color-text-muted, #5a5b6a);
  font-size: 16px;
}

@media screen and (max-width: 767px) {
  .cs-results { padding: 40px 28px; }
  .cs-results__grid { grid-template-columns: 1fr 1fr; }
}

@media screen and (max-width: 479px) {
  .cs-results__grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   CLIENT QUOTE
   --------------------------------------------------------------------- */
.cs-quote {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 65ch;
}

.cs-stars {
  display: flex;
  gap: 4px;
  color: var(--pink);
  font-size: 18px;
  line-height: 1;
}

.cs-quote__text {
  font-size: 26px;
  font-weight: 300;
  line-height: 1.45;
  margin: 0;
}

.cs-quote__author {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 4px;
}

.cs-quote__name {
  color: var(--pink);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.cs-quote__role {
  color: var(--dark-grey);
  font-size: 14px;
}

/* ---------------------------------------------------------------------
   HERO SHOWCASE — branded panel with desktop + mobile browser mockups
   --------------------------------------------------------------------- */
.cs-showcase {
  position: relative;
  width: 100%;
  background-color: var(--on-blue-text);
  /* Navy base with a soft pink radial glow (top-right, near the logo) */
  background-image: radial-gradient(110% 130% at 85% 0%, rgba(200, 45, 68, 0.5) 0%, rgba(200, 45, 68, 0) 55%);
  border-radius: var(--border-radius-lg, 24px);
  overflow: hidden;
  padding: 60px 60px 0;
}

/* Subtle brand grid texture behind the devices */
.cs-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* Light variant — applied by case-study.js when the logo is dark, so a dark
   logo stays legible on a lighter panel (in its natural colours). */
.cs-showcase.is-light {
  background-color: var(--light);
  background-image: radial-gradient(110% 130% at 85% 0%, rgba(200, 45, 68, 0.16) 0%, rgba(200, 45, 68, 0) 55%);
}

.cs-showcase.is-light::before {
  background-image:
    linear-gradient(rgba(32, 33, 50, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 33, 50, 0.05) 1px, transparent 1px);
}

.cs-showcase__logo {
  position: absolute;
  top: 30px;
  right: 36px;
  height: 40px;
  width: auto;
  max-width: 220px;
  z-index: 3;
  /* Default: render any logo as a clean white silhouette on the dark panel */
  filter: brightness(0) invert(1);
}

/* Dark logo on the light panel — keep its natural colours */
.cs-showcase.is-light .cs-showcase__logo {
  filter: none;
}

.cs-showcase__devices {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 40px;
}

/* Browser window mockup */
.cs-browser {
  background-color: var(--white);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.cs-browser__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 38px;
  padding: 0 16px;
  background-color: var(--light-grey);
  border-bottom: 1px solid rgba(32, 33, 50, 0.08);
}

.cs-browser__dots {
  display: inline-flex;
  gap: 7px;
  flex: 0 0 auto;
}

.cs-browser__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #cdd5dd;
}

.cs-browser__url {
  flex: 1 1 auto;
  max-width: 320px;
  height: 22px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background-color: var(--white);
  border-radius: 11px;
  font-size: 11px;
  color: var(--dark-grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-browser__screen {
  width: 100%;
  overflow: hidden;
}

/* Screenshot fills the window width and keeps its own aspect ratio,
   anchored to the top — the whole image shows (no crop, no white space). */
.cs-browser__screen img {
  display: block;
  width: 100%;
  height: auto;
}

/* Desktop window — wide, fills most of the panel */
.cs-browser--desktop {
  flex: 1 1 auto;
  max-width: 72%;
}

/* Mobile window — narrow and tall, sits alongside the desktop */
.cs-browser--mobile {
  flex: 0 0 auto;
  width: 210px;
  border-radius: 18px 18px 0 0;
}

.cs-browser--mobile .cs-browser__bar {
  height: 30px;
}

/* ---------------------------------------------------------------------
   Scroll reveal (progressive enhancement via case-study.js)
   --------------------------------------------------------------------- */
.cs-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.cs-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* No-JS / reduced-motion fallback — never hide content */
.no-js .cs-reveal,
.cs-reveal.cs-reveal--static {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .cs-reveal { opacity: 1; transform: none; transition: none; }
}

/* =====================================================================
   RESPONSIVE — match Webshape breakpoints (991 / 767 / 479)
   ===================================================================== */
@media screen and (max-width: 991px) {
  .cs-hero__title { font-size: 46px; }
  .cs-text-row__grid { grid-template-columns: 1fr; row-gap: 18px; column-gap: 0; }
  .cs-text-row__label { padding-top: 0; }
  .cs-text-row__heading { font-size: 28px; }
  .cs-showcase { padding: 40px 40px 0; }
  .cs-showcase__devices { gap: 24px; }
  .cs-browser--mobile { width: 150px; }
}

@media screen and (max-width: 767px) {
  .cs-hero { padding-top: 50px; }
  .cs-hero__title { font-size: 38px; }
  .cs-hero__meta { flex-direction: column; align-items: flex-start; }
  .cs-media-duo { grid-template-columns: 1fr; }
  .cs-beforeafter { grid-template-columns: 1fr; }
  .cs-media.wide { aspect-ratio: 4 / 3; padding: 20px; }
  .cs-quote__text { font-size: 22px; }
  /* Stack the browser windows on small screens */
  .cs-showcase { padding: 70px 24px 0; }
  .cs-showcase__logo { top: 22px; right: 22px; height: 30px; }
  .cs-showcase__devices { flex-direction: column; align-items: center; gap: 20px; }
  .cs-browser--desktop { max-width: 100%; width: 100%; }
  .cs-browser--mobile { width: 180px; }
}

@media screen and (max-width: 479px) {
  .cs-hero__title { font-size: 32px; }
  .cs-text-row__heading { font-size: 24px; }
}
