@layer base {
  html {
    font-size: 100%;

    @media (min-width: 100ch) {
      font-size: 1.1875rem;
    }
  }

  body {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: none;
    background: #fff;
    color: #222;
    font-family: var(--font-sans);
    interpolate-size: allow-keywords;
    line-height: 1.375;
    max-inline-size: 100vw;
    padding: 1rem;
    scroll-behavior: auto;
    text-rendering: optimizeLegibility;
    text-size-adjust: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  a, a:visited {
    color: #7b13d6;
  }

  a:hover {
    text-decoration: none;
  }

  section {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 0.5rem 0;
    width: 100%;
  }

  article {
    border: 1px solid #7b13d6;
    border-radius: 5px;
    min-width: 200px;
    padding: 1rem;
  }

  article article {
    border: 0;
    padding: 0;
    border-radius: 0;
    border-left: 5px solid #7b13d6;
    padding-left: 1rem;
  }

  article.w-full {
    min-width: 100%;
  }

  details {
    width: 100%;
  }

  section .field {
    border-bottom: 1px dotted #333;
    width: 100%;
  }

  section form .field {
    border-bottom: 0;
  }

  main, main turbo-frame {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
  }

  header {
    align-items: center;
    border-bottom: 1px solid #f91616;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    margin-bottom: 2rem;
    padding: 0 0 0.5rem 0;
  }

  header a:not(form a) {
    border: 1px solid #f91616;
    font-weight: bold;
    padding: 0.5rem;
    text-decoration: none;
  }

  header a:hover {
    color: #f91616;
  }

  footer {
    align-items: center;
    border-top: 1px solid #f91616;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    margin-top: 2rem;
    padding: 0.5rem 0 0 0;
  }

  mark {
    background: #7b13d6;
    border-radius: 5px;
    color: #fff;
    font-size: 0.7rem;
    padding: 1px 3px;
  }

  .actions {
    margin-bottom: 1rem;
    text-align: center;
  }

  .tags_selector {
    align-items: center;
    display: flex;
    gap: 1rem;
    margin: 1rem;

    fieldset {
      border-color: #7b13d6;
      border-radius: 5px;
    }

    legend {
      color: #7b13d6;
    }

    label {
      align-items: center;
      display: flex !important;
      font-size: 0.8rem !important;
      gap: 0.5rem;
    }
  }

  .modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1050;
    overflow-y: auto;
  }

  .modal.open {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.3s ease;
  }

  .modal-dialog {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(40px);
    opacity: 0;
    transition: all 0.3s ease;
  }

  .modal-dialog {
    max-width: 800px;
  }

  /* Petite modale */
  .modal:has(#modal div[data-modal-size="small"]) .modal-dialog {
    max-width: 400px;
  }

  /* Moyenne */
  .modal:has(#modal div[data-modal-size="medium"]) .modal-dialog {
    max-width: 600px;
  }

  /* Grande */
  .modal:has(#modal div[data-modal-size="large"]) .modal-dialog {
    max-width: 900px;
  }

  .modal.open .modal-dialog {
    transform: translateY(0);
    opacity: 1;
  }

  .modal-content {
    padding: 0.5rem 1rem;
  }

  .modal-content h1 {
    border-bottom: 1px solid #eee;
    font-size: 1rem;
    padding: 0.5rem 0 0.5rem 0;
    text-align: center;
  }

  .modal-content section {
    padding: 0;
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}