:root {
  --brand-dark: #4A2B33;
  --brand-light: #E8C4C8;
}

.transition-max-height {
  transition: max-height 0.3s ease-in-out;
}

.sidebar-link,
.sidebar-link-active {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}

.sidebar-link {
  color: rgb(120 113 108);
  transition: color 0.15s, background-color 0.15s;
}

.sidebar-link:hover {
  color: rgb(28 25 23);
  background-color: rgb(250 250 249);
}

.sidebar-link-active {
  color: rgb(28 25 23);
  background-color: rgb(245 245 244);
}

.sidebar-submenu {
  margin-left: 1.25rem;
  padding-top: 0.25rem;
  padding-left: 1rem;
  position: relative;
}

.submenu-track {
  position: absolute;
  left: 3px;
  top: 0;
  bottom: 1rem;
  width: 1px;
  background-color: rgb(231 229 228);
}

.sub-connector {
  position: absolute;
  width: 1rem;
  border-bottom: 1px solid rgb(231 229 228);
  border-left: 1px solid rgb(231 229 228);
  border-bottom-left-radius: 0.75rem;
  left: -13px;
}

.sub-connector--first {
  height: 50%;
  top: 0;
}

.sub-connector--last {
  height: 100%;
  top: -50%;
}

@media (min-width: 1024px) {
  #sidebar-nav-panel {
    max-height: none !important;
    overflow: visible !important;
  }
}

.data-card {
  background-color: rgb(250 250 250);
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid rgb(245 245 245);
}

.data-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgb(163 163 163);
  margin-bottom: 0.25rem;
}

.btn-view-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background-color: rgb(23 23 23);
  border-radius: 1rem;
  padding: 0.625rem 1rem;
  transition: background-color 0.15s ease;
}

.btn-view-more:hover {
  background-color: rgb(0 0 0);
}

.article-card {
  border-radius: 1.5rem;
  padding: 0.25rem;
  background-color: rgb(250 250 249);
  box-shadow: 0 0 0 1px rgb(229 229 229);
  transition:
    flex 0.6s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.4s ease,
    min-width 0.6s ease,
    transform 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.article-card:hover {
  transform: translateY(-2px);
}

@media (max-width: 1023px) {
  #expect-grid .article-card:nth-of-type(1) {
    order: 1;
  }

  #expect-grid .article-card:nth-of-type(2) {
    order: 3;
  }

  #expect-grid .article-card:nth-of-type(3) {
    order: 5;
  }

  #expect-grid.grid-has-active #expect-detail-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDownMobile 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  #expect-grid #expect-detail-card.fading-out {
    animation: slideUpMobile 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
  }

  @keyframes slideDownMobile {
    0% {
      opacity: 0;
      max-height: 0;
      padding-top: 0;
      padding-bottom: 0;
      margin-top: 0;
      border-width: 0;
      transform: translateY(-10px);
    }

    100% {
      opacity: 1;
      max-height: 3000px;
      padding-top: 2rem;
      padding-bottom: 2rem;
      margin-top: 0.5rem;
      border-width: 1px;
      transform: translateY(0);
    }
  }

  @keyframes slideUpMobile {
    0% {
      opacity: 1;
      max-height: 3000px;
      padding-top: 2rem;
      padding-bottom: 2rem;
      margin-top: 0.5rem;
      border-width: 1px;
      transform: translateY(0);
    }

    100% {
      opacity: 0;
      max-height: 0;
      padding-top: 0;
      padding-bottom: 0;
      margin-top: 0;
      border-width: 0;
      transform: translateY(-10px);
    }
  }
}

@media (min-width: 1024px) {
  #expect-grid.grid-has-active .article-card.active {
    order: -2 !important;
    z-index: 10;
  }

  #expect-grid.grid-has-active .article-card:not(.active):not(#expect-detail-card) {
    display: none;
  }

  #expect-grid.grid-has-active #expect-detail-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    order: -1 !important;
    opacity: 0;
    animation: fadeInSlide 0.6s ease forwards;
    animation-delay: 0.4s;
  }

  @keyframes fadeInSlide {
    from {
      opacity: 0;
      transform: translateX(-50px);
      clip-path: inset(0 100% 0 0);
    }

    to {
      opacity: 1;
      transform: translateX(0);
      clip-path: inset(0 0 0 0);
    }
  }

  #expect-grid {
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  #expect-grid.layout-shifting {
    opacity: 0;
    transform: translateY(5px);
  }

  #expect-detail-card.fading-out {
    animation: detailFadeOut 0.6s ease forwards !important;
  }

  @keyframes detailFadeOut {
    from {
      opacity: 1;
      transform: translateX(0);
      clip-path: inset(0 0 0 0);
    }

    to {
      opacity: 0;
      transform: translateX(-50px);
      clip-path: inset(0 100% 0 0);
    }
  }

  #expect-grid.returning .article-card:not(.was-active) {
    animation: cardsFadeIn 0.8s ease forwards;
  }

  @keyframes cardsFadeIn {
    from {
      opacity: 0;
      transform: scale(0.98);
    }

    to {
      opacity: 1;
      transform: scale(1);
    }
  }
}