/*
 * Estructura común de las plantillas nuevas de página bio (post_templates/_base/pagina.blade.php).
 * Cada plantilla carga este archivo y después su propio {tema}/style.css, que sólo cambia las
 * variables --bio-* y algún detalle. Las plantillas viejas (basic, sky…) no lo usan.
 */
.bio {
    --bio-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bio-font-titulo: var(--bio-font);
    --bio-fondo: #f6f8fc;
    --bio-tarjeta: #fff;
    --bio-tarjeta-borde: transparent;
    --bio-tarjeta-sombra: 0 20px 60px rgba(15, 23, 42, .08);
    --bio-texto: #0f172a;
    --bio-suave: #64748b;
    --bio-acento: #1460BC;
    --bio-boton: #fff;
    --bio-boton-texto: #0f172a;
    --bio-boton-borde: rgba(15, 23, 42, .1);
    --bio-boton-hover: #f8fafc;
    --bio-boton-radio: 16px;
    --bio-icono-fondo: #EEF5FD;
    --bio-icono-color: #1460BC;
    --bio-avatar-borde: #fff;
    --bio-red-fondo: #fff;
    --bio-red-color: #0f172a;
    --bio-marca-filtro: none;

    position: relative;
    min-height: 100vh;
    padding: 28px 16px 40px;
    display: flex;
    justify-content: center;
    font-family: var(--bio-font);
    color: var(--bio-texto);
    -webkit-font-smoothing: antialiased;
}
.bio-fondo { position: fixed; inset: 0; z-index: 0; background: var(--bio-fondo); }

.bio-tarjeta {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    align-self: flex-start;
    background: var(--bio-tarjeta);
    border: 1px solid var(--bio-tarjeta-borde);
    border-radius: 28px;
    box-shadow: var(--bio-tarjeta-sombra);
    padding: 28px 22px 26px;
    overflow: hidden;
}

/* Botón compartir */
.bio-compartir {
    position: absolute; top: 16px; right: 16px; z-index: 3;
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--bio-boton-borde);
    background: var(--bio-boton); color: var(--bio-boton-texto); display: grid; place-items: center; font-size: 15px;
    transition: transform .15s;
}
.bio-compartir:hover { transform: scale(1.06); }

/* Cabecera */
.bio-cabecera { text-align: center; position: relative; }
.bio-portada { margin: -28px -22px 0; height: 150px; overflow: hidden; }
.bio-portada img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bio-cabecera.con-portada .bio-avatar { margin-top: -56px; }
.bio-avatar {
    position: relative; width: 112px; height: 112px; margin: 8px auto 14px; border-radius: 50%;
    padding: 4px; background: var(--bio-avatar-borde);
}
.bio-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: #fff; }
.bio-nombre { font-family: var(--bio-font-titulo); font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; color: var(--bio-texto); line-height: 1.2; word-break: break-word; }
.bio-desc { color: var(--bio-suave); font-size: .98rem; line-height: 1.55; margin: 0 auto; max-width: 380px; white-space: pre-line; word-break: break-word; }
.bio-direccion { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: .88rem; color: var(--bio-suave); text-decoration: none; }
.bio-direccion:hover { color: var(--bio-acento); }
.bio-direccion i { color: var(--bio-acento); }

/* WhatsApp destacado */
.bio-whatsapp {
    display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px;
    padding: 15px 18px; border-radius: var(--bio-boton-radio); background: #25D366; color: #fff !important;
    font-weight: 700; font-size: 1.02rem; text-decoration: none; box-shadow: 0 10px 24px rgba(37, 211, 102, .35);
    transition: transform .15s, box-shadow .15s;
}
.bio-whatsapp i { font-size: 1.35rem; }
.bio-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(37, 211, 102, .45); }

/* Enlaces */
.bio-enlaces { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.bio-seccion { font-family: var(--bio-font-titulo); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--bio-suave); text-align: center; margin: 14px 0 0; }
.bio-enlace {
    position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 9px 16px 9px 9px;
    border-radius: var(--bio-boton-radio); background: var(--bio-boton); color: var(--bio-boton-texto) !important;
    border: 1px solid var(--bio-boton-borde); text-decoration: none; font-weight: 600; font-size: .98rem;
    transition: transform .15s, background .15s, box-shadow .15s, border-color .15s;
}
.bio-enlace:hover { transform: translateY(-2px); background: var(--bio-boton-hover); }
.bio-enlace-img {
    flex: 0 0 42px; width: 42px; height: 42px; border-radius: calc(var(--bio-boton-radio) - 6px); overflow: hidden;
    display: grid; place-items: center; background: var(--bio-icono-fondo); color: var(--bio-icono-color); font-size: 18px;
}
.bio-enlace-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.bio-enlace-img svg, .bio-red svg { width: 1em; height: 1em; }
.bio-enlace-texto { flex: 1; text-align: center; padding-right: 30px; line-height: 1.3; word-break: break-word; }
.bio-enlace-flecha { position: absolute; right: 16px; font-size: 14px; opacity: .45; transition: opacity .15s, transform .15s; }
.bio-enlace:hover .bio-enlace-flecha { opacity: .9; transform: translateX(3px); }
.bio-enlace.is-destacado { border-color: var(--bio-acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bio-acento) 22%, transparent); animation: bio-latido 2.4s ease-in-out infinite; }

/* Redes */
.bio-redes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.bio-red {
    width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 19px;
    background: var(--bio-red-fondo); color: var(--bio-red-color) !important; border: 1px solid var(--bio-boton-borde);
    text-decoration: none; transition: transform .15s, color .15s;
}
.bio-red:hover { transform: translateY(-2px); color: var(--bio-acento) !important; }

/* Marca */
.bio-marca { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 28px; font-size: .75rem; color: var(--bio-suave); text-decoration: none; opacity: .85; }
.bio-marca img { height: 24px; width: auto; filter: var(--bio-marca-filtro); }
.bio-marca:hover { opacity: 1; }

/* Entrada */
/* backwards (no both): al terminar no se queda el transform final, que anulaba el :hover */
.bio-cabecera, .bio-whatsapp, .bio-seccion, .bio-enlace, .bio-redes { animation: bio-entrar .5s ease backwards; animation-delay: calc(var(--n, 0) * 60ms + 80ms); }
.bio-enlace.is-destacado { animation: bio-entrar .5s ease backwards, bio-latido 2.4s ease-in-out 1.2s infinite; animation-delay: calc(var(--n, 0) * 60ms + 80ms), 1.2s; }
@keyframes bio-entrar { from { opacity: 0; transform: translateY(10px); } }
@keyframes bio-latido { 0%, 100% { transform: none; } 50% { transform: scale(1.02); } }
@media (prefers-reduced-motion: reduce) {
    .bio-cabecera, .bio-whatsapp, .bio-seccion, .bio-enlace, .bio-redes, .bio-enlace.is-destacado { animation: none; }
}

@media (max-width: 420px) {
    .bio { padding: 0; }
    .bio-tarjeta { border-radius: 0; min-height: 100vh; border: 0; box-shadow: none; padding: 26px 16px 28px; }
    .bio-portada { margin: -26px -16px 0; }
}

/* Modal de compartir (layout) con la tipografía de la plantilla */
.bio ~ .modal .modal-content { border-radius: 20px; font-family: var(--bio-font, inherit); }
