﻿/* ==========================================================================
   PAGE TEMPLATE: Full Background - Left Form
   Load order:  LAST (after webforms.core.css and theme.css)
   Purpose:     Defines the page AROUND the form only: body reset, header,
                navbar, footer, logo, and the app container that holds the form.
                The look of the form itself (fonts, fields, buttons, radio
                buttons, section titles) belongs in the theme.

   CONTENTS
     1. Base
     2. Page structure
     3. Header, navbar & logo
     4. App container
     5. Footer
     6. Responsive
   ========================================================================== */


/* ==========================================================================
   1. BASE
   ========================================================================== */

body {
    margin: 0;
}


/* ==========================================================================
   2. PAGE STRUCTURE
   ========================================================================== */

#pageContainer {
    display: flex;
    flex-direction: column;
}

#layoutContainer {
    display: flex;
    flex-direction: row;
    gap: 40px;
}

#leftColumn {
    width: 480px;
    min-width: 480px;
}

#rightColumn {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    max-width: 600px;
}

#rightContentBox {
    padding: 10px;
    background-color: white;
    box-shadow: 0 0 10px 0 #777;
    color: var(--app-theme-font-primary-color);
}


/* ==========================================================================
   3. HEADER, NAVBAR & LOGO
   ========================================================================== */

#ceNavbar {
    position: relative;
    padding: 10px 20px;
    border-radius: 0;
    background-color: #f9f9fb;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: 0 0 7px 0 #bdbdbd;
}

#orgLogoContainer {
    display: flex;
    align-items: center;
    height: 100px;
}

    #orgLogoContainer #orgLogo {
        max-width: 100%;
        max-height: 72px;
        height: auto;
    }

#title {
    margin: 0 0 1.25rem;
    font-size: 24pt;
}


/* ==========================================================================
   4. APP CONTAINER (the box that holds the form)
   ========================================================================== */

#ceApp-container {
    padding: 100px;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

#leftColumn {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 30px;
    background-color: #fff;
    box-shadow: 0 0 10px 0 #777;
    max-width: 1140px;
}

/* Fields that share a row (First / Last name, City / State / Postal Code, ...)
   stay on one line even when a label wraps. The form column is narrow, so a
   long label such as "State or Province" can wrap to two lines; each field is
   aligned to the bottom of the row so it still lines up with its neighbours,
   and each label stays directly above its own field. */
.ce-formRows.ce-hasMultipleFormFields:has(> .ce-dynamicLabelContainers) {
    align-items: flex-end;
}

/* ==========================================================================
   5. FOOTER
   ========================================================================== */

#footerLogoContainer {
    margin-top: 15px;
}

#footerSocialContainer ul {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 200px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

    #footerSocialContainer ul a {
        font-size: 30px;
    }

#footerTwitter {
    display: flex;
}


/* ==========================================================================
   6. RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {

    #layoutContainer {
        gap: 20px;
    }

    #ceApp-container {
        padding: 0;
    }
}

@media (max-width: 780px) {

    /* Stacked order: title + header content, then the form, then the footer
       content. The content column and its box are dissolved (display: contents)
       so their children can be ordered around the form. */
    #layoutContainer {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    #rightColumn,
    #rightContentBox {
        display: contents;
    }

    #title {
        order: 1;
    }

    #headerContent,
    #dd-container {
        order: 2;
    }

    #leftColumn {
        order: 3;
    }

    #footerContent {
        order: 4;
    }

    /* The box around the content no longer exists, so each piece is its own card */
    #title,
    #headerContent,
    #footerContent {
        padding: 10px;
        background-color: white;
        box-shadow: 0 0 10px 0 #777;
    }

        #title:empty,
        #headerContent:empty,
        #footerContent:empty {
            display: none;
        }

    /* Fit the screen: the form was 540px wide at any size (min-width plus padding) */
    #leftColumn {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        max-width: none;
    }
}

/* Mobile break */
@media (max-width: 500px) {

    #layoutContainer {
        max-width: 480px;
    }

    #leftColumn {
        width: 100%;
    }

    #appContainer {
        box-shadow: none;
    }

    /* Content pieces: no card, 15px in from the sides (as the old column padding did) */
    #title,
    #headerContent,
    #footerContent {
        margin-inline: 15px;
        padding: 0;
        box-shadow: none;
    }

        #title:not(:empty),
        #title:empty + #headerContent:not(:empty) {
            margin-top: 15px;
        }

        #footerContent:not(:empty) {
            margin-bottom: 15px;
        }

    #ceApp {
        width: 100%;
        padding: 0;
    }
}
