﻿/* ==========================================================================
   PAGE TEMPLATE: Split story card (Tab Logo) - Left Form
   File:        /_templates/_pages/split_story_card_tab_logo/page.css
   Load order:  LAST (after webforms.core.css and theme.css)
   Purpose:     Page structure only: container widths, logo tab, two-column
                layout, the white form card, title and social-sharing spacing.
                The look of the form itself lives in the theme.
   Variables (defined inline on :root by CharityEngine):
       --app-theme-button-color          (top border of the form card)
       --app-theme-top-banner-height     (pushes the right column below the banner)
   Also set in page.html's inline <style> block, not in this file:
       #pageContainer (grid), #topBanner (height + color) and
       #ceApp-container (grid-area + z-index). Together they lay the form
       container over the banner.

   CONTENTS
     1. Base
     2. App container
     3. Logo tab
     4. Two-column layout & form card
     5. Title
     6. Social sharing
     7. Responsive
   ========================================================================== */


/* ==========================================================================
   1. BASE
   (The page font is set in the theme.)
   ========================================================================== */

body {
    margin: 0;
}


/* ==========================================================================
   2. APP CONTAINER
   Its max-width steps up at each breakpoint (see Responsive).
   ========================================================================== */

#ceApp-container {
    width: 100%;
    margin-inline: auto;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}


/* ==========================================================================
   3. LOGO TAB (white tab above the form card)
   ========================================================================== */

#logoContainer {
    display: block;
    width: fit-content;
    min-width: 50%;
    margin-top: 40px;
    margin-inline: auto;
    padding: 5px 10px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    background: white;
    text-align: center;
}

#orgLogo {
    max-width: 250px;
    max-height: 110px;
    vertical-align: middle;
}


/* ==========================================================================
   4. TWO-COLUMN LAYOUT & FORM CARD
   >= 992px:  side by side. Left: logo tab + form card. Right: title, header
              and footer content, pushed down below the banner.
   < 992px:   one column below a shorter banner, in this order (see Responsive):
              title -> header content -> logo tab + form card -> footer content
   ========================================================================== */

#layoutContainer {
    display: flex;
    flex-wrap: wrap;
    box-sizing: border-box;
}

#leftColumn {
    box-sizing: border-box;
    padding-inline: .75rem;
    color: black;
}

#rightColumn {
    box-sizing: border-box;
    padding: 3rem;
    color: var(--app-theme-font-primary-color);
}

/* White card that holds the form */
#leftFormBox {
    margin-inline: auto;
    padding: 48px;
    border-top: 5px solid var(--app-theme-button-color);
    background-color: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, .35);
}


/* ==========================================================================
   5. TITLE
   ========================================================================== */

#title {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 40px;
    font-weight: 600;
}

/*#headerContent {
    color: var(--app-theme-font-primary-color);
}

#footerContent {
    color: var(--app-theme-font-primary-color);
}*/

/* ==========================================================================
   6. SOCIAL SHARING
   Base rules are in webforms.core.css; this only adds space above.
   ========================================================================== */
#ceSocialSharingWidgetContainer {
    margin-top: 50px;
}


/* ==========================================================================
   7. RESPONSIVE (mobile first)
   ========================================================================== */

@media (min-width: 576px) {
    #ceApp-container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    #ceApp-container {
        max-width: 720px;
    }
}

/* Desktop: wider container, form card (58%) beside content column (42%) */
@media (min-width: 992px) {
    #ceApp-container {
        max-width: 960px;
    }

    #leftColumn {
        width: 58.33333333%;
    }

    #rightColumn {
        width: 41.66666667%;
        margin-top: var(--app-theme-top-banner-height);
    }
}

/* Stacked (below 992px): everything starts BELOW the banner, in this order:
   title -> header content -> logo tab + form card -> footer content.
   The banner is shorter (it is only a header strip here) and the layout is
   pushed down by the same amount, so no content shows over the banner. The
   logo tab stays attached to the card.
   Dissolving the right column and its content box (display: contents) makes
   the title, header and footer content direct flex items of #layoutContainer,
   so `order` can place them around the card. Rules are scoped to
   #rightColumn so they stop applying if the page script moves the content
   box into the form (success page). */
@media (max-width: 991.98px) {

    /* Shorter banner (desktop keeps the 350px set in page.html). Setting it
       here changes the banner height and the offset below together. */
    #pageContainer {
        --app-theme-top-banner-height: clamp(120px, 35vw, 220px);
    }

    #layoutContainer {
        flex-direction: column;
        padding-top: calc(var(--app-theme-top-banner-height) + 1rem);
    }

    /* !important: the page script sets an inline display on #layoutContentBox */
    #rightColumn,
    #rightColumn #layoutContentBox {
        display: contents !important;
    }

        /* Line the text up with the card edge */
        #rightColumn #title,
        #rightColumn #headerContent,
        #rightColumn #footerContent {
            padding-inline: .75rem;
        }

        #rightColumn #title {
            order: 1;
        }

        #rightColumn #headerContent {
            order: 2;
        }

    /* The card unit (logo tab + form card) */
    #leftColumn {
        order: 3;
        margin-bottom: 1.5rem;
    }

    /* Below the card (the Double the Donation container comes before the
       footer in the markup, so it stays just above it) */
    #rightColumn #dd-container,
    #rightColumn #footerContent {
        order: 4;
    }

    /* An empty title takes no space */
    #rightColumn #title:empty {
        display: none;
    }

    /* The tab is on the page background here (not over the banner), so give
       it a thin outline in the card's top-border color. The card's top
       border is the tab's bottom edge. */
    #logoContainer {
        border: 1px solid var(--app-theme-button-color);
        border-bottom: none;
    }
}

@media (min-width: 1200px) {
    #ceApp-container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    #ceApp-container {
        max-width: 1320px;
    }
}
