/* canonical.cc — Lab share widget styles
 *
 * Standalone stylesheet so any lab page can include just the share-widget
 * styles without pulling in the full site CSS. (Capital-call-planner is a
 * built Vite SPA with its own bundled CSS; loading the full style.css would
 * conflict with its layout. This file is scoped to .lab-share-* so it's
 * safe to add to any page.)
 *
 * Pairs with /js/lab-share.js and the Jekyll partial _includes/lab-share.html.
 *
 * Three pieces:
 *   1. .lab-share-strip — inline strip dropped into a lab's hero
 *   2. .lab-share-fab-* — floating bottom-right share button
 *   3. .lab-share-modal — the lookalike "share this" post-results modal */

/* ── Inline share strip ──────────────────────────────────────────────── */
.lab-share-strip {
    margin-top: 1.75rem;
    margin-bottom: 0;
    width: 100%;
}
.lab-share-strip-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    /* No borders. Spacing is handled by the outer .lab-share-strip's
     * margin-top / margin-bottom — the strip is a clean row of icons. */
}

/* Physical AI + Semiconductor Stack: when the meta row follows the share
 * strip, drop its own top border — the user wants no horizontal line
 * separating the icons from the meta items.
 *
 * Use `~` (general sibling), not `+` (adjacent sibling): the Jekyll include
 * emits <link>, <div data-lab-share>, AND <script> as three siblings, so
 * the meta div isn't the IMMEDIATE next sibling of the mount div. */
[data-lab-share] ~ .pai-meta,
[data-lab-share] ~ .sem-meta {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 1.5rem;
}

.lab-share-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.lab-share-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-right: 0.25rem;
}
.lab-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: color 160ms ease, background 160ms ease,
        border-color 160ms ease, transform 160ms ease;
    text-decoration: none;
}
.lab-share-btn svg {
    width: 15px;
    height: 15px;
    display: block;
}
.lab-share-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}
.lab-share-source {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    transition: color 160ms ease;
}
.lab-share-source svg {
    width: 16px;
    height: 16px;
}
.lab-share-source:hover {
    color: #ffffff;
}
@media (max-width: 640px) {
    .lab-share-strip {
        margin-top: 1.25rem;
        margin-bottom: 0;
    }
    .lab-share-strip-inner {
        gap: 0.75rem;
    }
    .lab-share-group {
        gap: 0.4rem;
    }
    .lab-share-btn {
        width: 34px;
        height: 34px;
    }
    .lab-share-source span {
        display: none;
    }
    .lab-share-label {
        font-size: 0.65rem;
        letter-spacing: 0.16em;
    }
}
@media (max-width: 380px) {
    .lab-share-label {
        display: none;
    }
    .lab-share-strip-inner {
        gap: 0.5rem;
    }
}

/* ── Floating action button (FAB) ────────────────────────────────────── */
.lab-share-fab-root {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    /* Very high z-index so the FAB survives any SPA's stacking context.
     * Capital-call-planner is a built React/Tailwind SPA that we don't
     * control — keep this well above any plausible modal/overlay. */
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 0.6rem;
    font-family: 'Aeonik Regular', system-ui, -apple-system, BlinkMacSystemFont,
        'Segoe UI', Roboto, sans-serif;
}
.lab-share-fab {
    width: 52px;
    height: 52px;
    border-radius: 9999px;
    border: none;
    background: #1e3a8a;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35),
        0 2px 6px rgba(15, 23, 42, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 160ms ease, transform 160ms ease,
        box-shadow 160ms ease;
}
.lab-share-fab svg {
    width: 20px;
    height: 20px;
}
.lab-share-fab:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.4),
        0 3px 8px rgba(15, 23, 42, 0.22);
}
.lab-share-fab-root.is-open .lab-share-fab {
    background: #1d4ed8;
}
.lab-share-fab-menu {
    background: #ffffff;
    color: #0f172a;
    border-radius: 0.65rem;
    padding: 0.4rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25),
        0 4px 12px rgba(15, 23, 42, 0.12);
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lab-share-fab-menu[hidden] {
    display: none;
}
.lab-share-fab-menu a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.75rem;
    color: #0f172a;
    background: transparent;
    text-decoration: none;
    border-radius: 0.45rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 140ms ease, color 140ms ease;
}
.lab-share-fab-menu a:hover {
    background: #f1f5f9;
    color: #1d4ed8;
}
.lab-share-fab-menu a svg {
    width: 16px;
    height: 16px;
    color: #475569;
    transition: color 140ms ease;
}
.lab-share-fab-menu a:hover svg {
    color: #1d4ed8;
}
@media (max-width: 640px) {
    .lab-share-fab-root {
        right: 0.9rem;
        bottom: 0.9rem;
    }
    .lab-share-fab {
        width: 48px;
        height: 48px;
    }
}

/* ── Lookalike "share this" modal ────────────────────────────────────── */
.lab-share-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 200ms ease;
}
.lab-share-modal.is-visible {
    opacity: 1;
}
.lab-share-modal-card {
    position: relative;
    background: #ffffff;
    color: #0f172a;
    border-radius: 0.85rem;
    padding: 2rem 2rem 1.6rem;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.4),
        0 6px 18px rgba(15, 23, 42, 0.15);
    transform: translateY(8px);
    transition: transform 220ms ease;
    font-family: 'Aeonik Regular', system-ui, -apple-system, BlinkMacSystemFont,
        'Segoe UI', Roboto, sans-serif;
}
.lab-share-modal.is-visible .lab-share-modal-card {
    transform: translateY(0);
}
.lab-share-modal-close {
    position: absolute;
    top: 0.65rem;
    right: 0.9rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.05rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: color 140ms ease;
}
.lab-share-modal-close:hover {
    color: #0f172a;
}
.lab-share-modal-card h2 {
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.3;
    margin: 0 0 0.6rem;
    color: #0f172a;
}
.lab-share-modal-card .modal-sub {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #475569;
    margin: 0 0 1.5rem;
}
.lab-share-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 1.1rem;
}
.lab-share-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 0.55rem;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    background: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 140ms ease, color 140ms ease,
        border-color 140ms ease, transform 140ms ease;
}
.lab-share-modal-btn svg {
    width: 16px;
    height: 16px;
    color: #475569;
    transition: color 140ms ease;
}
.lab-share-modal-btn:hover {
    background: #1e3a8a;
    color: #ffffff;
    border-color: #1e3a8a;
    transform: translateY(-1px);
}
.lab-share-modal-btn:hover svg {
    color: #ffffff;
}
.lab-share-modal-dismiss {
    display: block;
    margin: 0 auto;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    transition: color 140ms ease;
}
.lab-share-modal-dismiss:hover {
    color: #0f172a;
}
@media (max-width: 480px) {
    .lab-share-modal {
        padding: 1rem;
    }
    .lab-share-modal-card {
        padding: 1.5rem 1.3rem 1.2rem;
    }
    .lab-share-modal-card h2 {
        font-size: 1.15rem;
    }
}
