/**
 * Top level layout and variables
 * ------------------------------------
*/
html {
  font-size: 1rem;
  --hamburger-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg' transform='matrix(-1, 0, 0, -1, 0, 0)'%3E%3Cg stroke-width='0'%3E%3C/g%3E%3Cg stroke-linecap='round' stroke-linejoin='round'%3E%3C/g%3E%3Cg %3E%3Cpath d='M4 18L20 18' stroke='%23141414' stroke-width='2' stroke-linecap='round'%3E%3C/path%3E%3Cpath d='M4 12L20 12' stroke='%23141414' stroke-width='2' stroke-linecap='round'%3E%3C/path%3E%3Cpath d='M4 6L20 6' stroke='%23141414' stroke-width='2' stroke-linecap='round'%3E%3C/path%3E%3C/g%3E%3C/svg%3E");
  --close-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0'%3E%3C/g%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round'%3E%3C/g%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath d='M16 8L8 16M8 8L16 16' stroke='%23141414' stroke-width='2' stroke-linecap='round'%3E%3C/path%3E%3C/g%3E%3C/svg%3E");
}

body {
  display: grid;
  grid-template-columns: 1fr 6fr;
  grid-template-rows: 2.5rem 1fr;
  min-height: 100vh;
}

body>main {
  grid-column: 2;
  grid-row: 2;
  padding: 1.5rem;
}

@view-transition {
  navigation: auto;
}

/**
 * Header
 * ------------------------------------
*/
body>header {
  grid-column: 2;
  grid-row: 1;
  padding: 0.1rem;
  background: var(--red-accent);
  height: var(--header-height);
  padding: 0;
}

body>header menu button.outline {
  border: none;
  margin-inline: 0.25rem;
}

.stack {
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.stack p {
  margin: 0;
}

.stack small {
  font-style: italic;
}



/**
 * Side Navbar
 * ------------------------------------
 */
body>aside {
  grid-column: 1;
  grid-row: 1 / row2-end;
  background-color: var(--off-white);
  box-shadow: 1.5rem 0px 3rem -1.5rem rgba(0, 0, 0, 0.1);
}

header button[popovertarget] {
  display: none;
  cursor: pointer;
  margin: 0.5rem;
  background-color: var(--off-white);
  border: none;
  height: 2em;
  aspect-ratio: 1;
  cursor: pointer;
  mask-image: var(--hamburger-icon);
}

nav li:first-child {
  height: var(--header-height);
  background: #c60c30;
  padding: 0.4rem;
  display: flex;
  justify-content: center;
}

nav li:first-child a {
  height: var(--header-height);
  display: flex;
}

nav li:first-child img {
  place-self: center;
  width: 90%;
}

nav ul {
  margin: 0 !important;
}

nav a {
  font-size: 0.9rem;
  text-align: center;
  color: var(--pico-h1-color)
}

nav a:hover,
nav a:focus {
  background-color: var(--off-white-alt);
  text-decoration: none;
}

.currentPage {
  background-color: var(--red-accent);
}

@media (max-width: 1200px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: 2.5rem 1fr;

  }

  body>header {
    grid-column: 1;
    grid-row: 1;
  }

  body>main {
    grid-column: 1;
    grid-row: 2;
  }

  header button[popovertarget] {
    display: revert;
  }

  aside[popover]:popover-open {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    opacity: 1;
    transform: translateX(0);
    backdrop-filter: blur(3px);
  }

  aside[popover] {
    /* picocss override */
    display: revert;
    height: 100%;
    border: none;
    margin: 0;
    opacity: 0;
    padding: 0;
    transform: translateX(-100%);
    transition: all 0.7s allow-discrete;
  }

  aside:not([popover]) {
    display: none;
  }

  @starting-style {
    aside[popover]:popover-open {
      opacity: 0;
      transform: translateX(-100%);
    }
  }

  form .grid {
    margin-bottom: 1em;
  }
}


/**
 * Button Menus
 * ------------------------------------
*/
menu {
  list-style-type: none;
  margin: 0;
  margin-inline: 0.4rem;
  height: 100%;
  display: flex;
}

menu p {
  margin: 0.25rem;
}

menu li {
  margin-inline: 0.1rem;
  align-content: center;
}

menu button {
  padding: 0;
}


/**
 * Tables
 * ------------------------------------
 */
.scroll-table {
  height: 30rem;
  overflow-y: scroll;
  border: 1px solid;
  border-color: #eee;
  overscroll-behavior: none;
  border-radius: var(--pico-border-radius);
}

.scroll-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody {
  font-size: 0.85rem;
}

td {
  white-space: nowrap;
}

tbody tr:nth-child(even) td {
  background-color: var(--off-white-alt);
}


/**
 * Forms
 * ------------------------------------
 */

article form {
  column-gap: calc(var(--pico-grid-column-gap) * 2);
  columns: 2;
}

article form>* {
  column-span: all;
}

form>section {
  break-inside: avoid;
  column-span: revert;
}

.grid:has(> *:nth-child(2)) article form {
  columns: 1;
}

@media (max-width: 1200px) {
  article form {
    columns: 1;
  }

  article form .grid {
    grid-template-columns: 1fr;
    grid-row-gap: 0;
  }
}

form .grid>label,
form .grid>input {
  align-content: center;
  margin-bottom: 0;
}

form label>strong {
  margin-top: 1em;
}

form .grid>input[type="checkbox"] {
  margin: 1rem;
}

form .grid>select {
  margin: 8px 8px 0px 8px;
}

.result {
  margin-top: 1rem;
}

.result input {
  background: var(--blue-accent-muted);
  color: var(--dark-grey);
}

input {
  margin: 0.5rem;
}

input:not([disabled]) {
  border: 1px solid var(--blue-accent);
}

input[type="submit"] {
  margin-top: 2rem;
  background: var(--blue-accent);
}

input[type="reset"] {
  margin-top: 2rem;
  background: var(--red-accent);
}

/* For Chrome, Safari, Edge, and Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* For Firefox */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/**
 * Cards (articles)
 * ------------------------------------
 */
article {
  border-top: 3px solid var(--blue-accent);
}

/**
 * Utility Classes
 * ------------------------------------
 */
.float-left {
  float: left;
}

.float-right {
  float: right;
}

.empty {
  background: none;
}

.tabbed {
  padding-left: 2em;
}

.outline {
  stroke: var(--pico-h1-color);
}