/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* If updating slim-select here, also update it in config/importmap.rb */
@import url("https://cdnjs.cloudflare.com/ajax/libs/slim-select/2.8.1/slimselect.min.css");

/* headers */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: Georgia, ‘Times New Roman’, serif;
}

/* links */

a {
  color: hsl(201.3 96.3% 32.2%);
}

.flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1em;

  a {
    white-space: nowrap;
  }
}

.leaderboard {
  width: 100%;
  border-collapse: collapse;

  td,
  th {
    border-left: 1px solid black;
    border-right: 1px solid black;
    padding-bottom: 10px;
    padding-top: 10px;
    text-align: center;
  }
  tbody {
    tr:nth-child(even) {
      background: lightgrey;
    }
  }
  thead {
    tr {
      background: lightgrey;
    }
  }
}

.rhp {
  padding-left: 20px;
  padding-right: 20px;
  a,
  span {
    padding-left: 5px;
    padding-right: 5px;
    white-space: nowrap;
  }
}

@media (min-width: 800px) {
  .wrapper {
    display: grid;
    grid-template-columns: 3fr 1fr;
  }
}

.scroll-wrapper {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.table {
  display: table;
  padding-left: 0;

  .tr {
    display: table-row;

    .td,
    .th {
      display: table-cell;
      padding-left: 4px;
      padding-right: 4px;
      white-space: nowrap;
    }

    .th {
      font-weight: 600;
    }
  }
}

/* Main content */
main {
  position: relative;
  padding: 2rem 2rem calc(2rem * 2) 2rem;
  margin-left: 320px;
}

main h1:first-of-type {
  margin-bottom: 0;
  margin-top: 0;
}

.sidebar-open .content {
  margin-left: 0;
}

.content__body > :last-child {
  margin-bottom: 0;
}

@media screen and (max-width: 900px) {
  main {
    margin-left: 0;
  }
}

/* Sidebar */
#sidebar {
  position: fixed;
  flex: 0;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 20;
  width: 320px;
  background-color: white;
  border-right: solid 1px hsl(240 5.9% 90%);
  border-radius: 0;
  padding: 2rem;
  margin: 0;
  overflow: auto;
  scrollbar-width: thin;
  transition: 250ms translate ease-in-out;
}

#sidebar::-webkit-scrollbar {
  width: 4px;
}

#sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 9999px;
}

#sidebar:hover::-webkit-scrollbar-thumb {
  background: hsl(240 5% 64.9%);
}

#sidebar:hover::-webkit-scrollbar-track {
  background: hsl(240 4.8% 95.9%);
}

#sidebar > header {
  margin-bottom: 1.5rem;
}

#sidebar > header h1 {
  margin: 0.125rem 0.5rem;
}

#sidebar > header a {
  display: block;
  text-decoration: none;
  color: inherit;
}

#sidebar > header a:hover {
  color: hsl(201.3 96.3% 32.2%);
}

#sidebar nav a {
  text-decoration: none;
}

#sidebar nav h2 {
  font-size: 1rem;
  font-weight: 500;
  border-bottom: solid 1px hsl(240 5.9% 90%);
  margin: 1.5rem 0 0.5rem 0;
}

#sidebar ul {
  padding: 0;
  margin: 0;
}

#sidebar ul + ul {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: dashed 1px hsl(201.3 96.3% 32.2%);
}

#sidebar ul li {
  list-style: none;
  padding: 0;
  margin: 0.125rem 0.5rem;
}

#sidebar ul ul ul {
  margin-left: 0.75rem;
}

#sidebar ul li a {
  line-height: 1.33;
  color: inherit;
  display: inline-block;
  padding: 0;
}

#sidebar ul li:hover {
  color: hsl(201.3 96.3% 32.2%);
}

#sidebar nav .active-link {
  color: hsl(201.3 96.3% 32.2%);
  border-bottom: dashed 1px hsl(201.3 96.3% 32.2%);
}

@media screen and (max-width: 900px) {
  #sidebar {
    translate: -100%;
  }

  .sidebar-open #sidebar {
    translate: 0;
  }
}

.sidebar-version {
  font-size: 0.75rem;
  color: hsl(240 3.8% 46.1%);
  text-align: right;
  margin-top: -0.5rem;
  margin-right: 1rem;
  margin-bottom: -0.5rem;
}

.sidebar-buttons {
  display: flex;
  justify-content: space-between;
}

/* Menu toggle */
#menu-toggle {
  display: none;
  position: fixed;
  z-index: 30;
  top: 0.25rem;
  left: 0.25rem;
  height: auto;
  width: auto;
  color: black;
  border: none;
  border-radius: 50%;
  background: var(--sl-color-neutral-0);
  padding: 0.5rem;
  margin: 0;
  cursor: pointer;
  transition: 250ms scale ease, 250ms rotate ease;
}

@media screen and (max-width: 900px) {
  #menu-toggle {
    display: flex;
  }
}

.sl-theme-dark #menu-toggle {
  color: white;
}

#menu-toggle:hover {
  scale: 1.1;
}

#menu-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.sidebar-open #menu-toggle {
  rotate: 180deg;
}
