/*
 * Tablette et téléphone. La mise en page de base (marges de 12 rem, menu latéral de 18 rem, en-tête fixe) tient à
 * partir de 1280 px ; ce fichier vient en dernier pour passer après les règles de base à spécificité égale.
 */
@media (max-width: 1279px) {
  section {
    width: auto;
    margin: 3rem 2rem 2rem;
  }

  div.alert {
    padding: 1em 2em;
  }
}

@media (max-width: 1023px) {
  header {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    padding: .5rem 1rem;

    h1 {
      padding: .2em 0;
    }

    nav {
      width: 100%;

      ul {
        flex-wrap: wrap;
        margin: .5rem 0 0;

        li ul {
          max-width: 90vw;
        }
      }
    }
  }

  section {
    flex-direction: column;
    margin-top: 1rem;

    aside, main {
      width: 100%;
    }
  }

  /* Le texte justifié crée des espaces irréguliers sur une colonne étroite. */
  article {
    text-align: left;
    font-size: 1.1rem;
  }
}

@media (max-width: 767px) {
  section {
    margin: 1rem .5rem;
    padding: .5rem;
  }

  header nav ul {
    flex-direction: column;
    align-items: flex-start;

    li {
      display: block;
      padding-bottom: .4em;

      ul {
        position: static;
        box-shadow: none;
      }
    }
  }

  .notice-grid {
    columns: 1;
  }

  /* Un tableau trop large défile dans sa boîte au lieu de déborder de la page. */
  article table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  /* Libellé au-dessus du champ, champ sur toute la largeur. */
  form .form-row {
    flex-direction: column;

    .input-radio {
      max-width: none;
    }
  }

  form .form-row label,
  form .form-row input:not([type='checkbox']),
  form .form-row select,
  form .form-row textarea,
  form select,
  form .ts-wrapper,
  form.contact-form textarea,
  form.notice-edit .form-row label,
  form.notice-edit .form-row input,
  form.notice-edit .form-row select,
  form.notice-edit .form-row textarea,
  form.photo-edit .form-row label,
  form.photo-edit .form-row input:not([type='checkbox']),
  form.photo-edit .form-row select {
    width: 100%;
  }
}
