body {
    background-color: black;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

.driver-page {
    display: flex;
    flex-wrap: wrap;
    margin-right: auto;
    width: calc(100vw - 300px);
    margin-top: 20px;
    margin-left: 150px;
    margin-right: 150px;
}

.teams-info {
    display: flex;
    flex-direction: column;
}

.image-block {
    display: flex;
    flex-direction: column;
    flex: 1; 
    min-width: 300px; /* Minimum width to prevent squishing */
    margin-right: 20px; /* Space between columns */
    color: white;
}

.stats-block {
    display: flex;
    flex: 1;
    font-family: 'Formula1';
    font-weight: 100;
    flex: 1; /* Takes up one column on larger screens */
    min-width: 300px; /* Minimum width to prevent squishing */
    color: white;
}

.stats-block p {
    margin-left: 20px;
}

.key-block {
    font-size: 1.2rem;
    font-weight: 500;
    margin-right: 70px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 15vh;
}

.value-block {
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 15vh;
}

.bio-block {
    flex-basis: 100%; /* Takes full width on smaller screens */
    margin-top: 20px; /* Space between blocks */
    color: white;
}

.driver-pic {
    height: 100%;
    width: 100%;
    background-size: contain; 
    background-position: center; 
    background-repeat: no-repeat;
    position: relative;
    border-radius: 2%;
    aspect-ratio: 1/1;
}

.number-flag {
    display: inline-block;
    color: white;
    margin: 0;
    padding: 10px;
}

.driver-number {
    font-family: 'Formula1';
    font-weight: 100;
    font-size: 2.4rem;
    display: inline-block;
    color: white;
    margin: 0;
    margin-right: 5px;
}

.driver-flag {
    height: 30px;
    width: 40px;
    display: inline-block;
    color: white;
    border-radius: 10%;
    margin: 0;
}

.name-text {
    font-family: 'Formula1';
    font-weight: 500;
    font-size: 3rem;
    color: white;
    margin: 0;
    padding: 10px;
}

.bio-block {
    font-family: 'Formula1';
    font-size: 1.25rem;
    flex-basis: 100%; 
    margin-top: 20px; 
    color: white;
}

.bio-block h2 {
    font-weight: 500;
    margin: 0;
}

.bio-block {
    padding: 10px;
}

.bio {
    border: 1px solid white;
    border-radius: 12px;
    margin-bottom: 10vh;
}

.bio p {
    color: white;
    font-family: 'Montserrat';
    text-align: justify;
    text-align: left;
    font-weight: 400;
    font-size: 1.12rem;
    padding: 15px;
    margin: 0;
}

@media (max-width: 768px) {
    .driver-page {
        flex-direction: column; /* Stacks elements vertically on smaller screens */
    }

    .image-block,
    .stats-block {
        min-width: auto; /* Remove minimum width */
        margin-right: 0; /* Reset margin */
    }
}