.share-menu {
  position: relative;
}

.share-menu > summary {
  list-style: none;
}

.share-menu > summary::-webkit-details-marker {
  display: none;
}

.share-menu > summary::before {
  content: '↗';
  font-size: 1.05em;
  font-weight: 900;
}

.share-menu[open] > summary {
  border-color: var(--primary);
  background: #eee6f7;
}

.share-panel {
  position: absolute;
  top: calc(100% + .7rem);
  left: 0;
  z-index: 12;
  width: min(360px, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid #cdbedb;
  border-radius: 17px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 16px 38px rgb(39 17 70 / 20%);
}

.share-panel h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 1.1rem;
  letter-spacing: -.02em;
}

.share-panel > p:first-of-type {
  margin: .35rem 0 .85rem;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}

.share-native-button,
.share-copy-button {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  font: inherit;
  font-size: .82rem;
  font-weight: 850;
  cursor: pointer;
}

.share-native-button {
  margin-bottom: .6rem;
  background: var(--primary);
  color: #fff;
}

.share-native-button:hover {
  background: var(--primary-dark);
}

.share-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}

.share-option {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: .55rem .65rem;
  border: 1px solid #cdbedb;
  border-radius: 10px;
  background: #fff;
  color: #452367;
  font-size: .78rem;
  font-weight: 820;
  text-decoration: none;
}

.share-option:hover {
  border-color: var(--primary);
  background: #f5f0f8;
}

.share-option-mark {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #4c2287;
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
}

.share-option-facebook .share-option-mark { background: #1459a8; }
.share-option-whatsapp .share-option-mark { background: #086b57; }
.share-option-x .share-option-mark { background: #000; }
.share-option-email .share-option-mark { background: #4c2287; }

.share-copy-button {
  margin-top: .6rem;
  background: #fff;
  color: var(--primary);
}

.share-copy-button:hover {
  background: #f5f0f8;
}

.share-status {
  min-height: 1.2em;
  margin: .55rem 0 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.4;
}

html[data-contrast="high"] .share-panel {
  border: 3px solid #000;
  background: #fff;
  color: #000;
  box-shadow: none;
}

html[data-contrast="high"] :is(.share-option, .share-copy-button) {
  border: 2px solid #000;
  background: #fff;
  color: #000;
}

html[data-contrast="high"] :is(.share-native-button, .share-option-mark) {
  border-color: #000;
  background: #000;
  color: #fff;
}

@media (max-width: 640px) {
  .share-menu,
  .share-menu > summary {
    width: 100%;
  }

  .share-panel {
    position: static;
    width: 100%;
    margin-top: .7rem;
  }
}
