/* Research project single post ([dt_research_project], inc/research-project.php) */

.rp-page {
    --rp-navy: #1c355e;
    --rp-red: #b01f2e;
    --rp-text: #2f3747;
    --rp-ink: #1f2733;
    --rp-muted: #5d6472;
    --rp-muted-2: #4e5563;
    --rp-line: #d9d3c6;
    --rp-line-soft: #eeebe4;
    --rp-sand: #efebe2;
    --rp-placeholder: #d8d2c4;

    background: #f7f5f0;
    color: var(--rp-text);
    font-family: "Inter", system-ui, sans-serif;
    width: 100%;
}

.rp-page h1,
.rp-page h2,
.rp-page h3,
.rp-page p,
.rp-page figure,
.rp-page blockquote {
    margin: 0;
}

.rp-page h1,
.rp-page h2,
.rp-page h3 {
    font-family: "Inter", system-ui, sans-serif;
    color: var(--rp-navy);
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
}

.rp-page img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Hero */
.rp-hero {
    height: 460px;
    background: #4a463e;
    overflow: hidden;
}

.rp-hero__img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
}

/* Header */
.rp-wrap {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: content-box;
}

.rp-header {
    padding-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rp-eyebrow {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rp-red);
}

.rp-page .rp-title {
    font-size: 46px;
    line-height: 1.15;
    max-width: 820px;
}

/* Two columns: intro + main on the left, sticky details card on the right */
.rp-layout {
    display: grid;
    grid-template-columns: minmax(0, 720px) 344px;
    grid-template-areas:
        "intro card"
        "main  card";
    grid-template-rows: auto 1fr;
    column-gap: 56px;
    row-gap: 56px;
    justify-content: space-between;
    align-items: start;
    padding: 40px 0 96px;
}

.rp-intro {
    grid-area: intro;
    font-size: 17px;
    line-height: 1.7;
    font-style: italic;
    color: var(--rp-text);
}

.rp-main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    gap: 56px;
    min-width: 0;
}

.rp-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* WYSIWYG content (content_1-3 and optional section texts) */
.rp-prose {
    font-size: 17px;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rp-prose:empty {
    display: none;
}

.rp-prose > *,
.rp-prose div > * {
    margin: 0;
}

/* flatten wrapper divs left by the old page builder so spacing stays consistent */
.rp-prose div {
    display: contents;
}

.rp-page .rp-prose h2 {
    font-size: 30px;
    line-height: 1.25;
}

.rp-prose h2 strong,
.rp-prose h2 span {
    font-weight: inherit;
    font-size: inherit;
    line-height: inherit;
}

.rp-prose h2 {
    margin-top: 36px;
}

.rp-prose > h2:first-child,
.rp-prose > div:first-child h2:first-child {
    margin-top: 0;
}

.rp-prose h3 {
    font-size: 21px;
    line-height: 1.35;
}

.rp-prose a {
    color: var(--rp-red);
    text-decoration: underline;
}

.rp-prose ul,
.rp-prose ol {
    padding-left: 1.2em;
}

/* Legacy drop caps from imported posts */
.rp-prose .dropcap2 {
    float: none;
    font: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
    background: none;
}

.rp-section > h2 {
    font-size: 30px;
    line-height: 1.25;
}

/* Figures */
.rp-figure {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
}

.rp-figure__img {
    width: 100%;
    border-radius: 6px;
    background: var(--rp-placeholder);
}

.rp-caption {
    font-size: 14px;
    line-height: 1.5;
    color: var(--rp-muted);
}

.rp-figure-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.rp-figure--tall .rp-figure__img {
    height: 400px;
    object-fit: cover;
}

/* Key figures */
.rp-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--rp-line);
    border-bottom: 1px solid var(--rp-line);
}

.rp-stat {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-left: 1px solid var(--rp-line);
}

.rp-stat:first-child {
    padding-left: 0;
    border-left: 0;
}

.rp-stat:last-child {
    padding-right: 0;
}

.rp-stat__value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    color: var(--rp-navy);
}

.rp-stat--highlight .rp-stat__value {
    color: var(--rp-red);
}

.rp-stat__label {
    font-size: 14px;
    line-height: 1.45;
    color: var(--rp-muted-2);
}

/* Team */
.rp-team__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 24px;
    background: var(--rp-sand);
    border-radius: 6px;
}

.rp-team__member {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rp-team__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--rp-navy);
}

.rp-team__role {
    font-size: 13px;
    color: var(--rp-muted-2);
}

/* Process */
.rp-steps {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-top: 8px;
}

.rp-step {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.rp-step__media {
    width: 240px;
    flex-shrink: 0;
}

.rp-step__img {
    width: 240px;
    height: 170px !important;
    object-fit: cover;
    border-radius: 6px;
}

.rp-step__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rp-step__label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rp-red);
}

.rp-page .rp-step__title {
    font-size: 21px;
}

.rp-step__text {
    font-size: 16px;
    line-height: 1.65;
}

/* Before / after */
.rp-compare {
    padding-top: 20px;
}

.rp-compare__frame {
    --rp-pos: 50%;
    position: relative;
    aspect-ratio: 720 / 420;
    border-radius: 6px;
    overflow: hidden;
    background: var(--rp-placeholder);
}

.rp-compare__img,
.rp-compare__before {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
}

.rp-compare__before {
    clip-path: inset(0 calc(100% - var(--rp-pos)) 0 0);
}

.rp-compare__tag {
    position: absolute;
    top: 16px;
    padding: 6px 12px;
    background: var(--rp-ink);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    pointer-events: none;
}

.rp-compare__tag--before {
    left: 16px;
}

.rp-compare__tag--after {
    right: 16px;
}

.rp-compare__handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--rp-pos);
    width: 2px;
    margin-left: -1px;
    background: #fff;
    pointer-events: none;
}

.rp-compare__handle span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.rp-compare__handle span::before {
    content: "\2039\00a0\203A";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--rp-navy);
}

.rp-compare__range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
}

/* Quote */
.rp-quote {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px 0;
    border: 0;
    background: none;
    font-style: normal;
}

.rp-quote__icon {
    font-size: 30px;
    color: var(--rp-red);
}

.rp-quote__title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rp-red);
}

.rp-quote__text {
    font-size: 21px;
    line-height: 1.55;
    font-weight: 500;
    color: var(--rp-navy);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rp-quote__text p {
    margin: 0;
}

.rp-quote__author {
    font-size: 15px;
    font-style: normal;
    color: var(--rp-muted-2);
}

/* Gallery */
.rp-gallery {
    padding-top: 24px;
    border-top: 1px solid var(--rp-line);
}

.rp-gallery__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

.rp-gallery__head h2 {
    font-size: 30px;
    line-height: 1.25;
}

.rp-gallery__hint {
    font-size: 14px;
    color: var(--rp-muted);
}

.rp-gallery__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.rp-gallery__grid--1 {
    grid-template-columns: 1fr;
}

.rp-gallery__grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rp-gallery__item {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    background: var(--rp-placeholder);
}

.rp-gallery__img {
    width: 100%;
    height: 220px !important;
    object-fit: cover;
}

.rp-gallery__grid--1 .rp-gallery__img {
    height: 405px !important;
}

.rp-gallery__grid--2 .rp-gallery__img {
    height: 300px !important;
}

/* Rounded images: Elementor resets border-radius on every img inside its widgets, so these need the extra specificity */
.rp-page .rp-figure__img,
.rp-page .rp-step__img,
.rp-page .rp-gallery__item,
.rp-page .rp-compare__frame {
    border-radius: 8px;
}

/* Project details card */

/* The7's page wrapper uses overflow:hidden, which disables position:sticky; clip crops the same without creating a scroll container */
body:has(.rp-card) #page {
    overflow: clip;
}

.rp-card {
    grid-area: card;
    position: sticky;
    top: 32px;
    background: #fff;
    border: 1px solid #e6e2d9;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(28, 53, 94, 0.08);
    padding: 28px;
    box-sizing: border-box;
    transition: border-radius 0.2s ease;
}

/* set by js/research-project.js while the card is stuck */
.rp-card--stuck {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.rp-page .rp-card__title {
    font-size: 19px;
    line-height: 1.3;
    padding-bottom: 16px;
}

.rp-card__row {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--rp-line-soft);
}

.rp-card__icon {
    width: 18px;
    padding-top: 2px;
    font-size: 15px;
    color: var(--rp-red);
    text-align: center;
    flex-shrink: 0;
}

.rp-card__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rp-muted);
    margin-bottom: 3px;
}

.rp-card__value {
    font-size: 15px;
    line-height: 1.45;
    color: var(--rp-ink);
}

.rp-card__footer {
    border-top: 1px solid var(--rp-line-soft);
}

.rp-card__share {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 20px;
}

.rp-card__share .rp-card__label {
    margin: 0;
}

.rp-card__share-links {
    display: flex;
    gap: 4px;
}

.rp-card__share-links a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rp-red);
    background: #f3f1ec;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.rp-card__share-links a:hover {
    background: var(--rp-red);
    color: #fff;
}

.rp-card__back {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border-radius: 6px;
    background: var(--rp-red);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}

.rp-card__back:hover {
    background: #8f1825;
    color: #fff;
}

.rp-card__back-short {
    display: none;
}

/* Tablet and mobile: single column, details card right after the intro */
@media (max-width: 1024px) {
    .rp-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "intro"
            "card"
            "main";
        grid-template-rows: none;
        row-gap: 32px;
        padding: 28px 0 48px;
    }

    .rp-card {
        position: static;
        padding: 20px;
    }

    .rp-page .rp-card__title {
        font-size: 17px;
        padding-bottom: 12px;
    }

    .rp-card__rows {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rp-card__row {
        padding: 12px 12px 12px 0;
    }

    .rp-card__row--wide {
        grid-column: 1 / -1;
    }

    /* an odd one out at the end (e.g. Published) takes the full row, so its divider spans the card */
    .rp-card__rows > .rp-card__row:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .rp-card__icon {
        display: none;
    }

    .rp-card__value {
        font-size: 14px;
        line-height: 1.4;
    }

    .rp-card__footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding-top: 12px;
    }

    .rp-card__share {
        padding: 0;
    }

    .rp-card__share > .rp-card__label {
        display: none;
    }

    .rp-card__back {
        height: 44px;
        padding: 0 16px;
    }

    .rp-card__back-long {
        display: none;
    }

    .rp-card__back-short {
        display: inline;
    }
}

@media (max-width: 767px) {
    .rp-hero {
        height: 240px;
    }

    .rp-header {
        padding-top: 28px;
        gap: 10px;
    }

    .rp-eyebrow {
        font-size: 12px;
    }

    .rp-page .rp-title {
        font-size: 30px;
        line-height: 1.2;
    }

    .rp-intro {
        font-size: 16px;
    }

    .rp-main {
        gap: 40px;
    }

    .rp-section,
    .rp-prose {
        gap: 16px;
    }

    .rp-prose {
        font-size: 16px;
    }

    .rp-page .rp-prose h2,
    .rp-section > h2,
    .rp-gallery__head h2 {
        font-size: 24px;
    }

    .rp-prose h2 {
        margin-top: 24px;
    }

    .rp-prose > h2:first-child,
    .rp-prose > div:first-child h2:first-child {
        margin-top: 0;
    }

    .rp-figure {
        padding-top: 8px;
        gap: 8px;
    }

    .rp-caption {
        font-size: 13px;
    }

    .rp-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rp-stat,
    .rp-stat:first-child,
    .rp-stat:last-child {
        padding: 18px 12px;
        border-left: 1px solid var(--rp-line);
    }

    .rp-stat:nth-child(odd) {
        padding-left: 0;
        border-left: 0;
    }

    .rp-stat:nth-child(n+3) {
        border-top: 1px solid var(--rp-line);
    }

    .rp-stat__value {
        font-size: 30px;
    }

    .rp-stat__label {
        font-size: 13px;
    }

    .rp-team__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 20px;
    }

    .rp-figure-pair {
        grid-template-columns: 1fr;
    }

    .rp-figure--tall .rp-figure__img {
        height: 260px;
    }

    .rp-step {
        flex-direction: column;
        gap: 14px;
    }

    .rp-step__media,
    .rp-step__img {
        width: 100%;
    }

    .rp-step__img {
        height: 200px !important;
    }

    .rp-quote__text {
        font-size: 18px;
    }

    .rp-gallery__head {
        flex-direction: column;
        gap: 4px;
    }

    .rp-gallery__grid,
    .rp-gallery__grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .rp-gallery__grid--1 {
        grid-template-columns: 1fr;
    }

    .rp-gallery__img,
    .rp-gallery__grid--2 .rp-gallery__img {
        height: 150px !important;
    }

    .rp-gallery__grid--1 .rp-gallery__img {
        height: 220px !important;
    }
}

/* Headings in Playfair Display like the rest of the site (news articles, section titles); the details card stays in Inter */
.rp-page .rp-title,
.rp-prose h2,
.rp-gallery__head h2 {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 600;
}
.rp-page .rp-title { letter-spacing: -0.01em; }
