@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300&display=swap');


:root {
  --styleguide_brand: hsl(280, 84%, 31%);
  --bright_orange: hsl(42, 100%, 55%);
  --lime_green: hsl(63, 88%, 46%);
  --sky_blue: hsl(182, 67%, 75%);
  --coral_pink: hsl(358, 100%, 73%);
  --fresh_green: hsl(78, 100%, 37%);
  --marine_turquoise: hsl(176, 82%, 38%);
  --royal_purple: hsl(312, 100%, 31%);
  --grass_green: hsl(145, 100%, 26%);
  --midnight_blue: hsl(207, 100%, 17%);
  --chalk_white: hsl(0, 0%, 100%);
  --faded_white: hsl(193, 100%, 60%);
  --ink_black: hsl(0, 0%, 0%);
  --mist_grey: hsl(180, 3%, 88%);
  --graphite_grey: hsl(193, 5%, 33%);
  
  --styleguide_pale: hsl(193, 50%, 96%);

  --warning: hsl(41, 87%, 47%);
  --warning_bg: hsl(41, 87%, 96%);
  --avoid: hsl(348, 83%, 47%);
  --avoid_bg: hsl(348, 83%, 98%);

  --sidebar-width: 15rem;
  --main-width: 56rem;

  --toc_title_font_size: 1.1rem;
  --toc_heading_font_size: 1.0rem;
  --toc_expand_button_size: 0.9rem;

  --chart_type_card: 6.25rem;
  --chart_type_image: 5.25rem;
  --chart_type_label: 1.0rem;
  --chart_type_card_gap: 0.5rem;
}


/* OPTIONS */


/* END OPTIONS */


body {
  font-family: 'Open Sans', Arial, sans-serif;
}

h1 {
  color: var(--styleguide_brand);
}

h2 {
  font-size: 1.6rem;
  color: var(--styleguide_brand);
}

h3 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-block-start: 0.5rem;
  margin-block-end: 0.5rem;
  color: var(--styleguide_brand);
}

h4 {
  font-size: 1.35rem;
  font-weight: bold;
}

h5 {
  font-size: 1.2rem;
  font-weight: bold;
  margin-block-end: 0;
}

h6 {
  font-size: 1rem;
  font-weight: bold;
}

section.examples {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
}

section.examples.two {
  flex-wrap: wrap;
}

  section.examples > figure {
    width: 15rem;
    padding: 0.5rem 2px;
  }

  section.examples > figure.warning {
    outline: 2px dashed var(--warning);
    background-color: var(--warning_bg);
  }

  section.examples > figure.avoid {
    outline: 2px dashed var(--avoid);
    background-color: var(--avoid_bg);
  }

  section.examples.two > figure {
    width: 40%;
    padding: 0.5rem 0;
  }

  figcaption {
    text-align: center;
  }

  figcaption > span.lead {
    text-transform: uppercase;
    font-weight: bold;
  }

  article figure {
    max-width: 20rem;
    /* display: inline-block; */
  }

  article div.figures {
    display: flex;
  }

    section.large > figure.readable_font,
    section.large > figure.readable_font img {
      width: 30rem;    
    }

    section.large > figure.unreadable_font img {
      width: 15rem;
    }

  article figure.quote {
    max-width: 80%;
    width: 80%;
    margin: auto;
  }

img.palette {
  height: 50px;
}

.draft {
  color: var(--chalk_white);
  background-color: var(--warning);
  padding: 0.1rem 0.5rem;
}



/* TOC */ 

main, 
header {
  font-family: inherit;
  max-width: var(--main-width);
  /* margin: 1rem auto; */
  margin-left: var(--sidebar-width); 
  padding: 0 2rem 2rem 2rem;
}

nav#toc {
  height: 100vh;
  max-width: var(--sidebar-width);
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  background-color: var(--styleguide_brand);
  color: var(--chalk_white);
  overflow-x: hidden;
  padding-top: 20px;
  padding: 0.5rem;
}


#toc ul,
#a11y-checklist-list {
  list-style-type: none;
  margin: 0;
  padding: 0;
}


div#toc-list {
  /* add buffer zone at bottom for scrolling */
  padding-bottom: 15%; 
}

nav#toc a {
  text-decoration: none;
  color: var(--chalk_white);
}

nav#toc a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2rem;
  text-decoration-skip: auto;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--chalk_white);
}

nav#toc details > ul,
nav#toc li > ul  {
  margin-left: 1.5rem;
}

nav#toc li > ul.topic  {
  margin-left: 0;
}

nav#toc li.grouping {
  margin-top: 1.1rem;
}

nav#toc details > summary::marker {
  font-family: Arial, Helvetica, sans-serif;
  display: block;
  content: '+ ';
}

nav#toc details[open] > summary::marker {
  /* use minus sign, not hyphen */
  content: '− ';
}

nav#toc details#toc-toggle > summary::marker {
  content: '';
}

nav#toc details#toc-toggle > summary {
  font-size: 2rem;
  margin-left: -0.3rem;
  padding-left: 0.2rem;
  cursor: pointer;
}

nav#toc #toc_expand_button {
  background-color: var(--chalk_white);
  color: var(--styleguide_brand);
  border: 0;
  border-radius: 50%;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  margin: 0.5rem 0 -0.5rem 0.25rem;
  width: var(--toc_expand_button_size);
  height: var(--toc_expand_button_size);
  padding: 0; 
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: var(--toc_expand_button_size);
  cursor: pointer;
}

nav#toc details summary {
  list-style-position: outside;
  margin-left: 1rem;
} 

nav#toc ul details summary,
nav#toc li.no-child  {
  font-size: var(--toc_heading_font_size);
}

nav#toc li.no-child  {
  margin-left: 1rem;
}

nav#toc li.grouping > span.grouping-title {
  font-size: var(--toc_title_font_size);
}


/* link target highlight for TOC */
*:target {
  text-decoration: underline;
  text-decoration-skip: auto;
  text-decoration-color: var(--styleguide_brand);
  text-decoration-thickness: 4px;
  text-underline-offset: 5px;
} 

/* larger size screen */

@media screen and (max-height: 450px) {
  nav#toc {padding-top: 15px;}
  nav#toc a {font-size: 18px;}
}


/* selecting chart types */

.optionSelector,
.optionContainer {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--chart_type_card_gap);
  flex-direction: row;
  justify-content: flex-start;
  overflow: hidden;
  margin: 10px;
}

.optionSelector {
  color: var(--styleguide_brand);
}


.optionSelector.chart_category {
  color: var(--royal_purple);
}

.optionSelector.series_selector {
  color: var(--grass_green);
}

.optionSelector.measurement_level_selector {
  color: var(--midnight_blue);
}

.optionContainer {
  margin: 0;
  border: none;
  border-radius: 0;
}

.optionGroup {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--mist_grey);
  border-radius: 4px;
  overflow: hidden;
}

[role=option] {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--mist_grey);
  border-radius: 4px;
  overflow: hidden;
  width: var(--chart_type_card);
  color: currentColor;
  cursor: pointer;
}


  .option__description {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
  }

  [role=option] img {
    width: var(--chart_type_image);
  }


  .option__label {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.3rem 0;
    font-size: var(--chart_type_label);
    border-top: 1px solid var(--mist_grey);
    background-color: var(--styleguide_pale);
    color: currentColor;
    cursor: pointer;
  }

  .optionGroup > .option__label {
    border-top: none;
    border-bottom: 1px solid var(--mist_grey);
    color: currentColor;
  }

[role=option][aria-selected=true],
[role=option]:focus,
[role=option]:hover {
  background-color: currentColor;
}



/* filtering sections and lists */

.hide_section:not(nav#toc li.hide_section) {
  display: none;
}

nav#toc li.hide_section {
  /* display: initial; */
  opacity: 0.5;
}

nav#toc li.hide_section a {
  pointer-events: none;
}


article.general,
article#chart-selector,
article[data-chart_type] {
  border: var(--mist_grey) solid 1px;
  margin: 10px;
  padding: 0 10px 10px 10px;
  border-radius: 4px;
}


.chart_type details summary { 
  margin-left: 2rem;
  cursor: pointer;
}

.chart_type details {
  margin-top: 0.5rem;
}

.chart_type summary {
  margin-top: 0.5rem;
}

.chart_type details > *:not(summary) {
  margin-left: 3rem;
}

.todo b,
.cite b {
  font-variant: small-caps;
  font-size: smaller;
  color: var(--royal_purple);
}

#gallery img {
  width: 150px;
}


/* General */

ul#a11y-checklist-list li input[type=checkbox] {
  width: 1.1rem;
  height: 1.1rem;
  border-color: var(--styleguide_brand);
}

ul#a11y-checklist-list li input[type=checkbox]:checked {
  accent-color: var(--styleguide_brand);
}

.palette_type {
  font-size: 1.1rem;
}

/* a.reference {
  text-decoration: none;
  color: var(--ink_black);
} */

/* temp */
img[src='.'] {
  outline: red solid 2px;
}

figure {
  background-color: hsl(350, 100%, 88%, 0.4);
}

figure:has(> img[src='.']) {
  outline: red solid 2px;
}