/* Public WPResidence agent-page layout. */

/* Use the verified 800 x 600 portraits instead of the cropped 525 x 328 derivatives. */
body.single-estate_agent.postid-19850
    .wpestate_agent_header2_content
    .wpestate_single_agent_details_wrapper_type2
    .agentpict,
body.single-estate_agent.postid-19852
    .wpestate_agent_header2_content
    .wpestate_single_agent_details_wrapper_type2
    .agentpict {
    aspect-ratio: 4 / 3;
    height: auto;
    background-color: #f7f7f5;
    background-position: 50% 0;
    background-size: contain;
}

body.single-estate_agent.postid-19850
    .wpestate_agent_header2_content
    .wpestate_single_agent_details_wrapper_type2
    .agentpict {
    background-image: url("/wp-content/uploads/2025/08/Fred-Photo-1.jpg") !important;
}

body.single-estate_agent.postid-19852
    .wpestate_agent_header2_content
    .wpestate_single_agent_details_wrapper_type2
    .agentpict {
    background-image: url("/wp-content/uploads/2025/08/Gilles-Photo-1-2.jpg") !important;
}

body.single-estate_agent.postid-19852
    .wpestate_agent_header2_content
    .wpestate_single_agent_details_wrapper_type2
    .agentpict {
    aspect-ratio: 4 / 3;
    width: 380px;
    height: auto !important;
    background-image: url("/wp-content/uploads/2025/08/Gilles-Photo-1-2.jpg") !important;
    background-position: 50% 0 !important;
    background-repeat: no-repeat;
    background-size: contain !important;
}

/* Hide only the compliance block incorrectly injected into the upper identity panel. */
body.single-estate_agent
    .single-content.single-agent
    > .wpestate_single_agent_details_wrapper_type2
    > .fp-commercial-compliance {
    display: none !important;
}

/* Keep the upper contact actions limited to the existing Call and WhatsApp links. */
body.single-estate_agent
    .wpestate_single_agent_details_wrapper_type2
    .realtor-contact-buttons {
    display: flex;
    flex-flow: row wrap;
    gap: 10px;
    align-items: flex-start;
}

body.single-estate_agent
    .wpestate_single_agent_details_wrapper_type2
    .realtor-contact-buttons
    .send_email_agent[href="#agent_send_email"] {
    display: none !important;
}

body.single-estate_agent
    .wpestate_single_agent_details_wrapper_type2
    .realtor-contact-buttons
    :is(.realtor_call, .realtor_whatsapp) {
    flex: 0 0 auto;
    max-width: 100%;
}

/* Stack the three identity fields and keep each label immediately above its field. */
body.single-estate_agent #agent_send_email .contact_form_flex_wrapper {
    align-items: stretch;
    flex-wrap: wrap;
}

body.single-estate_agent #agent_send_email .contact_form_flex_input_wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 6px;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    flex: 0 0 100%;
}

body.single-estate_agent #agent_send_email .contact_form_flex_input_wrapper > .fp-commercial-label {
    display: block;
    width: 100%;
    margin: 0;
    white-space: nowrap;
}

body.single-estate_agent #agent_send_email .contact_form_flex_input_wrapper
    > :is(label[for="agent_contact_name"], #agent_contact_name) {
    grid-column: 1;
}

body.single-estate_agent #agent_send_email label[for="agent_contact_name"] {
    grid-row: 1;
}

body.single-estate_agent #agent_send_email #agent_contact_name {
    grid-row: 2;
}

body.single-estate_agent #agent_send_email .contact_form_flex_input_wrapper
    > :is(label[for="agent_user_email"], #agent_user_email) {
    grid-column: 1;
}

body.single-estate_agent #agent_send_email label[for="agent_user_email"] {
    grid-row: 3;
    margin-top: 8px;
}

body.single-estate_agent #agent_send_email #agent_user_email {
    grid-row: 4;
}

body.single-estate_agent #agent_send_email .contact_form_flex_input_wrapper
    > :is(label[for="agent_phone"], #agent_phone) {
    grid-column: 1;
}

body.single-estate_agent #agent_send_email label[for="agent_phone"] {
    grid-row: 5;
    margin-top: 8px;
}

body.single-estate_agent #agent_send_email #agent_phone {
    grid-row: 6;
}

body.single-estate_agent #agent_send_email .contact_form_flex_input_wrapper > input.form-control,
body.single-estate_agent #agent_send_email .contact_form_flex_wrapper
    > :is(
        .fp-commercial-consents,
        label[for="agent_comment"],
        #agent_comment,
        .fp-commercial-compliance
    ) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    flex: 0 0 100%;
}

/* Preserve the exact validated case and native compact width of the form submit button. */
body.single-estate_agent #agent_send_email .agent_submit_class {
    width: auto;
    max-width: 100%;
    min-height: 40px;
    text-align: center;
    text-transform: none;
    white-space: normal;
}

@media screen and (max-width: 768px) {
    body.single-estate_agent
        .wpestate_agent_header2_content
        .wpestate_single_agent_details_wrapper_type2 {
        flex-direction: column !important;
    }
}
