/* Rouse Refresh - "Rouse Group" landing page (/the-rouse-group/).
   Figma: "Rouse Group Page- XLarge" (xJx4A6KpgHnrnTxY1wAzHX).
   Scoped to .rr-group. Built in phases; PHASE 1 = Hero.
   Shared hero layout lives in hero.css; this file only adds the Rouse Group
   decorative background and the page-specific sections. */

.rr-group {
    /* Design tokens (match the existing refresh palette). */
    --rr-group-purple: #6a59fd;
    --rr-group-purple-dark: #5444dd;
    --rr-group-dark-blue: #171245;
    --rr-group-ink: #232323;
    --rr-group-bg-soft: #f9f9f9;
    --rr-group-gutter: 72px;
    --rr-group-heading-font: var(--uat-heading-font, 'Archivo', Arial, sans-serif);

    overflow-x: hidden;
}

/* Shared content width + gutter, reused by every section below the hero. */
.rr-group__container {
    width: 100%;
    max-width: var(--rr-design-width, 1440px);
    margin-inline: auto;
    padding-inline: var(--rr-group-gutter);
}

/* ---- PHASE 1: Hero ----
   Reuses .rr-hero / .rr-hero--square; only the Rouse Group background differs:
   a subtle texture plus the diagonal "swoosh" lines from the design. */
.rr-group .rr-hero--group {
    /* !important keeps the dark brand colour even though the shared hero sets an inline
       background-color from refreshBackgroundColor. The swoosh/texture decoration is NOT
       hardcoded here: the editor selects it in the CMS "refreshHeroBackground" media field,
       which the shared hero renders as .rr-hero__background over this colour. */
    background-color: var(--rr-group-dark-blue) !important;
}

/* The shared hero renders the "Hero Image" (refreshHeroImage) as a bleeding cut-out.
   The Rouse Group design wants the contained, rounded photo on the right, so restyle
   it to match the square treatment (a 347x331 rounded card in a fixed right column). */
.rr-group .rr-hero--group.rr-hero--cutout .rr-hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 347px);
}

.rr-group .rr-hero--group .rr-hero__image {
    position: relative;
    inset: auto;
    justify-self: end;
    align-self: center;
    width: 100%;
    max-width: 347px;
    height: auto;
    aspect-ratio: 347 / 331;
    object-fit: cover;
    border-radius: 20px;
}

/* Mobile: the Rouse Group override above forces a fixed 347px image column at
   every width, which squeezes the heading to one letter per line on phones.
   Stack the hero into a single column here (the shared hero stacks at 749.98px
   too), so the heading gets the full width and the photo sits below it. */
@media (max-width: 749.98px) {
    .rr-group .rr-hero--group.rr-hero--cutout .rr-hero__inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .rr-group .rr-hero--group .rr-hero__image {
        justify-self: start;
    }
}

/* ---- PHASE 2: Intro ("One partner globally connected") ---- */
.rr-group__intro {
    background: #fff;
    /* Figma: 80px top + 80px bottom padding; sections butt with no margin. */
    padding-top: 80px;
    padding-bottom: 80px;
}

.rr-group__intro-head {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

.rr-group__intro-title {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    font-family: var(--rr-group-heading-font) !important;
    font-weight: 700;
    font-size: clamp(40px, 5.5vw, 80px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--rr-group-ink);
}

.rr-group__intro-text {
    flex: 1 1 0;
    min-width: 0;
    font-family: var(--rr-group-heading-font);
    font-weight: 500;
    font-size: clamp(20px, 2.2vw, 32px);
    line-height: 1.2;
    color: rgba(35, 35, 35, 0.8);
}

.rr-group__intro-text p {
    margin: 0;
}

.rr-group__intro-text p + p {
    margin-top: 24px;
}

/* ---- PHASE 2: Bento stats ---- */
/* Follows the "The Rouse Group" section; spacing comes from the adjacent
   sections' padding, so no extra top margin. */
.rr-group__bento {
    width: 100%;
    max-width: var(--rr-design-width, 1440px);
    margin: 0 auto;
    background: var(--rr-group-bg-soft);
    display: flex;
    gap: 48px;
    align-items: center;
    padding: 80px var(--rr-group-gutter);
}

.rr-group__bento-media {
    flex: 1 1 0;
    min-width: 0;
    align-self: stretch;
}

.rr-group__bento-media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 460px;
    object-fit: cover;
    border-radius: 20px;
}

.rr-group__stats {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rr-group__stats-row {
    display: flex;
    gap: 24px;
}

.rr-group__stat {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    min-height: 230px;
    padding: 24px;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.rr-group__stat-num {
    font-family: var(--rr-group-heading-font) !important;
    font-weight: 600;
    font-size: 56px;
    line-height: 1.05;
    color: var(--rr-group-dark-blue);
}

.rr-group__stat-label {
    font-family: var(--rr-group-heading-font);
    font-weight: 500;
    font-size: 20px;
    line-height: 1.05;
    color: var(--rr-group-ink);
}

.rr-group__stat--purple {
    background: var(--rr-group-purple);
    border-color: #fff;
}

.rr-group__stat--purple .rr-group__stat-num,
.rr-group__stat--purple .rr-group__stat-label {
    color: #fff;
}

.rr-group__stat--tier .rr-group__stat-num--tier {
    font-size: 40px;
}

.rr-group__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.rr-group__tag {
    padding: 7px 14px 8px;
    background: var(--rr-group-purple-dark);
    border: 0.5px solid #7767ff;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #fff;
}

/* ---- PHASE 3: Capability cards ---- */
.rr-group__caps {
    background: #fff;
    padding-block: 80px;
}

.rr-group__caps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.rr-group__cap {
    position: relative;
    display: flex;
    min-height: 362px;
    padding: 40px;
    border-radius: 20px;
    overflow: hidden;
    background-color: #1a2333;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* Dark overlay so the white text stays legible over the gradient photos. */
.rr-group__cap::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 0;
}

/* Capability card background photos are managed in the CMS (optional). Until one is set
   the base colour on .rr-group__cap shows through. */

.rr-group__cap--3::before {
    background: rgba(0, 0, 0, 0.66);
}

.rr-group__cap-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    color: #f9f9f9;
}

.rr-group__cap-title {
    margin: 0;
    font-family: var(--rr-group-heading-font) !important;
    font-weight: 600;
    font-size: 40px;
    line-height: 1.05;
    color: #f9f9f9;
}

.rr-group__cap-list {
    margin: 0;
    padding-left: 27px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    list-style: disc;
}

.rr-group__cap-list li {
    font-size: 18px;
    line-height: 1.15;
    color: #f9f9f9;
}

/* ---- PHASE 4: The Rouse Group company cards ---- */
.rr-group__companies {
    background: #fff;
    padding-block: 80px;
}

.rr-group__companies-heading {
    margin: 0 0 80px;
    text-align: center;
    font-family: var(--rr-group-heading-font) !important;
    font-weight: 700;
    font-size: clamp(40px, 5.5vw, 80px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--rr-group-dark-blue);
}

.rr-group__companies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.rr-group__company {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    background: #fff;
    border: 1px solid #efefef;
    border-radius: 20px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}

.rr-group__company-top {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rr-group__company-logo {
    display: flex;
    align-items: center;
    height: 44px;
}

.rr-group__company-logo img {
    max-height: 100%;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    object-position: left center;
}

.rr-group__company-desc {
    margin: 0;
    font-size: 16px;
    line-height: 1.15;
    color: var(--rr-group-dark-blue);
}

.rr-group__company-cta {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--rr-group-dark-blue);
    border-radius: 10px;
    font-family: var(--rr-group-heading-font);
    font-weight: 500;
    font-size: 16px;
    letter-spacing: -0.015em;
    color: var(--rr-group-dark-blue);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.rr-group__company-cta:hover,
.rr-group__company-cta:focus-visible {
    background: var(--rr-group-dark-blue);
    color: #fff;
}

/* ---- PHASE 5: Our combined scale ---- */
.rr-group__scale {
    /* Background photo is managed in the CMS (optional); the dark brand colour shows otherwise. */
    position: relative;
    background-color: var(--rr-group-dark-blue);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* Dark + purple wash over the photo so the white heading stays legible. */
.rr-group__scale::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(126deg, rgba(70, 0, 144, 0.45) 0%, rgba(70, 0, 144, 0.12) 55%, rgba(255, 255, 255, 0) 100%),
        rgba(23, 18, 69, 0.45);
    pointer-events: none;
}

.rr-group__scale-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 72px;
    padding-block: 120px;
}

.rr-group__scale-heading {
    margin: 0;
    text-align: center;
    font-family: var(--rr-group-heading-font) !important;
    font-weight: 700;
    font-size: clamp(40px, 5.5vw, 80px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #fff;
}

.rr-group__scale-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.rr-group__scale-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 40px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
}

.rr-group__scale-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    /* The wrapper supplies the purple rounded box; the CMS icon is a glyph-only
       (white) SVG centred inside it with padding, so it must NOT fill the box. */
    background: var(--rr-group-purple);
    border-radius: 16px;
    overflow: hidden;
}

.rr-group__scale-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.rr-group__scale-title {
    margin: 0;
    font-family: var(--rr-group-heading-font) !important;
    font-weight: 600;
    font-size: clamp(32px, 3.5vw, 56px);
    line-height: 1.05;
    color: var(--rr-group-dark-blue);
}

.rr-group__scale-desc {
    margin: 0;
    font-size: 16px;
    line-height: 1.15;
    color: var(--rr-group-dark-blue);
}

/* ---- Responsive: breakpoints aligned to the Figma frames
   (XLarge 1440, Large 1025, Medium 768, Small 374).
   The content stays in its Figma arrangement and only shrinks; layouts that
   stack do so at the frame width where the design itself stacks them. ---- */

/* Below the 1440 design width, use the 40px gutter from the Large/Medium frames. */
@media (max-width: 1439.98px) {
    .rr-group {
        --rr-group-gutter: 40px;
    }
}

/* Figma "Medium" type scale: once below the Large frame (1025) step headings down.
   Body copy (Noto Sans) keeps its size across breakpoints, as in the design. */
@media (max-width: 1024.98px) {
    .rr-group__intro-title,
    .rr-group__companies-heading,
    .rr-group__scale-heading {
        font-size: 56px; /* H1 */
    }

    .rr-group__stat-num,
    .rr-group__scale-title {
        font-size: 40px; /* H2 */
    }

    .rr-group__cap-title,
    .rr-group__stat--tier .rr-group__stat-num--tier {
        font-size: 32px; /* H3 */
    }

    .rr-group__intro-text {
        font-size: 24px; /* H4 */
    }

    .rr-group__stat-label {
        font-size: 18px; /* H5 */
    }
}

/* Tablet: collapse the multi-column card grids. The intro and bento stay
   side-by-side here (heading beside text, as in the Medium frame) and only
   shrink — they stack lower down, at the Small frame. */
@media (max-width: 991.98px) {
    .rr-group__caps-grid {
        grid-template-columns: 1fr;
    }

    .rr-group__scale-grid {
        grid-template-columns: 1fr;
    }

    .rr-group__scale-inner {
        padding-block: 72px;
        gap: 48px;
    }

    .rr-group__cap {
        min-height: 0;
    }

    .rr-group__companies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Figma "Small" frame (< 768): smallest type scale, tighter 16px gutter, and
   the intro/bento now stack (heading above text) as the Small frame does. */
@media (max-width: 767.98px) {
    .rr-group {
        --rr-group-gutter: 16px;
    }

    .rr-group__intro-title,
    .rr-group__companies-heading,
    .rr-group__scale-heading {
        font-size: 48px; /* H1 */
    }

    .rr-group__stat-num,
    .rr-group__scale-title {
        font-size: 32px; /* H2 */
    }

    .rr-group__cap-title,
    .rr-group__stat--tier .rr-group__stat-num--tier {
        font-size: 24px; /* H3 */
    }

    .rr-group__intro-text {
        font-size: 18px; /* H4 */
    }

    .rr-group__stat-label {
        font-size: 16px; /* H5 */
    }

    .rr-group__intro-head {
        flex-direction: column;
        gap: 24px;
    }

    .rr-group__bento {
        flex-direction: column;
    }

    .rr-group__bento-media {
        width: 100%;
    }

    .rr-group__bento-media img {
        min-height: 300px;
    }
}

@media (max-width: 575.98px) {
    /* The bento stats stay two-per-row on phones, as in the Small frame
       (19 | 43, 1000+ | Top Tier); only let the cards shrink to their content. */
    .rr-group__stat {
        min-height: 0;
        padding: 16px;
    }

    .rr-group__companies-grid {
        grid-template-columns: 1fr;
    }
}
