/* ==========================================================================
   SRH Funds — Global styles
   Tokens, base, header (incl. Funds mega menu), bottom CTA bar, footer,
   shared components. Page-specific CSS lives in assets/css/pages/*.css
   ========================================================================== */

:root {
    /* Arrow images (live media-library PNGs) used by the fancy links */
    --img-arrow-black: url('/wp-content/uploads/2024/10/black-arrow-upright-50x50-1.png');
    --img-arrow-white: url('/wp-content/uploads/2024/10/white-arrow-upright-50x50-1.png');
    /* Colour */
    --black:        #000;
    --white:        #fff;
    --stone:        #f1f1ef;   /* hero / slider panel */
    --blue-900:     #005695;   /* mega menu */
    --blue-800:     #0a5793;   /* tile 1 */
    --blue-700:     #1c5797;   /* CTA bar hover */
    --blue-600:     #4c85ae;   /* tile 2 */
    --blue-400:     #96b3cd;   /* tile 3 */
    --blue-200:     #dce1e7;   /* tile 4 */

    /* Type */
    --font-heading: "Plus Jakarta Sans", Helvetica, Arial, sans-serif;
    --font-body:    "Inter", Helvetica, Arial, sans-serif;

    /* Layout */
    --row-width:    90%;       /* content row width used site-wide */
    --header-h:     123px;
    --cta-bar-h:    71px;
    --ease:         .3s ease;

    /* Arrow icon (up-right), used as a mask so it inherits currentColor */
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 22px;
    line-height: 1.5;
    color: var(--black);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 500;
    line-height: 1.1;
    color: var(--black);
}

.skip-to-content {
    position: absolute; left: -9999px; top: 0; z-index: 10001;
    background: var(--black); color: var(--white); padding: .5rem 1rem; font-size: 16px;
}
.skip-to-content:focus { left: 1rem; top: 1rem; }

.row {
    width: var(--row-width);
    margin-inline: auto;
}

/* ── Buttons & links ──────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.7;
    padding: 4.8px 16px;
    border: 0;
    transition: background-color var(--ease), color var(--ease);
}
.btn--black { background: var(--black); color: var(--white); }
.btn--black:hover { background: var(--blue-700); }

/* "Find Out More ↗" style link — arrow flips on hover */
.fancy-link {
    display: inline-flex;
    align-items: center;
    gap: 17px;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 500;
    line-height: 1.7;
    padding: 6.6px 0;
    color: var(--black);
    cursor: pointer;
}
.fancy-link::after {
    content: "";
    width: 20px; height: 20px;
    flex: none;
    transition: transform var(--ease);
}
.fancy-link:hover { text-decoration: underline 1px; text-underline-offset: 4px; }
.fancy-link:hover::after { transform: rotate(-180deg); }
.fancy-link--white { color: var(--white); }

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
.site-header__inner {
    width: var(--row-width);
    margin-inline: auto;
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}
.site-logo__img { width: 100px; height: auto; }

.primary-nav__list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    align-items: center;
    gap: 22px;
}
.primary-nav__list > li > a {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 14px;
    padding: 0 0 8px;
    color: var(--black);
    transition: opacity var(--ease);
}
.primary-nav__list > li > a:hover { opacity: .7; }
.primary-nav__mobile-only,
.primary-nav__sub { display: none; }


/* Funds mega menu — full-width blue panel under the header (live Divi Mega Pro values) */
.mega-panel {
    position: absolute;
    left: 0; right: 0; top: calc(100% - 7px);
    background: var(--blue-900);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.has-mega:hover > .mega-panel,
.has-mega:focus-within > .mega-panel,
.has-mega.is-open > .mega-panel {
    opacity: 1; visibility: visible; transform: none;
}
.mega-panel__inner {
    width: 60%;
    margin-inline: auto;
    padding: 30.25px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5.5%;
}
.mega-panel__col { min-height: 150px; border-left: .8px solid #fff; padding-left: 3%; }
.mega-panel__heading {
    font-family: var(--font-body);
    font-size: 28px;
    font-weight: 600;
    line-height: 33px;
    color: #e2eded;
    margin: 0;
    padding-bottom: 21px;
}
.mega-panel__col a {
    display: block;
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 400;
    line-height: 33px;
    color: var(--white);
}
.mega-panel__col a:hover { text-decoration: underline 1px; text-underline-offset: 4px; }   /* live: .funds-dropdown a:hover */

/* Funds caret: Divi's ETmodules "angle down" glyph (16px box, bold), redrawn as an SVG */
.primary-nav__list > li.has-mega > a { position: relative; padding-right: 20px; gap: 0; }
.primary-nav__list > li.has-mega > a .caret {
    position: absolute; right: 0; top: -1px;
    width: 16px; height: 16px;
    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 71l33.5 33.5L118 71' fill='none' stroke='%23000' stroke-width='13' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px 16px 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 71l33.5 33.5L118 71' fill='none' stroke='%23000' stroke-width='13' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}
/* Hamburger (tablet/phone only): Divi's mobile menu bar = 32px "menu" glyph + "MENU" label, live blue */
.nav-toggle { display: none; }

/* ── Fixed bottom CTA bar ─────────────────────────────────────────────── */
.cta-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--black);
    transition: background-color var(--ease);
}
.cta-bar:hover { background: var(--blue-700); }
.cta-bar__inner {
    width: var(--row-width);
    margin-inline: auto;
    padding: 10px 0;
    min-height: var(--cta-bar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.cta-bar__text {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 25px;
    line-height: 33px;
    color: var(--white);
}
.cta-bar .fancy-link { padding-right: 0; margin-right: -15px; }   /* live: text ends 22px inside the row, arrow overhangs 15px */
body { padding-bottom: var(--cta-bar-h); }

/* ── Tiles (Home + Fund Overview) ─────────────────────────────────────── */
.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 278px;
    padding: 20px;
    color: var(--white);
    transition: background-color .3s ease;
}
.tile__arrow {
    align-self: flex-end;
    width: 65px; height: 65px;
    flex: none;
    display: block;
    transition: transform .9s ease-in-out;        /* live: slow return, quick turn on hover */
}
.tile:hover .tile__arrow { transform: rotate(-180deg); transition: transform .3s ease; }
.tile__title {
    margin-top: auto;
    padding-bottom: 8px;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.1;
    color: inherit;
}
.tile--blue-800 { background: var(--blue-800); }
.tile--blue-800:hover { background: #80aac8; }
.tile--blue-600 { background: var(--blue-600); }
.tile--blue-600:hover { background: #a5c1d6; }
.tile--blue-400 { background: var(--blue-400); color: var(--black); }
.tile--blue-400:hover { background: #cbd9e4; }
.tile--blue-200 { background: var(--blue-200); color: var(--black); }
.tile--blue-200:hover { background: #edf0f3; }
.tile--tall { min-height: 311px; }
.tile__sub {
    margin: 10px 0 0;
    font-family: var(--font-body);
    font-size: 22px;
    line-height: 1.5;
    color: inherit;
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--black);
    color: var(--white);
}
.site-footer__inner {
    width: 80%;
    margin-inline: auto;
    padding: 30px 0 60px;
}
.site-footer__logo img { width: 140px; height: auto; }
.site-footer__cols {
    display: grid;
    grid-template-columns: 15.625% 15.625% 1fr;
    column-gap: 5.5%;
    margin-top: 61px;
}
.site-footer__col h3 {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--white);
    padding-bottom: 10px;
}
.site-footer__col p,
.site-footer__copy {
    font-family: var(--font-heading);
    font-size: 16px;
    line-height: 1.3;
    color: var(--white);
}
.site-footer__col a:hover,
.site-footer__copy a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__col--address { padding-top: 0; }
.social-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; margin-top: 12px;
    border-radius: 50%;
    background: var(--white); color: var(--black);
    transition: opacity var(--ease);
}
.social-icon:hover { opacity: .75; }
.site-footer__copy {
    line-height: 1.4;
    margin: 61px 0 34px;
}
.site-footer__disclosure p {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 300;
    line-height: 1.3;
    color: var(--white);
    margin-bottom: 1.3em;
}
.site-footer__disclosure strong { font-weight: 700; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 980px) {
    .cta-bar { display: none; }
    body { padding-bottom: 0; }

    .site-footer__inner { width: var(--row-width); }
    .site-footer__cols { grid-template-columns: 1fr 1fr; row-gap: 30px; column-gap: 30px; margin-top: 40px; }
    .site-footer__col--address { grid-column: 1 / -1; }
    .site-footer__copy { margin-top: 40px; }
}

@media (max-width: 767px) {
    .tile--tall { min-height: 200px; }
    .tile__sub { font-size: 18px; }
    .fancy-link { font-size: 16px; }
    .fancy-link::after { width: 12px; height: 12px; }
}

/* ── Tablet/phone header, like live (Divi menu module):
      logo row (left on tablet, centred on phones), then a centred "≡ MENU" toggle.
      The menu drops down as a white 90%-wide panel with a 2.4px blue top border; the Funds
      sub-links are always listed (indented), with "ETFs" / "Closed-End Fund" as plain rows. ── */
@media (max-width: 980px) {
    :root { --header-h: 158px; }
    .header-cta { display: none; }
    .site-header__inner { position: relative; flex-wrap: wrap; padding: 30px 0; gap: 0; min-height: 0; }
    .site-logo { flex: 0 0 100%; line-height: 0; }
    .site-logo__img { width: 80px; }

    .nav-toggle {
        display: inline-flex; align-items: center;
        height: 32px; margin: 11px auto 5px; padding: 0;
        border: 0; background: none; cursor: pointer;
        color: var(--blue-700, #1c5797);
        font: 400 20px/1 var(--font-body); text-transform: uppercase;
    }
    .nav-toggle__icon { position: relative; flex: none; width: 32px; height: 32px; }
    .nav-toggle__label { position: relative; left: 9.2px; }   /* live: ::after { left: 10% } */
    .nav-toggle__icon span {
        position: absolute; left: 6px; width: 20px; height: 2px; border-radius: 1px;
        background: currentColor; transition: transform var(--ease), opacity var(--ease);
    }
    .nav-toggle__icon span:nth-child(1) { top: 9px; }
    .nav-toggle__icon span:nth-child(2) { top: 15px; }
    .nav-toggle__icon span:nth-child(3) { top: 21px; }
    .nav-open .nav-toggle__icon span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .nav-open .nav-toggle__icon span:nth-child(2) { opacity: 0; }
    .nav-open .nav-toggle__icon span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    .primary-nav {
        display: none;
        position: absolute; left: 0; right: 0; top: calc(100% - 30px); z-index: 10;
        padding: 5%;
        background: var(--white);
        border-top: 2.4px solid #1c5797;
        box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
    }
    .nav-open .primary-nav { display: block; }
    .primary-nav__list { display: block; }
    .primary-nav__mobile-only { display: block; }
    .primary-nav__list > li > a,
    .primary-nav__sub > li > * {
        display: block; width: auto; margin: 0;
        padding: 10px 5%;
        font: 400 18px/26px var(--font-body);
        color: var(--black);
        border-bottom: .8px solid rgba(0, 0, 0, .03);
        opacity: 1; text-decoration: none;
    }
    .primary-nav__list > li.has-mega > a { font-weight: 700; background: rgba(0, 0, 0, .03); padding-right: 5%; }
    .primary-nav__list > li > a .caret,
    .mega-panel { display: none; }
    .primary-nav__list > li > a:hover { opacity: 1; }
    .primary-nav__sub { display: block; list-style: none; margin: 0; padding: 0 0 0 24.75px; }
}
@media (max-width: 767px) {
    .site-logo { text-align: center; }
    .site-logo__img { display: inline-block; }
}

.social-icon svg { width: 17px; height: 17px; }
.site-footer__col--address p { margin-bottom: 0; } .site-footer__col--address .social-icon { margin-top: 10px; }

/* Fancy-link arrows = live media-library images (black / white) */
.fancy-link::after { background: var(--img-arrow-black) center / contain no-repeat; -webkit-mask: none; mask: none; }
.fancy-link--white::after { background-image: var(--img-arrow-white); }

/* ── Pop-ups: live Divi Overlays look — 15% black backdrop, 36px white round close button pinned to the viewport's top-right ── */
.popup-close {
    position: fixed; top: 0; right: 0; z-index: 2;
    width: 36px; height: 36px; padding: 3px;
    border: 0; border-radius: 50%;
    background: #fff; color: #333; cursor: pointer;
    font-size: 0; line-height: 0;
}
.popup-close::before {
    content: ""; display: block; width: 30px; height: 30px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7'%3E%3Cpath d='m0.14,0.14a0.5,0.5 0 0 1 0.7,0l2.65,2.64l2.65,-2.64a0.5,0.5 0 0 1 0.7,0.7l-2.64,2.65l2.64,2.65a0.5,0.5 0 0 1 -0.7,0.7l-2.65,-2.64l-2.65,2.64a0.5,0.5 0 0 1 -0.7,-0.7l2.64,-2.65l-2.64,-2.65a0.5,0.5 0 0 1 0,-0.7z'/%3E%3C/svg%3E") center / 7px 7px no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7'%3E%3Cpath d='m0.14,0.14a0.5,0.5 0 0 1 0.7,0l2.65,2.64l2.65,-2.64a0.5,0.5 0 0 1 0.7,0.7l-2.64,2.65l2.64,2.65a0.5,0.5 0 0 1 -0.7,0.7l-2.65,-2.64l-2.65,2.64a0.5,0.5 0 0 1 -0.7,-0.7l2.64,-2.65l-2.64,-2.65a0.5,0.5 0 0 1 0,-0.7z'/%3E%3C/svg%3E") center / 7px 7px no-repeat;
}
.tile:hover .tile__title, .tile .tile__title { text-decoration: none; }   /* live tiles never underline */
a.tile, a.tile:hover { text-decoration: none; }

/* Pop-up open: live blurs the whole page behind Divi Overlays (OutOfFocusIn/Out, 1s ease)
   and fades in a 15% black layer over 1s (dofadeIn). The fund-page #bioModal is live's
   own .modal (40% black + 15px backdrop blur) and is styled in fund.css. */
@keyframes srh-out-of-focus-in  { from { filter: blur(0); }    to { filter: blur(25px); } }
@keyframes srh-out-of-focus-out { from { filter: blur(25px); } to { filter: blur(0); } }
@keyframes srh-fade-in { from { opacity: 0; } to { opacity: 1; } }
body.popup-open > :is(header, .cta-bar, #page, footer)    { animation: srh-out-of-focus-in 1s ease both; }
body.popup-closing > :is(header, .cta-bar, #page, footer) { animation: srh-out-of-focus-out 1s ease both; }
dialog::backdrop { background: rgba(0, 0, 0, .15); backdrop-filter: none; animation: srh-fade-in 1s ease both; }
@media (prefers-reduced-motion: reduce) {
    body.popup-open > :is(header, .cta-bar, #page, footer) { animation-duration: .01s; }
    body.popup-closing > :is(header, .cta-bar, #page, footer) { animation: none; }
}
/* Opening a pop-up focuses the dialog itself (autofocus), not the close button, so there's no focus ring on the X
   unless you Tab to it (like live) */
dialog:focus { outline: none; }

/* Responsive PDF viewer (assets/js/pdf-viewer.js): pages drawn at the screen width on tablets/phones */
.pdf-viewer__pages { display: flex; flex-direction: column; gap: 12px; }
.pdf-viewer__page { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.pdf-viewer__status { text-align: center; padding: 40px 0; font-size: 16px; color: #555; }
.pdf-viewer__desktop[hidden], .pdf-viewer__pages[hidden] { display: none !important; }

/* ── Category / author archives (archive.php) — matches live's Divi blog archive ───────── */
.srh-archive__container { width: 80%; max-width: 1600px; margin: 0 auto; padding: 58px 0 50px; }
.srh-archive__list { width: 79.125%; padding-right: 5.5%; border-right: 1px solid #e2e2e2; box-sizing: border-box; }
.srh-archive__post { margin-bottom: 60px; }
.srh-archive__image { display: block; margin-bottom: 30px; }
.srh-archive__image img { display: block; width: 100%; height: auto; }
.srh-archive__title { font-family: "Plus Jakarta Sans", Helvetica, Arial, sans-serif; font-size: 38px; font-weight: 500; line-height: 1.1; color: #000; margin: 0; padding-bottom: 10px; }
.srh-archive__title a { color: #000; text-decoration: none; }
.srh-archive__meta { font-size: 14px; line-height: 33px; color: #000; margin: 0 0 6px; padding-bottom: 15px; }
.srh-archive__meta a { color: #666; text-decoration: none; }
.srh-archive__excerpt { margin: 0; }
.srh-archive__pagination { display: flex; justify-content: space-between; }
.srh-archive__pagination a { color: #1c5797; text-decoration: none; }
@media (max-width: 980px) {
    .srh-archive__list { width: 100%; padding-right: 0; border-right: 0; }
    .srh-archive__title { font-size: 28px; }
}
