/* page-actions — the copy/open-in-LLM menu (layouts/_partials/page-actions.html).

   Built on <details>, so the only state is the element's own `open`: no class
   toggling, and the menu closes on Escape without any handler.

   jg's theme ships no design tokens (static CSS, no custom properties), so
   this copy carries literal values rather than var() references that would
   resolve to nothing. Keep it in sync with the utheme copy by hand - it is a
   different theme, not a fork of one. */

.page-actions {
  position: relative;
  display: inline-block;
}

.page-actions > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

/* Safari draws its own disclosure triangle next to the SVG chevron. */
.page-actions > summary::-webkit-details-marker { display: none; }

.page-actions[open] > summary svg { transform: rotate(180deg); }
.page-actions > summary svg { transition: transform 120ms ease; }

.page-actions-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 17rem;
  padding: 0.3rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.10);
}

/* On narrow screens anchor the menu to the trigger's right edge: 17rem of
   menu opening leftward from a control near the viewport edge would overflow. */
@media (max-width: 640px) {
  .page-actions-menu { left: auto; right: 0; }
}

.page-actions-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  text-decoration: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.page-actions-item:hover,
.page-actions-item:focus-visible {
  background: #f4f4f5;
}

.page-actions-item strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
}

.page-actions-item small {
  display: block;
  font-size: 0.78rem;
  opacity: 0.62;
}


/* The menu is a navigation control, not content - never print it. */
@media print {
  .page-actions { display: none; }
}
