/*
 * RapidRank Systems
 * Site-wide visual refinements
 *
 * Governs:
 * - Rounded eyebrow/chapter labels across every public page
 * - Search Experience Asset hierarchy diagram
 * - Responsive hierarchy behavior
 */

/* =========================================================
   GOVERNED ROUNDED LABELS
   ========================================================= */

.rr-overline {
    width: fit-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 var(--rr-space-4);
    padding: 0.48rem 0.85rem;
    border: 1px solid rgba(24, 189, 242, 0.5);
    border-radius: var(--rr-radius-pill);
    color: var(--rr-color-blue-700);
    background:
        linear-gradient(
            135deg,
            rgba(18, 63, 196, 0.055),
            rgba(24, 189, 242, 0.1)
        );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 5px 16px rgba(18, 63, 196, 0.06);
    font-size: var(--rr-font-size-xs);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: 0.085em;
    text-transform: uppercase;
}

.rr-overline--inverse {
    border-color: rgba(118, 221, 255, 0.55);
    color: var(--rr-color-cyan-300);
    background:
        linear-gradient(
            135deg,
            rgba(118, 221, 255, 0.11),
            rgba(255, 255, 255, 0.055)
        );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 6px 20px rgba(0, 0, 0, 0.08);
}

/*
 * Keep the labels readable when they contain longer platform names.
 */
.rr-hero .rr-overline,
.rr-ka-hero .rr-overline,
.rr-hub-hero .rr-overline,
.rr-pillar-hero .rr-overline {
    white-space: normal;
    text-align: center;
}

/*
 * Chapter labels receive consistent spacing on every page type.
 */
.rr-chapter-heading .rr-overline,
.rr-ka-chapter__heading .rr-overline,
.rr-section-heading .rr-overline {
    margin-bottom: var(--rr-space-4);
}


/* =========================================================
   SEARCH EXPERIENCE ASSET HIERARCHY DIAGRAM
   ========================================================= */

.rr-sea-layout {
    align-items: start;
}

.rr-sea-tree {
    position: relative;
    overflow: hidden;
    padding: clamp(1.25rem, 2.5vw, 2rem);
}

.rr-sea-node {
    width: 100%;
    min-width: 0;
    height: auto;
    display: block;
    padding: var(--rr-space-5);
    overflow: hidden;
}

.rr-sea-node span,
.rr-sea-node strong,
.rr-sea-node small {
    overflow-wrap: anywhere;
    word-break: normal;
}

.rr-sea-node span {
    line-height: 1.35;
}

.rr-sea-node strong {
    line-height: 1.35;
}

.rr-sea-node--primary {
    width: min(100%, 560px);
    min-height: 136px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/*
 * Main three-column supporting layer.
 * align-items:start prevents empty supporting cards from stretching
 * to the height of the nested A1/A2 branch.
 */
.rr-tree-branch--three {
    position: relative;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.75rem, 2vw, 1.5rem);
    align-items: start;
    margin-top: 3.2rem;
}

/*
 * Vertical connector from primary SEA.
 */
.rr-tree-branch--three::before {
    top: -3.2rem;
    left: 50%;
    width: 2px;
    height: 1.8rem;
    background: rgba(24, 189, 242, 0.36);
}

/*
 * Horizontal connector joining the three supporting SEAs.
 */
.rr-tree-branch--three::after {
    position: absolute;
    top: -1.4rem;
    left: 16.666%;
    width: 66.668%;
    height: 2px;
    background: rgba(24, 189, 242, 0.36);
    content: "";
}

/*
 * Individual vertical drops from the horizontal connector.
 */
.rr-tree-branch--three > div,
.rr-tree-branch--three > .rr-sea-node {
    position: relative;
    min-width: 0;
}

.rr-tree-branch--three > div::before,
.rr-tree-branch--three > .rr-sea-node::before {
    position: absolute;
    top: -1.4rem;
    left: 50%;
    width: 2px;
    height: 1.4rem;
    background: rgba(24, 189, 242, 0.36);
    content: "";
}

.rr-tree-branch--three > div {
    display: grid;
    align-content: start;
}

.rr-tree-branch--three > div > .rr-sea-node,
.rr-tree-branch--three > .rr-sea-node {
    min-height: 132px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/*
 * Nested supporting-supporting layer beneath Related Intent A.
 */
.rr-tree-branch--two {
    position: relative;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    align-items: start;
    margin-top: 2.5rem;
}

.rr-tree-branch--two::before {
    top: -2.5rem;
    left: 50%;
    width: 2px;
    height: 1.25rem;
    background: rgba(24, 189, 242, 0.32);
}

.rr-tree-branch--two::after {
    position: absolute;
    top: -1.25rem;
    left: 25%;
    width: 50%;
    height: 2px;
    background: rgba(24, 189, 242, 0.32);
    content: "";
}

.rr-tree-branch--two > .rr-sea-node {
    position: relative;
    min-width: 0;
    min-height: 132px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.7rem;
}

.rr-tree-branch--two > .rr-sea-node::before {
    position: absolute;
    top: -1.25rem;
    left: 50%;
    width: 2px;
    height: 1.25rem;
    background: rgba(24, 189, 242, 0.32);
    content: "";
}

.rr-sea-node--child span {
    font-size: clamp(0.64rem, 0.9vw, 0.75rem);
    letter-spacing: 0.045em;
}

.rr-sea-node--child strong {
    margin-top: 0.55rem;
    font-size: 0.9rem;
}

/*
 * Keep all right-side capability cards aligned from the top.
 */
.rr-sea-capabilities {
    align-content: start;
}

.rr-sea-capabilities article {
    min-height: 156px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {
    .rr-tree-branch--three {
        grid-template-columns: 1fr;
        gap: var(--rr-space-4);
        margin-top: var(--rr-space-8);
    }

    .rr-tree-branch--three::before {
        top: calc(var(--rr-space-8) * -1);
        left: 2rem;
        height: var(--rr-space-8);
    }

    .rr-tree-branch--three::after {
        display: none;
    }

    .rr-tree-branch--three > div::before,
    .rr-tree-branch--three > .rr-sea-node::before {
        display: none;
    }

    .rr-tree-branch--three > div {
        gap: var(--rr-space-4);
    }

    .rr-tree-branch--three > div > .rr-sea-node,
    .rr-tree-branch--three > .rr-sea-node {
        min-height: 112px;
    }

    .rr-tree-branch--two {
        margin-top: var(--rr-space-4);
    }

    .rr-tree-branch--two::before,
    .rr-tree-branch--two::after,
    .rr-tree-branch--two > .rr-sea-node::before {
        display: none;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {
    .rr-overline {
        width: fit-content;
        max-width: 100%;
        padding: 0.42rem 0.7rem;
        font-size: 0.7rem;
        line-height: 1.35;
    }

    .rr-hero .rr-overline,
    .rr-ka-hero .rr-overline,
    .rr-hub-hero .rr-overline,
    .rr-pillar-hero .rr-overline {
        width: 100%;
    }

    .rr-sea-tree {
        padding: var(--rr-space-4);
    }

    .rr-sea-node--primary {
        min-height: 122px;
    }

    .rr-tree-branch--two {
        grid-template-columns: 1fr;
    }

    .rr-tree-branch--two > .rr-sea-node {
        min-height: 108px;
    }

    .rr-sea-capabilities article {
        min-height: auto;
    }
}
