/**
 * Shared landing-page content roles. No html/body typography rules: the header,
 * homepage hero, footer, and transaction screens retain their existing styles.
 */
#top.jpa-refined-page #main {
    --jpa-copy-size: 1rem;
    --jpa-copy-leading: 1.6;
    --jpa-eyebrow-size: 1.25rem;
    --jpa-section-size: 1.75rem;
    --jpa-title-size: clamp(2rem, 1.6rem + 1.5vw, 2.5rem);
    --jpa-content-font: lato, Helvetica, Arial, sans-serif;
    --jpa-card-padding: clamp(1rem, 2.2vw, 1.5rem);
    --jpa-card-gap: 1rem;
    --jpa-content-accent: #d28c2a;
}

/* Builder wrappers also contain unwrapped prose on the older content pages. */
#top.jpa-refined-page #main :where(.entry-content-wrapper):not(:where(#footer-page *, .jpa-home-hero *)) .avia_textblock,
#top.jpa-refined-page #main :where(.entry-content-wrapper):not(:where(#footer-page *, .jpa-home-hero *)) :is(p, li, blockquote) {
    font-family: var(--jpa-content-font);
    font-size: var(--jpa-copy-size);
    line-height: var(--jpa-copy-leading);
}

#top.jpa-refined-page #main :where(.entry-content-wrapper):not(:where(#footer-page *, .jpa-home-hero *)) :is(h1, h2, h3) {
    font-family: var(--jpa-content-font);
    line-height: 1.25;
    overflow-wrap: break-word;
}
#top.jpa-refined-page #main :where(.entry-content-wrapper):not(:where(#footer-page *, .jpa-home-hero *)) h1 {
    font-size: var(--jpa-title-size);
}
#top.jpa-refined-page #main :where(.entry-content-wrapper):not(:where(#footer-page *, .jpa-home-hero *)) h2 {
    font-size: var(--jpa-section-size);
}
/* custom1.css has an important h3 rule; match it only in the content region. */
#top.jpa-refined-page #main :where(.entry-content-wrapper):not(:where(#footer-page *, .jpa-home-hero *)) h3 {
    font-size: 1.375rem !important;
}

/* Orange labels are a single role even when Enfold wraps them in paragraphs. */
#top.jpa-refined-page #main :is(
    .jpa-card-eyebrow, .jpa-dashboard-kicker, .jpa-semester-empty-kicker,
    .jpa-training-eyebrow, .jpa-program-card__eyebrow, .jpa-program-toc__eyebrow,
    .jpa-links-kicker, .jpa-links-card-kicker
),
#top.jpa-refined-page #main :is(
    .jpa-card-eyebrow, .jpa-dashboard-kicker, .jpa-semester-empty-kicker,
    .jpa-training-eyebrow, .jpa-program-card__eyebrow,
    .jpa-links-kicker, .jpa-links-card-kicker
) p {
    margin: 0;
    color: var(--jpa-content-accent);
    font-family: var(--jpa-content-font);
    font-size: var(--jpa-eyebrow-size);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: .035em;
}

/* Preserve small artwork credits and event metadata as distinct content roles. */
#top.jpa-refined-page #main :is(.jpa-training-artwork figcaption, .jpa-about-artwork figcaption, .jpa-links-artwork-caption, .jpa-links-artwork-caption p) {
    font-size: .875rem;
    line-height: 1.5;
}

/* Replace table columns and absolutely positioned CTAs with content-sized grids. */
#top.jpa-refined-page #main .flex_column_table:has(> :is(.jpa-home-path-card, .jpa-dashboard-card, .jpa-links-card)) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: var(--jpa-card-gap);
    width: 100%;
    table-layout: auto;
}
#top.jpa-refined-page #main .flex_column_table:has(> .jpa-links-card) {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}
#top.jpa-refined-page #main .flex_column_table:has(> :is(.jpa-home-path-card, .jpa-dashboard-card, .jpa-links-card)) > .av-flex-placeholder {
    display: none;
}
#top.jpa-refined-page #main :is(.jpa-home-path-card, .jpa-dashboard-card, .jpa-links-card, .jpa-care-card) {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: var(--jpa-card-padding) !important;
    text-align: left;
    overflow-wrap: break-word;
    gap: var(--jpa-card-gap);
}
#top.jpa-refined-page #main :is(.jpa-home-path-card, .jpa-dashboard-card, .jpa-links-card, .jpa-care-card) :is(.av-special-heading, .avia_textblock, .avia-image-container, h2, p) {
    margin: 0;
}
#top.jpa-refined-page #main :is(.jpa-home-path-card, .jpa-dashboard-card, .jpa-links-card) > :is(.jpa-ia-button, .jpa-links-button) {
    position: static;
    margin: auto 0 0;
    align-self: start;
    width: 100%;
}
#top.jpa-refined-page #main :is(.jpa-home-path-card, .jpa-dashboard-card, .jpa-links-card) a.avia-button,
#top.jpa-refined-page #main :is(.jpa-care-card .jpa-ia-button, .jpa-training-button) {
    box-sizing: border-box;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    font-size: var(--jpa-copy-size);
    line-height: 1.35;
}

/* Shared, intrinsic rows align the panels without prescribed text heights. */
#top.jpa-refined-page #main .jpa-program-paths {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: var(--jpa-card-gap);
}
#top.jpa-refined-page #main .jpa-care-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
#top.jpa-refined-page #main .jpa-program-card {
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    padding: var(--jpa-card-padding);
    text-align: left;
    overflow-wrap: break-word;
    gap: var(--jpa-card-gap);
}
#top.jpa-refined-page #main .jpa-program-card > :is(p, h2) { margin: 0; }
#top.jpa-refined-page #main .jpa-program-card > p:has(> .jpa-training-button) {
    margin-top: auto;
}
#top.jpa-refined-page #main .jpa-program-card > p > br { display: none; }

@supports (grid-template-rows: subgrid) {
    @media (min-width: 768px) {
        #top.jpa-refined-page #main .jpa-program-card {
            display: grid;
            grid-row: span 4;
            grid-template-rows: subgrid;
            grid-template-columns: minmax(0, 1fr);
        }
        #top.jpa-refined-page #main .jpa-home-path-card {
            display: grid;
            grid-row: span 5;
            grid-template-rows: subgrid;
            grid-template-columns: minmax(0, 1fr);
        }
        #top.jpa-refined-page #main .jpa-home-path-card > .avia-image-container { grid-row: 1; }
        #top.jpa-refined-page #main .jpa-home-path-card > section:has(.jpa-card-eyebrow) { grid-row: 2; }
        #top.jpa-refined-page #main .jpa-home-path-card > .av-special-heading { grid-row: 3; }
        #top.jpa-refined-page #main .jpa-home-path-card > section:has(.jpa-home-path-card-copy) { grid-row: 4; }
        #top.jpa-refined-page #main .jpa-home-path-card > .avia-button-wrap { grid-row: 5; }
        #top.jpa-refined-page #main :is(.jpa-dashboard-card, .jpa-links-card, .jpa-care-card) {
            display: grid;
            grid-row: span 4;
            grid-template-rows: subgrid;
            grid-template-columns: minmax(0, 1fr);
        }
        #top.jpa-refined-page #main .jpa-care-card { grid-row: span 5; }
    }
}

#top.jpa-refined-page #main .jpa-about-artwork {
    max-width: 28rem;
    margin: 1.5rem auto 2rem;
}
#top.jpa-refined-page #main .jpa-about-artwork figure { margin: 0; }
#top.jpa-refined-page #main .jpa-about-artwork img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}
#top.jpa-refined-page #main .jpa-about-artwork figcaption {
    margin-top: .75rem;
    color: #666;
}

@media (max-width: 989px) {
    #top.jpa-refined-page #main .flex_column_table:has(> :is(.jpa-home-path-card, .jpa-dashboard-card)) {
        grid-template-columns: 1fr;
    }
    #top.jpa-refined-page #main :is(.jpa-home-path-card, .jpa-dashboard-card, .jpa-care-card) {
        display: flex;
        grid-row: auto;
    }
}
@media (max-width: 767px) {
    #top.jpa-refined-page #main .flex_column_table:has(> .jpa-links-card) { grid-template-columns: 1fr; }
    #top.jpa-refined-page #main :is(.jpa-home-path-card, .jpa-dashboard-card, .jpa-links-card, .jpa-program-card) {
        grid-row: auto;
        margin: 0 !important;
    }
}

/* Grid items must be allowed to wrap below their intrinsic word width at text zoom. */
#top.jpa-refined-page #main :is(.jpa-home-path-card, .jpa-dashboard-card, .jpa-links-card, .jpa-care-card, .jpa-program-card) > * {
    min-width: 0;
    max-width: 100%;
}
