/* ARC-GM site-specific compatibility patch v1.1.0.
 * Requires the existing CoreCMS grid.css; NO CubePlatform modifications.
 * Installed after cc_head(false), so plugin and builder CSS cannot override it.
 */

/* CoreCMS saves each resized column's inline percentage width. The former
 * flex: 1 1 calc(...) theme rules masked that value and forced equal widths.
 * Retain standard .cols-N CSS widths if none have been saved.
 * With a gap between flex items, 60% + 40% would exceed 100%; internal
 * section gutters already provide spacing, so keep the columns flush.
 */
.arcgm-main .arcgm-builder-zone .cc-builder-container .cc-builder-row {
    column-gap: 0;
    row-gap: var(--container-gap, 24px);
}
.arcgm-main .arcgm-builder-zone .cc-builder-container .cc-builder-row > .cc-builder-column {
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: auto;
    min-width: 0;
    max-width: 100%;
}

/* In the CMS editor, the same page content is wrapped in a KEditor container.
 * Only the editable website area is affected, not plugins' admin screens.
 */
body.is-auth .arcgm-main .arcgm-builder-zone .keditor-container .cc-builder-row > .cc-builder-column {
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: auto;
}

/* Native Foundation/CKEditor blockquotes, matching the current News design.
 * Selectors intentionally omit News article/quote grid content, allowing
 * the News plugin to retain its own styling when embedded.
 */
.arcgm-main .arcgm-builder-zone blockquote:not(.cc-news-article-content blockquote):not(.cc-news-quote-grid blockquote),
.cc-projects.cc-projects-single .cc-projects-article-content blockquote {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 46px 0;
    padding: 52px 38px 64px;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #c7e9ff;
    color: #111827;
    font-size: inherit;
    line-height: 1.55;
    font-style: italic;
    font-weight: 400;
    text-align: left;
    box-shadow: none;
}
.arcgm-main .arcgm-builder-zone blockquote:not(.cc-news-article-content blockquote):not(.cc-news-quote-grid blockquote)::before,
.cc-projects.cc-projects-single .cc-projects-article-content blockquote::before {
    content: "\201C";
    position: absolute;
    top: 10px;
    left: 30px;
    font-family: Georgia, serif;
    font-size: 4.4rem;
    line-height: 1;
    font-weight: 800;
    font-style: normal;
    color: #fc5d5d;
}
.arcgm-main .arcgm-builder-zone blockquote:not(.cc-news-article-content blockquote):not(.cc-news-quote-grid blockquote)::after,
.cc-projects.cc-projects-single .cc-projects-article-content blockquote::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 18px;
    background: transparent url("../img/svg/arcgm-quote-bottom.svg") no-repeat left bottom;
    background-size: 100% 100%;
}
.arcgm-main .arcgm-builder-zone blockquote:not(.cc-news-article-content blockquote) p,
.cc-projects.cc-projects-single .cc-projects-article-content blockquote p {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    font-style: inherit;
}
.arcgm-main .arcgm-builder-zone blockquote:not(.cc-news-article-content blockquote) p:last-child,
.cc-projects.cc-projects-single .cc-projects-article-content blockquote p:last-child { margin-bottom: 0; }
.arcgm-main .arcgm-builder-zone blockquote:not(.cc-news-article-content blockquote) strong,
.cc-projects.cc-projects-single .cc-projects-article-content blockquote strong {
    color: #1c285e;
}

/* A single Award Holder shortcode produces one card instead of an artificial
 * three-column grid with two blank spaces. Group layouts stay unchanged.
 */
.arc-awards.arc-awards--single .arc-awards__grid {
    grid-template-columns: minmax(0, min(100%, 420px));
}

/* Mobile needs full-width stacking regardless of desktop inline column widths.
 * Mirrors the existing CoreCMS grid.css responsive behaviour.
 */
@media (max-width: 639px) {
    .arcgm-main .arcgm-builder-zone .cc-builder-container .cc-builder-row > .cc-builder-column {
        flex: 0 0 100%;
        width: 100% !important;
        max-width: 100%;
    }
    .arcgm-main .arcgm-builder-zone blockquote:not(.cc-news-article-content blockquote):not(.cc-news-quote-grid blockquote),
    .cc-projects.cc-projects-single .cc-projects-article-content blockquote {
        padding: 48px 24px 54px;
        margin: 28px 0;
    }
    .arcgm-main .arcgm-builder-zone blockquote:not(.cc-news-article-content blockquote)::before,
    .cc-projects.cc-projects-single .cc-projects-article-content blockquote::before { left: 18px; }
}

/* ARC-GM dev v1.18.1: keep the research hero aligned with the centred
   page container, while letting the heading span its full content width.
   v1.18 accidentally removed the outer container's max-width, placing the
   heading at the left edge of the viewport. */
.arcgm-research-category .arcgm-inner-hero-content.container {
    width: 100%;
    max-width: var(--container-width, 1330px);
    margin-left: auto;
    margin-right: auto;
}
.arcgm-research-category .arcgm-inner-hero-copy {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}
.arcgm-research-category .arcgm-inner-hero h1 { max-width: 100%; }

/* Resources inner header: continue the coral strip behind its textured left
   section so screen-size/background scaling cannot leave a white gap. */
.arcgm-resources-page .arcgm-inner-grain {
    background-color: var(--coral, #fc5d5d);
    background-image: url('../img/svg/box-gradient.svg');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: min(824px, 62vw) 100%;
    width: 100%;
    min-width: 100%;
    max-width: none;
}
@media(max-width: 820px) {
    .arcgm-resources-page .arcgm-inner-grain { background-size: 72vw 100%; }
}
@media(max-width: 560px) {
    .arcgm-resources-page .arcgm-inner-grain { background-size: 82vw 100%; }
}
