/* Reusable anchored-image sharing. */
.image-share-target {
    position: relative;
    scroll-margin-top: 5rem;
}

.image-share-button {
    position: absolute;
    top: .65rem;
    right: .65rem;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    color: #fff;
    background: rgb(24 64 102 / 94%);
    border: 3px solid rgb(255 255 255 / 90%);
    border-radius: 50%;
    box-shadow: 0 2px 7px rgb(0 0 0 / 28%);
    opacity: .95;
    transition: opacity .2s ease, background-color .2s ease, transform .2s ease;
}

.image-share-button:hover,
.image-share-button:focus-visible {
    color: #fff;
    background: #2563a2;
    opacity: 1;
    transform: translateY(-1px);
}

.image-share-button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.image-share-button::after {
    content: attr(data-share-status);
    position: absolute;
    right: -0.4rem;
    bottom: calc(100% + 6px);
    display: block;
    padding: 4px 6px;
    color: #fff;
    background: #cf7400;
    border: 1px solid rgb(255 255 255 / 55%);
    border-radius: 3px;
    box-shadow: 0 2px 6px rgb(0 0 0 / 30%);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .08em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(3px);
    transition: opacity .16s ease, transform .16s ease;
}

.image-share-button:hover:not(.is-copied)::after,
.image-share-button:focus-visible:not(.is-copied)::after {
    opacity: 1;
    transform: translateY(0);
}

.image-share-button.is-copied::after {
    animation: image-share-status-fade 1.8s ease forwards;
}

.image-share-icon {
    display: block;
    flex: 0 0 20px;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
    overflow: visible;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: .45px;
    stroke-linejoin: round;
}

.image-share-icon path {
    fill: currentColor;
    stroke: currentColor;
    stroke-width: .45px;
    stroke-linejoin: round;
}

.image-share-button.is-copied {
    background: #236b3a;
}

.image-share-button.is-copied .image-share-icon {
    display: none;
}

.image-share-button.is-copied::before {
    content: "\2713";
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
}

.image-share-target.image-share-revealed {
    animation: image-share-reveal 2.4s ease-out;
}

@keyframes image-share-reveal {
    0%, 20% { box-shadow: 0 0 0 .35rem rgb(37 99 235 / 75%); }
    100% { box-shadow: 0 0 0 0 rgb(37 99 235 / 0%); }
}

@keyframes image-share-status-fade {
    0%, 55% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .image-share-button { transition: none; }
    .image-share-target.image-share-revealed { animation: none; outline: 3px solid #2563eb; }

    .image-share-button.is-copied::after {
        animation: image-share-status-fade 1.8s linear forwards;
        transform: none;
    }
}