/*
 * Cambria child theme: Research filter + single-post templates (Extima round 2, 2026-09-25).
 * Enqueued from functions.php after style.css (handle cambria-research-posts, filemtime version).
 * Formatting only where the markup comes from PHP (the [resource_filter] shortcode) or from post content
 * (the imported articles). Colours, fonts and sizes on the Elementor templates themselves are widget
 * controls on the kit globals, not rules here.
 */

/* ==========================================================================
   1. Research filter ([resource_filter], page 38)
   Values from the certified HTML (mockups/research.html + css/styles.css §13).
   ========================================================================== */

/* ---- Tabs: All · White Papers · Articles · Books · Webinars (D11, A18, A19) ---- */
.rf-wrapper .rf-cats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

.rf-wrapper .rf-cat {
    appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-family: 'Manrope', sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: normal;
    text-transform: none;
    color: #022A53;
    cursor: pointer;
    transition: color 180ms ease;
}

.rf-wrapper .rf-cat:hover,
.rf-wrapper .rf-cat:focus {
    background: none;
    color: #3F9AE0;
}

.rf-wrapper .rf-cat--active,
.rf-wrapper .rf-cat--active:hover,
.rf-wrapper .rf-cat--active:focus {
    color: #022A53;
}

/* the separator used to be an ::after on every tab but the last, which strands a "|" at the end of a
   wrapped row (A18). It is now drawn by the tab that FOLLOWS it, and dropped on phones. */
.rf-wrapper .rf-cat::after {
    content: none;
}

.rf-wrapper .rf-cat + .rf-cat::before {
    content: "|";
    display: inline-block;
    padding: 0 20px 6px;
    color: #022A53;
}

.rf-wrapper .rf-cat__label {
    display: inline-block;
    padding-bottom: 6px;
    border-bottom: 1.5px solid transparent;
    transition: border-color 180ms ease;
}

.rf-wrapper .rf-cat--active .rf-cat__label {
    border-bottom-color: #022A53;
}

/* ---- Keyboard focus (2px solid Bright Blue, 2px offset; matches the site ring in D27) ---- */
.rf-wrapper button:focus-visible,
.rf-wrapper a:focus-visible,
.rf-wrapper [role="option"]:focus-visible {
    outline: 2px solid #3F9AE0;
    outline-offset: 2px;
}

.rf-wrapper .rf-results:focus {
    outline: none;
}

/* ---- Search + topic filter (icons 24px, Etai 09-25; D28 labels) ---- */
.rf-wrapper .rf-controls {
    margin-bottom: 0;
}

.rf-wrapper .rf-search {
    justify-content: flex-start;
    gap: 16px;
    padding: 16px 24px;
    border-radius: 16px;
}

.rf-wrapper .rf-search:focus-within {
    outline: 2px solid #3F9AE0;
    outline-offset: 2px;
}

.rf-wrapper .rf-search__icon,
.rf-wrapper .rf-tagselect__icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin: 0;
}

.rf-wrapper .rf-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    line-height: 1.3;
    color: #022A53;
}

.rf-wrapper .rf-search input:focus {
    outline: none;
}

.rf-wrapper .rf-search input::placeholder {
    color: #58585A;
    opacity: 1;
}

.rf-wrapper .rf-tagselect__toggle,
.rf-wrapper .rf-tagselect__toggle:hover,
.rf-wrapper .rf-tagselect__toggle:focus {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    height: 64px;
    margin: 0;
    padding: 16px 24px;
    border: 0;
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: none;
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.3;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    color: #022A53;
    cursor: pointer;
}

.rf-wrapper .rf-tagselect__toggle span {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 18px;
}

.rf-wrapper .rf-tagselect__toggle[aria-expanded="true"] .rf-tagselect__arrow {
    transform: rotate(180deg);
}

.rf-wrapper .rf-tagselect__arrow {
    transition: transform 180ms ease;
}

.rf-wrapper .rf-tagselect__dropdown {
    margin: 0;
    padding: 8px 0;
    list-style: none;
}

.rf-wrapper .rf-tag-option {
    margin: 0;
    font-size: 18px;
}

.rf-wrapper .rf-tag-option[aria-selected="true"] {
    font-weight: 600;
}

.rf-wrapper .rf-tag-option:focus {
    background: #F2F6FA;
    outline: none;
}

.rf-wrapper .rf-tag-option:focus-visible {
    outline: 2px solid #3F9AE0;
    outline-offset: -2px;
}

/* ---- The 1px rule under the filter row (D12) ---- */
.rf-wrapper .rf-rule {
    height: 0;
    margin: 40px 0 0;
    border: 0;
    border-top: 1px solid rgba(10, 22, 40, 0.2);
    background: none;
}

/* ---- Grid ---- */
.rf-wrapper .rf-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 56px;
    margin-top: 64px;
    align-items: stretch;
}

.rf-wrapper .rf-results {
    transition: opacity 180ms ease;
}

/* ---- Cards ---- */
.rf-wrapper .rf-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    height: 100%;
    margin: 0;
}

/* fixed 300×391 cover boxes, object-fit cover (D12 / A10) */
.rf-wrapper .rf-card__thumb {
    display: block;
    width: 300px;
    max-width: 100%;
    height: auto;
    max-height: none;
    margin: 0 0 32px;
    line-height: 0;
}

.rf-wrapper .rf-card__thumb .rf-card__img {
    display: block;
    width: 300px;
    max-width: 100%;
    height: 391px;
    object-fit: cover;
    object-position: top center;
    border-radius: 0;
    background: #FFFFFF;
}

.rf-wrapper .rf-card__title {
    margin: 0;
    font-family: 'Fustat', sans-serif;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #022A53;
}

.rf-wrapper .rf-card__title a {
    color: inherit;
    text-decoration: none;
}

.rf-wrapper .rf-card__title a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
}

.rf-wrapper .rf-card__cta {
    margin-top: auto;
    padding-top: 24px;
}

.rf-wrapper .rf-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 12px 28px;
    border: 1px solid #022A53;
    border-radius: 12px;
    background: transparent;
    font-family: 'Fustat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #022A53;
    text-decoration: none;
    transition: background-color 180ms ease, color 180ms ease;
}

.rf-wrapper .rf-card__btn:hover,
.rf-wrapper .rf-card__btn:focus-visible {
    background: #022A53;
    color: #FFFFFF;
}

/* ---- Books (D13): 231×360 covers, 32px titles, arrow on the button only ---- */
.rf-wrapper .rf-card--books .rf-card__thumb {
    width: 231px;
    margin-bottom: 28px;
}

.rf-wrapper .rf-card--books .rf-card__thumb .rf-card__img {
    width: 231px;
    height: 360px;
    object-position: center;
}

.rf-wrapper .rf-card--books .rf-card__title {
    max-width: 350px;
    font-size: 32px;
}

.rf-wrapper .rf-card--books .rf-card__title a,
.rf-wrapper .rf-card--books .rf-card__thumb {
    display: block;
}

.rf-wrapper .rf-card--books .rf-card__title a::after,
.rf-wrapper .rf-card--books .rf-card__thumb::after {
    content: none;
    display: none;
}

.rf-wrapper .rf-card--books .rf-card__excerpt {
    margin: 12px 0 0;
    font-size: 18px;
    line-height: 1.3;
    color: rgba(10, 22, 40, 0.8);
}

.rf-wrapper .rf-card--books .rf-card__cta {
    padding-top: 32px;
}

.rf-wrapper .rf-card--books .rf-card__btn::after {
    filter: none;
}

.rf-wrapper .rf-card--books .rf-card__btn:hover::after,
.rf-wrapper .rf-card--books .rf-card__btn:focus-visible::after {
    filter: brightness(0) invert(1);
}

.rf-wrapper .rf-grid--books {
    row-gap: 64px;
}

/* ---- Pagination (buttons, D11) ---- */
.rf-wrapper .rf-pagination {
    gap: 20px;
    margin-top: 56px;
}

.rf-wrapper .rf-page-num,
.rf-wrapper .rf-page-arrow,
.rf-wrapper .rf-page-num:focus,
.rf-wrapper .rf-page-arrow:focus {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 40px;
    margin: 0;
    padding: 0 4px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-family: 'Manrope', sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.2;
    color: #022A53;
    cursor: pointer;
}

.rf-wrapper .rf-page-num:hover,
.rf-wrapper .rf-page-arrow:hover,
.rf-wrapper .rf-page-num[aria-current="page"] {
    background: none;
    color: #3F9AE0;
}

.rf-wrapper .rf-page-arrow svg {
    width: 10px;
    height: 16px;
}

.rf-wrapper .rf-page-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.rf-wrapper .rf-page-dots {
    font-size: 24px;
    color: #022A53;
}

/* ---- Empty states (D28) ---- */
.rf-wrapper .rf-empty {
    margin-top: 64px;
    padding: 24px 0 40px;
}

.rf-wrapper .rf-empty__title {
    margin: 0;
    font-family: 'Fustat', sans-serif;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #022A53;
}

.rf-wrapper .rf-empty__text {
    margin: 8px 0 0;
    font-size: 18px;
    line-height: 1.3;
    color: #58585A;
}

.rf-wrapper .rf-empty__reset,
.rf-wrapper .rf-empty__reset:focus {
    appearance: none;
    margin: 24px 0 0;
    padding: 12px 28px;
    border: 1px solid #022A53;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    font-family: 'Fustat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #022A53;
    cursor: pointer;
}

.rf-wrapper .rf-empty__reset:hover {
    background: #022A53;
    color: #FFFFFF;
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .rf-wrapper .rf-grid {
        gap: 56px 40px;
    }

    .rf-wrapper .rf-card__thumb,
    .rf-wrapper .rf-card--books .rf-card__thumb {
        width: 100%;
    }

    .rf-wrapper .rf-card__thumb .rf-card__img {
        width: 100%;
        height: auto;
        aspect-ratio: 300 / 391;
    }

    .rf-wrapper .rf-card--books .rf-card__thumb .rf-card__img {
        width: 100%;
        height: auto;
        aspect-ratio: 231 / 360;
    }
}

@media (max-width: 1024px) {
    .rf-wrapper .rf-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 56px;
    }

    .rf-wrapper .rf-card--books .rf-card__title {
        font-size: 28px;
    }
}

@media (max-width: 767px) {
    .rf-wrapper .rf-cats {
        gap: 12px 24px;
    }

    .rf-wrapper .rf-cat + .rf-cat::before {
        content: none;
    }

    .rf-wrapper .rf-cat {
        font-size: 18px;
    }

    .rf-wrapper .rf-search input,
    .rf-wrapper .rf-tagselect__toggle,
    .rf-wrapper .rf-tagselect__toggle span {
        font-size: 16px;
    }

    .rf-wrapper .rf-rule {
        margin-top: 32px;
    }

    .rf-wrapper .rf-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 48px;
        margin-top: 40px;
    }

    .rf-wrapper .rf-card__thumb,
    .rf-wrapper .rf-card--books .rf-card__thumb {
        max-width: 320px;
    }

    .rf-wrapper .rf-card__title {
        font-size: 22px;
    }

    .rf-wrapper .rf-card--books .rf-card__title {
        font-size: 26px;
    }

    .rf-wrapper .rf-card--books .rf-card__excerpt {
        font-size: 16px;
    }

    .rf-wrapper .rf-pagination {
        margin-top: 40px;
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rf-wrapper .rf-cat,
    .rf-wrapper .rf-cat__label,
    .rf-wrapper .rf-card__btn,
    .rf-wrapper .rf-tagselect__arrow,
    .rf-wrapper .rf-results {
        transition: none;
    }
}


/* ==========================================================================
   2. Single-post templates: Article (985) + White Paper / Book / Free Books / Podcast
   Head + body containers, widgets and their colours/type are Elementor controls on the kit
   globals. These rules format what has no control: the imported article HTML inside the
   Post Content widget (E13 + Etai 09-25: 960 grid, more air around images, images held to
   the column), the Post Navigation stack on phones, and headline wrapping.
   ========================================================================== */

.cmb-post-head .cmb-post-title .elementor-heading-title {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.cmb-post-head .cmb-post-eyebrow .elementor-heading-title,
.cmb-post-head .cmb-post-meta {
    margin: 0;
}

.cmb-post-head .cmb-post-sub p:last-child {
    margin-bottom: 0;
}

/* ---- Article body (imported 2018-era HTML) ---- */
body .cmb-article p {
    margin: 0 0 1em;
}

body .cmb-article .elementor-widget-container > :last-child,
body .cmb-article > :last-child {
    margin-bottom: 0;
}

body .cmb-article img {
    max-width: 100%;
    height: auto;
}

/* in-content images: block, held to the 960 column, generous air above and below */
body .cmb-article img:not(.mwe-math-fallback-image-inline) {
    display: block;
    margin: 48px 0;
}

body .cmb-article img.aligncenter {
    margin-left: auto;
    margin-right: auto;
}

body .cmb-article img.alignleft {
    float: left;
    margin: 8px 40px 24px 0;
}

body .cmb-article img.alignright {
    float: right;
    margin: 8px 0 24px 40px;
}

body .cmb-article img.mwe-math-fallback-image-inline {
    display: inline-block;
    margin: 0;
    vertical-align: middle;
}

/* a paragraph holding only an image should not add its own margin to the image's */
body .cmb-article p:has(> img:only-child) {
    margin: 0;
}

body .cmb-article figure,
body .cmb-article .wp-caption {
    max-width: 100%;
    margin: 48px 0;
}

body .cmb-article figure img,
body .cmb-article .wp-caption img {
    margin: 0 0 12px;
}

body .cmb-article figcaption,
body .cmb-article .wp-caption-text {
    font-size: 16px;
    line-height: 1.4;
}

body .cmb-article iframe {
    display: block;
    max-width: 100%;
    margin: 48px 0;
}

body .cmb-article table {
    width: 100%;
    margin: 48px 0;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 1.4;
}

body .cmb-article th,
body .cmb-article td {
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid rgba(10, 22, 40, 0.2);
    text-align: left;
    vertical-align: top;
}

/* content heading scale = the kit's H4 32 / H5 24 / Button 20 steps (the Post Content widget has no
   per-heading control); tags were normalised to H2-H4 under the template's single H1 */
body .cmb-article.elementor-widget-theme-post-content h2,
body .cmb-article.elementor-widget-theme-post-content h3,
body .cmb-article.elementor-widget-theme-post-content h4 {
    margin: 48px 0 16px;
    font-family: 'Fustat', sans-serif;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #022A53;
}

body .cmb-article.elementor-widget-theme-post-content h2 {
    font-size: 32px;
}

body .cmb-article.elementor-widget-theme-post-content h3 {
    font-size: 24px;
}

body .cmb-article.elementor-widget-theme-post-content h4 {
    font-size: 20px;
}

body .cmb-article a {
    color: #022A53;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

body .cmb-article a:hover {
    color: #3F9AE0;
}

body .cmb-article ul,
body .cmb-article ol {
    margin: 0 0 1em 1.25em;
    padding: 0;
}

body .cmb-article li {
    margin-bottom: 0.5em;
}

body .cmb-article blockquote {
    margin: 40px 0;
    padding: 0 0 0 24px;
    border-left: 2px solid rgba(10, 22, 40, 0.2);
    font-style: italic;
}

body .cmb-article small {
    font-size: 14px;
    line-height: 1.4;
}

body .cmb-article::after {
    content: "";
    display: table;
    clear: both;
}

/* ---- Research-item singles: cover + CTA column ---- */
.cmb-item-body .cmb-item-cover img {
    display: block;
    height: auto;
    border-radius: 0;
}

.cmb-item-body .cmb-item-text:empty,
.cmb-item-body .cmb-item-text .elementor-widget-container:empty {
    display: none;
}

/* ---- Post Navigation (Previous / Next article) ---- */
.cmb-post-nav .elementor-post-navigation__link a {
    align-items: flex-start;
}

.cmb-post-nav .post-navigation__prev--title,
.cmb-post-nav .post-navigation__next--title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

@media (max-width: 1024px) {
    body .cmb-article.elementor-widget-theme-post-content h2 {
        font-size: 28px;
    }
}

@media (max-width: 767px) {
    body .cmb-article img:not(.mwe-math-fallback-image-inline),
    body .cmb-article figure,
    body .cmb-article iframe {
        margin-top: 32px;
        margin-bottom: 32px;
    }

    body .cmb-article img.alignleft,
    body .cmb-article img.alignright {
        float: none;
        margin: 32px 0;
    }

    body .cmb-article table {
        display: block;
        overflow-x: auto;
    }

    body .cmb-article.elementor-widget-theme-post-content h2 {
        font-size: 26px;
    }

    body .cmb-article.elementor-widget-theme-post-content h3 {
        font-size: 22px;
    }

    .cmb-post-nav .elementor-post-navigation {
        flex-direction: column;
        gap: 24px;
    }

    .cmb-post-nav .elementor-post-navigation__separator-wrapper {
        display: none;
    }

    .cmb-post-nav .elementor-post-navigation__prev,
    .cmb-post-nav .elementor-post-navigation__next {
        width: 100%;
        max-width: 100%;
    }
}

/* Post Navigation labels: sentence case like the rest of the site (Elementor's default is uppercase; A3) */
.cmb-post-nav .post-navigation__prev--label,
.cmb-post-nav .post-navigation__next--label {
    text-transform: none;
    letter-spacing: normal;
}

/* research-item singles: the text column takes the row width left beside the cover (the Container's
   "full" content width would otherwise make it 100% wide and push it off the row) */
.cmb-item-body .cmb-item-textcol {
    flex: 1 1 0;
    min-width: 0;
}

@media (max-width: 767px) {
    .cmb-item-body .cmb-item-textcol {
        flex-basis: auto;
        width: 100%;
    }
}

/* ---- N9 (round 2 fix loop, 2026-09-25): designed cover ground for cards with no featured image ----
   Same 300x391 box as the white-paper covers; navy card ground (Deep Navy global under the certified
   HTML's navy-card-ground texture), white Cambria logo top-left, category name at the foot. */
.rf-wrapper .rf-card__fallback {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    width: 300px;
    max-width: 100%;
    height: 391px;
    padding: 28px 24px;
    background: var(--e-global-color-secondary, #022A53) url('/wp-content/uploads/2026/09/form-bg.jpg') center / cover no-repeat;
    line-height: 1.2;
}
.rf-wrapper .rf-card__fallback .rf-card__fallback-logo {
    display: block;
    width: 132px;
    height: auto;
}
.rf-wrapper .rf-card__fallback-label {
    font-family: 'Fustat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.012em;
    text-transform: uppercase;
    color: var(--e-global-color-cmb_ice, #B0CBEB);
}
@media (max-width: 1200px) {
    .rf-wrapper .rf-card__fallback { width: 100%; height: auto; aspect-ratio: 300 / 391; }
}
@media (max-width: 767px) {
    .rf-wrapper .rf-card__thumb--fallback { max-width: 320px; }
}
