/* LOT SHARE-VISUEL — bouton, cartouche et prévisualisation.
 *
 * Fichier SÉPARÉ, chargé après la maquette : `footlab.css`, `dashboard.css` et
 * `copilot.css` sont le miroir bit à bit du projet Claude Design et ne doivent
 * jamais porter un correctif de lot (modèle : `plan-rail.css`).
 *
 * Les couleurs passent par les tokens de thème, avec repli : le composant vit
 * aussi bien sous le chrome public que sous le dashboard. Le VISUEL, lui,
 * n'utilise aucune variable CSS — il est rendu hors du document. */

/* Ligne d'accueil du bouton quand il ne vit pas dans un en-tête de section.
   Le composant émet aussi la modale et le script : il doit donc être posé dans
   un conteneur de FLUX, jamais dans un <h2>. */
.share-visual-row {
    margin: 10px 0 0;
}

.sv-btn,
.sv-cartouche {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid rgba(var(--text-rgb, 255 255 255), 0.14);
    background: rgba(var(--text-rgb, 255 255 255), 0.04);
    color: var(--text, inherit);
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.sv-btn:hover,
.sv-btn:focus-visible {
    border-color: rgba(var(--accent-rgb, 241 176 76), 0.45);
    background: rgba(var(--accent-rgb, 241 176 76), 0.08);
}

.sv-cartouche {
    color: var(--muted, #8a8378);
    font-weight: 500;
    border-style: dashed;
}

.sv-cartouche:hover,
.sv-cartouche:focus-visible {
    color: var(--text, inherit);
    border-color: rgba(var(--accent-rgb, 241 176 76), 0.45);
}

/* ── Prévisualisation ───────────────────────────────────────────────────── */

.sv-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sv-modal[hidden] {
    display: none;
}

.sv-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 4, 6, 0.78);
}

.sv-modal__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(440px, 100%);
    max-height: calc(100vh - 40px);
    padding: 20px;
    border-radius: 20px;
    background: var(--bg-1, #101014);
    border: 1px solid rgba(var(--text-rgb, 255 255 255), 0.1);
    overflow-y: auto;
}

.sv-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sv-modal__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text, inherit);
}

.sv-modal__close {
    border: 0;
    background: none;
    color: var(--muted, #8a8378);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.sv-modal__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.sv-modal__status {
    margin: 0;
    font-size: 13px;
    color: var(--muted, #8a8378);
    text-align: center;
}

/* Le visuel est un portrait 4:5 : la prévisualisation garde le ratio exact,
   pour que l'utilisateur voie ce qu'il partagera, pas une approximation. */
.sv-modal__preview {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1080 / 1350;
    border-radius: 14px;
    background: #08080a;
}

.sv-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sv-action {
    flex: 1 1 auto;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(var(--text-rgb, 255 255 255), 0.14);
    background: transparent;
    color: var(--text, inherit);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.sv-action[hidden] {
    display: none;
}

.sv-action--primary {
    border-color: rgba(var(--accent-rgb, 241 176 76), 0.5);
    background: rgba(var(--accent-rgb, 241 176 76), 0.12);
}

.sv-action:hover,
.sv-action:focus-visible {
    border-color: rgba(var(--accent-rgb, 241 176 76), 0.6);
}

@media (prefers-reduced-motion: reduce) {
    .sv-btn,
    .sv-cartouche,
    .sv-action {
        transition: none;
    }
}
