/*
 * Case studies: listing, individual pages, browser-frame screenshots, chips, results band.
 * New for WaveLocal. Built from the reference's own tokens, type, radii, shadows and dark-mode treatment.
 */

/* ------------------------------------------------------------------ browser frame (shared) */
.cs-frame {
  margin: 0;
  border: 1px solid rgba(0, 31, 63, 0.1);
  border-radius: 1rem;
  background-color: #fff;
  box-shadow: 0 1.25rem 3rem rgba(0, 31, 63, 0.14);
  overflow: hidden;
}
.cs-frame__bar {
  display: flex;
  gap: 0.4rem;
  background-color: #eef1f5;
  padding: 0.7rem 0.9rem;
}
.cs-frame__bar i {
  display: block;
  border-radius: 50%;
  background-color: #c5cdd8;
  height: 0.6rem;
  width: 0.6rem;
}
.cs-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 800 / 520;
  object-fit: cover;
  object-position: top;
}
.cs-frame figcaption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ------------------------------------------------------------------ chips */
.cs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 31, 63, 0.2);
  border-radius: 3.75rem;
  padding: 0.4rem 0.9rem;
  text-decoration: none;
  text-transform: uppercase;
  font-family: var(--headerFont);
  font-size: 0.8125rem;
  line-height: 1.2em;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--primary);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.cs-chips--links .cs-chip {
  border-color: var(--primary);
  background-color: var(--primary);
  padding: 0.75rem 1.4rem;
  font-size: 1rem;
  color: #fff;
}
.cs-chips--links .cs-chip:hover {
  border-color: var(--secondary);
  background-color: var(--secondary);
  color: var(--primary);
}

/* ------------------------------------------------------------------ listing */
#case-studies,
#case-study {
  padding: var(--sectionPadding);
  background-color: #fff;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
#case-studies .cs-container,
#case-study .cs-container,
#case-related .cs-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  max-width: 80rem;
  width: 100%;
  gap: clamp(3rem, 6vw, 5rem);
}
#case-studies .cs-content,
#case-related .cs-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 46.875rem;
}
#case-studies .cs-text {
  max-width: 40.625rem;
}
#case-studies .cs-text p,
#case-study .cs-text p {
  margin: 0 0 1rem;
  color: var(--bodyTextColor);
}
#case-studies .cs-breadcrumbs,
#case-study .cs-breadcrumbs {
  align-self: flex-start;
  margin: 0;
}

.cs-case-list {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin: 0;
  padding: 0;
  width: 100%;
  list-style: none;
}
.cs-case {
  position: relative;
  display: grid;
  gap: 1.5rem;
  align-items: center;
  border-radius: 1rem;
  background-color: #f7f7f7;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.cs-case:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 1rem 2.5rem rgba(0, 31, 63, 0.12);
}
.cs-case:hover .cs-frame {
  box-shadow: 0 1.5rem 3.5rem rgba(0, 31, 63, 0.2);
}
.cs-case__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}
.cs-case__industry {
  text-transform: uppercase;
  font-family: var(--headerFont);
  font-size: 0.875rem;
  line-height: 1.2em;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #707070;
}
.cs-case__title {
  margin: 0;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 900;
  line-height: 1.1em;
  color: var(--headerColor);
}
.cs-case__link {
  text-decoration: none;
  color: inherit;
}
/* Stretch the heading link over the whole card so the card is one big click target. */
.cs-case__link:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 1rem;
}
.cs-case__link:focus-visible {
  outline: none;
}
.cs-case__link:focus-visible:after {
  outline: 3px solid var(--secondary);
  outline-offset: 3px;
}
.cs-case__summary {
  margin: 0;
  max-width: 32rem;
  line-height: 1.5em;
  color: var(--bodyTextColor);
}
.cs-case .cs-fake-link {
  position: relative;
  margin-top: 0.5rem;
  display: inline-block;
  padding: 0 1rem;
  text-transform: uppercase;
  font-family: var(--headerFont);
  font-size: 1rem;
  line-height: 2.25rem;
  font-weight: 700;
  color: var(--primary);
  background-color: transparent;
  box-shadow: inset 0 -2px 0 var(--primary);
  transition: color 0.3s, background-color 0.3s, box-shadow 0.3s;
}
.cs-case:hover .cs-fake-link {
  background-color: var(--secondary);
  box-shadow: inset 0 -2px 0 var(--secondary);
}
.cs-case--compact .cs-case__title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
}

@media only screen and (min-width: 64rem) {
  .cs-case {
    grid-template-columns: 1.15fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
  }
  .cs-case:nth-child(even) .cs-case__media {
    order: 2;
  }
  .cs-case--compact {
    grid-template-columns: 1fr;
  }
  #case-related .cs-case-list {
    grid-template-columns: repeat(2, 1fr);
  }
  #case-related .cs-case:nth-child(even) .cs-case__media {
    order: 0;
  }
}

/* ------------------------------------------------------------------ individual case study */
.cs-cs-intro {
  display: grid;
  gap: 3rem;
  align-items: center;
  width: 100%;
}
.cs-cs-intro .cs-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.cs-facts {
  display: grid;
  gap: 1rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  margin: 1rem 0 0;
  width: 100%;
}
.cs-facts dt {
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  font-family: var(--headerFont);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #707070;
}
.cs-facts dd {
  margin: 0;
  font-weight: 700;
  line-height: 1.3em;
  color: var(--headerColor);
}
.cs-facts a {
  color: var(--linkOnLight);
}
.cs-cs-visual {
  position: relative;
  width: 100%;
}
.cs-cs-visual__phone {
  display: none;
}
@media only screen and (min-width: 48rem) {
  .cs-cs-visual__phone {
    position: absolute;
    right: -1rem;
    bottom: -2.5rem;
    z-index: 2;
    display: block;
    border: 0.375rem solid var(--primary);
    border-radius: 1.5rem;
    background-color: #fff;
    box-shadow: 0 1.25rem 3rem rgba(0, 31, 63, 0.3);
    height: auto;
    width: 26%;
  }
}
@media only screen and (min-width: 64rem) {
  .cs-cs-intro {
    grid-template-columns: 1fr 1.15fr;
    gap: clamp(3rem, 6vw, 5rem);
  }
}

.cs-cs-section {
  display: grid;
  gap: 1rem;
  border-top: 1px solid #e3e6ea;
  padding-top: clamp(2rem, 4vw, 3rem);
  width: 100%;
}
.cs-cs-section__title {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.1em;
  color: var(--primary);
}
.cs-cs-section__body p {
  margin: 0 0 1rem;
  max-width: 42rem;
  line-height: 1.6em;
  color: var(--bodyTextColor);
}
.cs-cs-section__body ul,
.cs-cs-section__body ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  max-width: 42rem;
  color: var(--bodyTextColor);
}
@media only screen and (min-width: 64rem) {
  .cs-cs-section {
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
  }
}

.cs-gallery {
  display: grid;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-gallery__item--phone {
  max-width: 18rem;
}
.cs-gallery__item--phone img {
  aspect-ratio: 600 / 1300;
}
@media only screen and (min-width: 48rem) {
  .cs-gallery {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }
}

/* Results band: same look as the homepage's performance section */
#case-results {
  padding: var(--sectionPadding);
  background-color: var(--primary);
}
#case-results .cs-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  max-width: 80rem;
  width: 100%;
  gap: clamp(2.5rem, 5vw, 4rem);
}
#case-results .cs-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 46.875rem;
}
#case-results .cs-topper {
  color: var(--bodyTextColorWhite);
}
#case-results .cs-title {
  color: var(--bodyTextColorWhite);
}
#case-results .cs-color {
  color: var(--secondary);
}
#case-results .cs-text p {
  margin: 0 0 1rem;
  color: var(--bodyTextColorWhite);
  opacity: 0.9;
}
#case-results .cs-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 0;
  gap: 2rem clamp(2rem, 6vw, 5rem);
  list-style: none;
}
#case-results .cs-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 14rem;
}
#case-results .cs-number {
  font-family: var(--headerFont);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1em;
  font-weight: 700;
  color: var(--secondary);
}
#case-results .cs-desc {
  font-size: 1rem;
  line-height: 1.4em;
  color: var(--bodyTextColorWhite);
}

/* Testimonial */
#case-testimonial {
  padding: var(--sectionPadding);
  background-color: #fff;
}
#case-testimonial .cs-container {
  margin: auto;
  max-width: 56rem;
}
.cs-quote-card {
  margin: 0;
  border-radius: 1rem;
  background-color: #f7f7f7;
  padding: clamp(2rem, 5vw, 3.5rem);
}
.cs-quote-card blockquote {
  margin: 1rem 0 1.5rem;
}
.cs-quote-card blockquote p {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  line-height: 1.5em;
  color: var(--headerColor);
}
.cs-quote-card .cs-name {
  display: block;
  text-transform: uppercase;
  font-family: var(--headerFont);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--headerColor);
}
.cs-quote-card .cs-job {
  font-size: 0.9375rem;
  color: var(--bodyTextColor);
}

#case-related {
  padding: var(--sectionPadding);
  background-color: #fff;
}

/* ------------------------------------------------------------------ dark mode */
html.dark-mode #case-studies,
html.dark-mode #case-study,
html.dark-mode #case-testimonial,
html.dark-mode #case-related {
  background-color: var(--dark);
}
html.dark-mode #case-results {
  background-color: #000;
}
html.dark-mode .cs-case,
html.dark-mode .cs-quote-card {
  background-color: rgba(0, 0, 0, 0.4);
}
html.dark-mode .cs-case:hover {
  box-shadow: rgba(67, 183, 255, 0.2) 0px 0px 24px, rgba(67, 183, 255, 0.2) 0px 0px 39px;
}
html.dark-mode .cs-frame {
  border-color: rgba(255, 255, 255, 0.12);
  background-color: #0b1620;
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.5);
}
html.dark-mode .cs-case:hover .cs-frame {
  box-shadow: rgba(67, 183, 255, 0.25) 0px 0px 30px, rgba(67, 183, 255, 0.2) 0px 0px 60px;
}
html.dark-mode .cs-frame__bar {
  background-color: #14232f;
}
html.dark-mode .cs-frame__bar i {
  background-color: #36495a;
}
html.dark-mode .cs-case__title,
html.dark-mode .cs-case__summary,
html.dark-mode .cs-cs-section__title,
html.dark-mode .cs-cs-section__body p,
html.dark-mode .cs-cs-section__body li,
html.dark-mode .cs-facts dd,
html.dark-mode .cs-quote-card blockquote p,
html.dark-mode .cs-quote-card .cs-name,
html.dark-mode .cs-quote-card .cs-job,
html.dark-mode #case-studies .cs-text p,
html.dark-mode #case-study .cs-text p {
  color: #fff;
}
html.dark-mode .cs-case__industry,
html.dark-mode .cs-facts dt {
  color: var(--secondary);
}
html.dark-mode .cs-facts a {
  color: var(--secondary);
}
html.dark-mode .cs-chip {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
html.dark-mode .cs-chips--links .cs-chip {
  border-color: transparent;
  background: linear-gradient(45deg, #cecece 0%, #ffffff 100%);
  color: var(--primary);
}
html.dark-mode .cs-chips--links .cs-chip:hover {
  background: var(--secondary);
}
html.dark-mode .cs-cs-section {
  border-top-color: rgba(255, 255, 255, 0.15);
}
html.dark-mode .cs-case .cs-fake-link {
  color: #fff;
  box-shadow: inset 0 -2px 0 #fff;
}
html.dark-mode .cs-case:hover .cs-fake-link {
  color: var(--primary);
  background-color: #fff;
}
html.dark-mode .cs-cs-visual__phone {
  border-color: #0b1620;
}

/* A single related case study on a service page: let it use the wide layout, but not stretch silly-wide. */
@media only screen and (min-width: 64rem) {
  .cs-case-list--single {
    max-width: 60rem;
  }
  .cs-case-list--single .cs-case--compact {
    grid-template-columns: 1.15fr 1fr;
  }
}

/* Global `a { font-size: 1rem }` would shrink the heading link: inherit the heading's size instead. */
.cs-case__link {
  font-size: inherit;
  line-height: inherit;
  font-weight: inherit;
}
