/**
 * Share Bar — Minimalist Sticky Sidebar
 *
 * Floats on the left edge of the content area.
 * Collapses to inline footer on mobile.
 * Uses global theme tokens throughout.
 */

/* =================================================================
   LAYOUT: Sticky vertical bar (Desktop)
   ================================================================= */

.share-bar {
    position: sticky;
    top: 120px; /* below sticky header */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 10;

    /* Position: float left of article */
    float: left;
    margin-left: calc(-60px - var(--wp--preset--spacing--24));
    width: 44px;
}

.share-bar__label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--wp--preset--color--text-light);
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    margin-bottom: 4px;
    user-select: none;
}

/* =================================================================
   BUTTONS
   ================================================================= */

.share-bar__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--wp--preset--color--text-muted);
    border: 1px solid var(--wp--preset--color--surface);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 0; /* hide text nodes */
    line-height: 1;
}

.share-bar__btn:hover {
    background: var(--wp--preset--color--text-main);
    color: var(--wp--preset--color--bg);
    border-color: var(--wp--preset--color--text-main);
    transform: scale(1.1);
}

.share-bar__btn svg {
    display: block;
}

/* --- Copy button states --- */

.share-bar__copy .share-bar__check {
    display: none;
}

.share-bar__copy.is-copied {
    background: var(--wp--preset--color--status-green);
    border-color: var(--wp--preset--color--status-green);
    color: #fff;
}

.share-bar__copy.is-copied .share-bar__check {
    display: block;
}

.share-bar__copy.is-copied svg:first-child {
    display: none;
}

/* =================================================================
   MOBILE: Inline horizontal bar
   ================================================================= */

@media (max-width: 1200px) {
    .share-bar {
        position: static;
        float: none;
        flex-direction: row;
        justify-content: center;
        margin: var(--wp--preset--spacing--24) 0;
        padding: var(--wp--preset--spacing--16) 0;
        border-top: 1px solid var(--wp--preset--color--surface);
        width: 100%;
        gap: 12px;
    }

    .share-bar__label {
        writing-mode: horizontal-tb;
        transform: none;
        margin-bottom: 0;
        margin-right: 4px;
        font-size: 10px;
    }
}

/* =================================================================
   REDUCED MOTION
   ================================================================= */

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