src/layouts/list-layout.module.css
.layout {
  --filters-width: 20rem;
  --sidebar-width-one-col: 24rem;
  --sidebar-width-two-col: 47rem;

  display: grid;

  height: 100dvh;
  column-gap: 1rem;
  margin-inline: auto;
  max-width: var(--layout-max-width);
  padding-inline: var(--layout-padding);

  overflow: hidden;
  will-change: contents;

  grid-template-areas:
    "header header header"
    "sidebar content filters";

  grid-template-rows: auto minmax(0, 1fr);

  @media screen and (min-width: 52rem) {
    padding-bottom: 0.25rem;
    grid-template-columns: var(--sidebar-width-one-col) 1fr;
  }

  @media screen and (min-width: 75rem) {
    grid-template-columns: var(--sidebar-width-one-col) 1fr var(--filters-width);
  }

  @media screen and (min-width: 102rem) {
    grid-template-columns: var(--sidebar-width-max) 1fr var(--filters-width);
    & .sidebar {
      container-type: inline-size;
    }
  }
}

.layout:not(.has-filters) .content {
  grid-column-end: filters;
}

.layout::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  z-index: 3;
  display: none;
  opacity: 0;
}

.layout.floating-menu-open::before {
  display: block;
  opacity: 1;
  transition:
    opacity 0.2s ease-in,
    display 0.2s;
  transition-behavior: allow-discrete;
}

.sidebar,
.filters {
  position: relative;
  transform: translateX(0);
  background: var(--palette-0);
  z-index: 2;
  height: 100%;
  border: 1px solid var(--palette-1);
  border-radius: var(--rounded);
  contain: size layout style;

  > :not(.collapse) {
    overflow-x: hidden;
  }
}

.sidebar {
  grid-area: sidebar;
  width: var(--sidebar-width-one-col);

  &.floating {
    left: 0.25rem;
  }

  &[data-state="closed"] {
    display: none;
    transform: translateX(calc(-100% - 1.5rem));
    grid-area: unset;
  }

  @media screen and (min-width: 52rem) {
    width: auto;
  }
}

.filters {
  grid-area: filters;
  width: var(--filters-width);

  &.floating {
    right: 0.25rem;
  }

  &[data-state="closed"] {
    display: none;
    grid-area: unset;
    transform: translateX(calc(100% + 1.5rem));
  }
}

.floating {
  position: fixed;
  height: calc(100% - 0.5rem);
  max-width: 86.25%;
  top: 0.25rem;
  z-index: 3;
  background: var(--palette-0);
  box-shadow: var(--shadow-md);
  transition:
    transform 0.2s ease-in,
    display 0.2s;
  transition-behavior: allow-discrete;

  &[data-state="open"] {
    transform: translateX(0);
  }
}

.content {
  grid-area: content;
  contain: size layout style;

  &.collapsed-sidebar {
    grid-column-start: sidebar;
  }

  &.collapsed-filters {
    grid-column-end: filters;
  }
}

.footer {
  grid-area: footer;
}

@starting-style {
  .filters.floating {
    transform: translateX(calc(100% + 1.5rem));
  }

  .sidebar.floating {
    transform: translateX(calc(-100% - 1.5rem));
  }

  .layout.floating-menu-open::before {
    opacity: 0;
  }
}
