/* ======================================================================
   compartir.css  ·  botones y menú para compartir en redes
   Cárgalo DESPUÉS de styles.css (se hace en includes/head.php).
   Usa las variables de color de tu tema, por lo que funciona en claro y oscuro.
   ====================================================================== */

/* ---------- Fila de acciones de las cards: "Leer ahora" + ícono de compartir ---------- */

.story-card .actions {
    flex-wrap: nowrap;
}

.story-card .actions .btn:not(.btn-compartir-icono) {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    padding: 11px 12px;
    font-size: 14px;          /* antes heredaba el tamaño grande y deformaba el botón */
    line-height: 1.2;
    white-space: nowrap;
}

.btn-compartir-icono {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 44px;
    padding: 12px;
    line-height: 0;
}

.btn-compartir-icono svg {
    display: block;
}

.btn-compartir-icono[aria-expanded="true"] {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- Menú desplegable ---------- */

.compartir-menu {
    position: fixed;
    z-index: 100000;
    min-width: 210px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.compartir-menu[hidden] {
    display: none;
}

.compartir-opcion {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.compartir-opcion:hover,
.compartir-opcion:focus-visible {
    background: var(--bg-soft);
    outline: none;
}

.compartir-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--text);
    line-height: 0;
}

.compartir-ico .compartir-svg {
    width: 17px;
    height: 17px;
}

.compartir-ico-whatsapp { background: #25d366; color: #fff; }
.compartir-ico-facebook { background: #1877f2; color: #fff; }
.compartir-ico-x        { background: #000;    color: #fff; }
.compartir-ico-instagram { background: linear-gradient(45deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888); color: #fff; }
.compartir-ico-tiktok    { background: #010101; color: #fff; }

/* ---------- Barra del lector (lateral y al final del relato) ---------- */

.compartir-barra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 14px 0;
}

.compartir-barra:empty {
    display: none;
}

.compartir-etiqueta {
    margin-right: 4px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

/* Botones en círculo, solo con el ícono de la red */
.compartir-barra .compartir-red {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    box-shadow: none;
    transition: transform .15s ease, filter .15s ease;
}

.compartir-barra .compartir-red:hover {
    transform: translateY(-2px);
}

.compartir-barra .compartir-red:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Texto solo para lectores de pantalla */
.compartir-red-txt {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.compartir-red-ico {
    display: inline-flex;
    line-height: 0;
}

.compartir-red-ico .compartir-svg {
    width: 18px;
    height: 18px;
}

.compartir-barra .compartir-red:hover,
.compartir-barra .compartir-red:focus-visible {
    filter: brightness(1.08);
}

/* Colores de cada red */
.compartir-barra .compartir-red-whatsapp { background: #1fa855; }
.compartir-barra .compartir-red-facebook { background: #1877f2; }
.compartir-barra .compartir-red-x        { background: #000; border-color: rgba(255, 255, 255, .28); }
.compartir-barra .compartir-red-instagram { background: linear-gradient(45deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888); }
.compartir-barra .compartir-red-tiktok    { background: #010101; border-color: rgba(255, 255, 255, .28); }
.compartir-barra .compartir-red-copiar   { background: var(--surface); color: var(--text); border-color: var(--border); }

