.sch {
  text-align: center;
  padding-left: var(--side-padding);
  padding-right: var(--side-padding);
  padding-bottom: var(--section-spacing);
  position: relative;
  /* max-width: 1440px; */
  margin: 0 auto;
  width: 100%;
}

.sch-title {
  font-family: var(--secondary-font);
  font-size: 3.25rem;
  font-weight: 200;
  margin-bottom: 1.5rem;
  text-align: left;
}

.sch-items {
  display: grid;
  grid-template-rows: auto auto;
  gap: 0.5rem;
  width: 100%;
  /* max-width: 1440px; */
  margin: 0 auto;
}

.sch-bars-row,
.sch-labels-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 4rem;
  padding: 0;
}

.sch-item {
  display: grid;
  grid-template-rows: auto 350px auto auto;
  width: calc(25% - 3rem);
  flex: none;
  height: 550px;
  align-items: end;
  justify-items: center;
}

.sch-item-bar-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 350px;
  position: relative;
}

.sch-item-bar {
  width: 100%;
  height: 100%;
  background: #eee;
  position: relative;
  overflow: visible;
  display: flex;
  align-items: flex-end;
}

.sch-item-bar-inner {
  width: 100%;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  bottom: 0;
  left: 0;
}

.sch-item-label-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}

.sch-item-label {
  margin-top: 0.5rem;
  text-align: center;
  font-weight: bold;
  width: 100%;
  font-size: 16px;
}

.sch-item-sublabel {
  margin-top: 0.25rem;
  text-align: center;
  font-size: 14px;
  width: 100%;
}

.sch-footnote {
  font-family: var(--secondary-font);
  font-size: 1rem;
  padding-top: 1.5rem;
  margin-top: 1rem;
  text-align: left;
}

.sch-item-value {
  font-size: 28px;
  margin-bottom: 0.5rem;
}

/* =============================
   Styles for bar_chart_long
   ============================= */

.sch-bar-chart-long {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 1rem;
  margin: 2rem auto;
  width: 100%;
  /* max-width: 1440px; */
}

.sch-bar-chart-long-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 30px;
  flex: 1;
  position: relative;
}

.sch-bar-chart-long-label {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.875rem;
  color: var(--text-color);
  text-align: center;
  font-weight: 500;
  white-space: nowrap;
  z-index: 1;
}

.sch-bar-chart-long-stack {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  height: 240px;
  overflow: visible;
  background: transparent;
  position: relative;
  margin-top: 1.5rem;
}

.sch-bar-chart-long-v1 {
  background: #967499;
  width: 100%;
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-out;
  opacity: 1;
  position: relative;
}

.sch-bar-chart-long-v2 {
  background: #584b6e;
  width: 100%;
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-out;
  opacity: 1;
  position: relative;
}

.sch-bar-chart-long-v1:hover::after,
.sch-bar-chart-long-v2:hover::after {
  content: attr(data-value);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 4px);
  background: var(--text-color);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  margin-bottom: 0.25rem;
  z-index: 2;
}

.sch-bar-chart-long-v1:hover::before,
.sch-bar-chart-long-v2:hover::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 4px);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--text-color);
  z-index: 2;
}

.sch-bar-chart-long-year {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-color);
}

/* Key/Legend styles */
.sch-bar-chart-long-key {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
}

.sch-bar-chart-long-key-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-color);
}

.sch-bar-chart-long-key-swatch {
  width: 1rem;
  height: 1rem;
  border-radius: 2px;
}

/* Vertical label styles */
.sch-bar-chart-long-vertical-label {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
  white-space: nowrap;
  font-size: 0.875rem;
  color: var(--text-color);
  padding-left: 1rem;
  font-weight: 500;
}

/* Responsive styles for short bar chart */
@media screen and (max-width: 1023px) {
  .sch {
    padding: 0 1rem;
    margin: 2rem auto;
  }

  .sch-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }

  .sch-bars-row,
  .sch-labels-row {
    gap: 1rem;
  }

  .sch-item {
    width: calc(25% - 0.75rem);
    height: auto;
    grid-template-rows: auto 200px auto auto;
  }

  .sch-item-bar-area {
    height: 200px;
  }

  .sch-item-value {
    font-size: 20px;
    margin-bottom: 0.25rem;
  }

  .sch-item-label {
    font-size: 14px;
    margin-top: 0.25rem;
  }

  .sch-item-sublabel {
    font-size: 12px;
    margin-top: 0.125rem;
  }
}

/* Responsive styles for long bar chart */
@media screen and (max-width: 1023px) {
  .sch-bar-chart-long {
    gap: 0.5rem;
    margin: 1.5rem auto;
  }

  .sch-bar-chart-long-col {
    width: 20px;
  }

  .sch-bar-chart-long-label {
    font-size: 14px;
    top: -4px;
  }

  .sch-bar-chart-long-stack {
    height: 180px;
    margin-top: 1rem;
  }

  .sch-bar-chart-long-year {
    font-size: 14px;
    margin-top: 0.25rem;
  }

  .sch-bar-chart-long-key {
    gap: 1rem;
    margin-top: 1rem;
  }

  .sch-bar-chart-long-key-item {
    font-size: 14px;
    gap: 0.25rem;
  }

  .sch-bar-chart-long-key-swatch {
    width: 0.75rem;
    height: 0.75rem;
  }

  .sch-bar-chart-long-vertical-label {
    font-size: 14px;
    padding-left: 0.5rem;
  }

  .sch-bar-chart-long-v1:hover::after,
  .sch-bar-chart-long-v2:hover::after {
    font-size: 14px;
    padding: 0.125rem 0.25rem;
  }
}

@media screen and (max-width: 560px) {
  .sch-bar-chart-long-label {
    font-size: 8px;
  }

  .sch-bar-chart-long-year {
    font-size: 12px;
  }
}
