/*
 * Styling for the "Copy page" / LLM actions split button injected by
 * assets/javascripts/llm-actions.js. Colours come from Material's CSS
 * variables so the widget follows the active (light/slate) palette.
 */

.llm-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0 0 1.2rem;
}

.llm-actions__btn,
.llm-actions__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--md-default-fg-color--light);
  background: var(--md-default-bg-color);
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.llm-actions__btn {
  padding: 0.35rem 0.65rem;
  border-radius: 0.3rem 0 0 0.3rem;
}

.llm-actions__toggle {
  padding: 0.35rem 0.4rem;
  border-left: 0;
  border-radius: 0 0.3rem 0.3rem 0;
}

/* Hover/open: a subtle background shade only. The border stays constant so the
   two halves don't visibly swap borders as the pointer moves between them. */
.llm-actions__btn:hover,
.llm-actions__toggle:hover,
.llm-actions__toggle[aria-expanded="true"] {
  background: var(--md-default-fg-color--lightest);
}

.llm-actions__btn svg,
.llm-actions__toggle svg {
  width: 0.85rem;
  height: 0.85rem;
  flex: none;
}

.llm-actions__menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 5;
  width: 15rem;
  margin-top: 0.3rem;
  padding: 0.3rem 0;
  background: var(--md-default-bg-color);
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-radius: 0.4rem;
  box-shadow: var(--md-shadow-z2, 0 0.2rem 0.5rem rgba(0, 0, 0, 0.2));
  overflow: hidden;
}

.llm-actions__menu[hidden] {
  display: none;
}

.llm-actions__item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.8rem;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background-color 0.15s;
}

.llm-actions__item:hover {
  background: var(--md-default-fg-color--lightest);
}

/* Beat Material's `.md-typeset a` styling so anchor items look like menu rows,
   not underlined body links. */
.md-typeset .llm-actions__item,
.md-typeset .llm-actions__item:hover {
  color: var(--md-default-fg-color);
  text-decoration: none;
}

.llm-actions__item > svg {
  width: 0.9rem;
  height: 0.9rem;
  margin-top: 0.1rem;
  flex: none;
  color: var(--md-default-fg-color--light);
}

.llm-actions__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.llm-actions__title {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--md-default-fg-color);
}

.llm-actions__title svg {
  width: 0.62rem;
  height: 0.62rem;
  color: var(--md-default-fg-color--lighter);
}

.llm-actions__sub {
  font-size: 0.62rem;
  line-height: 1.3;
  color: var(--md-default-fg-color--light);
}

.llm-actions__divider {
  height: 0.05rem;
  margin: 0.3rem 0;
  background: var(--md-default-fg-color--lightest);
}
