/*
  Dropdown 01 — Foundational Menu — standalone HTML/CSS/JS
  implementation. No build step, no framework, no external dependency:
  copy index.html, this file, and script.js into any project as-is.
*/

:root {
  --dropdown-accent: #39ff14;
  --dropdown-fg: oklch(0.145 0 0);
  --dropdown-muted: oklch(0.5 0 0);
  --dropdown-border: oklch(0.88 0 0);
  --dropdown-hover: oklch(0.96 0 0);
  --dropdown-danger: oklch(0.55 0.22 27);
}

.dropdown01 {
  position: relative;
  display: inline-flex;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

.dropdown01__trigger {
  display: flex;
  font-family: inherit;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  color: var(--dropdown-muted);
  cursor: pointer;
  outline: none;
  transition:
    background-color 150ms ease-out,
    color 150ms ease-out;
}

.dropdown01__trigger svg {
  height: 1rem;
  width: 1rem;
}

.dropdown01__trigger:hover {
  background-color: var(--dropdown-hover);
  color: var(--dropdown-fg);
}

.dropdown01__trigger:focus-visible {
  outline: 2px solid var(--dropdown-fg);
  outline-offset: 2px;
}

.dropdown01__menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  margin-top: 0.375rem;
  width: 13rem;
  max-width: calc(100vw - 1rem);
  border-radius: 0.75rem;
  border: 1px solid var(--dropdown-border);
  background-color: #ffffff;
  padding: 0.375rem;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.3);
  transform-origin: top right;
  animation: dropdown01-in 140ms ease-out both;
}

.dropdown01__menu[data-open-upward="true"] {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 0.375rem;
  transform-origin: bottom right;
}

.dropdown01__menu[hidden] {
  display: none;
}

@keyframes dropdown01-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.dropdown01__item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.625rem;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--dropdown-fg);
  text-align: left;
  cursor: pointer;
  outline: none;
}

.dropdown01__item svg {
  height: 1rem;
  width: 1rem;
  flex-shrink: 0;
  color: var(--dropdown-muted);
}

.dropdown01__item:hover,
.dropdown01__item:focus-visible {
  background-color: var(--dropdown-hover);
}

.dropdown01__item--danger,
.dropdown01__item--danger svg {
  color: var(--dropdown-danger);
}

.dropdown01__divider {
  height: 1px;
  margin: 0.375rem 0;
  background-color: var(--dropdown-border);
}

@media (prefers-reduced-motion: reduce) {
  .dropdown01__menu {
    animation: none;
  }
}

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}
.dropdown01-layout {
  display: flex;
  min-height: 22rem;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 2.5rem 4rem;
}
.dropdown01-layout__panel {
  display: flex;
  width: 100%;
  max-width: 42.5rem;
  align-items: center;
  gap: 1rem;
  border: 1px solid oklch(0.9 0 0);
  border-radius: 1rem;
  background: #ffffff;
  padding: 1.5rem;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 40px -16px rgba(0, 0, 0, 0.14);
}
.dropdown01-layout__thumb {
  display: flex;
  height: 2.75rem;
  width: 2.75rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: oklch(0.96 0 0);
  color: oklch(0.55 0 0);
}
.dropdown01-layout__thumb svg {
  height: 1.25rem;
  width: 1.25rem;
}
.dropdown01-layout__title {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  color: oklch(0.145 0 0);
}
.dropdown01-layout__subtitle {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  color: oklch(0.5 0 0);
}
