@media (pointer: coarse) {
  header::after {
    display: flex;
    color: var(--purple);
    content: '×';
    font-size: 2rem;
    line-height: 4rem;
    position: absolute;
    right: 1.5rem;
    top: 0;
    z-index: 1;
  }

  header:has(nav:not(:hover))::after {
    color: transparent;
  }

  header nav:hover {
    height: calc(100vh - 4rem);
    padding-top: 4rem;
  }
}

@media (max-width: 920px) {
  body {
    margin-top: 0;
  }

  header {
    bottom: 0;
    top: auto;
  }
  header h1 {
    display: none;
  }
  header nav ul {
    font-size: 1rem;
  }
  header nav:hover {
    height: 100vh;
    line-height: 1;
    margin-top: calc(4rem - 100vh);
    overflow: scroll;
    padding: 0;
    width: 100vw;
  }
  header > ul a {
    padding: 0 1em;
  }

  #messages {
    bottom: 4em;
  }
  #messages section input {
    bottom: 0;
    left: 0;
    text-align: right;
    width: auto;
  }

  main {
    margin-bottom: 4em;
    margin-top: 0;
  }

  .actions {
    bottom: 4.5rem;
    flex-direction: column;
    right: 0.5rem;
    top: auto;
  }
  .follow *::before {
    margin: 0;
  }

  table {
    font-size: 0.8em;
  }
  table td,
  table th {
    padding: 0.1em;
  }

  fieldset {
    align-items: flex-start;
    flex-direction: column;
  }
  fieldset input[type=radio] + label,
  fieldset input[type=checkbox] + label {
    margin: -1.5rem 0 1rem;
    padding-left: 3rem;
  }
  fieldset legend {
    margin: 0.5rem 0;
  }

  #page-login header::after {
    content: none;
  }
  #page-login main {
    flex-direction: column;
  }
  #page-login main img {
    max-width: calc(100% - 4em);
  }
  #page-login main section {
    width: 100%;
  }

  #page-spectacles main section {
    width: 100%;
  }
  #page-spectacles main section > a dl {
    margin: 0;
  }
  #page-spectacles main section > dl {
    display: none;
  }

  #page-spectacle_create form,
  #page-spectacle_update form {
    grid-template-columns: 1fr 1fr;
  }
  #page-spectacle_create form h3,
  #page-spectacle_update form h3,
  #page-spectacle_create form > label:has(textarea, input[type=checkbox]),
  #page-spectacle_update form > label:has(textarea, input[type=checkbox]) {
    grid-column: span 2;
    padding-right: 0;
  }

  #page-artists div,
  #page-costumes div,
  #page-makeups div,
  #page-persons div,
  #page-sounds div,
  #page-vehicles div,
  form,
  #images
  {
    width: auto;
  }
}
