/* @import './script.css'; */

:root {
    /* Primary */
    --col-ochre: #f0b323;
    --col-charcoal: #373a36;
    /* Secondary */
    --col-teal: #009d98;
    --col-slate: #a7bbc5;
}

* {
    font-family: inherit;
    line-height: inherit;
    color: inherit;
}

* {
    margin: 0;
    scroll-margin-top: 2rem;
    & + * {
        margin-top: 1.5em;
    }
}

.no-space {
    margin-top: 0;
}

html {
    font-family: 'Gilroy';
    font-size: 125%;
    line-height: 1.5;
    color: #222;
    background: #eeeeee;
    scrollbar-gutter: stable;
    height: 100%;
    scroll-behaviour: smooth;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    > * {
        width: 100%;
        flex-shrink: 0;
    }
    > main {
        flex-grow: 1;
    }
}

h1, h2, h3, h4, [data-headline] {
    font-weight: 400;
}

h1 {
    font-size: min(3rem, 12vw);
}

h2 {
    font-size: min(2.5rem, 10vw);
}

h3 {
    font-size: min(1.5rem, 6vw);
}

main > *:not(.full-width), body header, body nav, .container > *  {
    padding-inline: 0.5rem;
    max-width: 120rem;
    margin-inline: auto;
}

input, textarea, button {
    font-size: inherit;
}

label, input {
    display: block
}

body, br, li, dt, dd, th, td, option, input, table > *, thead > *, tbody > * {
    margin-top: 0;
}

details {
    summary {
        cursor: pointer;
        > * {
            display: inline;
            flex-grow: 1;
        }
    }
}

.block {
    padding-block: 1em;
    &.ochre {
        color: var(--col-charcoal);
        background-color: var(--col-ochre);
    }
    &.teal {
        color: white; /*var(--col-charcoal);*/
        background-color: var(--col-teal);
    }
    &.grey {
        color: var(--col-ochre);
        background-color: var(--col-charcoal);
    }
}

.flex-grid {
    display: flex;
    flex-wrap: wrap;
    > * {
        flex-grow: 1;
        margin-top: 0;
    }
}

.table-container {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    caption {
        text-align: left;
        font-weight: 800;
    }
    th {
        background: var(--col-charcoal);
        color: white;
    }
    td, th {
        padding: 0.1rem 0.3rem;
        border: 1px solid var(--col-slate);
    }
}

hr {
    border-width: 2em;
}

.visually-hidden {
    &:not(:focus):not(:active) {
        /* https://a11yproject.com/posts/how-to-hide-content/ */
        position: absolute;
        height: 1px;
        width: 1px;
        overflow: hidden;
        /*clip with spaces for older browsers*/
        clip: rect(1px 1px 1px 1px);
        /*clip with commas for most browsers*/
        clip: rect(1px, 1px, 1px, 1px);
        /*clip-path for newer browsers*/
        clip-path: rect(1px, 1px, 1px, 1px);
    }
    &:focus {
        position: static;
        width: auto;
        height: auto;
        overflow: auto;
    }
}

[data-comp="Headline"] {
  flex-flow: wrap;
  gap: 1rem;
  width: 100%;
  font-size: min(2rem, 6vw);
  display: flex;

  & .wrapper {
    color: var(--col-charcoal);
    background: var(--col-ochre);
    text-align: center;
    flex-direction: column;
    flex-grow: 1;
    flex-basis: 10rem;
    justify-content: space-between;
    margin-top: 0;
    padding: 1rem;
    display: flex;
  }

  & dt {
    font-weight: 100;
  }

  & dd {
    font-size: min(6rem, 12vw);
    font-weight: 700;
  }
}

.response-bar {
  background: #333;

  & .bb-axis {
    fill: #fff;

    & line, & path {
      stroke: #fff;
    }
  }
}

.bb {
  & svg {
    margin-inline: auto;
  }

  & text {
    font-size: 16px;
  }
}

.bb-tooltip-container {
  margin-top: 0;
}

.bb-tooltip {
  & td {
    color: var(--col-charcoal, "black");
  }

  & th {
    text-wrap: wrap;
    max-width: 60vw;
  }
}

[data-viz-type="map"] {
  & path {
    stroke: #fff;
    stroke-width: .01px;
    stroke-linejoin: round;
    fill: #808080cc;

    &.active {
      fill: #999c;
    }
  }
}

details {
  position: relative;

  & summary {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    display: flex;

    &:after {
      content: "+";
      color: #fff;
      aspect-ratio: 1;
      text-align: center;
      background: #000;
      border: 4px solid #fff;
      border-radius: 5rem;
      height: 1em;
      margin: .5rem;
      font-size: min(3rem, 10vw);
      line-height: 1;
      display: block;
    }
  }

  &[open] summary {
    z-index: 100;
    top: 0;

    &:after {
      content: "-";
    }
  }
}

[data-comp="response.Presentation"] {
  & .content {
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem 6rem;
    display: flex;

    & > * {
      flex: 27em;
      margin-top: 0;
    }

    & > .narrative {
      flex-grow: 1;
      max-width: 100%;

      & > .wv-wrapper + * {
        margin-top: 0;
      }
    }
  }

  & .statistics {
    font-size: 1.5em;
  }

  & .friendly {
    text-align: center;
    font-size: min(2em, 10vw);
    font-weight: 500;
    line-height: 1;
  }
}

[data-comp="ResponseSummary"] {
  align-items: center;
  gap: 1rem;
  max-width: 85%;
  font-size: min(2.5rem, 5vw);
  font-weight: 100;
  display: inline-flex;

  & * {
    margin-top: 0;
  }

  & .number {
    text-align: center;
    line-height: 1;

    & .percent {
      font-size: 2em;
      font-weight: 700;
    }
  }
}

.response-gauge {
  background: #333;

  & .bb-legend {
    fill: #fff;
  }

  & .bb-needle {
    stroke: none;
  }
}

body header {
  box-sizing: border-box;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding-block: 1rem;
  font-size: 2rem;
  font-weight: 800;
  display: flex;

  & img {
    height: 1.5em;
  }
}

[data-comp-Nav] {
  box-sizing: border-box;

  & ul {
    gap: 1ch;
    padding-inline: 0;
    list-style: none;
    display: flex;
  }
}

body footer {
  box-sizing: border-box;
  color: var(--col-white, white);
  background: var(--col-charcoal);
  flex-direction: column;
  gap: 1rem;
  margin-block-start: 2rem;
  padding-block: 1rem;
  padding-inline: .5em;
  display: flex;

  & * + * {
    margin-block-start: 0;
  }

  & a {
    text-decoration: unset;
    font-weight: 700;

    &:hover {
      text-decoration: underline;
    }
  }

  & ul {
    padding-inline-start: 0;
    list-style: none;
  }

  & > .columns {
    justify-content: space-between;
    gap: 1rem;
    display: flex;
  }

  & .copyright {
    font-size: .7rem;
  }
}
