/* ================================================
   SHARE LINKS
   Reusable share bar for single templates.
   ================================================ */

.share-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2.5rem 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid #d4d4d4;
}

.share-links__label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e1e23;
}

.share-links__list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.share-links__item {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Remove the theme's default list bullet/spacing if it leaks in. */
.share-links__item::before,
.share-links__item::marker {
    content: none;
}

.share-links__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #d4d4d4;
    border-radius: 50%;
    background: transparent;
    color: #1e1e23;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.share-links__link:hover,
.share-links__link:focus-visible {
    background-color: #00e65f;
    border-color: #00e65f;
    color: #1e1e23;
}

.share-links__link:focus-visible {
    outline: 2px solid #1e1e23;
    outline-offset: 2px;
}

/*
 * The shared brand SVGs carry hardcoded fill attributes. A CSS `fill` beats a
 * presentation attribute, so this lets the icons inherit the link colour and
 * pick up the hover state.
 *
 * These selectors are deliberately doubled up (.share-links .share-links__link)
 * to outrank two global rules in the compiled stylesheet that target ANY bare
 * <button>, which the copy control is:
 *
 *     button svg path        { fill: #f0ebf0 }   (0,0,3)
 *     button:hover svg path  { fill: #00e65f }   (0,1,3)
 *
 * The hover one previously won, painting the copy icon brand green on a brand
 * green background - a blank green circle. (0,2,2) beats (0,1,3).
 * The margin reset neutralises `button svg { margin-left/right }` from the same
 * global block, which was nudging the copy icon off-centre.
 */
.share-links .share-links__link svg {
    width: 18px;
    height: 18px;
    display: block;
    margin: 0;
}

.share-links .share-links__link svg path,
.share-links .share-links__link svg rect,
.share-links .share-links__link svg polygon,
.share-links .share-links__link svg circle,
.share-links .share-links__link:hover svg path,
.share-links .share-links__link:hover svg rect,
.share-links .share-links__link:hover svg polygon,
.share-links .share-links__link:hover svg circle,
.share-links .share-links__link:focus-visible svg path,
.share-links .share-links__link:focus-visible svg polygon {
    fill: currentColor;
}

/* "Copied" confirmation bubble on the copy-link button. */
.share-links__copied {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e23;
    color: #ffffff;
    font-size: 0.75rem;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.share-links__link--copy.is-copied .share-links__copied {
    opacity: 1;
    visibility: visible;
}

/* ------------------------------------------------
   Responsive
   ------------------------------------------------ */

@media (max-width: 768px) {
    .share-links {
        margin-top: 2rem;
        gap: 0.75rem;
    }

    .share-links__link {
        width: 36px;
        height: 36px;
    }

    .share-links__link svg {
        width: 16px;
        height: 16px;
    }
}
