/* "List / Cards / Map" switch in the apps' Explore tab (the web has it in its header). */
@layer components {
  .view-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0.75rem 0;
    padding: 3px;
    border-radius: 8px;
    background: #efefef;
  }

  .view-menu__item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 38px;
    border-radius: 6px;
    color: #555555;
    font-size: 0.9rem;
    text-decoration: none;

    & svg {
      width: 16px;
      height: 16px;
      fill: currentColor;
    }

    /* The map icon is drawn with strokes. */
    & .map-svg {
      fill: none;
      stroke: currentColor;
    }

    &[aria-current] {
      background: #ffffff;
      color: #111827;
      font-weight: 600;
      box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
    }
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .view-menu {
      background: #1e293b;

      & .view-menu__item {
        color: #94a3b8;
      }

      & .view-menu__item[aria-current] {
        background: #334155;
        color: #f1f5f9;
      }
    }
  }

  [data-theme="dark"] .view-menu {
    background: #1e293b;

    & .view-menu__item {
      color: #94a3b8;
    }

    & .view-menu__item[aria-current] {
      background: #334155;
      color: #f1f5f9;
    }
  }
}
