/* 4.3.7 article navigation, share controls, category support blocks and footer edge fixes. */

/* Keep the document background continuous after the footer on short pages and iOS overscroll. */
html {
    min-height: 100%;
    background: #ff6708;
}
body {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    background: #ff6708;
}
body > main {
    width: 100%;
    flex: 1 0 auto;
    background: #fff;
}
.site-header,
.site-footer-v433 { width: 100%; flex: 0 0 auto; }
.site-footer-v433 { margin: 0 !important; }

/* Full table of contents inside one independently scrolling card. */
.article-v42-toc {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: min(68vh, 620px);
    flex-direction: column;
}
.article-v42-toc h2 { flex: 0 0 auto; }
.article-v42-toc nav {
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #ff9a5b #f7eee6;
}
.article-v42-toc a {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}
.article-v42-toc nav::-webkit-scrollbar { width: 7px; }
.article-v42-toc nav::-webkit-scrollbar-track { border-radius: 999px; background: #f7eee6; }
.article-v42-toc nav::-webkit-scrollbar-thumb { border-radius: 999px; background: #ff9a5b; }
.article-v42-toc a.level-4 { padding-left: 24px; color: #8a8d94; }

/* Icon-only, accessible share actions. */
.article-v42-share {
    justify-content: center;
    gap: 11px;
}
.article-v42-share > span { display: none !important; }
.article-v42-share a,
.article-v42-share button {
    display: grid;
    box-sizing: border-box;
    width: 43px;
    height: 43px;
    place-items: center;
    border: 1px solid #ddd5cd;
    border-radius: 50%;
    padding: 0;
    color: #17294e;
    background: #fff;
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.article-v42-share a:hover,
.article-v42-share a:focus-visible,
.article-v42-share button:hover,
.article-v42-share button:focus-visible,
.article-v42-share button.is-copied {
    border-color: #ff6708;
    color: #fff;
    background: #ff6708;
    transform: translateY(-2px);
}
.article-v42-share .ui-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}
.article-v42-share a[aria-label="Share on Facebook"] .ui-icon { fill: currentColor; stroke: currentColor; }

/* Give long category FAQ titles and answers room to breathe. */
.category-landing .category-faq {
    margin-top: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(29,43,73,.045);
}
.category-landing .category-faq header { padding: 20px 22px; }
.category-landing .category-faq h2 {
    max-width: 900px;
    font-size: clamp(22px,1.7vw,28px) !important;
    line-height: 1.22;
    letter-spacing: -.3px;
}
.category-landing .category-faq summary {
    min-height: 58px;
    gap: 18px;
    padding: 10px 22px;
    font-size: 15px !important;
    line-height: 1.45;
}
.category-landing .category-faq summary span { flex: 0 0 auto; }
.category-landing .category-faq details p {
    max-width: 920px;
    padding: 1px 58px 19px 22px;
    font-size: 14px !important;
    line-height: 1.7;
}

/* Editorial promise follows the page's left edge instead of appearing centered. */
.category-landing .category-editorial {
    display: block;
    padding: 24px;
    text-align: left !important;
}
.category-landing .category-editorial > div { width: 100%; min-width: 0; text-align: left !important; }
.category-landing .category-editorial h2,
.category-landing .category-editorial p { max-width: none; text-align: left !important; }
.category-landing .category-editorial__badges { justify-content: flex-start; }

/* Separate newsletter field and action; both controls keep four rounded corners. */
.home-v43-newsletter form,
.home-v43-newsletter-mobile form {
    gap: 10px;
}
.home-v43-newsletter input,
.home-v43-newsletter button,
.home-v43-newsletter-mobile input,
.home-v43-newsletter-mobile button {
    border-radius: 999px !important;
}

@media (max-width: 780px) {
    .article-v42-toc { max-height: 250px; }
    .article-v42-toc nav { padding-right: 6px; }
    .article-v42-toc a {
        min-height: 35px;
        border-radius: 10px;
        padding: 9px 30px 9px 12px;
        line-height: 1.4;
    }
    .article-v42-toc a::after { top: 50%; transform: translateY(-50%); }
    .article-v42-share { gap: 9px; margin-top: 25px; }
    .article-v42-share a,
    .article-v42-share button { width: 41px; height: 41px; }

    .category-landing .category-faq { margin-top: 20px; border-radius: 12px; }
    .category-landing .category-faq header { padding: 16px; }
    .category-landing .category-faq h2 { font-size: 20px !important; line-height: 1.25; }
    .category-landing .category-faq summary {
        min-height: 0;
        padding: 13px 16px;
        font-size: 15px !important;
        line-height: 1.42;
    }
    .category-landing .category-faq details p {
        padding: 0 40px 16px 16px;
        font-size: 14px !important;
        line-height: 1.62;
    }

    .category-landing .category-editorial {
        display: block;
        padding: 16px;
    }
    .category-landing .category-editorial h2 { font-size: 18px !important; line-height: 1.25; }
    .category-landing .category-editorial p { font-size: 14px !important; line-height: 1.58; }
    .category-landing .category-editorial__badges { gap: 8px 12px; margin-top: 10px; }
    .category-landing .category-editorial__badges span { font-size: 11px !important; }

    .home-v43-newsletter-mobile form {
        display: grid;
        grid-template-columns: minmax(0,1fr) 108px;
        gap: 10px !important;
    }
    .home-v43-newsletter-mobile input,
    .home-v43-newsletter-mobile button {
        width: 100%;
        min-width: 0;
        border-radius: 999px !important;
    }
}

@media (max-width: 390px) {
    .home-v43-newsletter-mobile form { grid-template-columns: 1fr; }
}

/* 4.3.9: one compact newsletter pattern across mobile templates. */
.journal-newsletter-mobile { display: none; }
@media (max-width: 780px) {
    .home-v43-newsletter-mobile.journal-newsletter-mobile,
    .category-newsletter-mobile.journal-newsletter-mobile,
    .article-v42-mobile-newsletter.journal-newsletter-mobile {
        display: block !important;
        box-sizing: border-box;
        padding: 15px 12px 18px !important;
        background: #f4f6fb !important;
    }
    .journal-newsletter-mobile .journal-newsletter-card,
    .article-v42-mobile-newsletter.journal-newsletter-mobile > .journal-newsletter-card {
        box-sizing: border-box;
        width: min(100%, 720px);
        margin: 0 auto;
        border: 1px solid #ebd5bd;
        border-radius: 13px;
        padding: 17px 15px;
        color: #5a301c;
        background: #fff8ef;
        text-align: center;
    }
    .journal-newsletter-mobile .journal-newsletter-card h2 {
        margin: 0 !important;
        color: #5a301c;
        font-size: 21px !important;
        line-height: 1.16;
        letter-spacing: -.2px;
    }
    .journal-newsletter-mobile .journal-newsletter-card p {
        margin: 6px auto 11px !important;
        color: #776e68;
        font-size: 12px !important;
        line-height: 1.48;
    }
    .journal-newsletter-mobile .journal-newsletter-card form {
        display: grid !important;
        grid-template-columns: minmax(0,1fr) 96px !important;
        gap: 10px !important;
        width: 100%;
    }
    .journal-newsletter-mobile .journal-newsletter-card input,
    .journal-newsletter-mobile .journal-newsletter-card button {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        height: 40px !important;
        border-radius: 999px !important;
    }
    .journal-newsletter-mobile .journal-newsletter-card input {
        border: 1px solid #ded6cf !important;
        padding: 0 13px;
        color: #28344d;
        background: #fff;
        font-size: 16px !important;
    }
    .journal-newsletter-mobile .journal-newsletter-card button {
        border: 0 !important;
        color: #fff;
        background: #ff6708;
        font-size: 11px !important;
        font-weight: 800;
    }
    .journal-newsletter-mobile .journal-newsletter-card small {
        display: block;
        margin-top: 7px;
        color: #8b827a;
        font-size: 8px !important;
        line-height: 1.4;
        text-align: center;
    }
}
@media (max-width: 350px) {
    .journal-newsletter-mobile .journal-newsletter-card form { grid-template-columns: 1fr !important; }
}

/* Narrow hero trust badges scroll horizontally instead of being clipped. */
@media (max-width: 780px) {
    .home-v43-hero .home-v43-trust {
        display: flex !important;
        width: 100%;
        max-width: 100%;
        grid-template-columns: none !important;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 1px 0 7px;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .home-v43-hero .home-v43-trust::-webkit-scrollbar { display: none; }
    .home-v43-hero .home-v43-trust span {
        flex: 0 0 auto;
        min-width: max-content;
        padding: 8px 11px;
        scroll-snap-align: start;
        white-space: nowrap;
    }
}

/* 4.3.13: when no takeaways are entered, the remaining answer uses the full row. */
.article-v42-hero__grid--quick-only .article-v42-quick { grid-column: 1 / -1; }

/* Category-like search cards. */
.search-results-page { padding: 42px 0 64px; background: #f7f8fb !important; }
.search-results-shell { width: min(calc(100% - 48px), 1380px); margin-inline: auto; }
.search-results-header { margin-bottom: 26px; }
.search-results-header .kicker { margin: 0 0 7px; color: #ff6708; font-size: 12px; font-weight: 850; letter-spacing: .7px; text-transform: uppercase; }
.search-results-header h1 { margin: 0; color: #071b55; font-size: clamp(36px,4vw,56px); line-height: 1.05; }
.search-results-header > p:last-child { margin: 9px 0 0; color: #727984; font-size: 15px; }
.search-result-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.search-result-card { min-width: 0; overflow: hidden; border: 1px solid #e4ddd5; border-radius: 14px; background: #fff; }
.search-result-card__image { position: relative; display: block; height: 220px; overflow: hidden; }
.search-result-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.search-result-card__image > span { position: absolute; top: 10px; left: 10px; max-width: calc(100% - 20px); overflow: hidden; border-radius: 999px; padding: 5px 9px; color: #fff; background: #ff6708; font-size: 9px; font-weight: 850; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.search-result-card__body { min-width: 0; padding: 17px 18px 19px; }
.search-result-card__body h2 { margin: 0 0 8px; color: #071b55; font-size: 21px; line-height: 1.17; overflow-wrap: anywhere; }
.search-result-card__body h2 a { color: inherit; }
.search-result-card__body > p { display: -webkit-box; min-height: 3em; margin: 0 0 10px; overflow: hidden; color: #69707b; font-size: 13px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.search-result-card__meta { display: flex; flex-wrap: wrap; gap: 5px 12px; color: #7d838c; font-size: 11px; }
.search-result-card__more { display: inline-flex; gap: 5px; margin-top: 13px; color: #ff6708; font-size: 13px; font-weight: 850; }
.search-results-page .journal-pagination { margin-top: 30px; }

@media (max-width: 980px) {
    .search-result-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
    .search-results-page { padding: 22px 0 38px; }
    .search-results-shell { width: calc(100% - 20px); }
    .search-results-header { margin-bottom: 16px; }
    .search-results-header h1 { font-size: 29px; line-height: 1.12; }
    .search-results-header > p:last-child { font-size: 13px; }
    .search-result-list { display: flex; flex-direction: column; gap: 9px; }
    .search-result-card { display: grid; grid-template-columns: 36% minmax(0,64%); min-height: 184px; border-radius: 13px; }
    .search-result-card__image { width: 100%; height: 100%; min-height: 184px; }
    .search-result-card__image > span { top: 7px; left: 7px; max-width: calc(100% - 14px); padding: 4px 7px; font-size: 7px; }
    .search-result-card__body { display: flex; min-width: 0; flex-direction: column; padding: 11px 10px 12px; }
    .search-result-card__body h2 { margin-bottom: 6px; font-size: 18px; line-height: 1.16; }
    .search-result-card__body > p { min-height: 0; margin-bottom: 7px; font-size: 12px; line-height: 1.45; }
    .search-result-card__meta { gap: 4px 9px; font-size: 10px; }
    .search-result-card__more { align-self: flex-end; margin-top: auto; font-size: 13px; }
}

/* Keep the complete article sidebar visible while desktop readers scroll. */
@media (min-width: 901px) {
    .article-v42-sidebar {
        position: sticky;
        top: calc(var(--puainta-admin-offset, 0px) + 92px);
        max-height: calc(100vh - var(--puainta-admin-offset, 0px) - 112px);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-right: 5px;
        scrollbar-width: thin;
        scrollbar-color: #ff9a5b #f7eee6;
    }
    .article-v42-sidebar::-webkit-scrollbar { width: 6px; }
    .article-v42-sidebar::-webkit-scrollbar-track { border-radius: 999px; background: #f7eee6; }
    .article-v42-sidebar::-webkit-scrollbar-thumb { border-radius: 999px; background: #ff9a5b; }
}

/* 4.3.10: keep one authoritative article outline and make it easier to scan. */
@media (min-width: 901px) {
    .article-v42-toc {
        position: sticky;
        top: calc(var(--puainta-admin-offset, 0px) + 92px);
        align-self: start;
        max-height: min(58vh, 610px);
        overflow: hidden;
        border-radius: 14px;
    }
    .article-v42-toc h2 {
        position: relative;
        z-index: 1;
        margin: 0;
        border-bottom: 1px solid #ece4dc;
        padding: 16px 17px 13px;
        background: #fff;
    }
    .article-v42-toc nav {
        max-height: calc(min(58vh, 610px) - 55px);
        overflow-x: hidden;
        overflow-y: auto;
        padding: 8px 8px 13px;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
        scrollbar-width: thin;
        scrollbar-color: #ff9a5b #f7eee6;
    }
    .article-v42-toc nav::-webkit-scrollbar { width: 5px; }
    .article-v42-toc nav::-webkit-scrollbar-track { border-radius: 999px; background: #f7eee6; }
    .article-v42-toc nav::-webkit-scrollbar-thumb { border-radius: 999px; background: #ff9a5b; }
    .article-v42-toc a {
        display: block;
        margin: 0;
        border-left: 2px solid transparent;
        border-radius: 0 7px 7px 0;
        padding: 7px 8px 7px 10px;
        color: #596579;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }
    .article-v42-toc a:hover,
    .article-v42-toc a:focus,
    .article-v42-toc a[aria-current="true"] {
        border-left-color: #ff6708;
        color: #e95300;
        background: #fff7ef;
    }
    .article-v42-toc a.level-3 { padding-left: 20px; color: #737c8a; }
    .article-v42-toc a.level-4 { padding-left: 30px; color: #858c97; }
}

/* The three mobile trust badges stay on one swipeable row inside a clear frame. */
@media (max-width: 780px) {
    .home-v43-hero .home-v43-trust {
        flex-wrap: nowrap !important;
        gap: 7px !important;
        border: 0;
        border-radius: 0;
        padding: 0 !important;
        background: transparent;
        box-shadow: none;
    }
    .home-v43-hero .home-v43-trust span {
        min-height: 34px;
        border-color: #e4dcd4;
        padding: 7px 10px;
        background: #fff;
    }
}
