[data-theme="dark"] {
    --color-base: #070502;
    --color-highlights: #5e7783;
    --color-text:#dfdbd8;
}

[data-theme="light"] {
  --color-base: #dfdbd8;
  --color-highlights: #7aa39a;
  --color-text: #070502;
}

* {
  font-size: 20px;
  font-family: sans-serif;
  color: var(--color-text);
  box-sizing: border-box;
}

body {
  background-color: var(--color-base);
}

/* navigation bar */
.nav-bar {
  height: 10vh;
  width: 90vw;
  margin:auto;
  padding: 0.5rem 1rem;
  position: relative;
  display:flex;
  flex-flow:row nowrap;
  align-items:center;
  justify-content:space-between;
}

/* Select second adjacent navbar logo button so gap can be inserted */
[class *= "nav-bar__"] + * {
  margin-left: 1em;
}

.nav-bar__info-logo {
  background:none;
  border:none;
  cursor: pointer;
  user-select: none;
  content: '\2139';
  font-size: 1.5rem;
  padding:0;
}

.nav-bar__toggle-theme--logo {
  font-size: 1.5rem;
  cursor: pointer;
  user-select: none;
}

.nav-bar__filter {
  font-size: 1.5rem;
  cursor: pointer;
  user-select: none;
  
}

.nav-bar__filter--active{
  font-size: 1.5rem;
  cursor: pointer;
  user-select: none;
}

.nav-bar__toggle-theme--logo:active {
  content: "\263E";
}

.nav-bar__info-legend {
  display: none;
  z-index: 4;
  position: absolute;
  top: 0.8em;
  left: 1.5em;
  border: 2px solid black;
  padding: 0.2em;
  background-color: var(--color-highlights);
}

.legend--detail{
  color:var(--color-base);
}

.nav-bar__info-logo--active + .nav-bar__info-legend {
  display: block;
}

.nav-bar__info-logo:focus + .nav-bar__info-legend {
display: block;
}

/* canvas */
#canvas {
  display: grid;
  height: 90vh;
  width: 100vw;
  position: absolute;
  top: 10%;
  left: 0;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(auto-fill, 2rem);
  padding: 1em 0;
  background: linear-gradient(var(--color-base), var(--color-highlights));
}

/* .item > checkbox and text input */
.item {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  width: 100%;
  grid-column: 2 / span 4;
}

.item--filtered-out:has(.item__completed:checked) {
  display:none;
}

.item__completed {
  width: 1em;
  visibility: hidden;
  position: relative;
}

.item__description {
  width: 100%;
  border: none;
  background-color: transparent;
  text-overflow: ellipsis;
}

.item__delete-button{
  background:none;
  border:none;
  color:var(--color-text);
  position:absolute;
  right:45px;
}

@media screen and (min-width:480px) {
  .item__delete-button{
    display:none;
    position:absolute;
    right:40%;
  }
  
  .item:hover > .item__delete-button{
    display:block;
  }
}

/* newest list item being defined */
.item:first-of-type {
  flex-direction: row-reverse;
}

.item:first-of-type > .item__completed::after {
  display: none;
}

.item:first-of-type > .item__description {
  font-weight: initial;
}

.item:first-of-type > .item__delete-button{
  display:none;
}

/* items not checked off -- still to do */
.item__completed:not(checked)::after {
  visibility: visible;
  content: "\0021";
  position: absolute;
  right: 1rem;
}

.item__completed:not(checked) + .item__description {
  font-weight: bold;
}

/* items checked off -- completed */
.item__completed:checked::after {
  visibility: visible;
  content: "\2713";
  position: absolute;
  right: .7rem;
}

.item__completed:checked + .item__description {
  text-decoration: line-through;
  font-style: italic;
  font-weight: initial;
}

.center {
  margin-left: auto;
  margin-right: auto;
}

/*
Mobile first page width setting
-------------------------------
Set all 'width-<size>' CSS classes to % of viewport width by default
e.g. .width-small, .width-medium, .width-large ... */
[class*="width-"] {
  max-width: 90vw;
}

/*
Larger viewport page width overrides
------------------------------------
Override screen width mobile-first settings for larger viewports */
@media only screen and (min-width: 768px) {
  .width-small {
    max-width: 20rem;
  }

  .width-medium {
    max-width: 40rem;
  }

  .width-large {
    max-width: 60rem;
  }
}
