/*------------------------------------*\
    
    WYSIWYG block — section shell, typography, and shared rich content.

    Section fill + Figma shape layers: global.css (e.g. .bg-white, .bg-blue, .bg-navy, .bg-blue-shapes, .bg-white-shapes, .bg-navy-shapes).
    Blue WYSIWYG sections (.wysiwyg.bg-blue / .wysiwyg.bg-blue-shapes): blockquote invert + facet tint. Navy: global `.bg-navy` / `.bg-navy-shapes` + typography overrides in trumps.css (after this file). Inner: .wysiwyg__wrapper > content.

    Block-only chrome (e.g. masthead) stays in blocks/*.css; WYSIWYG variants belong here.

\*------------------------------------*/

.top-content {
    margin-bottom: 20px;
}

.headlines :last-child {
    margin-bottom: 0;
}

.bottom-content {
    margin-top: 20px;
}

@media (min-width: 768px) {
    .top-content {
        margin-bottom: 32px;
    }

    .bottom-content {
        margin-top: 32px;
    }
}

@media (min-width: 1200px) {
    .top-content {
        margin-bottom: 52px;
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .headlines {
        max-width: 800px;
    }

}

@media (min-width: 1366px) {

    .headlines {
        max-width: 870px;
    }

}

/**
 * Four 19 / Figma — rich WYSIWYG (aligns with flex-page.html pattern)
 * Markup: mostly plain h2, p, ul, blockquote, table inside .wysiwyg__wrapper — lists use icon bullets via global.css `.wysiwyg__wrapper ul li`;
 * floated img.alignleft/alignright before ul wraps copy beside the image; stacked hero = ul then img without align classes (wysiwyg.css).
 * h2 .h2-accent, .blockquote-wrap (facet + quote icon via ::before / ::after), .table-wrap.
 * Mobile-first; use rem literals here — vertical section rhythm: global .section-margins / .section-padding.
 */
.wysiwyg {
    position: relative;
}

.wysiwyg__wrapper {
    width: 100%;
}

.wysiwyg__wrapper > .sub-heading {
    margin-bottom: 0.75rem;
}

.wysiwyg__wrapper > .sub-heading:last-child {
    margin-bottom: 0;
}

/* Headings + body copy (semantic tags, no per-element BEM) */
/**
 * Typography matches global.css heading scale (28px → 36px → 48px for h2)
 * so mobile/tablet are not forced to desktop sizes.
 */
.wysiwyg__wrapper .sub-heading {
    margin-top: 0;
    font-family: var(--secondary-font);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
    font-size: 1.125rem;
    margin-bottom: 0;
}

.wysiwyg__wrapper h2 {
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    font-weight: 700;
    line-height: 1.2;
    color: var(--heading-color);
    font-size: 1.75rem;
    font-family: var(--primary-font);
}

.wysiwyg__wrapper h2 .h2-accent {
    font-family: var(--secondary-font);
    font-size: 28px;
    color: var(--primary-color);
}

.wysiwyg__wrapper h3 {
    margin: 0 0 15px;
    font-size: 1.375rem;
    color: var(--heading-color);
}

.wysiwyg__wrapper h4 {
    color: var(--heading-color);
}

.wysiwyg__wrapper p {
    margin: 0 0 1.25rem 0;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-color);
}

.wysiwyg__wrapper blockquote > p:last-child {
    margin-bottom: 0;
}

.wysiwyg__wrapper > p:last-child {
    margin-bottom: 0;
}

.wysiwyg__wrapper p a:not(.btn) {
    color: var(--blue);
    font-weight: 700;
    text-decoration: underline;
}

/**
 * Stacked hero image after a list — centered crop when img is not alignleft/alignright.
 */
.wysiwyg__wrapper > ul + img:not(.alignleft):not(.alignright) {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 31.75rem;
    height: auto;
    border-radius: 0.625rem;
    min-height: 15rem;
    object-fit: cover;
}

/**
 * Blockquote: inner markup is only blockquote; right facet curve + gold marks from pseudo-elements.
 * --blockquote-facet-fill tints the masked SVG (matches former inline path fills).
 * Legacy __facet / __deco HTML from the editor is suppressed so layout stays single-column.
 */
.blockquote-wrap {
    clear: both;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
    margin: 20px 0
    ;
}

.blockquote-wrap {
    --blockquote-facet-fill: var(--light-blue);
}

.bg-blue .blockquote-wrap,
.bg-blue-shapes .blockquote-wrap {
    --blockquote-facet-fill: var(--primary-color);
}

.bg-blue .wysiwyg__wrapper .blockquote-wrap,
.bg-blue-shapes .wysiwyg__wrapper .blockquote-wrap {
    --blockquote-facet-fill: var(--primary-color);
}

.blockquote-wrap__facet,
.blockquote-wrap__deco {
    display: none !important;
}

/* Curve column (tablet+); mask = viewBox 123×138 path, stretched with quote height */
.blockquote-wrap::before {
    content: "";
    display: none;
}

/* Gold quote mark: graphic from global.css (shared with i.icon-block-quote); hidden on mobile */
.blockquote-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 3.8125rem;
    height: 3.8125rem;
    pointer-events: none;
    display: none;
    transform: none;
}

.blockquote-wrap blockquote {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 20px 30px;
    background: var(--light-blue);
    color: var(--text-color);
    border-radius: 0.625rem;
    font-family: var(--primary-font);
    font-weight: 500;
    font-size: 0.9375rem;
    line-height: 1.5;

    h2,
    h3,
    h4,
    h5,
    h6 {
        color: inherit;
    }
}

.blockquote-wrap blockquote strong {
    font-weight: 700;
}

/* Table: Figma White WYSIWYG — table-wrap > toolbar (search row) + table-scroll > table-structure > table */
.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Search row: primary #28448D, 62px min-height, 5px top radii, controls right-aligned (8133:1025) */
.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0;
    min-height: 3.875rem;
    box-sizing: border-box;
    padding: 0.8125rem 0.6875rem;
    background: var(--primary-color);
    border-radius: 0.3125rem 0.3125rem 0 0;
}

.wysiwyg__wrapper .table-toolbar input[type="search"] {
    margin: 0;
    box-sizing: border-box;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0.5625rem 0.8125rem;
    border: 0.0625rem solid var(--text-color);
    border-right: 0;
    border-radius: 0.25rem 0 0 0.25rem;
    font-family: Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.3;
    color: var(--black);
    background: var(--white);
    width: 9.6875rem;
    vertical-align: middle;
    appearance: none;
}

.wysiwyg__wrapper .table-toolbar input[type="search"]::placeholder {
    color: var(--black);
    opacity: 0.6;
}

.wysiwyg__wrapper .table-toolbar button {
    display: flex;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0.0625rem solid var(--text-color);
    border-left: 0;
    background: var(--white);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    width: 2.511875rem;
    min-width: 2.511875rem;
    min-height: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
}

.wysiwyg__wrapper .table-toolbar button + button {
    border-left: 0.0625rem solid var(--text-color);
    width: 2.125rem;
    min-width: 2.125rem;
}

.wysiwyg__wrapper .table-toolbar .icon-search,
.wysiwyg__wrapper .table-toolbar .icon-dropdown {
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-color);
}

.wysiwyg__wrapper .table-scroll {
    position: relative;
    border-radius: 0 0 0.3125rem 0.3125rem;
    overflow: hidden;
}

.wysiwyg__wrapper .table-structure {
    min-width: 100%;
    border-radius: 0 0 0.3125rem 0.3125rem;
    overflow: hidden;
    background: var(--white);
}

.wysiwyg__wrapper .table-structure table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: auto;
}

/* Header row: brand secondary blue — scales with global body rhythm */
.wysiwyg__wrapper .table-structure thead th {
    background: var(--blue);
    color: var(--white);
    font-family: var(--primary-font);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: 0;
    text-align: left;
    padding: 0.5rem 0.6875rem;
    border: 0;
    vertical-align: middle;
}

@media (min-width: 768px) {

    .wysiwyg__wrapper .table-structure thead th {
        font-size: 1.25rem;
    }
}

@media (min-width: 1200px) {

    .wysiwyg__wrapper .table-structure thead th {
        font-size: 1.5rem;
    }
}

/* Body: 18px medium, #000 (8133:1027+); odd white / even #D7ECF9 */
.wysiwyg__wrapper .table-structure tbody tr:nth-child(odd) {
    background: var(--white);
}

.wysiwyg__wrapper .table-structure tbody tr:nth-child(even) {
    background: var(--light-blue);
}

.wysiwyg__wrapper .table-structure tbody td {
    font-family: var(--primary-font);
    font-weight: 500;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--black);
    padding: 0.5rem 0.6875rem;
    border: 0;
    vertical-align: middle;

    & a {
        font-weight: 400;
        text-decoration: none;
    }
}

@media (min-width: 768px) {

    .wysiwyg__wrapper .table-structure tbody td {
        font-size: 1rem;
    }
}

@media (min-width: 1200px) {

    .wysiwyg__wrapper .table-structure tbody td {
        font-size: 1.125rem;
    }
}

/* Global .btn variants; .wysiwyg-tertiary = inline link + icon (no .btn). */

.wysiwyg__wrapper .wysiwyg-tertiary {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-family: var(--primary-font);
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1;
    color: var(--text-color);
    text-decoration: none;
    padding: 1rem 0;
    border: none;
    background: none;
    border-radius: 0.5rem;
}

.wysiwyg__wrapper .wysiwyg-tertiary .icon-right-cta-arrow {
    font-size: 1.625rem;
    line-height: 1;
}

@media (min-width: 768px) {
    .wysiwyg__wrapper .sub-heading {
        font-size: 1.125rem;
    }

    .wysiwyg__wrapper h2 {
        font-size: 2.25rem;
    }

    .wysiwyg__wrapper h2 .h2-accent {
        font-size: 2.25rem;
    }

    .wysiwyg__wrapper h3 {
        font-size: 1.75rem;
    }

    .wysiwyg__wrapper h4 {
        font-size: 1.5rem;
    }

    .wysiwyg__wrapper p,
    .wysiwyg__wrapper ul li,
    .blockquote-wrap ul li {
        font-size: 1rem;
    }

    .wysiwyg__wrapper > ul + img:not(.alignleft):not(.alignright) {
        min-height: 22rem;
    }

    .blockquote-wrap {
        flex-direction: row;
        align-items: stretch;
        padding-right: 1.25rem;
    }

    .blockquote-wrap::before {
        display: block;
        flex: 0 0 7.6875rem;
        width: 7.6875rem;
        height: 7.6875rem;
        min-width: 0;
        align-self: stretch;
        order: 2;
        margin: 0 calc(-1 * 1.25rem) 0 0;
        background-color: var(--blockquote-facet-fill);
        line-height: 0;
        /* Same path as legacy inline SVG; white fill = mask alpha */
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 123 138' preserveAspectRatio='none'%3E%3Cpath fill='white' d='M44 35.8262C44.0001 57.4613 61.5387 74.9999 83.1738 75H113C118.523 75 123 79.4771 123 85V128C123 133.523 118.523 138 113 138H10C4.47715 138 0 133.523 0 128V10C0 4.47715 4.47715 0 10 0H34C39.5228 0 44 4.47715 44 10V35.8262Z'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 123 138' preserveAspectRatio='none'%3E%3Cpath fill='white' d='M44 35.8262C44.0001 57.4613 61.5387 74.9999 83.1738 75H113C118.523 75 123 79.4771 123 85V128C123 133.523 118.523 138 113 138H10C4.47715 138 0 133.523 0 128V10C0 4.47715 4.47715 0 10 0H34C39.5228 0 44 4.47715 44 10V35.8262Z'/%3E%3C/svg%3E");
        -webkit-mask-size: 100% 100%;
        mask-size: 100% 100%;
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-position: center;
        mask-position: center;
    }

    .blockquote-wrap blockquote {
        flex: 1 1 auto;
        min-width: 0;
        border-radius: 0.625rem 0 0 0.625rem;
        padding: 1.5625rem 0 1.5625rem 1.5625rem;
        margin: 0 calc(-1 * 1.25rem) 0 0;
        order: 1;
        font-size: 1rem;
        position: relative;

        &:before {
            content: "";
            position: absolute;
            bottom: 0;
            right: -103px;
            width: 100%;
            height: calc(100% - 7.2875rem);
            background-color: var(--blockquote-facet-fill);
            z-index: -1;
            border-bottom-right-radius: 0.625rem;
            overflow: hidden;
        }
    }

    .bg-blue .blockquote-wrap blockquote::before,
    .bg-blue-shapes .blockquote-wrap blockquote::before {
        background-color: var(--primary-color);
    }

    .blockquote-wrap::after {
        display: block;
        right: 1.25rem;
        /* Nudge gold mark over facet top-right; tune if Figma shifts */
        transform: translate(18%, 0);
    }

    .wysiwyg__wrapper .btn-group {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 2rem;
    }
}

@media (min-width: 1200px) {
    .wysiwyg__wrapper .sub-heading {
        font-size: 1.875rem;
    }

    .wysiwyg__wrapper h2 {
        font-size: 3rem;
    }

    .wysiwyg__wrapper h2 .h2-accent {
        font-size: 3rem;
    }

    .wysiwyg__wrapper h3 {
        font-size: 2.25rem;
    }

    .wysiwyg__wrapper h4 {
        font-size: 2rem;
    }

    .wysiwyg__wrapper p,
    .wysiwyg__wrapper ul li,
    .blockquote-wrap ul li {
        font-size: 1.125rem;
    }

    .wysiwyg__wrapper .blockquote-wrap blockquote {
        font-size: 1.125rem;
    }

    .wysiwyg__wrapper > ul + img:not(.alignleft):not(.alignright) {
        min-height: 27rem;
    }

    .wysiwyg__wrapper p a:hover:not(.btn),
    .wysiwyg__wrapper p a:focus:not(.btn) {
        color: var(--primary-color);
    }

    .wysiwyg__wrapper .wysiwyg-tertiary:hover,
    .wysiwyg__wrapper .wysiwyg-tertiary:focus {
        color: var(--primary-color);
    }

    .wysiwyg__wrapper .wysiwyg-tertiary:hover .icon-right-cta-arrow,
    .wysiwyg__wrapper .wysiwyg-tertiary:focus .icon-right-cta-arrow {
        color: var(--primary-color);
    }
}

/* Invert blockquote on blue: primary panel + matching facet tint (section .bg-blue or .bg-blue-shapes). */
.bg-blue .blockquote-wrap blockquote,
.bg-blue-shapes .blockquote-wrap blockquote {
    background: var(--primary-color);
    color: var(--white);

    li {
        color: inherit;

        &:before {
            background-color: var(--btn-text);
        }

        &:after {
            color: var(--btn-primary-bg);
        }
    }
}

.bg-blue .blockquote-wrap blockquote strong,
.bg-blue-shapes .blockquote-wrap blockquote strong {
    color: var(--white);
}

.bg-blue .blockquote-wrap blockquote p,
.bg-blue-shapes .blockquote-wrap blockquote p {
    color: var(--white);

    a {
        color: inherit;
    }
}


.wysiwyg {
    .input-group-btn .btn {
        &:before,
        &:after {
            display: none;
        }
    }

    .semantic_ui .ui.table thead th {
        background: var(--blue);
        color: var(--white);
        border: 0;
    }

    .semantic_ui .ui.table tr:first-child td,
    .semantic_ui .ui.table tr td,
    .semantic_ui .ui.table {
        border: 0;
    }

    .semantic_ui .ui.table thead tr.footable-filtering th {
        background: var(--primary-color);
    }

    table.footable > thead > tr.footable-filtering > th div.input-group {
        background-color: var(--white);
        border-radius: 6px;
        overflow: hidden;
    }

    .footable .btn-default {
        border: 0;
    }

    .foo-table.footable.table > thead > tr > th {
        padding: 13px;
    }

    .foo-table .form-group.footable-filtering-search .input-group-btn > button {
        background: var(--btn-secondary-bg);
        color: var(--text-color);
        border: 0;
        font-weight: bold;
        font-size: 15px;
    }

    .footable_parent .fooicon-search:before {
        content: "\e91d";
        font-family: 'four-19-properties-icons' !important;
    }
}