/* =========================================================================
   WIZAY - BIOGRAFÍA (Crónica Editorial Infográfica Equilibrada)
   Ubicación: /css/bio.css
   ========================================================================= */

#biografia {
    background-color: var(--color-beige);
    /* Dos manchas de tono muy suaves. Con radio fijo y alejadas de los bordes superior e inferior:
       así valen 0 en la unión con los divisores (antes, con porcentajes, el tono llegaba hasta
       arriba por la izquierda y se veía un escalón de color distinto a izquierda y derecha) */
    background-image:
        radial-gradient(circle 560px at 10% 700px, rgba(184, 74, 40, 0.04) 0%, transparent 100%),
        radial-gradient(circle 560px at 90% calc(100% - 700px), rgba(107, 15, 26, 0.04) 0%, transparent 100%);
    color: var(--color-oscuro);
    padding: clamp(60px, 9vh, 130px) 20px;
    position: relative;
}

.bio-contenedor {
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
}

/* TÍTULO DE SECCIÓN CON REMATE DE PUNTOS */
.bio-titulo-seccion {
    text-align: center;
    margin-bottom: clamp(40px, 6.5vh, 75px);
    font-family: var(--fuente-titulos);
    color: var(--color-burdeos);
    font-size: clamp(2rem, 1.6rem + 1.8vw, 3.4rem);
    letter-spacing: 2.5px;
    position: relative;
    padding-bottom: 18px;
}

/* Con frase debajo, el hueco grande pasa a la frase */
.bio-titulo-seccion:has(+ .bio-descripcion) {
    margin-bottom: 14px;
}

.bio-descripcion {
    text-align: center;
    max-width: 62ch;
    margin: 0 auto clamp(40px, 6.5vh, 75px);
    font-size: clamp(0.95rem, 0.88rem + 0.3vw, 1.15rem);
    font-weight: 300;
    color: var(--color-oscuro);
    text-wrap: balance;
}

.bio-titulo-seccion::after {
    content: "•  •  ✶  •  •";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    letter-spacing: 4px;
    color: var(--color-naranja-trazo);
    opacity: 0.75;
    font-weight: 400;
}

/* =========================================================================
   CUADRÍCULA EDITORIAL (2 COLUMNAS SIN HUECOS VACÍOS EN PC)
   ========================================================================= */
.bio-layout-editorial {
    display: grid;
    grid-template-columns: minmax(320px, 440px) 1fr;
    grid-template-areas:
        "foto   est01"
        "est02  est03"
        "sello  est04";
    gap: clamp(28px, 3.6vw, 48px);
    align-items: stretch;
}

/* ASIGNACIÓN DE ÁREAS */
.bio-area-foto  { grid-area: foto; }
.bio-area-est01 { grid-area: est01; }
.bio-area-est02 { grid-area: est02; }
.bio-area-est03 { grid-area: est03; }
.bio-area-est04 { grid-area: est04; }
.bio-area-sello { grid-area: sello; }

/* =========================================================================
   RETRATO OFICIAL (TRAZO ORIGINAL + PRESENCIA ESCÉNICA INTERIOR)
   ========================================================================= */
.bio-retrato-marco {
    border: 2px dashed var(--color-naranja-trazo);
    border-radius: 8px;
    padding: 16px 16px 12px;
    background: linear-gradient(155deg, rgba(255, 253, 250, 0.88) 0%, rgba(245, 235, 222, 0.65) 100%);
    box-shadow: 
        0 24px 50px -12px rgba(107, 15, 26, 0.16),
        0 6px 18px rgba(18, 18, 18, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease, border-color 0.45s ease;
}

/* Filete interior sutil de enmarcado fotográfico */
.bio-retrato-marco::before {
    content: "";
    position: absolute;
    inset: 9px;
    border: 1px solid rgba(107, 15, 26, 0.12);
    border-radius: 4px;
    pointer-events: none;
    z-index: 2;
}

.bio-retrato-marco:hover {
    transform: translateY(-3px);
    border-color: var(--color-burdeos);
    box-shadow: 
        0 30px 60px -12px rgba(107, 15, 26, 0.22),
        0 8px 22px rgba(18, 18, 18, 0.07),
        inset 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.bio-retrato-img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    border-radius: 4px;
    display: block;
    object-fit: cover;
    box-shadow: 0 4px 14px rgba(18, 18, 18, 0.12);
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.bio-retrato-marco:hover .bio-retrato-img {
    transform: scale(1.015);
}

/* Pie de foto estilo crédito de programa de mano */
.bio-retrato-pie {
    margin-top: 12px;
    padding: 9px 10px 4px;
    background: transparent;
    border-top: 2px dotted rgba(184, 74, 40, 0.38);
    text-align: center;
    font-family: var(--fuente-titulos);
    font-size: 0.76rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-burdeos);
    font-weight: 700;
    position: relative;
    z-index: 3;
}

.bio-retrato-pie span::before,
.bio-retrato-pie span::after {
    content: "•";
    color: var(--color-naranja-trazo);
    margin: 0 8px;
    opacity: 0.75;
}

/* =========================================================================
   ESTACIONES INFOGRÁFICAS & HILO CONDUCTOR DE PUNTOS
   ========================================================================= */
.bio-estacion {
    position: relative;
    padding-left: clamp(34px, 4.2vw, 50px);
    display: flex;
    flex-direction: column;
    transition: opacity 0.45s ease, filter 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Estela vertical de puntos que guía cada estación */
.bio-estacion::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 38px;
    bottom: 14px;
    width: 0;
    border-left: 2px dotted rgba(184, 74, 40, 0.45);
    z-index: 1;
    transform-origin: top center;
    transition: border-color 0.35s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}

/* Punto de vértice al final de la estela de cada estación */
.bio-estacion::after {
    content: "";
    position: absolute;
    left: 13px;
    bottom: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-beige);
    border: 2px solid var(--color-naranja-trazo);
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.35s ease, border-color 0.35s ease;
}

.bio-estacion:hover::before,
.bio-estacion.foco-escenico::before {
    border-left-color: var(--color-burdeos);
}

.bio-estacion:hover::after,
.bio-estacion.foco-escenico::after {
    background: var(--color-burdeos);
    border-color: var(--color-burdeos);
    transform: scale(1.25);
}

/* NODO NUMERADO ESCÉNICO (01, 02, 03, 04) */
.bio-nodo-indicador {
    position: absolute;
    left: 0;
    top: 4px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-burdeos);
    border: 2px solid var(--color-beige);
    outline: 2px dotted rgba(184, 74, 40, 0.55);
    outline-offset: 2px;
    box-shadow: 0 5px 15px rgba(107, 15, 26, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), outline-color 0.35s ease, box-shadow 0.35s ease;
}

/* Pequeño puente punteado horizontal entre el nodo y el pliego */
.bio-nodo-indicador::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    width: 14px;
    border-top: 2px dotted rgba(184, 74, 40, 0.5);
    transform: translateY(-50%);
    pointer-events: none;
}

.bio-estacion:hover .bio-nodo-indicador,
.bio-estacion.foco-escenico .bio-nodo-indicador {
    transform: scale(1.1);
    outline-color: var(--color-burdeos);
    box-shadow: 0 0 0 5px rgba(107, 15, 26, 0.08), 0 8px 20px rgba(107, 15, 26, 0.35);
}

.bio-nodo-numero {
    font-family: var(--fuente-titulos);
    font-size: 0.76rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    letter-spacing: 0.5px;
}

/* =========================================================================
   PLIEGO EDITORIAL & EFECTO "FOCO DE ESCENARIO" (TOQUE MAGISTRAL 3)
   ========================================================================= */
.bio-estacion-contenido {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.76) 0%, rgba(255, 250, 244, 0.48) 100%);
    border: 1px solid rgba(184, 74, 40, 0.18);
    border-radius: 10px;
    padding: clamp(20px, 2.6vw, 30px);
    box-shadow: 
        0 12px 32px -10px rgba(107, 15, 26, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Luz cenital de escenario proyectada desde arriba */
.bio-estacion-contenido::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-naranja-trazo), var(--color-burdeos), var(--color-naranja-trazo), transparent);
    opacity: 0;
    transition: opacity 0.4s ease, left 0.4s ease, right 0.4s ease;
    pointer-events: none;
}

.bio-estacion-contenido:hover,
.bio-estacion.foco-escenico .bio-estacion-contenido {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 252, 248, 0.78) 100%);
    border-color: rgba(184, 74, 40, 0.48);
    transform: translateY(-2px);
    box-shadow: 
        0 22px 45px -12px rgba(107, 15, 26, 0.14),
        0 4px 14px rgba(184, 74, 40, 0.06),
        inset 0 1px 0 #ffffff;
}

.bio-estacion-contenido:hover::before,
.bio-estacion.foco-escenico .bio-estacion-contenido::before {
    opacity: 0.85;
    left: 0;
    right: 0;
}

/* En PC, cuando el lector ilumina una estación con el ratón, las demás bajan sutilmente la luz de sala */
@media (hover: hover) and (min-width: 901px) {
    .bio-layout-editorial:has(.bio-estacion:hover) .bio-estacion:not(:hover) {
        opacity: 0.62;
        filter: saturate(0.85);
    }
}

/* Etiqueta superior de cada estación con punto de origen */
.bio-estacion-etiqueta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--fuente-titulos);
    font-size: 0.76rem;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--color-naranja-trazo);
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px dotted rgba(184, 74, 40, 0.32);
}

.bio-estacion-etiqueta::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-burdeos);
    flex-shrink: 0;
}

.bio-parrafo {
    font-family: var(--fuente-textos);
    font-size: clamp(0.95rem, 0.89rem + 0.25vw, 1.06rem);
    line-height: 1.78;
    color: #222222;
    font-weight: 300;
    margin: 0 0 15px;
}

.bio-parrafo:last-child {
    margin-bottom: 0;
}

/* =========================================================================
   LETRA CAPITULAR EDITORIAL EN EL ARRANQUE (TOQUE MAGISTRAL 2)
   ========================================================================= */
.bio-area-est01 .bio-parrafo:first-of-type::first-letter {
    font-family: var(--fuente-titulos);
    font-size: clamp(2.9rem, 2.5rem + 1.2vw, 3.6rem);
    font-weight: 800;
    color: var(--color-burdeos);
    float: left;
    line-height: 0.82;
    margin: 4px 12px 2px 0;
    padding: 6px 10px 4px 8px;
    background: linear-gradient(145deg, rgba(107, 15, 26, 0.06) 0%, rgba(184, 74, 40, 0.02) 100%);
    border-right: 2px dotted rgba(184, 74, 40, 0.45);
    border-bottom: 2px dotted rgba(184, 74, 40, 0.45);
    border-radius: 4px 0 6px 0;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
}

.bio-parrafo strong {
    color: var(--color-burdeos);
    font-weight: 600;
}

.bio-parrafo em {
    color: var(--color-burdeos);
    font-style: italic;
    font-weight: 600;
}

/* =========================================================================
   CITAS LITERARIAS & BROCHE FINAL
   ========================================================================= */
.bio-destacado-cita {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 16px 0;
    padding: 12px 18px;
    background: linear-gradient(90deg, rgba(107, 15, 26, 0.06) 0%, rgba(184, 74, 40, 0.01) 100%);
    border-left: 3px solid var(--color-burdeos);
    border-top: 1px dotted rgba(184, 74, 40, 0.28);
    border-bottom: 1px dotted rgba(184, 74, 40, 0.28);
    border-radius: 0 4px 4px 0;
}

.bio-destacado-icono {
    color: var(--color-naranja-trazo);
    font-size: 1.05rem;
    line-height: 1;
    flex-shrink: 0;
}

.bio-destacado-frase {
    margin: 0;
    font-family: var(--fuente-titulos);
    font-size: clamp(0.98rem, 0.92rem + 0.25vw, 1.18rem);
    font-style: italic;
    color: var(--color-burdeos);
    letter-spacing: 0.6px;
    font-weight: 700;
}

/* REMATE FINAL POÉTICO */
.bio-parrafo-cierre {
    font-style: italic;
    color: var(--color-burdeos);
}

.bio-broche-final {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
    padding-top: 4px;
}

.bio-broche-linea {
    flex: 1;
    height: 0;
    border-top: 2px dotted var(--color-naranja-trazo);
    opacity: 0.55;
}

.bio-broche-estrella {
    color: var(--color-burdeos);
    font-size: 1.05rem;
    line-height: 1;
}

/* =========================================================================
   MARCA DE AGUA FLOTANTE "W" (SIN CONTORNO, FIEL AL DISEÑO ORIGINAL)
   ========================================================================= */
.bio-sello-contenedor {
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    pointer-events: none;
    min-height: 140px;
}

.bio-sello-w-letra {
    font-family: var(--fuente-titulos);
    font-size: clamp(4.8rem, 7.2vw, 7.2rem);
    font-weight: 800;
    color: var(--color-burdeos);
    opacity: 0.22;
    line-height: 1;
    letter-spacing: 0;
    display: block;
    text-align: center;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.55), 0 12px 24px rgba(107, 15, 26, 0.14);
}

/* =========================================================================
   ANIMACIÓN DE TRAZADO Y UNIÓN DE PUNTOS EN SCROLL (TOQUE MAGISTRAL 1)
   ========================================================================= */
.bio-item-grid.bio-anim-pendiente {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(2px);
}

.bio-estacion.bio-anim-pendiente::before {
    transform: scaleY(0);
}

.bio-estacion.bio-anim-pendiente::after {
    transform: scale(0);
}

.bio-estacion.bio-anim-pendiente .bio-nodo-indicador {
    transform: scale(0.4);
}

/* Entrada: más lenta y sin rebote. main.js retira .bio-anim-visible al terminar,
   para que el foco de lectura recupere sus propias transiciones rápidas. */
.bio-item-grid.bio-anim-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    transition:
        opacity 1.1s ease,
        transform 1.4s cubic-bezier(0.22, 1, 0.36, 1),
        filter 1.1s ease;
}

/* La estela de puntos se dibuja un poco después de que la estación asome */
.bio-estacion.bio-anim-visible::before {
    transition: border-color 0.35s ease, transform 1.5s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}
.bio-estacion.bio-anim-visible::after {
    transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1) 0.9s, background 0.35s ease, border-color 0.35s ease;
}
.bio-estacion.bio-anim-visible .bio-nodo-indicador {
    transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.15s, outline-color 0.35s ease, box-shadow 0.35s ease;
}

/* =========================================================================
   RESPONSIVE DESIGN (TABLET Y MÓVIL EN 1 COLUMNA CONTINUA)
   ========================================================================= */
@media (max-width: 900px) {
    .bio-layout-editorial {
        display: flex;
        flex-direction: column;
        gap: 32px;
    }

    .bio-area-foto {
        max-width: 340px;
        margin: 0 auto;
        width: 100%;
    }

    /* En móvil y tablet estrecha, la W flotante no compite */
    .bio-sello-contenedor {
        display: none;
    }

    .bio-estacion {
        padding-left: 40px;
    }

    /* En 1 columna, el hilo punteado conecta una estación con la siguiente */
    .bio-estacion:not(.bio-estacion-final)::before {
        bottom: -34px;
    }

    .bio-estacion:not(.bio-estacion-final)::after {
        display: none;
    }
}

@media (max-width: 600px) {
    .bio-estacion {
        padding-left: 36px;
    }

    .bio-nodo-indicador {
        width: 28px;
        height: 28px;
        outline-width: 1.5px;
    }

    .bio-nodo-indicador::after {
        width: 8px;
    }

    .bio-estacion::before {
        left: 13px;
        top: 34px;
    }

    .bio-estacion::after {
        left: 10px;
    }

    .bio-nodo-numero {
        font-size: 0.7rem;
    }

    .bio-estacion-contenido {
        padding: 16px 18px;
    }

    .bio-area-est01 .bio-parrafo:first-of-type::first-letter {
        font-size: 2.5rem;
        margin: 2px 10px 2px 0;
        padding: 4px 8px 3px 6px;
    }

    .bio-destacado-cita {
        padding: 8px 12px;
        gap: 8px;
    }

    .bio-destacado-icono {
        display: none;
    }
}

/* =========================================================================
   PÁRRAFOS JUSTIFICADOS (OPCIÓN DEL PANEL: «Aspecto de los textos»)
   Solo actúa si la sección lleva la clase .bio-texto-justificado.
   Las citas destacadas y la frase bajo el título no se tocan.
   ========================================================================= */
.bio-texto-justificado .bio-parrafo {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}
