[grid]{display:flex;flex-wrap:wrap;contain:layout}[grid][order~=reverse]{flex-direction:row-reverse}[grid][horizontally-aligned~=left]{justify-content:flex-start}[grid][horizontally-aligned~=center]{justify-content:center}[grid][horizontally-aligned~=right]{justify-content:flex-end}[grid][vertically-aligned~=top],[grid~=rows]{align-items:flex-start}[grid][vertically-aligned~=center]{align-items:center}[grid][vertically-aligned~=bottom]{align-items:flex-end}[grid][vertically-aligned~=baseline]{align-items:baseline}[grid][horizontally-distributed~=around]{justify-content:space-around}[grid][horizontally-distributed~=between]{justify-content:space-between}[grid][horizontally-distributed~=equal]>*{flex-grow:1}[grid][vertically-distributed~=around]{align-content:space-around}[grid][vertically-distributed~=between]{align-content:space-between}[grid][vertically-distributed~=equal]{align-items:stretch}[grid][columns~="2"]>*{flex-basis:50%}[grid][columns~="3"]>*{flex-basis:33.333333333333336%}[grid][columns~="4"]>*{flex-basis:25%}[grid][columns~="5"]>*{flex-basis:20%}[grid][columns~="6"]>*{flex-basis:16.666666666666668%}[grid][columns~="7"]>*{flex-basis:14.285714285714286%}[grid][columns~="8"]>*{flex-basis:12.5%}[grid][columns~="9"]>*{flex-basis:11.11111111111111%}[grid][columns~="10"]>*{flex-basis:10%}[grid][columns~="11"]>*{flex-basis:9.090909090909092%}[grid][columns~="12"]>*{flex-basis:8.333333333333334%}[grid~=columns][vertically-distributed~=equal]{align-items:stretch}[grid~=columns][vertically-distributed~=equal]>*{height:auto}[grid~=rows]{flex-direction:column}[grid~=rows][order~=reverse]{flex-direction:column-reverse}[grid~=rows][horizontally-aligned~=center]{align-items:center}[grid~=rows][horizontally-aligned~=right]{align-items:flex-end}[grid~=rows][vertically-distributed~=around]{justify-content:space-around}[grid~=rows][vertically-distributed~=between]{justify-content:space-between}[grid~=rows][vertically-distributed~=equal]>*{width:initial}[grid~=masonry]{flex-flow:column wrap;height:20rem}body {
  min-height: 100vh;
}

body:not([testing]) [data-selected=true] {
  transition: all 0.15s ease;
}

[data-pseudo-select=true] {
  outline: 1px dashed hsl(267, 100%, 58%);
}

[data-selected-hide=true][data-selected=true]:after {
  display: none;
}

[data-selected=true][contenteditable=true] {
  caret-color: var(--neon-pink);
}

[data-measuring=true] {
  cursor: crosshair;
}

[draggable=true] {
  cursor: grab;

  &:active {
    cursor: grabbing;
  }

  & :is(a, img) {
    -webkit-user-drag: none !important;
  }
}

h1,h2,h3 {
  font-family: "Google Sans", system-ui;
  font-weight: lighter;
  line-height: 1.2;
  margin: 0;
}

small {
  color: var(--mid-grey);
}

a {
  color: var(--theme-color);

  &[href]:not(:hover) {
    text-decoration: none;
  }
}

[text-styles] {
  padding: 0 2rem 2rem;
}

[bad-contrast] {
  padding: 1rem 2rem;
  background:  hsl(0,0%,40%);
  color: hsl(0,0%,70%);
}

[good-contrast] {
  padding: 1rem 2rem;
  font-weight: bold;
  background:  black;
  color: white;
}

.artboard {
  background: white;
  color: var(--light-grey);
  box-shadow: 0 1px 2px 1px hsla(0,0%,0%,5%);
  position: relative;
  z-index: 1;
  margin-top: 1.5rem;

  &[flex] {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  &[padded], & > [padded] {
    padding: 0.5rem;
  }

  &.dark {
    background: var(--dark-grey);
    border: 1px solid var(--darker-grey);
    box-shadow: none;
    color: var(--lighter-grey);
  }

  &.message {
    display: flex;
    justify-content: center;
    flex-direction: column;
    padding: 1.5rem;

    & > h2 {
      font-weight: bold;
    }

    & > p {
      line-height: 1.5;
      margin-bottom: 0;
    }
  }

  & > label {
    content: attr(artboard);
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    height: 20px;
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: lighter;
    color: var(--lightest-grey);
    white-space: nowrap;

    & > summary {
      display: inline-flex;
      align-items: center;
    }

    & > summary > svg {
      height: 20px;
      margin-right: 0.5rem;
    }

    & > b {
      color: var(--theme-color);
    }

    & > :matches(b, .material-icons) {
      margin: 0 0.25em;
    }

    &:hover {
      color: var(--lightest-grey);
    }

    &[with-info] {
      justify-content: space-between;

      & i {
        cursor: pointer;
        font-style: normal;
        border: 1px solid var(--dark-grey);
        border-radius: 50%;
        width: 1.4em;
        height: 1.4em;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1.1;

        &:hover {
          color: var(--theme-color);
          border-color: var(--theme-color);
        }
      }
    }
  }

  & .tips {
    display: grid;
    grid-gap: 0.5rem;
    border: 1px solid var(--darkest-grey);
    border-radius: 1rem;
    padding: 0.5rem;

    & > p {
      margin-top: 0;
      margin-bottom: 0;
      font-size: 0.8rem;

      @media (max-width: 480px) {
        font-size: 1rem;
      }
    }
  }

  & > [grid][vertically-aligned] {
    padding: 0.5rem;
    box-sizing: border-box;
    width: 100%;
    height: auto;

    & > h2 {
      margin: 0;
    }
  }

  & [fit-height] {
    flex: 1;
  }

  &.pictures img{
    object-fit: cover;
    width: 100%;
    height: 100%;
  }
}

.card {
  background: #fff;
  max-width: 400px;
  box-shadow: 0 0.2em 0.3em hsla(0,0%,0%,20%);
  padding: 1rem;
  border-radius: 0.2em;
  border: 1px solid hsl(0,0%,90%);

  & > .card-header {
    & h2, & small {
      margin: 0;
    }

    & > img {
      width: 4rem;
      height: 4rem;
      border-radius: 50%;
      overflow: hidden;
      object-fit: cover;
    }

    & > div {
      margin-left: 1rem;
    }
  }

  & > .card-content {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;

    & img {
      width: 100%;
      height: 200px;
      object-fit: cover;
    }
  }

  & > .card-footer {
    padding-top: 0.5rem;
    border-top: 1px solid #e6e6e6;

    & > button {
      padding: 0.5rem 1rem;
    }

    & time {
      flex: 2;
      text-align: right;
    }
  }

  & date, & time {
    font-size: 0.8rem;
    color: #808080;
  }
}

.mdc-card {
  max-width: 400px;
}

main {
  --card-size: 70vw;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-size), 1fr));
  grid-auto-rows: minmax(var(--card-size), max-content);
  grid-auto-flow: dense;
  gap: 1rem 2rem;
  padding: 1rem 2rem;

  @media (min-width:480px) {
    --card-size: 35vw;
  }

  @media (min-width:768px) {
    --card-size: 20vw;

    & > article {
      &[span2x2] {
        grid-row: span 2;
        grid-column: span 2;
      }

      &[span3x1] {
        grid-column: span 3;
      }

      &[span2x1] {
        grid-column: span 2;
      }

      &[span1x2] {
        grid-row: span 2;
      }

      &[span1x1] {
        grid-row: span 1;
        grid-column: span 1;
      }
    }
  }

  @media (min-width:1024px) {
    --card-size: 16vw;
  }

  @media (min-width:1600px) {
    --card-size: 15vw;
  }
}

[image-grid] {
  display: grid;
  gap: .5rem;
  height: 100%;
  align-items: space-between;
  justify-content: space-between;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr 1fr;

  & > div:first-child {
    grid-column: span 2;
  }

  & img {
    height: 100%;
    width: 100%;
    object-fit: contain;
    object-position: center center;
  }
}

[text-styles] {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
  gap: .5rem;

  & :matches(h1,h2,h3,h4,h5,h6) {
    margin: 0;
  }
}

[color-grid] {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: .5rem;

  & > div {
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    &:not(:first-of-type) {
      color: white;
    }
  }
}

[stop-light] {
  display: grid;
  align-items: center;
  justify-content: space-around;

  & > .filled-circle {
    width: 7rem;
    height: 7rem;
  }
}

[ordered-numbers] {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(5, 5rem);
  justify-content: space-around;

  & > .filled-circle:nth-child(1) { background: hsl(200, 50%, 50%); }
  & > .filled-circle:nth-child(2) { background: hsl(225, 50%, 50%); }
  & > .filled-circle:nth-child(3) { background: hsl(250, 50%, 50%); }
  & > .filled-circle:nth-child(4) { background: hsl(275, 50%, 50%); }
  & > .filled-circle:nth-child(5) { background: hsl(300, 50%, 50%); }
}

nav {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;

  &[margin] {
    grid-auto-flow: row;
  }

  & > a {
    text-align: center;
    margin: 5px;
    border: 1px solid var(--darkest-grey);
    border-radius: .25rem;
  }
}

.outlined-square {
  border: 1px solid var(--light-grey);
  width: 10rem;
  height: 10rem;
}

.filled-square {
  background: var(--light-grey);
  width: 4rem;
  height: 4rem;
}

.filled-circle {
  background: var(--grey);
  border-radius: 50%;
  width: 5rem;
  height: 5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;

  &.small { width: 2.5rem; height: 2.5rem; }
}


.red     { background-color: red; }
.green   { background-color: green; }
.yellow  { background-color: yellow; }
.google-blue     { background-color: #4285F4; }
.google-yellow   { background-color: #F4B400; }
.google-red      { background-color: #DB4437; }
.google-green    { background-color: #0F9D58; }
.shadow-circle   { background-color: white; box-shadow: 0 10px 30px 2px hsla(0,0%,0%,20%); }

[round-icon] {
  box-sizing: border-box;
  padding: 1rem;
  width: var(--card-size);
  height: var(--card-size);
  border: 5px solid var(--light-grey);
  border-radius: 50%;
  fill: var(--grey);
}

[bgfg] {
  width: 100%;
  display: grid;
  grid-gap: 0.5rem;
  grid-template-columns: 15vw 15vw;
  grid-template-rows: 15vw 15vw;
  justify-content: space-around;
  margin-top: 0.5rem;

  & > .filled-circle {
    font-size: 5vw;
    width: 100%;
    height: 100%;
  }
}

[multi-select] {
  flex: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, 2.5rem);
  grid-auto-rows: 2.5rem;
  grid-auto-flow: dense;
  justify-content: space-between;
  grid-gap: 1rem;
  padding: 0 1rem;
  height: 100%;
  box-sizing: border-box;

  & > span {
    background: var(--grey);
    border-radius: 50%;

    &:hover {
      background: var(--theme-color);
    }
  }
}

[mock-ad] {
  & h2 {
    font-weight: bold;
    font-size: 4rem;
    color: red;
    border: 2px solid red;
    padding: 2rem;
    animation: pulse-annoyingly 1s linear infinite;
  }
}

@keyframes pulse-annoyingly {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.9);
  }
}

:root {
  --hue:            210;
  --saturation:     8%;
  --darkest-grey:   hsl(var(--hue) var(--saturation) 5%);
  --darker-grey:    hsl(var(--hue) var(--saturation) 7%);
  --dark-grey:      hsl(var(--hue) var(--saturation) 12%);
  --grey:           hsl(var(--hue) var(--saturation) 30%);
  --mid-grey:       hsl(var(--hue) var(--saturation) 50%);
  --light-grey:     hsl(var(--hue) var(--saturation) 70%);
  --lighter-grey:   hsl(var(--hue) var(--saturation) 85%);
  --lightest-grey:  hsl(var(--hue) var(--saturation) 95%);
  --theme-color:    hotpink;
  --theme-light:    hsl(330, 50%, 70%);
  --bg:             white;
}

html[light] {
  --hue:            210;
  --saturation:     4%;
  --darkest-grey:   hsl(var(--hue) var(--saturation) 90%);
  --darker-grey:    hsl(var(--hue) var(--saturation) 80%);
  --dark-grey:      hsl(var(--hue) var(--saturation) 65%);
  --grey:           hsl(var(--hue) var(--saturation) 40%);
  --mid-grey:       hsl(var(--hue) var(--saturation) 30%);
  --light-grey:     hsl(var(--hue) var(--saturation) 25%);
  --lighter-grey:   hsl(var(--hue) var(--saturation) 20%);
  --lightest-grey:  hsl(var(--hue) var(--saturation) 15%);
  --theme-color:    hotpink;
  --theme-light:    hsl(330, 50%, 70%);
  --bg:             white;

  & :matches(body, .dark) {
    background: var(--darkest-grey);
  }

  & .artboard label {
    color: var(--light-grey);
  }

  & kbd {
    background: var(--darkest-grey);
  }
}

body {
  margin: 0;
  padding-left: 4rem;
  background: var(--dark-grey);
  color: var(--lighter-grey);
  font-family: system-ui;
  font-weight: lighter;

  --mdc-theme-primary: hotpink;
  --mdc-theme-secondary: rebeccapurple;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1rem 2.5rem;
  color: var(--lighter-grey);
  font-size: 0.9rem;

  & a {
    color: inherit;
    text-underline-offset: 0.2em;

    &:hover {
      color: var(--theme-color);
    }
  }
}

img {
  max-width: 100%;
}

[intro] {
  /*background: var(--dark-grey);
  color: var(--light-grey);
  border: 1px solid var(--darker-grey);*/
  /*box-shadow: none;*/
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-wrap: nowrap;

  & figure {
    margin: 0;
    text-align: center;

    & svg {
      margin-top: 1rem;
      width: 50%;
      object-fit: contain;
    }

    & figcaption {
      display: flex;
      flex-direction: column;
    }
  }

  & h1 {
    margin: 0 0 0.25rem 0;
    font-size: 3rem;
    font-weight: 300;
    color: var(--lighter-grey);

    &:hover {
      color: var(--lightest-grey);
    }
  }

  & h2 {
    font-size: 1rem;
    letter-spacing: 1.5px;
    font-weight: lighter;
    color: var(--lighter-grey);
  }

  & em {
    color: var(--light-grey);
    font-style: normal;
    font-size: 0.8em;
  }

  & > picture {
    flex: 1;
    & > img {
      max-height: 15vh;
      object-fit: contain;
    }
  }

  /*& > [arrows] {
    display: inline-flex;
    align-items: flex-start;
    width: 100%;
  }*/

  & > [filters] {
    width: 100%;
    display: grid;
    grid-gap: 0.5rem;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--darkest-grey);

    & > div {
      width: 100%;
      display: grid;
      grid-auto-flow: column;
      align-items: center;
      justify-content: space-between;
      grid-gap: 0.5rem;
    }
  }

  & > [social] {
    width: 100%;

    & svg {
      width: 2.5vh;
      fill: var(--grey);

      &:hover {
        fill: var(--theme-color);
      }
    }
  }
}

/*dl {
  margin: 2rem 0;

  & > dt {
    color: var(--lightest-grey);
    font-size: 1.4rem;
    font-weight: 300;
    margin: 2rem 0 0.75rem;
  }

  & > dd {
    font-size: 0.9rem;
    font-weight: lighter;
    margin: 0;
    line-height: 1.5;
    color: var(--lighter-grey);
  }
}*/

/*.github {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
}*/

kbd {
  font-weight: bold;
  font-size: 1rem;
  background: var(--lighter-grey);
  border-radius: 0.5rem;
  padding: 0.1em 0.6em 0.2em;
  position: relative;
  bottom: 0.05em;
}

.key {
  font-size: 1.75rem;
  height: 3rem;
  padding: 0 1.25rem;
  margin: 0.5rem 0;
  display: inline-flex;
  align-items: center;
  border-radius: 0.5rem;
  color: white;
  background-color: var(--theme-color);
  box-shadow: 0 2px 5px hsla(0,0%,0%,15%);
}
