/*
 * GPLG global footer layout v0.9
 * Purpose: keep Blocksy footer content aligned with the GPLG content grid
 * instead of stretching navigation/legal/contact groups to viewport edges.
 * No colours, content, links or footer background are changed.
 */

#footer.ct-footer [data-row] > .ct-container,
footer#footer [data-row] > .ct-container,
#footer [data-row] > .ct-container {
    width: min(100% - 64px, 1280px) !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Main footer row: three balanced functional areas */
#footer [data-row="middle"] [data-column-set],
#footer [data-row="top"] [data-column-set] {
    width: 100% !important;
    column-gap: 44px !important;
}

/* Give the contact column enough room while keeping it inside the grid. */
#footer [data-row] [data-column-set] > *:last-child {
    min-width: 0;
}

/* Reduce excessive vertical air without making the footer cramped. */
#footer [data-row="middle"] > .ct-container,
#footer [data-row="top"] > .ct-container {
    padding-top: 28px !important;
    padding-bottom: 28px !important;
}

/* Bottom/copyright row should use the same alignment. */
#footer [data-row="bottom"] > .ct-container {
    padding-top: 16px !important;
    padding-bottom: 16px !important;
}

/* Tablet */
@media (max-width: 1024px) {
    #footer.ct-footer [data-row] > .ct-container,
    footer#footer [data-row] > .ct-container,
    #footer [data-row] > .ct-container {
        width: min(100% - 48px, 1280px) !important;
    }

    #footer [data-row="middle"] [data-column-set],
    #footer [data-row="top"] [data-column-set] {
        column-gap: 28px !important;
    }
}

/* Mobile: preserve Blocksy stacking, only provide safe side padding. */
@media (max-width: 689px) {
    #footer.ct-footer [data-row] > .ct-container,
    footer#footer [data-row] > .ct-container,
    #footer [data-row] > .ct-container {
        width: calc(100% - 36px) !important;
    }

    #footer [data-row="middle"] > .ct-container,
    #footer [data-row="top"] > .ct-container {
        padding-top: 24px !important;
        padding-bottom: 24px !important;
    }
}
