.case-page .content-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  color: var(--text-color);
}

.button {
  display: flex;
  align-items: center;
  gap: 0.75em;
  align-self: flex-start;
  justify-content: center;
}

.button > svg {
  height: 1em;
  width: 1em;
}

.case-header-img {
  border-radius: 1.5% / 3.6%;
}

.content-and-index {
  display: flex;
  gap: var(--space-xl);
}

.case-description {
  flex: 3 1 0;
  padding: var(--space-l);
  background-color: var(--case-description-bg);
  border-radius: var(--border-radius-xs);
  box-shadow: 0px 0px 10px 3px rgba(0, 0, 0, 0.08);
}

.case-description h1 {
  margin-bottom: var(--space-m);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: normal;
}

.case-description h2 {
  margin-top: var(--space-m);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: normal;
}

.margin-bottom {
  margin-bottom: var(--space-sm);
}

.case-description ul,
.case-description ol {
  margin: var(--space-m) 0;
}

.case-description li {
  margin-bottom: var(--space-s);
}

.case-description section {
  scroll-margin-top: 4.625rem;
  margin-bottom: var(--space-l);
  counter-reset: section;
}

.case-description section:last-of-type {
  margin-bottom: 0rem;
}

.case-description li {
  font-family: 'Figtree', sans-serif;
}

.bold {
  font-weight: 600;
}

.italic {
  font-style: italic;
}

/* #region - Numbered point */

.numbered-point {  
  counter-increment: section;
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-m);
}

.point-content p:first-child {
  font-size: 1.125rem;
  font-weight: 600;
  padding-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.numbered-point::before {
  font-family: 'Poppins';
  content: counter(section);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75em;
  height: 1.75em;
  background: var(--point-number);
  color: white;
  font-weight: bold;
  font-size: 0.875rem;
  border-radius: var(--border-radius-xxs);
  margin-right: 0.125rem;
  flex-shrink: 0; 
}

/* #endregion - Numbered point */

/* #region - Case index */

.case-index { 
  position: relative;
  font-family: 'Figtree', sans-serif;
  flex: 2 1 0;
  min-width: 0;
  max-width: 350px;
  max-height: calc(100dvh - 3.5rem);
  overflow: auto;
  position: sticky;
  align-self: flex-start;
  order: 2;
  top: 94px;
  padding: var(--space-m);
  background-color: var(--case-description-bg);
  border-radius: var(--border-radius-xs);
  box-shadow: 0px 0px 10px 3px rgba(0, 0, 0, 0.08);
}

.index-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: var(--space-m);
}

#item-counter {
  display: flex;
  gap: 0.1em;
}

.case-index ol {
  padding-left: 0;
  margin: 0;
  counter-reset: index-counter;
}

.case-index li {
  display: flex;
  align-items: center;
  font-size: 1em;
  min-width: 0;
}

.case-index li:not(:last-child) {
  margin-bottom: 0.75em;
}

.case-index li a {
  position: relative;
  gap: 0.5em;
  flex-grow: 1;
  flex-shrink: 1;
  padding-right: 1.25em;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  color: var(--case-index-inactive);
  transition: color 0.4s ease;
}

.case-index li.active a {
  color: var(--text-color);
}

.case-index li ::before, 
.case-index li.active ::before {
  counter-increment: index-counter;
  content: counter(index-counter) ".";
  margin-right: 0.5em;
}

.case-index li ::after {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  content: url(/img/case-page/check.svg);
}

.case-index li ::after {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  content: url(/img/case-page/check-white.svg);
}

.case-index li.active ::after {
  opacity: 1;
  content: url(/img/case-page/check.svg);
}

html.dark .case-index li.active ::after {
  opacity: 1;
  content: url(/img/case-page/check-white.svg);
}

/* #endregion - Case index */

/* #region - Image modal */


.case-description img {
  margin: var(--space-l) 0rem;
  border-radius: var(--border-radius-s);
  cursor: pointer;
}

.case-description img:last-of-type {
  margin-bottom: 0rem;
}

.popup-modal {
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--modal-background);
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.popup-modal.open {
  opacity: 1;
  visibility: visible;
}

.popup-modal span {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 2.5rem;
  font-weight: bolder;
  color: var(--grayscale-0);
  cursor: pointer;
  height: var(--space-xl);
  width: var(--space-xl);
  border-radius: 50%;
}

.popup-modal span:hover {
  background-color: var(--grayscale-60);
}

.popup-modal img {
  max-height: 90%;
  max-width: 85%;
  border: 4px solid var(--grayscale-0);
  border-radius: var(--border-radius-xs);
}

.no-scroll {
  overflow: hidden;
}

/* #endregion - CTA element */

/* #region - CTA element */

.cta-container {
  display: flex;
  gap: var(--space-lm);
  margin-bottom: var(--space-xl);
}

.cta {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  gap: var(--space-sm);
  padding: var(--space-l);
  background-color: var(--card-background);
  border-radius: var(--border-radius-m);
  box-shadow: 0px 0px 10px 3px rgba(0, 0, 0, 0.05);
  container-type: inline-size;
}

.cta-button-container {
  display: flex;
  gap: 0.5em;
  justify-content: flex-end;
}

/* #endregion - CTA element */

/* .case-image {
  border-radius: var(--border-radius-xs);
  border: 1px solid rgba(0, 0, 0, 0.10);
  overflow: hidden;
} */

@media (max-width: 767px) {
  .content-and-index {
    flex-direction: column;
  }

  .case-index {
  order: 0;
  position: relative;
  max-width: none;
  top: 0;
  align-self: stretch;

  flex: none;
  height: auto;
  max-height: calc(100dvh - 3.5rem);
  overflow-y: auto;
  }

  .cta-container {
    flex-direction: column;
  }

  @container (max-width: 450px) {
    .cta-button-container {
      justify-content: center;
    }
  }

}