
@font-face {
  font-family: "Inter Tight";
  src: url("../css/InterTight-VariableFont_wght.ttf");
  font-style: normal;
}
@font-face {
  font-family: "Inter Tight";
  src: url("../css/InterTight-Italic-VariableFont_wght.ttf");
  font-style: italic;
}

:root {
  --yellow: #fc0;
  --tealish: #009d88;
  --forest: #006c5c;
  --blue: #455bc6;
  --pink: #e97a9f;
  --bordeaux: #920047;
  --max-width: 960px;
  --font: "Inter Tight";
  --offset: 0.6rem;
}

* {
  box-sizing: border-box;
}
html, body {
  font-family: var(--font);
  min-height: 100%;
}
body {
  margin-left: auto;
  margin-right: auto;
  max-width: 960px;
}
h1 {
  text-align: center;
  font-weight: 500;
}
p {
  margin: 0 2rem;
}
nav > div {
  margin: 2rem;
}
nav {
  display: grid;
  grid-template-areas:
    "filter-1 filter-2"
    "sort sort"
  ;
}
nav > div:nth-child(1) { grid-area: filter-1; }
nav > div:nth-child(2) { grid-area: filter-2; }
nav > label {
  grid-area: sort;
  margin: 0 2rem 2rem 2rem;
}
nav label {
  font-weight: 600;
  display: block;
}
nav div input {
  width: 100%;
}
nav .datalist {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  writing-mode: vertical-lr;
  width: 100%;
}
nav .datalist span {
  cursor: pointer;
}

#choice {
  display: grid;
  grid-template-columns: 56px 1fr auto auto auto 1fr;
  column-gap: 1rem;
  row-gap: 0;
}
 [data-topic="browser"] #choice {
  grid-template-columns: 56px 1fr auto auto 1fr;
}
.row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  column-gap: 1rem;
  padding: 12px 0;
  border-bottom: 1px solid #ddd;
}
.row:first-child {
  border-top: 1px solid #ddd;
}
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo img {
  display: block;
  width: 3rem;
  height: 3rem;
  object-fit: contain;
}
.name h2 {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 600;
}
.name p {
  margin: 0;
  font-size: 0.85rem;
  color: #555;
}
.privacy,
.sustainability {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  white-space: nowrap;
}
.privacy strong,
.sustainability strong {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
}
.privacy span,
.sustainability span {
  font-size: 0.9rem;
}
stars {
  white-space: nowrap;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}
.stars .have {
  color: #f5a623;
}
.stars .missing {
  color: #ccc;
}
.action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  white-space: nowrap;
}
.action label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  cursor: pointer;
}
.action button {
  padding: 5px 14px;
  font-size: 0.85rem;
  cursor: pointer;
}

dialog > div {
  display: grid;
  grid-template-areas:
    "chose chose"
    "logo name"
    "opt-out opt-out"
    "close close"
  ;
  grid-template-columns: 3rem 1fr;
  align-items: center;
}
dialog > div > p { grid-area: chose; margin: 1rem 0 2rem 0; }
dialog > div > img { grid-area: logo; width: 3rem; }
dialog > div > h2 { grid-area: name; margin-left: 0.4rem; }
dialog > div > div { grid-area: opt-out; margin: 1rem 0; }
dialog > div > button {
  grid-area: close;
  text-align: right;
  background: transparent;
  border: none;
  cursor: pointer;
}

@media only screen and (max-width:500px) {
  nav {
    grid-template-areas:
      "filter-1"
      "filter-2"
      "sort"
    ;
  }
  nav > div {
    margin: 1rem;
  }
  nav > label {
    margin: 0 1rem 1rem 1rem;
  }
  #choice {
    grid-template-columns: 56px 1fr 1fr 1fr;
  }
  .name {
    grid-column-start: 2;
    grid-column-end: 5;
  }
  .privacy {
    grid-column-start: 2;
    grid-column-end: 3;
  }
  .sustainability {
    grid-column-start: 3;
    grid-column-end: 4;
  }
  .stars {
    grid-column-start: 4;
    grid-column-end: 5;
  }
  .action {
    grid-column-start: 2;
    grid-column-end: 5;
  }
}
