/**
 * Case Studies Section Module Styles
 * Matches live Next.js slider layout, cards, and theme variations
 * Comprehensive support for Light, Natural, and Dark theme styles & text colors
 */

.morae-case-study-section {
  position: relative;
  width: 100%;
  padding-top: clamp(3rem, 6vw, 6rem);
  padding-bottom: clamp(3rem, 11.3194vw, 11.3194vw);
  box-sizing: border-box;
}

/* ==========================================================================
   Theme Variations: Section Background & Base Text
   ========================================================================== */

/* 1. Light Theme (Default) */
.morae-case-study-section,
.morae-case-study-section.morae-theme-light,
.morae-case-study-section.theme-light {
  background-color: #ffffff;
  color: #101010;
}

.morae-case-study-section .morae-case-study-title,
.morae-case-study-section.morae-theme-light .morae-case-study-title,
.morae-case-study-section.theme-light .morae-case-study-title {
  color: #262626!important;
}

.morae-case-study-section .morae-case-study-card,
.morae-case-study-section.morae-theme-light .morae-case-study-card,
.morae-case-study-section.theme-light .morae-case-study-card {
  border-color: #ede5de;
}

.morae-case-study-section .morae-case-study-card-title,
.morae-case-study-section.morae-theme-light .morae-case-study-card-title,
.morae-case-study-section.theme-light .morae-case-study-card-title {
  color: #262626!important;
}

.morae-case-study-section .morae-case-study-metric-label,
.morae-case-study-section.morae-theme-light .morae-case-study-metric-label,
.morae-case-study-section.theme-light .morae-case-study-metric-label {
  color: #262626!important;
}

.morae-case-study-section .morae-case-study-card-abstract,
.morae-case-study-section.morae-theme-light .morae-case-study-card-abstract,
.morae-case-study-section.theme-light .morae-case-study-card-abstract,
.morae-case-study-section .morae-case-study-content,
.morae-case-study-section.morae-theme-light .morae-case-study-content,
.morae-case-study-section.theme-light .morae-case-study-content {
  color: #262626 !important;
}

.morae-case-study-section .morae-case-study-link,
.morae-case-study-section.morae-theme-light .morae-case-study-link,
.morae-case-study-section.theme-light .morae-case-study-link {
  color: #262626!important;
}

.morae-case-study-section .morae-case-study-arrow,
.morae-case-study-section.morae-theme-light .morae-case-study-arrow,
.morae-case-study-section.theme-light .morae-case-study-arrow {
  background-color: transparent;
  border: 2px solid #ede5de;
  color: #6e6e6e;
}

.morae-case-study-section .morae-case-study-arrow:not(:disabled):hover,
.morae-case-study-section.morae-theme-light .morae-case-study-arrow:not(:disabled):hover,
.morae-case-study-section.theme-light .morae-case-study-arrow:not(:disabled):hover {
  background-color: #f5f0eb;
  border-color: #ede5de;
  color: #0f0f0f;
}

/* 2. Natural Theme */
.morae-case-study-section.morae-theme-natural,
.morae-case-study-section.theme-natural {
  background-color: var(--morae-bg-natural, #f5f2ef);
  color: #101010;
}

.morae-case-study-section.morae-theme-natural .morae-case-study-title,
.morae-case-study-section.theme-natural .morae-case-study-title {
  color: #262626!important;
}

.morae-case-study-section.morae-theme-natural .morae-case-study-card,
.morae-case-study-section.theme-natural .morae-case-study-card {
  border-color: #e0deda;
}

.morae-case-study-section.morae-theme-natural .morae-case-study-card-title,
.morae-case-study-section.theme-natural .morae-case-study-card-title {
  color: #262626!important;
}

.morae-case-study-section.morae-theme-natural .morae-case-study-metric-label,
.morae-case-study-section.theme-natural .morae-case-study-metric-label {
  color: #262626!important;
}

.morae-case-study-section.morae-theme-natural .morae-case-study-card-abstract,
.morae-case-study-section.theme-natural .morae-case-study-card-abstract,
.morae-case-study-section.morae-theme-natural .morae-case-study-content,
.morae-case-study-section.theme-natural .morae-case-study-content {
  color: #525252 !important;
}

.morae-case-study-section.morae-theme-natural .morae-case-study-link,
.morae-case-study-section.theme-natural .morae-case-study-link {
  color: #262626!important;
}

.morae-case-study-section.morae-theme-natural .morae-case-study-arrow,
.morae-case-study-section.theme-natural .morae-case-study-arrow {
  background-color: transparent;
  border: 2px solid #e0deda;
  color: #6e6e6e;
}

.morae-case-study-section.morae-theme-natural .morae-case-study-arrow:not(:disabled):hover,
.morae-case-study-section.theme-natural .morae-case-study-arrow:not(:disabled):hover {
  background-color: #e8e5e0;
  border-color: #e0deda;
  color: #0f0f0f;
}

/* 3. Dark Theme */
.morae-case-study-section.morae-theme-dark,
.morae-case-study-section.theme-dark {
  background-color: var(--morae-bg-dark, #101010);
  color: #f5f2ef;
}

.morae-case-study-section.morae-theme-dark .morae-case-study-title,
.morae-case-study-section.theme-dark .morae-case-study-title {
  color: #f5f2ef !important;
}

.morae-case-study-section.morae-theme-dark .morae-case-study-card,
.morae-case-study-section.theme-dark .morae-case-study-card {
  border-color: #262626;
}

.morae-case-study-section.morae-theme-dark .morae-case-study-card-title,
.morae-case-study-section.theme-dark .morae-case-study-card-title {
  color: #f5f2ef !important;
}

.morae-case-study-section.morae-theme-dark .morae-case-study-metric-label,
.morae-case-study-section.theme-dark .morae-case-study-metric-label {
  color: #f5f2ef !important;
}

.morae-case-study-section.morae-theme-dark .morae-case-study-card-abstract,
.morae-case-study-section.theme-dark .morae-case-study-card-abstract,
.morae-case-study-section.morae-theme-dark .morae-case-study-content,
.morae-case-study-section.theme-dark .morae-case-study-content {
  color: #a3a3a3 !important;
}

.morae-case-study-section.morae-theme-dark .morae-case-study-link,
.morae-case-study-section.theme-dark .morae-case-study-link {
  color: #f5f2ef !important;
}

.morae-case-study-section.morae-theme-dark .morae-case-study-arrow,
.morae-case-study-section.theme-dark .morae-case-study-arrow {
  background-color: transparent;
  border: 2px solid #404040;
  color: #a3a3a3;
}

.morae-case-study-section.morae-theme-dark .morae-case-study-arrow:not(:disabled):hover,
.morae-case-study-section.theme-dark .morae-case-study-arrow:not(:disabled):hover {
  background-color: #262626;
  border-color: #555555;
  color: #ffffff;
}

.morae-case-study-section.morae-theme-dark .morae-case-study-img-wrap,
.morae-case-study-section.theme-dark .morae-case-study-img-wrap {
  background-color: #1a1a1a;
}

/* Container */
.morae-case-study-container {
  max-width: 1920px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 2.5vw, 2.5rem);
  padding-right: clamp(1rem, 2.5vw, 2.5rem);
  box-sizing: border-box;
}

/* Header Row */
.morae-case-study-header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: clamp(2rem, 3.5vw, 3.5rem);
}

.morae-case-study-header {
  max-width: 800px;
}

.morae-case-study-topline {
  font-family: var(--morae-font, 'IBM Plex Sans', sans-serif);
  font-size: var(--morae-font-size-topline, clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem));
  line-height: 1.4;
  letter-spacing: 0em;
  font-weight: 500;
  color: var(--morae-topline-color, var(--morae-scarlet-400, #ff3600));
  margin: 0;
}

.morae-case-study-title {
  font-family: var(--morae-font, 'IBM Plex Sans', sans-serif);
  font-size: var(--morae-font-size-display-2xl, clamp(2rem, 1.6rem + 1.8vw, 3rem));
  line-height: 1.2;
  font-weight: 400;
  margin: 0;
  text-wrap: balance;
  margin-top: clamp(.875rem, .8491022099447514rem + .11049723756906078vw, .9375rem);
}

.morae-case-study-title strong {
  font-weight: 600;
  color: inherit;
}

.morae-case-study-content {
  font-family: var(--morae-font, 'IBM Plex Sans', sans-serif);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  margin-top: 0.75rem;
}

.morae-case-study-content p {
  margin: 0;
}

/* Navigation Arrow Buttons */
.morae-case-study-nav {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
}

.morae-case-study-arrow {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.1s ease, border-color 0.1s ease, color 0.1s ease;
  padding: 0;
  -webkit-appearance: none;
  box-sizing: border-box;
}

.morae-case-study-arrow:disabled,
.morae-case-study-arrow.is-disabled {
  opacity: 1 !important;
  color: #d1d1d1 !important;
  border-color: #ede5de !important;
  background-color: transparent !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.morae-case-study-section.morae-theme-dark .morae-case-study-arrow:disabled,
.morae-case-study-section.theme-dark .morae-case-study-arrow:disabled {
  color: #555555 !important;
  border-color: #333333 !important;
}

.morae-case-study-arrow svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  display: block;
}

/* Slider Track & Slides */
.morae-case-study-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-top: clamp(1.5rem, 2.7vw, 2.4375rem);
}

.morae-case-study-track {
  display: flex;
  width: 100%;
  box-sizing: border-box;
}

.morae-case-study-slide {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Card */
.morae-case-study-card {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  border-top: 0 !important;
  border-right: 0 !important;
  border-bottom-width: 1px;
  border-bottom-style: solid;
  border-left-width: 1px;
  border-left-style: solid;
  border-radius: 0;
  box-sizing: border-box;
  background-color: transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

@media (min-width: 1024px) {
  .morae-case-study-card {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0;
  }
}

/* Body / Content Column */
.morae-case-study-body {
  order: 2;
  padding: 0 clamp(1.5rem, 4.7vw, 4.25rem) clamp(1.5rem, 4.7vw, 4.25rem) clamp(1.5rem, 4.7vw, 4.25rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .morae-case-study-body {
    grid-column: span 6;
    order: 1;
    padding: clamp(2.5rem, 6.4583vw, 5.8125rem) 0 clamp(2.5rem, 6.4583vw, 5.8125rem) clamp(2.5rem, 6.4583vw, 5.8125rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.morae-case-study-body-top {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 1.666vw, 1.5rem);
  width: 100%;
}

.morae-case-study-card-title {
  font-family: var(--morae-font, 'IBM Plex Sans', sans-serif);
  font-size: clamp(1.35rem, 1.85416vw, 2.225rem);
  line-height: 1.5;
  font-weight: 400;
  margin: 0;
}

/* Key Metrics Callout */
.morae-case-study-metric-wrap {
  margin: 0;
  padding: 0;
}

.morae-case-study-metric {
  display: flex;
  align-items: center;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 100%;
}

.morae-case-study-metric-stat,
.morae-case-study-metric-stat.text-primary,
.morae-case-study-section .morae-case-study-metric-stat,
.morae-case-study-section .morae-case-study-metric-stat.text-primary {
  font-family: var(--morae-font, 'IBM Plex Sans', sans-serif);
  font-size: clamp(2.5rem, 4.3854vw, 5.26rem);
  font-weight: 400;
  color: var(--morae-scarlet-400, #ff3600) !important;
  line-height: 1.2;
  border-left: 0.05em solid var(--morae-scarlet-400, #ff3600) !important;
  padding-left: 0.4em !important;
  display: inline-flex;
  align-items: flex-start;
  white-space: nowrap;
  margin: 0;
}

.morae-case-study-metric-stat span {
  font-size: clamp(1.5rem, 2.468vw, 2.96rem);
  line-height: 1.4;
  margin-left: 0.05em;
  font-weight: inherit;
  color: inherit !important;
}

.morae-case-study-metric-label {
  font-family: var(--morae-font, 'IBM Plex Sans', sans-serif);
  font-size: clamp(1rem, 1.3888vw, 1.666rem);
  line-height: 1.5;
  margin-left: clamp(1rem, 1.3888vw, 1.666rem);
  margin-top: 0;
  margin-bottom: 0;
  font-weight: 500;
  max-width: none;
}

/* Abstract */
.morae-case-study-card-abstract {
  font-family: var(--morae-font, 'IBM Plex Sans', sans-serif);
  font-size: clamp(1rem, 1.3888vw, 1.666rem);
  line-height: 1.5;
  margin: 0;
}

/* Read The Story Link */
.morae-case-study-card-action {
  margin-top: clamp(1.5rem, 2.7083vw, 3.25rem);
}

.morae-case-study-link {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.5rem, 0.8576vw, 1.029vw);
  font-family: var(--morae-font, 'IBM Plex Sans', sans-serif);
  font-size: clamp(0.75rem, 0.96458vw, 1.1575rem);
  line-height: 1.5;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.2s ease;
  cursor: pointer;
}

/* Stretched link overlay - makes entire case study card clickable */
.morae-case-study-link::before {
  content: "";
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: pointer;
}

.morae-case-study-link span {
  position: relative;
  z-index: 11;
  border-bottom: 0.09375em solid transparent;
  transition: border-color 0.2s ease;
  padding-bottom: 0;
}

.morae-case-study-link:hover span,
.morae-case-study-card:hover .morae-case-study-link span,
.morae-case-study-card:focus-within .morae-case-study-link span {
  border-color: var(--morae-scarlet-400, #ff3600) !important;
  color: inherit !important;
}

.morae-case-study-link svg,
.morae-case-study-link .morae-btn-icon,
.morae-case-study-section .morae-case-study-link svg,
.morae-case-study-section .morae-case-study-link .morae-btn-icon {
  position: relative;
  z-index: 11;
  width: clamp(10px, 0.8257vw, 16px);
  height: clamp(10px, 0.8257vw, 16px);
  fill: var(--morae-scarlet-400, #ff3600) !important;
  color: var(--morae-scarlet-400, #ff3600) !important;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.morae-case-study-link:hover svg,
.morae-case-study-link:hover .morae-btn-icon,
.morae-case-study-section .morae-case-study-link:hover svg,
.morae-case-study-section .morae-case-study-link:hover .morae-btn-icon,
.morae-case-study-card:hover .morae-case-study-link svg,
.morae-case-study-card:hover .morae-case-study-link .morae-btn-icon,
.morae-case-study-card:focus-within .morae-case-study-link svg,
.morae-case-study-card:focus-within .morae-case-study-link .morae-btn-icon {
  transform: translateX(4px);
  fill: var(--morae-scarlet-400, #ff3600) !important;
}

/* Media / Image Column */
.morae-case-study-media {
  order: 1;
  padding: clamp(1.5rem, 4.7vw, 4.25rem) clamp(1.5rem, 4.7vw, 4.25rem) 0 clamp(1.5rem, 4.7vw, 4.25rem);
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .morae-case-study-media {
    grid-column: span 6;
    order: 2;
    padding: clamp(2.5rem, 6.4583vw, 5.8125rem) 0 clamp(2.5rem, 6.4583vw, 5.8125rem) clamp(2.5rem, 6.4583vw, 5.8125rem);
    display: block;
  }
}

.morae-case-study-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.75;
  overflow: hidden;
  border-radius: 0;
  background-color: var(--morae-bg-minimal, #f5f4f0);
}

.morae-case-study-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}


@media (min-width: 90rem), (min-width: 1440px) {
  .morae-case-study-section {
    padding-bottom: 11.3194vw !important;
  }

  .morae-case-study-topline {
    font-size: 1.3889vw !important;
    line-height: 1.4 !important;
  }

  .morae-case-study-title {
    font-size: 3.2895833vw !important;
    line-height: 1.3 !important;
    margin-top: 1.0416vw;
  }

  .morae-case-study-content,
  .morae-case-study-content p {
    font-size: 1.38899vw !important;
    line-height: 1.6 !important;
    margin-top: 1.0416vw;
  }

  .morae-case-study-nav {
    gap: 0.5555vw !important;
  }

  .morae-case-study-arrow {
    width: 3.3333vw !important;
    height: 3.3333vw !important;
    border-width: 2px !important;
  }

  .morae-case-study-arrow svg {
    width: 1.6666vw !important;
    height: 1.6666vw !important;
  }

  .morae-case-study-slider {
    margin-top: 2.7083vw !important;
  }

  .morae-case-study-body {
    padding: 6.45833vw 0 6.45833vw 6.45833vw !important;
  }

  .morae-case-study-media {
    padding: 6.45833vw 0 6.45833vw 6.45833vw !important;
  }

  .morae-case-study-body-top {
    gap: 1.6666vw !important;
  }

  .morae-case-study-card-title {
    font-size: 1.85416vw !important;
    line-height: 1.5 !important;
    margin: 0 !important;
  }

  .morae-case-study-metric-stat,
  .morae-case-study-metric-stat.text-primary,
  .morae-case-study-section .morae-case-study-metric-stat,
  .morae-case-study-section .morae-case-study-metric-stat.text-primary {
    font-size: 4.3854167vw !important;
    line-height: 1.2 !important;
    border-left-width: 0.05em !important;
    padding-left: 0.4em !important;
  }

  .morae-case-study-metric-stat span {
    font-size: 2.4680556vw !important;
    line-height: 1.4 !important;
  }

  .morae-case-study-metric-label {
    font-size: 1.3889vw !important;
    line-height: 1.5 !important;
    margin-left: 1.3888vw !important;
  }

  .morae-case-study-card-abstract {
    font-size: 1.38899vw !important;
    line-height: 1.5 !important;
    margin: 0 !important;
  }

  .morae-case-study-card-action {
    margin-top: 2.7083vw !important;
  }

  .morae-case-study-link {
    font-size: 0.96458vw !important;
    line-height: 1.5 !important;
    gap: 0.8576vw !important;
  }

  .morae-case-study-link svg,
  .morae-case-study-link .morae-btn-icon,
  .morae-case-study-section .morae-case-study-link svg,
  .morae-case-study-section .morae-case-study-link .morae-btn-icon {
    width: 0.8257vw !important;
    height: 0.8257vw !important;
  }
}
