/* Line Chart */

.c-chart {
  background-color: #F0F7E8;
  background-color: var(--c-foreground-color);
  padding-left: 1.75rem;
  width: auto;
}
.ct-chart {
}
.ct-chart-line {
  overflow: visible;
}

/* line elements */
.ct-line { /* to make points visible assign bigger value than for line */
  stroke-width: 4px;
}
.ct-point { /* to make points visible assign bigger value than for line */
  stroke-width: 8px;
}
.ct-asterisk {
  fill-opacity: 1; 
  stroke: #0056A0;
  stroke-width: 3px;
}

/* set colours for lines (lines are listed from the bottom - 'untreated' - to the top one - 'asterisks') */
.ct-series-a .ct-line, .ct-series-a .ct-point { /* Untreated */
  stroke: #717275;
}
.ct-series-b .ct-line, .ct-series-b .ct-point { /* CeraVe Moisturizing Lotion */
  stroke: #C7A45A;
}
.ct-series-c .ct-line, .ct-series-c .ct-point { /* Cetaphil Moisturizing Lotion */
  stroke: #80C342;
}
.ct-series-d .ct-line, .ct-series-d .ct-point { /* asterisks */
  stroke: #0056A0;
}

/* axis labels */
.ct-label {
  font-size: 1.2rem;
	color: #0056A0;
}
.ct-label.ct-horizontal.ct-end {
  display: block;
}
.ct-chart .ct-grid.ct-horizontal.axis {
  stroke:dimgray;
  stroke-dasharray: none;
}
.ct-chart .ct-grid.ct-vertical.axis {
  stroke:dimgray; 
  stroke-dasharray: none;
}

/* chart axis titles */
/* https://stackoverflow.com/questions/29311970/how-to-add-axis-title-in-chartist */
.ct-axis-title {
  font-size: 1.2rem;
  fill: #0056A0;
}
[data-x-axis]::before {
  content: attr(data-x-axis);
  position: absolute;
  left: 0;
  top: 83%;
  width: 100%;
  text-align: left;
  padding-left: 48px;
  font-size: 1rem;
  color: #0056A0;
}
[data-y-axis]::after {
  content: attr(data-y-axis);
  position: absolute;
  top: 38%;
  left: -16px;
  font-size: 1rem;
  line-height: 1.1;
  color: #0056A0;
  text-align: center;
  transform: translateX(-50%) rotate(-90deg);
  width: 50%;
}

/* chart legend */
.c-legend {
  position: absolute;
  top: 2rem;
  right: 2rem;
  left: unset;
  padding: 10px;
  /* border:black 1px solid; */
  font-size: 1rem;
	color: #0056A0;
	z-index: 1;
}
.c-legend-value {
  margin-bottom: 8px;
  margin-right: 10px;
  display: flex;
  align-items: center;
}
.c-legend-block {
  height: 20px;
  width: 50px;
}
.c-legend-label {
  margin-left: 4px;
  margin-right: 4px;
}
.c-legend-line {
  stroke-width: 7px;
}
.c-legend-point {
}
.c-legend-variance {
  text-align: right;
  font-style: italic;
  padding-left: 50px;
}

/* adjust for small devices */
@media (max-width: 767px) {
  .c-chart {
    padding-left: 4px;
  }
  .ct-golden-section > svg {
    left: 16px;
  }
  .ct-label {
  } 
  [data-x-axis]::before {
    top: 83%;
    left: 20px;
    font-size: 1rem;
  }
  [data-y-axis]::after {
    left: 4px;
    font-size: 1rem;
    top: 35%;
    width: 50%;
  }
  .c-legend {
    top: 1rem;
    right: 0rem;
    font-size: 0.9rem;
  }
}

/* adjust for extra small devices (but don't impact desktop zoom) */
@media (max-width: 575px) {
  .c-chart {
    /* max-height: calc(9/16 * 100vw); */
    margin-bottom: 3rem;
    padding-left: 4px;
    padding-bottom: 0rem;
  }
  .ct-golden-section > svg {
    left: 4px;
  }
  .ct-line { /* to make points visible assign bigger value than for line */
    stroke-width: 3px;
  }
  .ct-point { /* to make points visible assign bigger value than for line */
    stroke-width: 6px;
  }
  .ct-asterisk {
    stroke-width: 2px;
    transform-box: fill-box;
    transform: scale(0.5) translateX(10px) translateY(10px);
  }
  .ct-label {
    font-size: 0.7rem;
  }
  [data-x-axis]::before {
    top: 78%;
    left: 4px;
    font-size: 0.7rem;
  }
  [data-y-axis]::after {
    font-size: 0.7rem;
    left: 4px;
    top: 35%;
    width: 52%;
  }
  .c-legend {
    position: absolute;
    top: 90%;
    right: 0;
    left: 8px;
    display: flex;
    max-width: 100%;
    padding: 0px;
  }
  .c-legend-value {
    font-size: 0.7rem;
    line-height: 1.2;
    margin-bottom: 0;
    margin-right: 0;
    width: 100px;
  }
  .c-legend-block {
    height: 20px;
    max-width: 20px;
  }
  .c-legend-label {
      margin-right: 8px;
  }
  .c-legend-line {
    stroke-width: 16px;
    transform: scaleX(0.5)
  }
  .c-legend-point {
    transform: translateY(25%) scale(0.5);
  }
  .c-legend-variance {
    padding-left: 0px;
    padding-right: 4px;
    text-align: center;
    max-width: 5rem;
  }
}
/* adjust for really small devices */
@media (max-width: 374px) {
  h1 {
    padding: 1rem 0.5rem;
  }
  .ct-label {
    font-size: 0.6rem;
  }
  .c-legend {
    left: -6px;
  }
  .c-legend-value {
    font-size: 0.65rem;
    line-height: 1.1;
  }
  .c-legend-label {
    margin-right: 6px;
  }
}

/* adjust for large devices */
@media (min-width: 769px) {
  [data-x-axis]::before {
    top: 83%;
    font-size: 1.25rem;
    line-height: 1.1;
  }
  [data-y-axis]::after {
    font-size: 1.25rem;
  }
}
@media (min-width: 992px) {
  .c-chart {
    padding-left: 36px;
  }
}
@media (min-device-width: 1200px) {
  .c-chart {
    margin-left: 20%;
  }
  .ct-label {
  }
  [data-x-axis]::before {
    top: 74%;
    font-size: 1.5rem;
  }
  [data-y-axis]::after {
    left: -4%;
    top: 33%;
    font-size: 1.5rem;
    width: 45%;
  }
  .c-legend {
    left: 45%;
  }
}

/* default chart settinigs for small width on desktops */
@media only screen 
  and (min-device-width: 1200px) 
  and (max-width: 1200px) {
    .c-chart {
      margin-left: 5%;
    }
    .ct-label {
      font-size: 1rem;
    }
    [data-x-axis]::before {
      font-size: 1rem;
      top: 82%;
    }
    [data-y-axis]::after {
      font-size: 1rem;
    }
    .c-legend {
      font-size: 1rem;
    }
}
@media only screen 
  and (min-device-width: 1200px) 
  and (max-width: 767px) {
    .ct-label {
      font-size: 0.75rem;
    }
    [data-x-axis]::before {
      font-size: 0.75rem;
    }
    [data-y-axis]::after {
      left: 0;
      font-size: 0.75rem;
    }
    .c-legend {
      font-size: 0.75rem;
      top: 0.5rem;
      right: 0.5rem;
      left: unset;
    }
}

@media only screen 
  and (min-device-width: 1200px) 
  and (max-width: 575px) {
    .ct-label {
      font-size: 0.60rem;
    }
    [data-x-axis]::before {
      top: 80%;
      font-size: 0.60rem;
    }
    [data-y-axis]::after {
      left: 0;
      font-size: 0.60rem;
    }
    .c-legend {
      left: 10px;
      top: 95%;
      display: flex;
      max-width: 100%;
      padding: 0px;
      font-size: 0.75rem;
    }
    .c-legend-value {
      width: 120px;
    }
  }
