@import '../../styles/inline.css';

.share {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  padding: 64px 0;
}

.share svg.icon {
  height: 28px;
  transition: filter 0.3s;
  display: inline-block;
  width: 28px;
  margin: 0;
  color: #adadad;
}

.share a svg.icon:hover {
  filter: brightness(0.7);
}

.share p.icon-container,
.share p.icon-container a {
  display: flex;
  align-items: center;
  padding-bottom: 0;
  justify-content: center;
}

.share p {
  padding-bottom: 8px;
}

.share p.icon-container svg {
  color: #adadad;
}

.share p.icon-container > a:not(:first-child) {
  margin-inline-start: 18px;
}

.share .copy-to-clipboard {
  padding: 0;
  background: none;
  margin: 0;
  line-height: 0;
  cursor: pointer;
  position: relative;
  transition: filter 0.3s;
  border-radius: 4px;
  border: 2px solid transparent;
  outline: none;
  margin-inline-start: 16px;
}

.share .copy-to-clipboard:focus-visible {
  border: 2px solid black;
}

.share .copy-to-clipboard:hover svg {
  filter: brightness(0.7);
}

.share .copy-to-clipboard::before {
  content: attr(data-copy-to-clipboard);
  display: block;        
  pointer-events: none;
  position : absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -4px);
  opacity: 0;
  visibility: hidden;
  transition: transform 130ms ease-in-out, opacity 130ms ease-in-out, visibility 0ms linear 130ms;
  background-color: #6d6d6d;
  color: #fff;
  padding: 4px 9px 5px;
  font-size: 12px;
  line-height: 1.3;
  border-radius: 4px;
  white-space: nowrap;
}

.share .copy-to-clipboard::after {
  content: '';
  display: block;
  pointer-events: none;
  position : absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, 0);
  opacity: 0;
  visibility: hidden;
  transition: transform 130ms ease-in-out, opacity 130ms ease-in-out, visibility 0ms linear 130ms;
  height: 4px;
  width: 8px;
  background-color: #6d6d6d;
  clip-path: polygon(0 -5%, 50% 100%, 100% -5%);
}

.share .copy-to-clipboard:hover::before,
.share .copy-to-clipboard:focus::before,
.share .copy-to-clipboard:hover::after,
.share .copy-to-clipboard:focus::after {
  visibility: visible;
  opacity: 1;
  transition-delay: 0ms;
}

.share .copy-to-clipboard:hover::before,
.share .copy-to-clipboard:focus::before {
  transform: translate(-50%, -6px);
}

.share .copy-to-clipboard:hover::after,
.share .copy-to-clipboard:focus::after {
  transform: translate(-50%, -2px);
}

.share .copy-to-clipboard.copy-to-clipboard-copied::before {
  content: attr(data-copied);
}

.share.inline {
  margin: 0 auto;
  text-align: center;
  padding: 8px 0 16px;
}

.share.inline p.icon-container {
  justify-content: flex-start;
  margin: 0;
}

main > .section > .share.inline {
  margin: 0 auto;
}

main > .section > .inline-wrapper > .share.inline {
  margin-top: 0;
  margin-bottom: 0;
}

main > .section.center .share.inline p.icon-container {
  margin: 0 auto;
  justify-content: center;
}
