/* The Share control. Sized to sit beside a heading or inside a result row. */

.rb-share {
    position: relative;
    display: inline-block;
}

.rb-share__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    font-family: var(--font-primary), sans-serif;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #111111;
    background: transparent;
    border: 1px solid #cfd4da;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.rb-share__btn:hover {
    border-color: #111111;
    background: #f1f2f4;
}

.rb-share__btn:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 2px;
}

.rb-share__icon {
    flex: none;
    display: block;
}

/* While the card image is being generated. */
.rb-share__btn.is-busy {
    opacity: 0.55;
    cursor: progress;
}

/* Beside a result row there is no space for a word. */
.rb-share--compact .rb-share__btn {
    padding: 0.35rem 0.45rem;
    border-color: transparent;
    color: #6b7280;
}

.rb-share--compact .rb-share__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.rb-share--compact .rb-share__btn:hover {
    color: #111111;
    border-color: #cfd4da;
}

/* Fallback menu: only ever seen where there is no native share sheet. */
.rb-share__menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 40;
    min-width: 11rem;
    background: #ffffff;
    border: 1px solid #e6e8eb;
    box-shadow: 0 12px 28px rgba(17, 17, 17, 0.12);
}

.rb-share__item {
    display: block;
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-family: var(--font-primary), sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    color: #3d444b;
    background: none;
    border: none;
    border-bottom: 1px solid #f0f1f3;
    cursor: pointer;
}

.rb-share__item:last-child {
    border-bottom: none;
}

.rb-share__item:hover {
    background: #f4f5f6;
    color: #111111;
}

@media (prefers-reduced-motion: reduce) {
    .rb-share__btn {
        transition: none;
    }
}
