@import 'fonts.css';
@import 'variables.css';

:root {
  font-family: Inter, sans-serif;
  font-weight: 450;
}
@supports (font-variation-settings: normal) {
  :root { font-family: InterVariable, sans-serif; }
}

html {
  font-size: 16px;
  line-height: 1.35rem;
  letter-spacing: 0.02em;
  background-color: var(--white)
}

body {
  box-sizing: border-box;
}

main {
  width: 100%;
  min-height: 100vh;
  margin: auto;
  box-sizing: border-box;
}

.lazy {
  opacity: 0;
}

.loaded {
  opacity: 1;
  transition: 0.5s;
}

/* general */

h2 {
  font-size: 2rem;
  padding: 0.5rem 0 0.5rem 0;
}

a, a:link, a:visited {
  cursor: pointer;
}

ul {
  padding-left: 1rem;
}

li {
  list-style: disc;
}

ul:has(li:first-child:last-child) {
  padding-left: 0rem;
}

li:first-child:last-child {
  list-style: none;
}

button, .button {
  cursor: pointer;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* header */

header {
  background-color: var(--white);
  border-bottom: 1px solid var(--darkgrey);
  padding: 0.5rem 1.75rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  z-index: 1000;
}

header nav {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
}

header a {
  display: inline-block;
  padding: 0.5rem;
  transition: 0.1s;
}

nav a.active {
  text-decoration: underline;
}

header a:hover {
  color: var(--accent);
}

header a:active {
  color: var(--accent)!important;
  transform: scale(0.98);
}

/* table */

table {
  width: 100%;
}

tr {
  border-bottom: 1px solid var(--darkgrey);
  min-height: 1.75rem;
  padding: 0.25rem;
  padding-left: 0;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 10rem auto;
  gap: 1rem;
}

th {
  font-weight: normal;
  font-size: 0.9em;
  letter-spacing: 0.02em;
  position: relative;
}

td a, td a:link, td a:visited {
  color: var(--accent);
}

td {
  max-width: 42em;
  text-wrap: balance;
}

.tnum {
  font-feature-settings:"tnum";
}



/* archive */

.archive main {
  padding: 1rem 2rem;
  display: grid;
  grid-template-columns: calc(var(--sidebar) - 3rem) auto;
  gap: 2rem;
  max-width: 100%;
}

.results-collection {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.filters, .results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.results {
  width: 100%;
}

.results ul {
  display: flex;
  flex-direction: column;
  padding: 0;
  width: 100%;
}

.list-header {
  display: grid;
  grid-template-columns: auto 3rem 6.25rem;
  align-items: center;
  padding: 0.6rem 0.5rem;
  box-sizing: border-box;
  width: 100%;
  gap: 2rem;
  border-bottom: 1px solid var(--black);
  font-size: 0.85rem;
  margin-bottom: -1rem;
}

.list-header .date {
  text-align: right;
}

.list-header .scan,
.list-header .source {
  text-align: center;
}

/* item list */

.item-list {
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: auto 3rem 6.25rem;
  align-items: center;
  padding: 0.6rem 0.5rem;
  box-sizing: border-box;
  width: 100%;
  gap: 2rem;
  border-bottom: 1px solid var(--darkgrey);
}

.item-list:hover {
  background-color: var(--lightgrey);
}

.item-list.active {
  background-color: var(--accent);
  color: white;
  position: sticky;
  top: 1rem;
  bottom: 1rem;
  border-color: transparent;
  border-top: 1px solid var(--accent);
  margin-top: -1px;
}

.item-list .date {
  text-align: right;
  font-size: 0.9em;
}

.item-list .source {
  text-align: center;
  font-size: 0.9em;
}

/* item navigation */

.item-nav {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  font-size: 0.9rem;

}

.item-nav .functions,
.item-nav .navigation {
  display: flex;
  gap: 0.5rem;
}

.item-nav .button {
  background-color: var(--white);
  outline: 1px solid var(--darkgrey);
  color: var(--black)!important;
  margin-bottom: 1rem;
  min-width: 2em;
  box-sizing: border-box;
  text-align: center;
  display: flex;
  height: 40px;
  min-width: 40px;
  justify-content: center;
  align-items: center;
  padding: 0 0.75em;
  border-radius: 6px;
}

.item-nav .saved {
  background-color: var(--accent2)!important;
}

/* item popup */

#item-popup {
  position: fixed;
  left: calc(-1 * var(--sidebar));
  top: 0;
  height: 100vh;
  width: var(--sidebar);
  background-color: var(--lightgrey);
  overflow-y: auto;
  padding: 1rem;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  border-right: 1px solid var(--darkgrey);
}

#item-popup.active {
  left: 0rem;
  opacity: 1;
  pointer-events: all;
}

#item-popup.loading {
  pointer-events: none;
}

#item-popup table {
  transition: filter 0.3s, opacity 0.3s;
}

#item-popup.loading table {
  opacity: 0.25;
}

#item-popup tr.text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 5rem;
}

/* item page */

.item main {
  padding: 1rem;
  box-sizing: border-box;
  display: block;
  width: 100%;
  margin: auto;
}

.item-content {
  width: 100%;
}

/* pagination */

nav.pagination {
  font-size: 0.9rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

nav.pagination ul {
  display: flex;
  flex-direction: row;
  justify-content: center;
  box-sizing: border-box;
  gap: 0.1em
}

nav.pagination li {
  list-style: none;
  text-align: center;
}

nav.pagination a {
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

nav.pagination a:hover {
  background-color: var(--lightgrey);
}

nav.pagination a.active {
  background-color: var(--lightgrey);
  border-radius: 40px;
}

/* filters */

input, select, label {
  padding: 0.25em 0.5rem;
  box-sizing: border-box;
  accent-color: var(--black);
  min-height: 40px;
  min-width: 1rem;
  cursor: pointer;
}

label::selection {
  background-color: transparent;
}

[type="text"] {
  width: 100%;
  background-color: var(--white);
}

select {
  width: 100%;
  padding-right: 1rem;
  padding-left: 0.25rem;
  border-right: 0.25rem solid transparent;
  background-color: var(--white);
}

label {
  display: flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.1em 0em;
  box-sizing: border-box;
}

.inputs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filters [type='text']:not(:placeholder-shown),
.filters select:not(:has(option[value=""]:checked)), 
.filters .tag-single:has(:checked) {
    background-color: var(--accent);
    color: white;
}

/* fields sections */

.fields-section {
  padding: 1rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: var(--lightgrey);
  border-radius: 0.5rem;
  outline: 1px solid var(--darkgrey);
}

.fields-section h3 {
  font-weight: normal;
  font-size: 1.25rem;
}

.fields-section#date label {
  width: 4rem;
}

.fields-section.button {
  padding: 0;
}

.fields-section.button a,
.fields-section.button button {
  padding: 1rem;
  text-align: center;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fields-header {
  position: relative;
}

.fields-header h3 {
  padding-bottom: 0.5rem;
}

.fields-footer {
  display: flex;
  flex-direction: column;
  gap: 0;
}

#date .fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

#date .field {
  flex-direction: column;
  gap: 0.25rem;
}

#date label {
  min-height: 0;
}

.field {
  display: flex;
  gap: 0.75rem
}

/* help */

.help {
  position: absolute;
  right: -1rem;
  top: -1rem;
}

.help-open {
  width: 3em;
  height: 3em;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.help-close {
  position: absolute;
  width: 3em;
  height: 3em;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  right: 0;
  top: 0;
}

.help-container {
  position: absolute;
  top: 1rem;
  left: calc(100% + 1rem);
  width: 30rem;
  padding: 1rem;
  padding-right: 3em;
  box-sizing: border-box;
  background-color: var(--black);
  color: var(--white);
  z-index: 1000;
  box-shadow: 0 0 10px #00000050;
  border-radius: 0.5rem;
  transition: 0.25s;
  opacity: 0;
  pointer-events: none;
}

.active .help-container {
  opacity: 1;
  pointer-events: all;
  top: 0rem;
}

.help-content {
  position: relative;
  top: -50%;
}

.help-tip {
  position: absolute;
  left: -5px;
  top: 1rem;
  background-color: var(--black);
  width: 20px;
  height: 20px;
  transform: rotate(45deg);
}

/* tag collection */

.tag-collection {
  height: 0;
  overflow-y: scroll;
  background-color: var(--white);
  padding: 0;
  box-sizing: border-box;
  width: 100%;
  transition: 0.5s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.tag-collection.active {
  height: 50vh;
}

.logic {
  display: none;
  gap: 0.75rem;
  font-size: 0.9rem;
}

#source .logic {
  display: none;
}

.fields-section:has(.tag-selection .tag-single) .logic {
  display: flex;
}

.count {
  display: block;
  font-size: 0.85em;
  font-weight: normal;
  text-align: right;
}

.mode {
  font-size: 0.9rem;
}

/* tag search */

.tag-search {
  margin-bottom: -0.5rem;
  border-bottom: 1px solid var(--darkgrey);
}

.tag-search [type='text'] {
  background-color: var(--white)!important;
  color: var(--black)!important;
  opacity: 0.75;
}

/* tag selection */

.tag-selection {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-selection:not(:has(*)) {
  display: none;
}

.tag-selection label::before {
  content: "× "
}

/* tag single */

.tag-single {
  text-wrap: balance;
  box-sizing: border-box;
}

.tag-single:hover {
  background-color: var(--lightgrey);
}

.tag-single.hidden {
  display: none;
}

.tag-single input {
  display: none;
}

.tag-single label {
  width: 100%;
  min-height: 40px;
  padding: 0.25rem;
  box-sizing: border-box;
}

.tag-collection .tag-single {
  width: 100%;
  border-bottom: 1px solid var(--darkgrey);
}

.tag-selection .tag-single:hover {
  opacity: 0.75;
}

.tag-selection .tag-single label {
  border-radius: 6px;
  padding: 0.5em;
}

/* sort */

#sort {
  display: flex;
  flex-direction: row;
  align-items: center;
  background-color: transparent;
  outline: none;
  border-radius: 0;
  border-bottom: 1px solid var(--black);
  padding: 0.5rem;
  margin-bottom: -1rem;
  font-size: 0.9rem;
}

#sort .fields {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 2rem;
}

#sort select {
  width: auto;
  padding: 0.5rem;
  background-color: white;
  border-radius: 6px;
  outline: 1px solid var(--darkgrey);
}

/* submit */

#submit {
  position: sticky;
  bottom: 0.5rem;
  background-color: var(--accent2);
}

#submit.hidden {
  display: none;
}

/* mark */

mark {
  background-color: var(--accent3);
}


/* footer */

footer {
  background-color: var(--black);
  padding: 2rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 3rem;
  color: var(--white);
}

footer nav {
  display: flex;
  flex-direction: row;
  gap: 4rem;
  width: 100%;
}

footer ul {
  padding-left: 0;
}

footer li {
  list-style: none;
}

footer nav a {
  display: inline-block;
  padding: 0;
  min-height: 25px;
}

.item footer {
  display: none;
}


/* account */

.account main {
  padding: 1rem 2rem;
  display: grid;
  grid-template-columns: calc(var(--sidebar) - 3rem) auto;
  gap: 2rem;
  max-width: 100%;
}

.account-info {
  display: flex;
  flex-direction: column;
  gap: 1rem
}



/* home */

.home main {
  padding: 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 3rem
}

.home h2 {
  font-size: 7rem;
  letter-spacing: -0.01em;
  line-height: 0.9;
}

.home h3 {
  font-size: 5rem;
  line-height: 1.1;
  text-wrap: balance;
  margin-top: 0rem;
  margin-bottom: 0.25rem;
}

.home h4 {
  font-size: 2.25rem;
  line-height: 1.1;
  text-wrap: balance;
  margin-top: 0rem;
  margin-bottom: 1rem;
}

.home p {
  font-size: 1.25rem;
  line-height: 1.35;
  margin-bottom: 1rem;
  hyphens: auto;
}

.subpage-collection {
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.subpage-single {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.subpage-single article {
  max-width: 50rem;
}

.hero {
  width: 100%;
  height: 75vh;
  background-size: 150%;
  background-color: var(--accent);
  background-blend-mode: screen;
  mix-blend-mode: darken;
  border-radius: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 3rem;
  box-sizing: border-box;
}

.quicksearch {
  width: 100%;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.quicksearch input {
  height: 4rem;
  border-radius: 0.5rem;
  outline: 1px solid var(--darkgrey);
  font-size: 1.25rem;
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.75);
}

.quicksearch .button {
  width: 13rem;
  background-color: var(--accent);
  text-align: center;
  color: var(--white);
  border-radius: 0.5rem;
  outline: 1px solid var(--lightgrey);
  font-size: 1.25rem;
}

.random {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}

.random-item {
  background-color: var(--lightgrey);
  outline: 1px solid var(--darkgrey);
  padding: 1rem;
  box-sizing: border-box;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  aspect-ratio: 3/2;
  gap: 0.75rem
}

.random-year {
  text-align: left;
  padding-bottom: 0.5rem;
  font-size: 1.25rem;
}


.random-title {
  text-align: center;
  font-size: 1.5rem;
  line-height: 1.15;
  text-wrap: balance;
  color: var(--accent);
}

.random-source {
  text-align: center;
  color: var(--accent);
}

.bar-chart {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding-top: 0.25rem;
  border-bottom: 1px solid var(--darkgrey);
}

.row:first-of-type {
  border-top: 1px solid var(--darkgrey);
}

.row:hover {
  background-color: var(--lightgrey);
}

.bar {
  background-color: var(--accent);
  height: 1.75rem;
}

.bar-count {
  text-align: right;
  color: var(--accent);
}

.bar-numbers {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 0.25rem 0.35rem 0.25rem;
  box-sizing: border-box;
}

.bar-chart h3 {
  width: 100%;
  padding: 0.5rem 0;
  background-color: var(--white);
  position: sticky;
  top: 0;
}

.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

#map {
  width: 100%;
  height: 75vh;
  background-color: var(--black);
  border-radius: 1rem;
  outline: 1px solid var(--darkgrey);
  outline-offset: -0.5px;
}

.maplibregl-map {
  font-family: Inter, sans-serif;
  font-size: 1rem;
  color: var(--accent);
}

.maplibregl-popup-content {
  box-shadow: 0 0 10px #00000050;
  padding: 0.25rem;
}

.maplibregl-popup-content a {
  display: block;
  padding: 0.25rem;
}