/* ==========================================================================
   SRH Funds — Insights listing (insights.php) + single insight (single.php)
   ========================================================================== */

/* ── Blue banner hero (reusable) ──────────────────────────────────────── */
.banner-hero { margin: 20px 0; }
.banner-hero__row {
    background: var(--blue-700);
    padding: 2% 0 2% 3%;        /* live Divi row padding (% of section width) */
}
.banner-hero__title {
    font-size: 80px;
    line-height: 1.1;
    font-weight: 500;
    color: var(--white);
    padding-bottom: 10px;
}

/* ── Listing ──────────────────────────────────────────────────────────── */
.insights-list { padding: 84px 0 90px; }
.insights-list__inner { width: 80%; margin-inline: auto; }

.insights-filter {
    list-style: none;
    margin: 0 0 56px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.insights-filter li { margin: 0 15px 15px 0; }   /* live spacing (trailing margin shifts the row 7px left) */
.insights-filter button {
    padding: 10px;
    border: 0;
    background: #f4f4f4;
    color: var(--blue-700);
    font-family: var(--font-body);
    font-size: 22px;
    line-height: normal;
    cursor: pointer;
    transition: background-color var(--ease), color var(--ease);
}
.insights-filter button:hover { background: var(--blue-200); }
.insights-filter button.is-active { background: var(--blue-700); color: var(--white); }

.insights-grid__items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}
/* masonry (insights-grid.js): cards distributed into columns, shortest column first */
.insights-grid__items.is-masonry { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 20px; align-items: start; }
.insights-grid__col { min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.insight-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    box-shadow: 0 0 2px rgba(0, 0, 0, .2);
}
.insight-card[hidden] { display: none; }
.insight-card__media { display: block; overflow: hidden; }
.insight-card__media img {
    width: 100%;
    height: auto;               /* natural height, like the live masonry grid */
    transition: transform .5s ease;
}
.insight-card:hover .insight-card__media img { transform: scale(1.03); }
.insight-card__body { padding: 20px; }
.insight-card__cat {
    margin: 3px 0 5px;
    font-size: 14px;
    line-height: 33px;
    color: var(--blue-700);
}
.insight-card__title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #ededed;
}
.insight-card__title a:hover { color: var(--blue-700); }
.insight-card__excerpt {
    font-size: 13px;
    line-height: 1.1;
    color: #666;
    margin-bottom: 15px;
}
/* Divi button hover (like live): padding shifts 14/14 -> 9.8/28 and an
   ETmodules "angle up" glyph slides in from the left and fades in. No underline. */
.insight-card__more {
    display: block;
    position: relative;
    width: fit-content;
    margin-inline: auto;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.7;
    padding: 4.2px 14px;
    color: #000;
    text-decoration: none;
    transition: all .2s;
}
.insight-card__more::after {
    content: "";
    position: absolute;
    top: 4.2px;          /* no left/right: sits right after the text, like Divi */
    width: 14px;
    height: 23.8px;
    margin-left: -1em;
    opacity: 0;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160'%3E%3Cpath d='M51 92l33.5-33.5L118 92' fill='none' stroke='%23000' stroke-width='13' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160'%3E%3Cpath d='M51 92l33.5-33.5L118 92' fill='none' stroke='%23000' stroke-width='13' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
    transition: all .2s;
}
.insight-card__more:hover,
.insight-card__more:focus-visible { padding: 4.2px 28px 4.2px 9.8px; text-decoration: none; }
.insight-card__more:hover::after,
.insight-card__more:focus-visible::after { opacity: 1; margin-left: 0; }

.insights-grid__more { text-align: center; margin-top: 40px; }
.insights-grid__more[hidden] { display: none; }

/* ── Single insight ───────────────────────────────────────────────────── */
.insight-single__doc { padding: 140px 0 211px; }
.pdf-wrapper {
    max-width: 1432px;          /* 1400px viewer + 16px gutters, like live */
    margin-inline: auto;
    padding: 0 16px;
}
.pdf-wrapper iframe {
    display: block;
    width: 100%;
    height: 1400px;
    border: 0;
}
.pdf-wrapper__fallback { text-align: center; margin-top: 20px; }
@media (min-width: 981px) { .pdf-wrapper__fallback { display: none; } }

.insight-article {
    width: min(80%, 900px);
    margin-inline: auto;
}
.insight-article__title { font-size: 48px; margin-bottom: 30px; }
.insight-article .entry-content { font-size: 18px; line-height: 1.6; }
.insight-article .entry-content h2 { font-size: 30px; margin: 1.4em 0 .5em; }
.insight-article .entry-content h3 { font-size: 24px; margin: 1.2em 0 .5em; }
.insight-article .entry-content img { margin: 1.5em auto; }
.insight-article .entry-content a { color: var(--blue-700); text-decoration: underline; }
.insight-article .entry-content ul,
.insight-article .entry-content ol { padding-left: 1.4em; margin: 0 0 1em; }

/* ── Phone CTA band ───────────────────────────────────────────────────── */
.phone-cta {
    background: var(--blue-700);
    padding: 4% 0;              /* live Divi section/row padding */
}
.phone-cta .row { padding: 2% 0; }
.phone-cta__text {
    font-size: 32px;
    line-height: 1.1;
    font-weight: 500;
    color: var(--white);
    padding-bottom: 10px;
}
.phone-cta__text a { white-space: nowrap; text-decoration: underline; text-underline-offset: 4px; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 980px) {
    .insights-list { padding: 50px 0 60px; }
    .insights-grid__items { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
    .insights-filter { gap: 10px; }
    .insights-filter button { font-size: 16px; }
    .insights-grid__items { grid-template-columns: 1fr; }
    .insight-article__title { font-size: 34px; }
}

/* ── Tablet / phone parity with live ─────────────────────────────────── */
@media (max-width: 980px) {
    .banner-hero__row { padding: 30px 0 30px 3%; }
    .banner-hero__title { font-size: 80px; line-height: 88px; }
    .insights-list { padding-top: 80px; }
    .insights-list__inner { width: 80%; }
}
@media (max-width: 767px) {
    .banner-hero__row { padding: 30px 0 30px 3%; }
    .banner-hero__title { font-size: 80px; line-height: 88px; }
}

/* Filter dropdown on tablets/phones (live: category bar with a menu icon, list drops down) */
.insights-filter-wrap { position: relative; }
.insights-filter-toggle { display: none; }
@media (max-width: 980px) {
    .insights-filter-wrap { margin-bottom: 50px; }
    .insights-filter-toggle {
        display: flex; align-items: center; justify-content: space-between;
        width: 100%; padding: 10px; border: .8px solid #f3f3f3; background: #f5f5f5;
        font-family: var(--font-body); font-size: 22px; line-height: 27px; color: #000; text-align: left; cursor: pointer;
    }
    .insights-filter-toggle__icon { width: 32px; height: 27px; position: relative; }
    .insights-filter-toggle__icon::before {
        content: ""; position: absolute; left: 5px; right: 5px; top: 6px; height: 3px; background: #000;
        box-shadow: 0 7px 0 #000, 0 14px 0 #000;
    }
    .insights-filter {
        display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 5;
        margin: 0; background: #aeaeae; flex-direction: column;
    }
    .filter-open .insights-filter { display: flex; }
    .insights-filter li { margin: 0; border-bottom: .8px dotted #969696; }
    .insights-filter button { width: 100%; text-align: left; font-size: 22px; background: #f4f4f4; }
}
@media (max-width: 980px) {
    /* live keeps the 1400px PDF viewer and the desktop spacing on tablets/phones */
    .insight-single__doc { padding: 140px 0 135px; }   /* + visible "Open PDF" link ≈ live spacing */
    .pdf-wrapper iframe { height: 1400px; }
    .phone-cta { padding: 50px 0; }
    .phone-cta .row { padding: 30px 0; }
    .phone-cta__text { font-size: 32px; line-height: 35.2px; }
}
@media (max-width: 767px) { .phone-cta__text { font-size: 32px; } }

/* Single fund document / distribution / news / tax PDF (single-fund-document.php) — live: Divi row
   90% wide, 60px section + 30px row padding, 1200px viewer. */
.fund-document__doc { width: var(--row-width); max-width: none; margin: 0 auto; padding: 90px 0 99px; }
.fund-document .pdf-viewer__desktop iframe { display: block; width: 100%; height: 1200px; border: 0; }

/* ── Divi layouts in legacy posts (includes/divi-content.php) — live's layout ─────────── */
.insight-single__doc--divi { padding: 30px 0 60px; }
.insight-article--divi { width: auto; }
.dv-section { padding-bottom: 4px; }
.dv-row { width: 80%; margin-inline: auto; padding: 40px 0 4px; }
.dv-row--cols { display: flex; align-items: stretch; }
.dv-row--cols > .dv-col { flex: 1 1 0; min-width: 0; }
.dv-row--cols:not(.dv-row--nogutter) { gap: 5.5%; }
.dv-col--image { background-size: cover; background-position: center; background-repeat: no-repeat; }
.dv-col > * { margin-bottom: 33.275px; }
.dv-col > *:last-child { margin-bottom: 0; }
.dv-post-title { font-family: var(--font-heading); font-size: 75px; font-weight: 500; line-height: 1.1; margin: 0; padding: 0; }
.dv-text { font-size: 22px; line-height: 33px; color: #000; }
.dv-text p { margin: 0; padding-bottom: 22px; }
.dv-text p:last-child { padding-bottom: 0; }
.dv-text h2 { font-size: 40px; font-weight: 500; line-height: 1.2; margin: 0; padding-bottom: 10px; }
.dv-text h3 { font-size: 32px; font-weight: 500; line-height: 1.2; margin: 0; padding-bottom: 10px; }
.dv-text ul, .dv-text ol { padding: 0 0 22px 1em; margin: 0; }
.dv-text a { color: var(--blue-700); text-decoration: underline; }
.dv-text sup { font-size: 70%; }
.dv-image { line-height: 0; }
.dv-image img { display: block; max-width: 100%; height: auto; }
.dv-image--center img { margin-inline: auto; }
.dv-image--right img { margin-left: auto; }
.dv-divider { height: 23px; border-top: 0.8px solid #1c5797; }
/* "Back to Insights" — live's fancy-text-link button */
.dv-button a.fancy-text-link { position: relative; display: inline-block; padding: 6.6px 22px 6.6px 0; font-family: var(--font-heading); font-size: 22px; font-weight: 500; line-height: 1.7; color: #000; text-decoration: none; }
.dv-button a.fancy-text-link::after { content: ""; position: absolute; right: -2px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); background: var(--img-arrow-black) center / contain no-repeat; transition: transform var(--ease); }
.dv-button a.fancy-text-link:hover { text-decoration: underline 1px; text-underline-offset: 4px; }
.dv-button a.fancy-text-link:hover::after { transform: translateY(-50%) rotate(-180deg); }
@media (max-width: 980px) {
    .dv-row--cols { flex-direction: column; }
    .dv-col--image { min-height: 400px; }
    .dv-post-title { font-size: 60px; }
}
@media (max-width: 767px) {
    .dv-post-title { font-size: 48px; }
    .dv-col--image { min-height: 260px; }
}
