/* =================================================================
    CONTACT PAGE STYLING
==================================================================== */

/* --- Base Scene Layout --- */
body.page-template-page-contact-php {
    overflow-x: hidden;
}

main.contact-scene-container {
    width: 100%;
    position: relative; /* Establishes a context for child elements */
    padding-top: var(--hdr-height, 80px); /* Desktop: Pushes content down below header */
    box-sizing: border-box;
}

#contact-scene {
    width: 100%;
    position: relative;
}

/* --- Animated Background Images (UPDATED) --- */
/*
 * UPDATED: Using `position: fixed`.
 * This fixes the images to the viewport itself, ensuring they always
 * cover the full screen from the top-right corner, behind all content.
 * This works consistently on both desktop and mobile.
*/
.contact-photo, .contact-sketch {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* Cover 100% of the viewport width */
    height: 100vh; /* Cover 100% of the viewport height */
    object-fit: cover;
    object-position: right top; /* Aligns to the top right */
    transition: opacity 2.5s ease-in-out;
    z-index: -1; /* Places them behind all other content */
}

/* Initial state: The photo is visible, the sketch is hidden. */
.contact-photo { opacity: 1; }
.contact-sketch { opacity: 0; }

/* State triggered by JavaScript */
body.contact-sketch-active .contact-sketch { opacity: 1; }
body.contact-sketch-active .contact-photo { opacity: 0; }


/* --- Content Styling --- */
.contact-content-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    margin-left: 10%;
    margin-right: auto;
    padding: 3rem 1.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.contact-left-content,
.contact-form-wrapper {
    width: 100%;
}

.contact-heading {
    font-family: var(--heading-font);
    font-size: 2.5rem;
    line-height: 1.1;
    transform: rotate(-3deg);
    text-align: left;
    margin-top: 0;
    margin-bottom: 1rem;
}

.contact-note p {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    line-height: 1.3;
    text-align: left;
    margin-bottom: 1.5rem;
    transform: rotate(-2.5deg);
}

.contact-social-icons {
    list-style: none;
    display: flex;
    gap: 14px;
    justify-content: flex-start;
    padding: 0;
    margin: 0 0 2rem 0;
}

.contact-social-icons li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #ccc;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.contact-social-icons li a:hover {
    background: #f0f0f0;
    border-color: #aaa;
}

.contact-social-icons svg {
    width: 20px;
    height: 20px;
    fill: var(--dark-purple);
}

/* --- Form Styling --- */
.contact-form {
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    margin: 0;
}

.contact-form label {
    text-align: left;
    font-family: var(--body-font);
    margin-bottom: 0.5rem;
    display: block;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--body-font);
    font-size: 1rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.contact-form textarea {
    margin-bottom: 1.5rem;
    min-height: 120px;
}

.contact-form button[type="submit"],
.contact-form input[type="submit"] {
    background: var(--dark-purple);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-family: var(--body-font);
    font-size: 1.2rem;
    width: 100%;
}

.contact-form button[type="submit"]:hover,
.contact-form input[type="submit"]:hover {
    background-color: #0f0013;
}

.contact-error {
    color: red;
    font-weight: bold;
    margin-top: 1rem;
    text-align: left;
}

.contact-form input#website {
    display: none;
}

/* --- Accessibility Focus Styles --- */
.contact-social-icons li a:focus-visible,
.contact-form input:focus-visible,
.contact-form textarea:focus-visible,
.contact-form button:focus-visible,
.contact-form input[type="submit"]:focus-visible {
    outline: 2px solid var(--dark-purple);
    outline-offset: 2px;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
    border-color: var(--dark-purple);
}


/* =================================================================
    RESPONSIVE LAYOUT FOR CONTACT PAGE
==================================================================== */

@media (max-width: 1024px) {
    /* --- Tablet & Mobile Layout --- */

    /* Force header to be a transparent overlay */
    body.page-template-page-contact-php .site-header {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: transparent !important;
        z-index: 1000;
    }

    /* Adjust header position if admin bar is present */
    body.admin-bar.page-template-page-contact-php .site-header {
       top: var(--admin-bar-height, 32px);
    }

    /* Remove the top padding from the main container on mobile */
    body.page-template-page-contact-php main.contact-scene-container {
        padding-top: 0 !important;
    }

    /* Center content and add padding to prevent overlap with the overlay header */
    .contact-content-wrapper {
        margin-left: auto;
        margin-right: auto;
        padding: 2rem 1rem;
        padding-top: calc(var(--hdr-height, 80px) + var(--admin-bar-height, 32px));
    }

    /* Apply a readable background to the text content */
    body.page-template-page-contact-php .contact-left-content {
        background-color: rgba(255, 255, 255, 0.9) !important;
        padding: 1.5rem !important;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
        margin-bottom: 1.5rem;
    }

    /* Ensure button color and form background are correct */
    .contact-form {
        background: rgba(255, 255, 255, 1);
        margin-top: 0;
    }

    .contact-form input[type="submit"],
    .contact-form button[type="submit"] {
        background-color: var(--dark-purple) !important;
    }
}

@media (max-width: 767px) {
    /* --- Finer Tweaks for Small Mobile Screens --- */

    .contact-heading {
        font-size: 2rem;
    }

    .contact-note p {
        font-size: 1.5rem;
    }

    .contact-form {
        padding: 1.5rem;
    }
}