*,
*::before,
*::after {
  box-sizing: border-box;
}

/* --------------------- */
/* Hero Section Styles   */
/* --------------------- */

/* Hero Section */
.hero-section {
    display: flex;
    width: 100%;
    margin: 6rem 0 0; 
    min-height: calc(100vh - 6rem); 
    height: auto;
    background-color: #effff6;
}

/* Hero Content */
.hero-content {
    display: flex;
    flex-direction: row; 
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 104rem;
    margin: 0 auto;
    padding: 0 3rem;
    flex-wrap: wrap;
}

/* Hero Text */
.hero-text {
    width: 48%; /* Slightly less than half to reduce risk of overflow */
    text-align: left;
    z-index: 10; 
    position: relative;
    margin-right: 2rem; /* Space to separate from .hero-typing */
}

.hero-text img {
    width: 100%;
}

.hero-text p {
    margin-top: 2rem;
    font-size: 1.5rem;
    color: #4a4a4a;
}

.hero-button {
    margin-top: 3rem;
    padding: 1rem 2rem;
    background-color: #2ecc71;
    color: white;
    font-weight: 600;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
}

.hero-button:hover {
    background-color: #1dd84e;
}

/* --------------------- */
/* Hero Typing Styles    */
/* --------------------- */

.hero-typing {
    width: 48%; /* Keep in sync with hero-text to fit within container */
    max-width: 100%;
    z-index: 5;
    text-align: right;
    display: flex;
    justify-content: flex-end; /* Right-align content within its box */
    position: relative;
    overflow: hidden; 
    height: fit-content;
    
}

.typing-container {
    width: 100%;
    height: fit-content;
    display: flex;
    justify-content: right;
    transform-origin: top;
    border-radius: 0.5rem;
    text-align: left;
    align-items: center;
    margin: 5% 0;
}

.typing-box {
    width: 90%;
    height: auto;
    max-width: 100%;
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 2rem;
    overflow-wrap: break-word; 
}

.company-description {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.company-logo {
    height: 100%;
}

.company-text {
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    font-size: 1.5rem;
    align-items: center;
}

.first-company-text {
    margin-bottom: 0.25rem;
}

.typing-field {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cv-field {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.typing-label {
    font-size: 1.75rem;
    margin: 0 0.5rem 0.5rem;
}

.typing-span {
    border: 2px solid #d1d5db;
    border-radius: 10px;
    padding: 0.5rem 1rem;
    width: 100%;
    font-size: 1.5rem;
    min-height: 3rem;
    line-height: 2rem;
}

.cover-letter-span {
    height: 13rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 6;
    line-clamp: 6;
}

.cv {
    border-radius: 20px;
    background-color: rgba(238, 237, 229, 0.9);
    padding: 0.75rem 1.5rem;
    align-self: center;
    font-size: 2rem;
    font-weight: 600;
    margin-top: 0.5rem;
    position: relative;
}

/* --------------------- */
/* Responsive Breakpoints*/
/* --------------------- */

/* Medium devices (larger tablets/small laptops) */
@media (max-width: 1080px) and (orientation: landscape) {
    .hero-text h1 {
        font-size: 3rem;
    }

    .hero-text p {
        font-size: 1.25rem;
    }

    .typing-box {
        font-size: 1.75rem;
    }
}

/* Small devices (tablets) */
@media (max-width: 810px) {
    .hero-section {
        /* Allow content to expand downward rather than forcing a fixed height */
        height: auto; 
        min-height: 110vh; 
    }
    
    .hero-content {
        flex-direction: column;
        align-items: normal;
        justify-content: normal;
        flex-wrap: nowrap; 
    }

    .hero-text {
        width: 100%;
        padding: 0 5%;
        margin: 5% 0;
        height: fit-content;
    }

    .hero-typing {
        width: 100%;
        padding: 0 5%;
        height: auto; /* Let content define height */
        margin: 5% 0;
        align-items: flex-start;
    }

    .typing-container {
        justify-content: center;
    }
}

/* Extra small devices (phones) */
@media (max-width: 576px) {
    .hero-section {
        padding: 0 5%;
    }
    .hero-content {
        padding: 1rem 0; 
    }

    .hero-text {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0;
        margin-right: 0; /* No side margin in column layout */
    }

    .hero-text h1 {
        font-size: 2rem;
        text-align: center;
    }

    .hero-text p {
        margin-top: 1rem;
        padding: 0 1.5rem;
        font-size: 1.125rem;
        text-align: center !important;
    }

    .hero-button {
        margin-top: 1.5rem;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .hero-typing {
        padding: 0;
        justify-content: center;
    }

    .typing-box {
        font-size: 1.25rem;
        padding: 1rem;
        width: 100%;
    }
}
