/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
  font-family: sans-serif;
}

* {
  box-sizing: border-box;
}

main {
  padding: 2em;
  padding-top: 0;
  h1 {
    font-size: 4em;
    margin-bottom: 0;
  }
  h2 {
    color: grey;
    font-weight: normal;
  }
  nav {
    margin-top:2em;
    margin-bottom:2em;
  }
  nav .button {
    color: white;
    text-decoration: none;
    background-color:#007bff;
    border-radius: 3px;
    padding:0.5em;
    padding-left: 1em;
    padding-right: 1em;
    margin:0.7em;
    &:first-child {
      margin-left:0;
    }
  }
}

form {
  input {
    display:block;
    margin-top:0.5em;
    margin-bottom:0.5em;
    padding:0.35em;
    border-radius: 3px;
    border: grey 1px solid;
    font-size:0.9em;
  }
  fieldset {
    label {
      display:block;
      input[type="radio"] {
        display:inline;
      }
    }
  }
  label p {
    margin-block:0;
    #organization {
      display: inline;
      padding: 0.2em;
    }
  }
  #prefix {
    padding: 0.2em;
    display:inline;
    text-align: right;
    width:6em;
  }
  .header-mini {
    margin-block-end: 0;
  }
}

nav {
  /* Base styles */
  ul {
    display: inline-block;
    padding-inline-start: 0;
    list-style-type: none;
  }
  li {
    min-width: 10em;
    width: max-content;
    text-align: center;
  }
  /* Top row */
  > ul > li {
    position: relative;
    display: inline-block;
    &:not(:last-child) {
      border-right: 1px solid lightgrey;
    }
  }
  /* Dropdowns */
  ul ul {
    display: none;
    position: absolute;
    width: 100%;
    li {
      width: 100%;
      padding: 0.3em;
    }
  }
  ul li ul {
    padding-top: 0.5em;
    transition: transform 0.2s, opacity 0.2s;
    transform: scaleY(0) translateY(-50%);
    visibility: hidden;
    display: block;
    opacity: 0;
  }
  ul li:hover ul {
    opacity: 1;
    visibility: visible;
    transform: scaleY(1) translateY(0);
  }
  li:has(ul) {
    &:before {
      content: "⌄";
      position: absolute;
      margin-top: -0.15em;
      transition: transform 0.1s linear;
      left: 0.5em;
    }
    &:hover:before {
      transform: scaleY(-1) translateY(-0.55em);
    }
  }
}
