section {
    text-align: justify;
}

#qui {
    position: relative; /* anchor absolute children */
    display: flex;
    flex-direction: row;
    justify-content: left;
    gap: 2em;
    margin-bottom: 2em;
}

/* Desktop: place the left column absolutely so it does not determine the row height.
   The right column stays in-flow and defines the container height; the left column
   will be constrained to that height (top:0; bottom:0). Use a CSS variable to
   control left column width so it's easy to adjust in one place. */
:root {
    --qui-left-width: 40%; /* default width for the left column on desktop */
}

#qui-left {
    width: var(--qui-left-width);
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    overflow: hidden; /* prevent image/content from overflowing past the bottom */
}

#qui-left img {
    width: auto;
    height: 100%; /* fill the available height (which matches #qui-right's height)
                     and be cropped if necessary due to overflow:hidden */
    object-fit: cover;
}

/* Make space for the absolutely-positioned left column so the right column doesn't overlap it */
#qui-right {
    margin-left: calc(var(--qui-left-width) + 2em);
}

@media screen and (max-width: 850px) {
    /* Revert to stacked layout on small screens */
    #qui { position: static; flex-direction: column; }
    /* Make left image a square and crop from the bottom by positioning the image at the top */
    #qui-left { position: static; width: 100%; aspect-ratio: 1/1; overflow: hidden; }
    #qui-left img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
    #qui-right { margin-left: 0; }
}

/************************************************
*                BIOGRAPHIE STYLE               *
************************************************/
#qui-right {
    line-height: 1.6;
    text-align: left;
}
h1 { font-size: clamp(2.2rem, 4vw, 3rem); line-height: 1.1; margin: 0 0 0.4em 0; }
#qui-right h2 { font-size: clamp(1.9rem, 3.2vw, 2.4rem); line-height: 1.15; margin: 0.2em 0 0.4em; }
#qui-right h3 { font-size: clamp(1.25rem, 2.1vw, 1.55rem); font-weight: 500; line-height: 1.3; margin: 0 0 0.9em; }
#qui-right p { margin: 0 0 1em 0; }
#qui-right .bio-lead { font-size: 1.12em; font-weight: 500; }
#qui-right .drop-cap:first-letter {
    float: left;
    font-size: 3.3em;
    line-height: 0.85;
    padding: 0.05em 0.18em 0 0;
    font-weight: 600;
    color: var(--color-blue);
}

#qui-right .bio-highlight {
    background: linear-gradient(to right, rgba(0,123,255,0.12), rgba(0,123,255,0));
    padding: 0.4em 0.4em;
    border-left: 4px solid var(--color-blue);
    font-weight: 500;
}

@media screen and (max-width: 850px) {
    #qui { flex-direction: column; }
    h1 {
        text-align: center;
    }
    #qui-right {
        max-width: 100%;
        text-align: justify;
    }
    
    #qui-right .separateur {
        margin-left: auto;
        margin-right: auto;
    }

    #qui-right h1, #qui-right h2, #qui-right h3 {
        text-align: center;
    }

}