/* Default look of the platform's share menu (pkg/theme/platform/share.html).
   Every rule is wrapped in  so it has no specificity, and any
   theme rule wins. Themes can also just set the variables:
   --share-fg, --share-bg, --share-rule, --share-accent. */

.share {
  position: relative;
  display: inline-block;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.875rem;
  line-height: 1.4;
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.4em 0.85em;
  border: 1px solid var(--share-rule, currentColor);
  border-radius: 999px;
  color: var(--share-fg, inherit);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.share-button::-webkit-details-marker { display: none; }
.share-button:hover,
.share-menu[open] > .share-button {
  border-color: var(--share-accent, currentColor);
  color: var(--share-accent, inherit);
}
.share-button:focus-visible {
  outline: 2px solid var(--share-accent, currentColor);
  outline-offset: 2px;
}

.share-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 15rem;
  max-width: calc(100vw - 2rem);
  padding: 0.35rem;
  border: 1px solid var(--share-rule, #d0d0d0);
  border-radius: 0.6rem;
  background: var(--share-bg, Canvas);
  color: var(--share-fg, CanvasText);
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.15);
}

.share-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.share-list > li[hidden] { display: none; }

.share-item {
  display: block;
  width: 100%;
  padding: 0.45em 0.7em;
  border: 0;
  border-radius: 0.4rem;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.share-item:hover,
.share-item:focus-visible {
  background: color-mix(in srgb, var(--share-accent, currentColor) 12%, transparent);
  color: inherit;
  outline: none;
}

.share-qr {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--share-rule, #d0d0d0);
}
.share-qr > summary { list-style: none; }
.share-qr > summary::-webkit-details-marker { display: none; }
.share-qr-code {
  display: block;
  width: 10rem;
  height: auto;
  margin: 0.5rem auto 0.35rem;
}

@media print {
  .share { display: none; }
}
