/* Action Sheet
 * ==========================================================================
 * Basecamp-style colored panel that slides from the right edge of .panel--perma
 */

.action-sheet {
  position: relative;
}

/* Trigger button — 28px circle with ⋯ icon, overlaps close button position */
.action-sheet__trigger {
  position: absolute;
  top: calc(12px - var(--panel-radius, 8px));
  right: calc(-1 * var(--panel-pad, 16px) + 12px);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 990px;
  border: 1px solid var(--color-border--light);
  background: var(--color-bg--surface);
  color: var(--color-ink--surface);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
  z-index: 1;
}

.action-sheet__trigger:hover {
  background: var(--color-bg--container);
  border-color: var(--color-border);
}

/* Content — slides in from the right via inline-size transition */
.action-sheet__content {
  position: absolute;
  inset-block-start: calc(var(--panel-radius, 8px) * -1);
  inset-inline-end: calc(var(--panel-pad, 16px) * -1);
  visibility: hidden;
  inline-size: 0;
  overflow: hidden;
  transition: inline-size 0.2s ease, visibility 0.2s;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-large, 12px) 0 0 var(--radius-large, 12px);
  padding-inline: 0.4rem;
  padding-block: 5.2rem 0.4rem;
  z-index: var(--layer-popover);
}

.action-sheet.expanded .action-sheet__content {
  visibility: visible;
  inline-size: 260px;
}

/* Close button — top right of content */
.action-sheet__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 990px;
  border: none;
  background: transparent;
  color: white;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.action-sheet__close:hover {
  opacity: 1;
  background: oklch(from var(--color-primary) calc(l - 0.08) c h);
}

/* Action items */
.action-sheet__action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 15px;
  border-radius: 8px;
  color: white;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background 0.12s ease;
}

.action-sheet__action:hover {
  background: oklch(from var(--color-primary) calc(l - 0.08) c h);
}

.action-sheet__action:visited {
  color: white;
}

/* Icon inside action items */
.action-sheet__action-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

/* Danger variant — slightly muted with warm tint */
.action-sheet__action--danger {
  color: rgba(255, 255, 255, 0.85);
}

.action-sheet__action--danger:hover {
  background: oklch(0.35 0.06 25 / 0.6);
}

/* Divider between action groups */
.action-sheet__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 4px 15px;
  list-style: none;
}

/* Section header */
.action-sheet__section {
  padding: 8px 15px 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.55);
  list-style: none;
}

/* Form inside action sheet (for button_to) */
.action-sheet__form {
  margin: 0;
  padding: 0;
}

.action-sheet__form button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 15px;
  border-radius: 8px;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background 0.12s ease;
}

.action-sheet__form button:hover {
  background: oklch(from var(--color-primary) calc(l - 0.08) c h);
}

/* Dark mode adjustments
 * -------------------------------------------------------------------------- */
[data-color-scheme="dark"] {
  .action-sheet__trigger {
    background: var(--color-bg--container);
    border-color: var(--color-border);
  }

  .action-sheet__trigger:hover {
    background: var(--color-bg--overlay);
  }
}
