/* line chart elements */
:root {
	--c-chart-text-colour: grey;
}
.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-golden-section > svg {
  overflow: visible;
}

/* set colours for lines (lines are listed from the top - 'Cetaphil Moisturizing Lotion' - to the bottom one - 'Placebo') */
.ct-series-d .ct-line, .ct-series-d .ct-point, .ct-series-d .ct-pointlabel  { /* Cetaphil Moisturizing Lotion */
  stroke: #5B9BD5;
}
.ct-series-e .ct-line, .ct-series-e .ct-point, .ct-series-e .ct-pointlabel  { /* Cetaphil Moisturizing Cream */
  stroke: #ED7D31;
}
.ct-series-f .ct-line, .ct-series-f .ct-point, .ct-series-f .ct-pointlabel  { /* Cetaphil DailyAdvance Lotion */
  stroke: #858585;
}
.ct-series-b .ct-line, .ct-series-b .ct-point, .ct-series-b .ct-pointlabel  { /* Aveeno Body Yogurt */
  stroke: #FFC000;
}
.ct-series-c .ct-line, .ct-series-c .ct-point, .ct-series-c .ct-pointlabel  { /* Eucerin Advanced Repair Lotion */
  stroke: #2452A4;
}
.ct-series-a .ct-line, .ct-series-a .ct-point, .ct-series-a .ct-pointlabel { /* Placebo */
  stroke: #609D37;
}

/* axis labels */
.ct-label {
  font-size: 1.2rem;
	color: var(--c-chart-text-colour);
}
.ct-label.ct-pointlabel {
    font-size: 1.3rem;
}
.ct-label.ct-horizontal.ct-end {
  display: block;
  text-align: center;
}
.ct-chart .ct-grid.ct-horizontal.axis {
  stroke:dimgray;
  stroke-dasharray: none;
}
.ct-chart .ct-grid.ct-vertical.axis {
  stroke:dimgray; 
  stroke-dasharray: none; 
}

/* axis titles */
/* https://stackoverflow.com/questions/29311970/how-to-add-axis-title-in-chartist */
[data-x-axis]::before {
  content: attr(data-x-axis);
	position: absolute;
	left: 0;
  top: 88%;
  width: 100%;
  text-align: center;
  font-size: 1.15rem;
  color: var(--c-chart-text-colour);
}
[data-y-axis]::after {
  content: attr(data-y-axis);
  position: absolute;
  top: 39%;
  left: 4px;
  font-size: 1.15rem;
  line-height: 1.1;
  color: var(--c-chart-text-colour);
  text-align: center;
  transform: translateX(-50%) rotate(-90deg);
}

/* legend -> */
.c-legend {
	position: absolute;
  top: 31%;
  right: 11rem;
  padding: 10px;
  /* border:black 1px solid; */
  font-size: 1rem;
	color: var(--c-chart-text-colour);
	max-width: 400px;
	z-index: 1;
}
.c-legend-value {
  display: flex;
  align-items: center;
}
.c-legend-block {
	height: 20px;
  width: 40px;
}
.c-legend-label {
  margin-left: 4px;
  margin-right: 16px;
}
.c-legend-line {
  stroke-width: 7px;
}
.c-legend-point {
}
.c-legend-finals {
		position: absolute;
		top: 20%;
		right: -16px;
}
/* <- legend */

/* adjust for large devices */
@media all
  and (min-device-width: 1200px)
  and (min-width: 1201px) {
  .c-chart {
    margin-left: 10%;
  }
}

/* adjust for small devices */
@media (max-width: 767px) {
  .ct-line { /* to make points visible assign bigger value than for line */
    stroke-width: 2px;
  }
  .ct-golden-section > svg {
    left: 4px;
  }
  .ct-point { /* to make points visible assign bigger value than for line */
    stroke-width: 6px;
	}
	.ct-label {
    font-size: 0.9rem;
  }
  .ct-label.ct-pointlabel {
    font-size: 0.75rem;
  }
  .ct-series-b .ct-pointlabel  {
    transform: translateY(1px);
  }
  .ct-series-d .ct-pointlabel  {
    transform: translateY(6px);
  }
  .ct-series-f .ct-pointlabel  {
    transform: translateY(-4px);
  }
  [data-x-axis]::before {
    top: 86%;
    font-size: .9rem;
  }
  [data-y-axis]::after {
    font-size: .9rem;
    line-height: 1.1;
    left: 8px;
    width: 50%;
	}
	.c-chart-title {
		max-width: 90%;
		margin: auto;
	}
  .c-legend {
    position: absolute;
    top: 95%;
    left: 0px;
    display: flex;
    flex-flow: wrap;
    justify-content: center;
    padding: 0px;
    font-size: 0.9rem;
    width: 100%;
    max-width: calc(100vw - 8px);
  }
  .c-legend-value {
    line-height: 1.1;
    margin-bottom: 8px;
    margin-right: 0;
    width: 112px;
  }
  .c-legend-block {
    height: 16px;
		max-width: 16px;
		padding-right: 2px;
  }
  .c-legend-label {
		margin-left: 4px;
		margin-right: 4px;
		text-align: left;
  }
  .c-legend-line {
    stroke-width: 16px;
    /* transform: translate(10%) scaleX(0.3) */
  }
  .c-legend-point {
    transform: translateY(33%) scale(0.4);
	}
	.c-legend-finals {
		position: absolute;
		top: 4px;
	}
}

/* adjust for extra small devices */
@media (max-width: 575px) {
  .c-legend {
    top: 100%;
    left: 0px;
    font-size: 0.8rem;
    width: 100%;
  }
  .c-legend-value {
    width: 104px;
  }
  [data-x-axis]::before {
    top: 86%;
  }
  [data-y-axis]::after {
    top: 33%;
  }
}

/* adjust for really small devices */
@media (max-width: 374px) {
  .ct-label.ct-pointlabel {
    font-size: 0.7rem;
  }
  [data-x-axis]::before {
    top: 80%;
  }
  .c-legend {
    font-size: 0.75rem;
    top: 95%;
    left: 8px;
  }
  .c-legend-value {
    line-height: 1.0;
    width: 100px;
  }
  .ct-label {
    font-size: 0.75rem;
  }
  [data-y-axis]::after {
    font-size: 0.75rem;
  }
  .c-legend-variance {
    margin-top: 0.25rem;
  }
}

/* adjust for large devices */
@media (min-width: 1200px) {
	.c-chart {
		margin-left: 15%;
	}
	[data-x-axis]::before {
		top: 75%;
		left: -12%;
	}
	[data-y-axis]::after {
		left: 0px;
	}
	.c-legend {
		line-height: 1.5;
	}
}

/* default chart settinigs for small width on desktops */
@media only screen 
  and (min-device-width: 1200px) 
  and (max-width: 1200px) {
    .ct-label {
      font-size: 1rem;
    }
    [data-x-axis]::before {
      font-size: 1rem;
    }
    [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 {
      font-size: 0.75rem;
    }
    .c-legend {
      font-size: 0.75rem;
      left: 10%;
    }
    .c-legend-value {
      max-width: 100px;
    }
    .c-legend-label {
      margin-left: 2px;
    }
}
