/* MetaForge floating social buttons. All classes are namespaced se-social-*. */

.se-social {
    position: fixed;
    z-index: 99990;
    bottom: calc(var(--se-social-y, 24px) + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 1;
    /* The container's box still occupies layout when the list is collapsed
       (visibility: hidden removes hit-testing for the list, not the parent),
       so without this an invisible column intercepts clicks on whatever the
       theme renders in that corner. Re-enabled on the interactive children. */
    pointer-events: none;
}

.se-social-toggle,
.se-social-launcher,
.se-social-link { pointer-events: auto; }

.se-social--right { right: calc(var(--se-social-x, 24px) + env(safe-area-inset-right, 0px)); }
.se-social--left  { left:  calc(var(--se-social-x, 24px) + env(safe-area-inset-left, 0px)); }

.se-social-list {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.se-social-item { margin: 0; padding: 0; }

.se-social-link {
    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--se-social-size, 56px);
    height: var(--se-social-size, 56px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .28);
    background-color: var(--se-social-color, #4f46e5);
    background-image: linear-gradient(
        145deg,
        rgba(255, 255, 255, .24) 0%,
        rgba(255, 255, 255, .06) 46%,
        rgba(0, 0, 0, .14) 100%
    );
    color: #fff;
    text-decoration: none;
    box-shadow:
        0 8px 22px rgba(15, 23, 42, .20),
        0 2px 6px rgba(15, 23, 42, .12),
        inset 0 1px 0 rgba(255, 255, 255, .28);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.se-social-link:hover,
.se-social-link:focus-visible {
    transform: translateY(-2px) scale(1.045);
    box-shadow:
        0 12px 28px rgba(15, 23, 42, .24),
        0 4px 9px rgba(15, 23, 42, .14),
        inset 0 1px 0 rgba(255, 255, 255, .34);
    filter: saturate(1.06);
    color: #fff;
}

.se-social-link:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.se-social-icon {
    position: relative;
    z-index: 1;
    display: flex;
}
.se-social-icon svg {
    width: 55%;
    height: 55%;
    min-width: 36px;
    min-height: 36px;
}

/* The text label is for assistive tech only; the icon carries the meaning. */
.se-social-label {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --- grouped mode -------------------------------------------------------- */

.se-social-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; }

.se-social-launcher {
    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--se-social-size, 56px);
    height: var(--se-social-size, 56px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .28);
    background-color: #4f46e5;
    background-image: linear-gradient(
        145deg,
        rgba(255, 255, 255, .24) 0%,
        rgba(255, 255, 255, .06) 46%,
        rgba(0, 0, 0, .14) 100%
    );
    color: #fff;
    cursor: pointer;
    box-shadow:
        0 8px 22px rgba(15, 23, 42, .20),
        0 2px 6px rgba(15, 23, 42, .12),
        inset 0 1px 0 rgba(255, 255, 255, .28);
    transition: transform .18s ease, box-shadow .18s ease;
}

.se-social-launcher:hover {
    transform: translateY(-2px) scale(1.045);
    box-shadow:
        0 12px 28px rgba(15, 23, 42, .24),
        0 4px 9px rgba(15, 23, 42, .14),
        inset 0 1px 0 rgba(255, 255, 255, .34);
}

.se-social-launcher-open,
.se-social-launcher-close {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .18s ease, transform .18s ease;
}

.se-social-launcher-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-45deg) scale(.7);
}

.se-social-launcher-open svg,
.se-social-launcher-close svg {
    width: calc(var(--se-social-size, 56px) * .5);
    height: calc(var(--se-social-size, 56px) * .5);
}

.se-social-toggle:focus-visible + .se-social-launcher { outline: 3px solid #4f46e5; outline-offset: 3px; }

/* Closed by default in grouped mode; the checkbox opens it with no JS. */
.se-social--grouped .se-social-list {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}

.se-social--grouped .se-social-toggle:checked ~ .se-social-list {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.se-social--grouped .se-social-toggle:checked + .se-social-launcher .se-social-launcher-open {
    opacity: 0;
    transform: rotate(45deg) scale(.7);
}

.se-social--grouped .se-social-toggle:checked + .se-social-launcher .se-social-launcher-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* --- article sharing ----------------------------------------------------- */

.se-share {
    clear: both;
    margin: 32px 0 8px;
    padding-top: 20px;
    border-top: 1px solid rgba(15, 23, 42, .12);
    font-size: 14px;
    line-height: 1.3;
}

.se-share-title {
    display: block;
    margin-bottom: 11px;
    color: inherit;
    font-weight: 700;
}

.se-share-list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.se-share-link {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 999px;
    background-color: var(--se-share-color, #4f46e5);
    background-image: linear-gradient(
        145deg,
        rgba(255, 255, 255, .20) 0%,
        rgba(255, 255, 255, .04) 48%,
        rgba(0, 0, 0, .12) 100%
    );
    box-shadow:
        0 4px 12px rgba(15, 23, 42, .14),
        inset 0 1px 0 rgba(255, 255, 255, .22);
    color: #fff;
    font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.se-share-link:hover,
.se-share-link:focus-visible {
    transform: translateY(-2px);
    box-shadow:
        0 7px 18px rgba(15, 23, 42, .19),
        inset 0 1px 0 rgba(255, 255, 255, .28);
    filter: saturate(1.06);
    color: #fff;
    text-decoration: none;
}

.se-share-link:focus-visible {
    outline: 3px solid rgba(79, 70, 229, .35);
    outline-offset: 2px;
}

.se-share-icon {
    display: inline-flex;
    flex: 0 0 18px;
}

.se-share-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

/* On pointer devices the accessible channel name doubles as a compact tooltip.
   Touch screens keep the intentionally minimal icon-only presentation. */
@media (hover: hover) and (pointer: fine) and (min-width: 480px) {
    .se-social-label {
        top: 50%;
        width: max-content;
        height: auto;
        margin: 0;
        padding: 7px 10px;
        overflow: visible;
        clip: auto;
        border: 1px solid rgba(255, 255, 255, .12);
        border-radius: 8px;
        background: rgba(15, 23, 42, .94);
        box-shadow: 0 6px 18px rgba(15, 23, 42, .18);
        color: #fff;
        font: 600 12px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        letter-spacing: .01em;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .15s ease, transform .15s ease, visibility .15s;
    }

    .se-social--right .se-social-label {
        right: calc(100% + 11px);
        transform: translate(4px, -50%);
    }

    .se-social--left .se-social-label {
        left: calc(100% + 11px);
        transform: translate(-4px, -50%);
    }

    .se-social-link:hover .se-social-label,
    .se-social-link:focus-visible .se-social-label {
        opacity: 1;
        visibility: visible;
        transform: translate(0, -50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .se-social-link,
    .se-social-launcher,
    .se-social-launcher-open,
    .se-social-launcher-close,
    .se-social-label,
    .se-share-link,
    .se-social--grouped .se-social-list { transition: none; }
}
