/* PD Share — the button and the menu.
 *
 * Colours come from the Political Dictionary theme's tokens (--pd-*) with
 * hard-coded fallbacks, so the plugin still looks right on another theme.
 * Dark mode is html[data-pd-theme="dark"], the theme's own switch. */

/* ---------------------------------------------------------------------------
 * The button: a round, bordered 48px target with a bold arrow.
 * ------------------------------------------------------------------------ */

.pdsh-span {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.pdsh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 2px solid var(--pd-rule-strong, #1d1a17);
    border-radius: 50%;
    background: var(--pd-bg, #fff);
    box-shadow: none;
    color: var(--pd-ink-bright, #121110);
    font: inherit;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 120ms ease, color 120ms ease;
}

.pdsh-btn:hover,
.pdsh-btn:focus,
.pdsh-btn[aria-expanded="true"] {
    background: var(--pd-rule-strong, #1d1a17);
    color: var(--pd-bg, #fff);
}

.pdsh-btn:focus-visible {
    outline: 2px solid var(--pd-focus, #004b91);
    outline-offset: 3px;
}

.pdsh-icon {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.75;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.pdsh-after-content {
    margin: 1.2em 0 0;
}

/* ---------------------------------------------------------------------------
 * The menu. Built once by the script and appended to <body>.
 * ------------------------------------------------------------------------ */

.pdsh-pop {
    position: absolute;
    z-index: 9999;
    box-sizing: border-box;
    width: 244px;
    margin: 0;
    padding: 6px 0;
    border: 1px solid var(--pd-rule, #e6e1da);
    border-radius: 10px;
    background: var(--pd-bg, #fff);
    color: var(--pd-ink, #1d1a17);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
}

.pdsh-pop-arrow {
    position: absolute;
    bottom: 100%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: 0 0 -6px -6px;
    border: 1px solid var(--pd-rule, #e6e1da);
    border-width: 1px 0 0 1px;
    background: var(--pd-bg, #fff);
    transform: rotate(45deg);
}

.pdsh-pop-title {
    margin: 0;
    padding: 6px 14px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pd-ink-dim, #6b665f);
}

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

.pdsh-list li {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Extra specificity on purpose so the theme's link rules stay out. */
.pdsh-pop a.pdsh-item,
.pdsh-pop button.pdsh-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 7px 14px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.pdsh-pop a.pdsh-item:hover,
.pdsh-pop button.pdsh-item:hover,
.pdsh-pop a.pdsh-item:focus-visible,
.pdsh-pop button.pdsh-item:focus-visible {
    background: var(--pd-panel-2, #f2f0ec);
    color: inherit;
    text-decoration: none;
    outline: none;
}

.pdsh-item-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--pd-rule, #d9d1c5);
    border-radius: 50%;
    color: var(--pd-ink-bright, #121110);
}

.pdsh-item-icon svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.pdsh-item-icon svg.pdsh-stroke {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.pdsh-item-label {
    flex: 1 1 auto;
    min-width: 0;
}

.pdsh-list li.pdsh-sep {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid var(--pd-rule, #e6e1da);
}

/* "Link copied" swaps the label for a moment. */
.pdsh-item.is-done .pdsh-item-label {
    color: var(--pd-accent, #b32317);
    font-weight: 600;
}

/* ---- Dark mode (Political Dictionary theme) ----------------------------- */

html[data-pd-theme="dark"] .pdsh-pop {
    background: var(--pd-panel, #1e2126);
    border-color: var(--pd-rule, #2b2f36);
    color: var(--pd-ink-bright, #eef0f2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

html[data-pd-theme="dark"] .pdsh-pop-arrow {
    background: var(--pd-panel, #1e2126);
    border-color: var(--pd-rule, #2b2f36);
}

html[data-pd-theme="dark"] .pdsh-pop a.pdsh-item:hover,
html[data-pd-theme="dark"] .pdsh-pop button.pdsh-item:hover,
html[data-pd-theme="dark"] .pdsh-pop a.pdsh-item:focus-visible,
html[data-pd-theme="dark"] .pdsh-pop button.pdsh-item:focus-visible {
    background: var(--pd-panel-2, #262a30);
}

@media (prefers-reduced-motion: no-preference) {
    .pdsh-pop {
        animation: pdsh-in 120ms ease-out;
    }
    @keyframes pdsh-in {
        from { opacity: 0; transform: translateY(-4px); }
        to   { opacity: 1; transform: none; }
    }
}
