.modal {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: var(--z-modal);
  visibility: hidden;

  .modal__container {
    background-color: var(--color-white);
    position: static;
    width: 50em;
    height: 40em;
  }

  .modal__header {
    padding: 0.5em 2em;
    display: flex;
    flex-direction: row-reverse;
  }

  .modal__content-container {
    padding: 0 2em 3em 2em;
    display: flex;
    flex-direction: column;
    overflow: auto;
    height: 100%;
  }

  .modal__content {
    display: flex;
    flex-direction: column;
    height: 100%;

    h2 {
      margin-bottom: 50px;
      font-family: var(--font-family-text);
      font-weight: bold;
      color: var(--color-dark-blue);
    }
    h3 {
      margin-top: 40px;
    }
  }

  .modal__content-body {
    overflow: auto;
    flex-grow: 1;
    -webkit-box-flex: 1;
  }

  .modal__content-footer {
  }
}

.modal--visible {
  visibility: visible;
}

.slideout {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 44em;
  max-width: 90%;
  height: 100%;
  display: flex;
  flex-direction: column;

  background-color: var(--color-white);
  /* lighten(#868E96, 10%) éclairci de 30 % encore, ce qu'écrivait la cascade de variables Sass en */
  /* tête de cette feuille : quatre de ses six couleurs ne servaient plus, et lighten() n'existe pas */
  /* en CSS natif (étape 6c de docs/hotwire.md). */
  border-left: 0.063em solid #f3f4f5;

  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  z-index: var(--z-slideout);

  transform: translateX(100%);
  transition: transform 0.3s ease, width 0.3s ease;
}

#slideout select{
  width: 100%;
}

.slideout, .modal {
  h1 {
    font-family: var(--font-family-text);
    font-size: 25px;
    font-weight: bold;
    color: var(--color-dark-blue);
    text-shadow: 0px 0px 0.4px;
    line-height: 1.5;
    margin-bottom: 20px;
    margin-top: 20px;
  }

  label {
    color: var(--color-dark-blue);
    font-weight: bold;
    margin-bottom: 0;
  }

  select, input[type='text'], textarea, input[type='file'], input[type='email'] {
    margin-top: 13px;
  }

  input[type='text'] {
    font-size: 14px;
  }

  select[multiple='multiple'] {
    height: 70px;
  }

  input[type='file'] {
    height: 51px;
    padding: 14px;
  }

  textarea {
    height: 78px;
  }

  .field{
    margin-bottom: 23px;
  }

  .message__container p {
    font-size: 14px;
    line-height: 15px;
  }
}

.full-width {
  position: absolute;
  top: 64px;
  background-color: var(--color-white);
  width: 90%;
}

/* Slideout Header */

.slideout-header {
  padding: 1em 1em 0.5em 1.7em;
  display: flex;
  justify-content: space-between;

  img.icon--back {
    filter: invert(22%) sepia(13%) saturate(2299%) hue-rotate(242deg) brightness(93%) contrast(90%);
  }
}

.slideout-close {
  display: inline-block;
  img {
    width: 10px;
    filter: invert(16%) sepia(92%) saturate(706%) hue-rotate(206deg) brightness(96%) contrast(95%);
  }
  &:hover {
    color: var(--color-black);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
  }
  &:focus {
      outline: auto 5px -webkit-focus-ring-color;
  }
}

/* Slideout effect */

.slideout--open {
  transform: translateX(0);
}

.slideout-mask {
  position: fixed;
  overflow: hidden;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-black);
  z-index: var(--z-slideout-mask);
  opacity: 0.0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.slideout-mask--visible {
  visibility: visible;
  /* Une virgule tenait ici la place du point-virgule. Sass la réparait sans un mot — la feuille
     compilée de la référence sert bien `opacity: 0.7;` —, le navigateur jette la déclaration :
     depuis l'étape 6c le voile du panneau s'affichait entièrement transparent. Trouvé par les
     onze tests système du panneau, puis par bin/goldmaster check (étape 6i de docs/hotwire.md). */
  opacity: 0.7;
}

/* Slideout Content */

.slideout-content-wrapper {
  display: flex;
  flex-direction: column;
  overflow: auto;
  height: 100%;
}

.slideout-content {
  /* lighten(#868E96, 15%), comme le bord gauche du panneau plus haut : la fonction est de Sass,
     la valeur est celle que le compilateur écrivait (étape 6c de docs/hotwire.md). */
  border-top: 0.063em solid #afb4ba;
  padding: 0 1.750em;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.slideout-content-body {
  overflow: auto;
  flex-grow: 1;
  -webkit-box-flex: 1;

  input[type="text"], input[type="email"], input[type="password"], textarea {
    border: 1px solid var(--color-light-gray);
    border-radius: 5px;
    font-size: 14px;
    padding: 10px 8px;
    font-family: "Lexend", sans-serif;
  }

  input:focus, textarea:focus {
    border: 1px solid var(--color-light-gray);
    box-shadow: none;
    outline: none;
  }
}

.slideout-content-footer {
  border-top: 0.063em solid #afb4ba;
}

.options__checkbox {
  display: flex;
  input[type='checkbox'] {
    margin-top: 0;
    margin-right: 10px;
  }
  .options__title {
    width: 262px;
  }
  .options__title .options__explanations {
    left: 49px;
  }
}

.archive-wrapper {
  border: 0.063em solid #afb4ba;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 1em;
  padding-top: 1em;
}

.table__title {
  display: flex;
  justify-content: space-between;
  p {
    font-size: 14px;
    font-weight: bold;
  }
}


/* Slideout Buttons */

.actions {
  display: flex;
  background-color: var(--color-white);
  justify-content: end;
  margin-top: 15px;
}


.letter__button--add {
  img {
    filter: invert(21%) sepia(18%) saturate(1825%) hue-rotate(242deg) brightness(95%) contrast(88%);
  }
}

.letter__button--add:hover {
  img {
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(203deg) brightness(107%) contrast(101%);
  }
}

.options__buttons {
  margin-bottom: 40px;
  display: flex;
  justify-content: left;
  width: 93%;
}

.options--btn {
  margin-right: 10px;
  a {
    display: flex;
    border-radius: 20px;
    padding: 5px 12px;
  }
  p {
    color: var(--color-purple);
    font-size: 14px;
  }
  img {
    margin-right: 10px;
    filter: invert(22%) sepia(13%) saturate(2299%) hue-rotate(242deg) brightness(93%) contrast(90%);
  }
}

.options--btn:hover {
  img {
    filter: invert(100%) sepia(25%) saturate(357%) hue-rotate(191deg) brightness(118%) contrast(100%);
  }
  p {
    color: var(--color-white);
  }
  a {
    text-decoration: none;
    font-weight: bold;
    color: var(--color-white);
  }
}

/* Slideout */

.slideout-spinner {
  position: absolute;
  top: 40%;
  left: 50%;

  margin-top: -24px; /* Half the height */
  margin-left: -24px;

  width: 48px;
  height: 48px;
  border: 5px solid var(--color-white);
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
  }

  @keyframes rotation {
  0% {
      transform: rotate(0deg);
  }
  100% {
      transform: rotate(360deg);
  }
}

.slideout-spinner--invisible {
  display: none;
}

/* Slideout settings menu */

ul.letter-menu__container{
  padding-left: 0;
  list-style: none;
}

.letter-menu__content--delete{
  display: flex;
  p {
    font-size: 16px;
    margin-left: 10px;
  }
  li {
    list-style: none;
  }
}

.letter-menu__content {
  border: 1px solid #2f415a;
  width: 100%;
  margin-bottom: 20px;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  li {
    list-style: none;
  }
  p {
    color: #2f415a;
    font-size: 16px;
  }

  li:hover {
    border-bottom: none;
  }

  img {
    transform: rotate(272deg);
    float: right;
    margin-top: auto;
    margin-bottom: auto;
  }
}

.letter-menu__content--delete{
  p {
    color: var(--color-red);
  }
  img {
    filter: invert(42%) sepia(36%) saturate(1989%) hue-rotate(327deg) brightness(82%) contrast(76%);
  }
}

.letter-menu__content--delete:hover {
  text-decoration: none;
  p {
    font-weight: bold;
  }
}

.letter-menu__content:hover {
  text-decoration: none;
  background-color: #2f415a;
  cursor: pointer;
  p {
    color: var(--color-white);
  }
  img {
    filter: invert(100%) sepia(0%) saturate(2%) hue-rotate(301deg) brightness(114%) contrast(101%);
  }
  .letter-menu__title {
    display: flex;
    justify-content: space-between;
  }
}

/* Explications text on info icon hover */

.options__dropdown {
  position: relative;
}

.options__title .options__explanations {
  display: none;
  position: absolute;
  background-color: var(--color-hover-yellow);
  left: 26px;
  bottom: 3px;
  border-radius: 5px;
  padding: 10px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  max-width: 80%;
  p{
    font-size: 13px;
    line-height: 24px;
  }
}

.options__title {
  display: flex;
  width: fit-content;
  img{
    margin-left: 10px;
  }
}

.options__title:hover .options__explanations {
  display: block;
}


#letters_schedule_days {
  option {
    padding: 5px;
    border-radius: 5px;
  }
}

td.td--delete {
  padding: 0;
  img {
    filter: invert(42%) sepia(36%) saturate(1989%) hue-rotate(327deg) brightness(82%) contrast(76%);
  }
}

.section__form {
  display: flex;
  .options__title .options__explanations{
    left: -108px;
    max-width: 256%;
  }
  label{
    font-size: 14px;
  }
  .modal__actions{
    margin-top: auto;
    margin-bottom: auto;
    input{
      margin-top: 13px;
    }
  }
}

.section__form--sources{
  display: flex;
  justify-content: space-between;
  width: 355px;
  label{
    font-size: 14px;
  }
}

#page__container .section__form-field {
  padding: 0em 1.5em 0em 0em;
  select{
    width: 100%;
  }
}

.section__items {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  overflow: auto;
}

.section__item {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0.5em 0em;
  img.section__item--add{
    filter: invert(21%) sepia(18%) saturate(1825%) hue-rotate(242deg) brightness(95%) contrast(88%);
  }
  img.section__item--remove{
    filter: invert(42%) sepia(36%) saturate(1989%) hue-rotate(327deg) brightness(82%) contrast(76%);
  }
}

.section__item > * {
  padding-right: 16px;
}

.section__item--odd {
  background-color: var(--color-white);
}

.section__item--even {
  background-color: #f9f9f9;
}

.section__item--unselected {
  opacity: 0.9;
}

.section__item--last {
  /*border-bottom: 1px solid #583262; */
}

.section__item-paragraph {
  h4 {
    font-size: 17px;
  }

  p {
    line-height: normal;
    font-size: 15px;
  }

  a {
    line-height: normal;
    font-size: 15px;
    color: var(--color-purple);
    font-weight: normal;
    text-decoration: underline;
  }

  a:hover {
    color: var(--color-purple);
    font-weight: bold;
  }
}

.section__item-textdata {
  h4 {
    font-size: 17px;
  }

  p {
    line-height: normal;
    font-size: 15px;
  }

  a {
    line-height: normal;
    font-size: 15px;
    color: var(--color-purple);
    font-weight: normal;
    text-decoration: underline;
  }

  a:hover {
    color: var(--color-purple);
    font-weight: bold;
  }
}

.section__search-bar {
  display: flex;
  flex-direction: row;
  margin-bottom: 0.5em;
  margin-right: 1em;
  border: 1px solid var(--color-light-gray);
  border-radius: 5px;

  img {
    margin-left: 1em;
    margin-right: 1em;
    width: 17px;
  }

  input {
    border: 0;
    box-shadow: none;
    margin: 0;
  }
}

@media (max-width: 767px) {
  .slideout {
    width: 25em;
  }
  .letters #bodyTable {
    width: 345px;
  }
  .archive-wrapper {
    border: 0;
  }
  .options__buttons {
    width: 100%;
    flex-wrap: wrap;
  }
  .options--upload {
    margin-bottom: 20px;
  }
  .table__title {
    justify-content: space-between;
  }
  .modal .modal__container {
    min-width: 34em;
  }
  .modal .modal__content{
    width: 80%;
    margin: auto;
  }
  .section__form{
    display: revert;
  }
  .section__form--sources{
    width: 95%;
    display: revert;
  }
}
