/*
 * 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.
 */

dialog::backdrop {
  background: rgb(28 25 23 / 0.55);
}

dialog {
  margin: auto;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}

body {
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}

.safe-area-top {
  padding-top: env(safe-area-inset-top);
}

.safe-area-drawer {
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  padding-left: max(1rem, env(safe-area-inset-left));
}

.navigation-actions a,
.navigation-actions button {
  display: inline-flex;
  min-block-size: 2.75rem;
  align-items: center;
}

@media (pointer: coarse) {
  button,
  input[type="button"],
  input[type="reset"],
  input[type="submit"] {
    min-block-size: 2.75rem;
  }

  kbd {
    display: none;
  }
}

@media (max-width: 47.999rem) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
  select,
  textarea {
    font-size: 1rem;
    min-block-size: 2.75rem;
  }

  .assignment-save {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: max(1rem, env(safe-area-inset-left));
    z-index: 20;
    box-shadow: 0 10px 25px rgb(0 0 0 / 0.2);
  }

  [data-responsive-table] {
    display: block;
    min-width: 0;
  }

  [data-responsive-table] caption {
    display: block;
    width: 100%;
  }

  [data-responsive-table] thead {
    display: none;
  }

  [data-responsive-table] tbody {
    display: block;
  }

  [data-responsive-table] tbody tr {
    display: grid;
    gap: 0.5rem;
    padding: 0.875rem;
  }

  [data-responsive-table] td {
    display: grid;
    width: auto;
    grid-template-columns: minmax(6rem, 0.75fr) minmax(0, 1fr);
    align-items: baseline;
    gap: 0.75rem;
    padding: 0;
    overflow-wrap: anywhere;
    text-align: right;
  }

  [data-responsive-table] td::before {
    content: attr(data-label);
    color: rgb(120 113 108);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
  }

  [data-responsive-table] td > * {
    min-width: 0;
    justify-self: end;
  }

  turbo-frame[id$="_detail"] > article,
  turbo-frame[id$="_detail"] > div {
    padding: 1rem;
  }
}

[data-controller~="grid-search"] > .grid {
  gap: 0;
  overflow: hidden;
  border: 1px solid rgb(231 229 228);
  border-radius: 0.5rem;
  background: white;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

[data-controller~="grid-search"] > .grid > div:first-child {
  gap: 0;
  border-bottom: 1px solid rgb(231 229 228);
}

[data-controller~="grid-search"] > .grid > div:first-child > div {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

[data-controller~="grid-search"] > .grid > div:first-child > div:first-child {
  border-bottom: 1px solid rgb(231 229 228);
}

[data-controller~="grid-search"] > .grid > div:last-child {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

@media (min-width: 64rem) {
  [data-controller~="grid-search"] > .grid > div:first-child {
    border-right: 1px solid rgb(231 229 228);
    border-bottom: 0;
  }
}

@media (min-width: 48rem) {
  .assignment-save {
    position: static;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  }
}
