/*
    Rouse Refresh article page. Used by Views/newsDetailNew.cshtml.
    Figma "Rouse - The Power of Evidence Chains": XL 1440, Large 1025, Medium 768.

    Above 1440px the page keeps the 1440 layout: content stays in a centred 1440px
    container and only the section backgrounds stretch to the screen edges.
*/

body:has(.rr-article) main.home {
    padding-top: 0 !important;
}

/* The article has no image hero, so the header sits on the page background. */
body:has(.rr-article) header.rr-header:not(.rr-header--scrolled) {
    background-color: #f9f9f9;
    border-bottom-color: rgba(23, 18, 69, .3);
}

.rr-article {
    --article-ink: #171245;
    --article-teal: #07333d;
    --article-purple: #6a59fd;
    --article-grey: #e8e8e8;
    --article-paper: #f9f9f9;
    --article-cyan: #28ffff;
    --article-heading-font: var(--uat-heading-font, 'Archivo', 'Noto Sans', Arial, sans-serif);
    --article-body-font: var(--uat-body-font, 'Noto Sans', 'Segoe UI', Arial, sans-serif);
    display: block;
    color: var(--article-ink);
    background: var(--article-paper);
    font-family: var(--article-body-font);
}

    .rr-article *,
    .rr-article *::before,
    .rr-article *::after {
        box-sizing: border-box;
    }

    .rr-article h1,
    .rr-article h2,
    .rr-article h3,
    .rr-article h4,
    .rr-article h5,
    .rr-article h6 {
        color: inherit;
        font-family: var(--article-heading-font) !important;
        text-transform: none;
    }

    .rr-article p,
    .rr-article li,
    .rr-article td,
    .rr-article th,
    .rr-article time {
        font-family: var(--article-body-font) !important;
    }

.rr-article__container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 72px;
}

/* ---------- Hero ---------- */

.rr-article__hero {
    position: relative;
    overflow: hidden;
    padding-top: 80px;
    background: var(--article-paper);
}

.rr-article__hero-inner {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 64px;
    min-height: 642px;
    padding-top: 120px;
    padding-bottom: 80px;
}

/* Figma "Group 1": starts 414px into the 1440 frame and runs off its right edge. */
.rr-article__swoosh {
    position: absolute;
    top: 0;
    left: 414px;
    width: 1236px;
    height: 642px;
    pointer-events: none;
}

.rr-article__intro {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    flex: 0 1 685px;
    min-width: 0;
}

.rr-article .rr-article__intro h1 {
    margin: 0;
    font-size: 56px;
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: 0;
}

.rr-article .rr-article__summary {
    margin: 0;
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: -0.015em;
}

.rr-article__hero-image {
    position: relative;
    flex: 0 0 auto;
    width: 463px;
    height: 442px;
    object-fit: cover;
    border-radius: 20px;
    background: var(--article-grey);
}

/* Cyan pill: published date and tags. */
.rr-article .rr-article__pill {
    display: inline-block;
    margin: 0;
    padding: 7.5px 10px;
    border-radius: 20px;
    background: var(--article-cyan);
    color: var(--article-ink);
    font-family: var(--article-body-font) !important;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.03em;
    text-decoration: none;
}

    .rr-article .rr-article__pill time {
        font: inherit;
        letter-spacing: inherit;
    }

.rr-article a.rr-article__pill {
    transition: background-color .2s ease, color .2s ease;
}

    .rr-article a.rr-article__pill:hover,
    .rr-article a.rr-article__pill:focus-visible {
        background: var(--article-ink);
        color: #fff;
    }

/* ---------- Body ---------- */

.rr-article__main {
    display: flex;
    flex-direction: column;
    gap: 50px;
    padding-top: 80px;
    padding-bottom: 80px;
    padding-left: 182px;
}

.rr-article__column {
    width: 100%;
    max-width: 1079px;
}

.rr-article__content {
    font-size: 16px;
    line-height: 1.15;
    overflow-wrap: break-word;
}

    .rr-article__content > :first-child {
        margin-top: 0 !important;
    }

    .rr-article__content > :last-child {
        margin-bottom: 0 !important;
    }

    .rr-article .rr-article__content p,
    .rr-article .rr-article__content li {
        margin: 0 0 24px;
        font-size: 16px;
        font-weight: 400;
        line-height: 1.15;
        letter-spacing: 0;
        color: var(--article-ink);
    }

    .rr-article .rr-article__content h1,
    .rr-article .rr-article__content h2 {
        margin: 48px 0 24px;
        font-size: 32px;
        font-weight: 500;
        line-height: 1.05;
        letter-spacing: 0;
    }

    .rr-article .rr-article__content h3,
    .rr-article .rr-article__content h4,
    .rr-article .rr-article__content h5,
    .rr-article .rr-article__content h6 {
        margin: 48px 0 24px;
        font-size: 20px;
        font-weight: 500;
        line-height: 1.05;
        letter-spacing: 0;
    }

    .rr-article .rr-article__content :is(h1, h2) + :is(h3, h4, h5, h6) {
        margin-top: 24px;
    }

    .rr-article .rr-article__content ul,
    .rr-article .rr-article__content ol {
        margin: 0 0 24px;
        padding-left: 24px;
    }

    .rr-article .rr-article__content ol.lowerAlpha {
        list-style-type: lower-alpha;
    }

    .rr-article .rr-article__content li {
        margin-bottom: 16px;
    }

        .rr-article .rr-article__content li > :is(ul, ol) {
            margin: 16px 0 0;
        }

    .rr-article .rr-article__content a {
        color: inherit;
        text-decoration: underline;
        text-underline-offset: 2px;
    }

        .rr-article .rr-article__content a:hover,
        .rr-article .rr-article__content a:focus-visible {
            color: var(--article-purple);
        }

    .rr-article .rr-article__content img {
        max-width: 100%;
        height: auto;
    }

    .rr-article .rr-article__content blockquote {
        margin: 0 0 24px;
        padding-left: 20px;
        border-left: 3px solid var(--article-purple);
    }

/* Tables: dark teal header row, rounded teal outline (Figma "Table Container"). */
.rr-article__table {
    width: 100%;
    max-width: 688px;
    margin: 0 0 48px;
    border: 1px solid rgba(7, 51, 61, .7);
    border-radius: 16px;
    background: var(--article-paper);
    overflow: hidden;
}

    .rr-article .rr-article__table table {
        width: 100% !important;
        height: auto !important;
        margin: 0;
        border: 0;
        border-collapse: collapse;
        background: var(--article-paper);
    }

    .rr-article .rr-article__table :is(td, th) {
        padding: 12px;
        border: 1px solid var(--article-teal);
        vertical-align: top;
        text-align: left;
        color: var(--article-teal);
        font-size: 14px;
        font-weight: 400;
        line-height: 1.05;
        letter-spacing: -0.03em;
    }

    .rr-article .rr-article__table tr:first-child > :is(td, th) {
        border-top: 0;
    }

    .rr-article .rr-article__table tr:last-child > :is(td, th) {
        border-bottom: 0;
    }

    .rr-article .rr-article__table tr > :first-child {
        border-left: 0;
    }

    .rr-article .rr-article__table tr > :last-child {
        border-right: 0;
    }

    .rr-article .rr-article__table :is(td, th) :is(p, li) {
        margin: 0 0 8px;
        color: inherit;
        font-size: inherit;
        line-height: inherit;
        letter-spacing: inherit;
    }

        .rr-article .rr-article__table :is(td, th) :is(p, li):last-child {
            margin-bottom: 0;
        }

    /* Header row: the table head, or the first row when the editor used plain cells. */
    .rr-article .rr-article__table thead tr,
    .rr-article .rr-article__table table:not(:has(thead)) > tbody:first-child > tr:first-child,
    .rr-article .rr-article__table table:not(:has(thead)) > tr:first-child {
        background: var(--article-teal);
    }

        .rr-article .rr-article__table thead tr > :is(td, th),
        .rr-article .rr-article__table table:not(:has(thead)) > tbody:first-child > tr:first-child > :is(td, th),
        .rr-article .rr-article__table table:not(:has(thead)) > tr:first-child > :is(td, th) {
            border-color: var(--article-teal);
            border-left-color: var(--article-paper);
            color: var(--article-paper);
            vertical-align: middle;
        }

/* PDF downloads */
.rr-article__downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 48px 0 0;
    padding: 0;
    list-style: none;
}

.rr-article .rr-article__download {
    display: inline-block;
    padding: 12px 14px;
    border: 1px solid var(--article-ink);
    border-radius: 10px;
    color: var(--article-ink);
    font-family: var(--article-heading-font) !important;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.015em;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
}

    .rr-article .rr-article__download:hover,
    .rr-article .rr-article__download:focus-visible {
        background: var(--article-ink);
        color: #fff;
    }

/* ---------- Tags and contributors ---------- */

.rr-article__meta {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rr-article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0 0 8px;
    list-style: none;
}

/* XL shows the profiles straight under the tags; smaller frames add a heading. */
.rr-article .rr-article__contributors-title {
    display: none;
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.05;
}

.rr-article__profiles {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
}

.rr-article__profile {
    display: flex;
    flex: 0 1 340px;
    min-width: 0;
}

.rr-article__profile-image {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--article-grey);
}

.rr-article__profile-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    min-width: 0;
    padding-left: 20px;
    opacity: .8;
}

.rr-article .rr-article__profile-name {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.05;
}

    .rr-article .rr-article__profile-name a {
        color: inherit;
        text-decoration: none;
    }

        .rr-article .rr-article__profile-name a:hover,
        .rr-article .rr-article__profile-name a:focus-visible {
            color: var(--article-purple);
        }

.rr-article__profile-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .rr-article .rr-article__profile-details p {
        margin: 0;
        font-size: 16px;
        line-height: 1.15;
    }

.rr-article__profile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .rr-article__profile-actions a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--article-grey);
        transition: background-color .2s ease;
    }

        .rr-article__profile-actions a:hover,
        .rr-article__profile-actions a:focus-visible {
            background: var(--article-cyan);
        }

/* ---------- Related articles ---------- */

.rr-article__related {
    background: var(--article-grey);
    padding-bottom: 80px;
}

.rr-article__related-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 80px 0 48px;
}

    .rr-article .rr-article__related-head h2 {
        margin: 0;
        font-size: 40px;
        font-weight: 600;
        line-height: 1.05;
    }

.rr-article .rr-article__button {
    display: inline-block;
    flex: 0 0 auto;
    padding: 11px 14px;
    border: 1px solid var(--article-ink);
    border-radius: 10px;
    background: transparent;
    color: var(--article-ink);
    font-family: var(--article-heading-font) !important;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.015em;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

    .rr-article .rr-article__button:hover,
    .rr-article .rr-article__button:focus-visible {
        background: var(--article-ink);
        color: #fff;
    }

.rr-article__cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.rr-article__card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 501px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--article-paper);
    transition: transform .22s ease, box-shadow .22s ease;
}

.rr-article__card-image {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--article-grey);
}

.rr-article__card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background: var(--article-paper);
    color: var(--article-ink);
    transition: background-color .2s ease, color .2s ease;
}

.rr-article .rr-article__card h3 {
    margin: 0;
    font-size: 32px;
    font-weight: 500;
    line-height: 1.05;
}

.rr-article .rr-article__card p {
    margin: 0;
    font-size: 16px;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.rr-article__card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 13px;
    margin-top: auto;
    padding-top: 24px;
}

.rr-article .rr-article__card time {
    color: rgba(23, 18, 69, .5);
    font-size: 14px;
    line-height: 1.05;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

/* Same hover as the Insights cards: lift, ink panel, light button. */
.rr-article__card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(23, 18, 69, .12);
}

@media (hover: hover) and (pointer: fine) {
    .rr-article__card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 24px rgba(23, 18, 69, .12);
    }
}

.rr-article .rr-article__card:is(:hover, :has(:focus-visible)) .rr-article__card-body {
    background: var(--article-ink);
    color: #fff;
}

.rr-article .rr-article__card:is(:hover, :has(:focus-visible)) time {
    color: rgba(255, 255, 255, .7);
}

.rr-article .rr-article__card:is(:hover, :has(:focus-visible)) .rr-article__button {
    border-color: #fff;
    background: #fff;
    color: var(--article-ink);
}

@media (prefers-reduced-motion: reduce) {
    .rr-article__card,
    .rr-article__card-body,
    .rr-article .rr-article__button {
        transition: none;
    }

        .rr-article__card:hover,
        .rr-article__card:focus-within {
            transform: none;
        }
}

/* ---------- Large: 1025 - 1439 ---------- */

@media (max-width: 1439px) {
    .rr-article__container {
        padding: 0 40px;
    }

    .rr-article__hero {
        padding-top: 0;
    }

    .rr-article__hero-inner {
        gap: 48px;
        min-height: 0;
        padding-top: 120px;
        padding-bottom: 64px;
    }

    .rr-article__swoosh {
        display: none;
    }

    .rr-article__intro {
        flex: 1 1 537px;
    }

    .rr-article__hero-image {
        width: 360px;
        height: 344px;
    }

    .rr-article__main {
        padding: 80px 124px 80px 122px;
    }

    .rr-article .rr-article__contributors-title {
        display: block;
    }

    .rr-article__related {
        padding-bottom: 64px;
    }

    .rr-article__related-head {
        padding: 64px 0 48px;
    }

    .rr-article__card {
        min-height: 587px;
    }
}

/* ---------- Medium: 768 - 1024 ---------- */

@media (max-width: 1024px) {
    .rr-article__container {
        padding: 0 20px;
    }

    .rr-article__hero-inner {
        align-items: center;
        gap: 24px;
        padding-top: 120px;
        padding-bottom: 56px;
    }

    .rr-article__intro {
        flex: 1 1 355px;
    }

    .rr-article .rr-article__intro h1 {
        font-size: 40px;
    }

    .rr-article__hero-image {
        width: 346px;
        height: 330px;
    }

    .rr-article__main {
        gap: 32px;
        padding: 64px 20px;
    }

    .rr-article__column {
        max-width: none;
    }

    .rr-article .rr-article__content p,
    .rr-article .rr-article__content li {
        margin-bottom: 16px;
    }

    .rr-article .rr-article__content h1,
    .rr-article .rr-article__content h2 {
        margin: 32px 0 16px;
        font-weight: 600;
    }

    .rr-article .rr-article__content h3 {
        margin: 32px 0 16px;
        font-size: 18px;
    }

    .rr-article .rr-article__content :is(h4, h5, h6) {
        margin: 32px 0 16px;
        font-size: 16px;
    }

    .rr-article .rr-article__content :is(h1, h2) + :is(h3, h4, h5, h6) {
        margin-top: 16px;
    }

    .rr-article .rr-article__content :is(ul, ol) {
        margin-bottom: 16px;
    }

    .rr-article__table {
        max-width: none;
        margin-bottom: 32px;
    }

        .rr-article .rr-article__table :is(td, th) {
            font-size: 14px;
        }

    .rr-article__profile {
        flex: 1 1 calc(50% - 12px);
    }

    .rr-article .rr-article__profile-name {
        font-size: 24px;
        font-weight: 600;
    }

    .rr-article__related {
        padding-bottom: 56px;
    }

        .rr-article__related .rr-article__container {
            padding: 0 24px;
        }

    .rr-article__related-head {
        padding: 56px 0 32px;
    }

        .rr-article .rr-article__related-head h2 {
            font-size: 32px;
        }

    .rr-article__cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Third card takes the full row, as in the Medium frame. */
    .rr-article__card:nth-child(3):last-child {
        grid-column: 1 / -1;
    }

    .rr-article__card {
        min-height: 450px;
    }

    .rr-article .rr-article__card h3 {
        font-size: 24px;
    }
}

/* ---------- Small: up to 767 (no Figma frame; follows Medium, stacked) ---------- */

@media (max-width: 767px) {
    .rr-article__container,
    .rr-article__related .rr-article__container {
        padding: 0 16px;
    }

    .rr-article__hero-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 32px;
        padding-top: 92px;
        padding-bottom: 48px;
    }

    .rr-article__intro {
        flex: 0 0 auto;
    }

    .rr-article .rr-article__intro h1 {
        font-size: 32px;
    }

    .rr-article .rr-article__summary {
        font-size: 18px;
    }

    .rr-article__hero-image {
        width: 100%;
        height: auto;
        aspect-ratio: 346 / 330;
    }

    .rr-article__main {
        padding: 48px 16px;
    }

    .rr-article .rr-article__content h1,
    .rr-article .rr-article__content h2 {
        font-size: 26px;
    }

    /* Wide tables scroll inside their rounded frame instead of the page. */
    .rr-article__table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

        .rr-article .rr-article__table table {
            min-width: 560px;
        }

    .rr-article__profile {
        flex: 1 1 100%;
    }

    .rr-article__related {
        padding-bottom: 48px;
    }

    .rr-article__related-head {
        padding: 48px 0 24px;
    }

        .rr-article .rr-article__related-head h2 {
            font-size: 28px;
        }

    .rr-article__cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .rr-article__card {
        min-height: 0;
    }
}
