/* ==========================================================================
   /services/residential-property-valuation, unit types (2026-11-11): one section
   instead of the numbered "What We Value" cells plus the plain text tabs. Three
   icon tabs (apartment, villa, office unit) choose a panel: photo beside method
   and turnaround, the value factors as a ticked list and the documents as file
   chips. Prefix .rpu-. Built as a 'raw' block of includes/frv-service-page.php.
   ========================================================================== */

.rpu {
    --rpu-brand: #0b2dbe;
    --rpu-ink: #0b1533;
    --rpu-body: #5b6478;
    --rpu-muted: #8a93a6;
    --rpu-line: #e3e8f2;
}

.rpu-head {
    display: grid;
    gap: 16px 64px;
    align-items: end;
    margin-bottom: clamp(28px, 3vw, 40px);
}

@media (min-width: 1024px) {
    .rpu-head {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    }
}

.rpu-h2 {
    margin: 0;
    font-size: clamp(28px, 2.7vw, 42px);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -.025em;
    color: var(--rpu-ink);
    text-wrap: balance;
}

.rpu-lead {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--rpu-body);
}

/* ---- the three tabs: icon, unit type and one line */
.rpu-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 24px;
}

.rpu-tab {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 2px 16px;
    align-items: center;
    padding: 20px 22px;
    border: 1px solid var(--rpu-line);
    background: rgba(255, 255, 255, .55);
    color: var(--rpu-ink);
    text-align: left;
    cursor: pointer;
    transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.rpu-tab::before {
    content: "";
    position: absolute;
    left: -1px;
    right: -1px;
    top: -1px;
    height: 2px;
    background: var(--rpu-brand);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .45s cubic-bezier(.22, .61, .36, 1);
}

.rpu-tab:hover {
    background: #fff;
}

.rpu-tab[aria-selected="true"] {
    border-color: #d5ddef;
    background: #fff;
    box-shadow: 0 22px 44px -32px rgba(10, 33, 82, .4);
}

.rpu-tab[aria-selected="true"]::before {
    transform: scaleX(1);
}

.rpu-tab:focus-visible {
    outline: 2px solid var(--rpu-brand);
    outline-offset: 2px;
}

.rpu-tab__ico {
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--rpu-muted);
    transition: color .3s ease;
}

.rpu-tab__ico svg {
    width: 32px;
    height: 32px;
}

.rpu-tab[aria-selected="true"] .rpu-tab__ico,
.rpu-tab:hover .rpu-tab__ico {
    color: var(--rpu-brand);
}

.rpu-tab__name {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.rpu-tab__line {
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--rpu-body);
}

/* ---- the panel */
.rpu-panel {
    display: grid;
    gap: 28px;
    padding: clamp(20px, 2.4vw, 32px);
    border: 1px solid var(--rpu-line);
    background: #fff;
}

.rpu-panel[hidden] {
    display: none;
}

.rpu-panel.is-enter {
    animation: rpuIn .45s ease both;
}

@keyframes rpuIn {
    from { opacity: 0; transform: translate3d(0, 8px, 0); }
    to { opacity: 1; transform: none; }
}

@media (min-width: 1024px) {
    .rpu-panel {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        gap: 44px;
        align-items: stretch;
    }
}

.rpu-panel__media {
    position: relative;
    min-height: 260px;
    margin: 0;
    overflow: hidden;
}

.rpu-panel__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rpu-facts {
    display: grid;
    gap: 12px;
    margin: 0 0 26px;
}

@media (min-width: 640px) {
    .rpu-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.rpu-fact {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 4px 12px;
    margin: 0;
    padding: 16px 18px;
    border: 1px solid var(--rpu-line);
    background: #f7f9fc;
}

.rpu-fact svg {
    grid-row: 1 / 3;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    color: var(--rpu-brand);
}

.rpu-fact dt {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--rpu-ink);
}

.rpu-fact dd {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--rpu-body);
}

.rpu-label {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--rpu-ink);
}

.rpu-label::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--rpu-line);
}

.rpu-factors {
    display: grid;
    gap: 10px 24px;
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
}

@media (min-width: 640px) {
    .rpu-factors {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.rpu-factors li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14.5px;
    line-height: 1.45;
    color: var(--rpu-ink);
}

.rpu-factors svg {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--rpu-brand);
}

.rpu-docs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rpu-docs li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid #d5ddef;
    border-radius: 999px;
    background: #fff;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--rpu-ink);
}

.rpu-docs svg {
    flex: none;
    width: 16px;
    height: 16px;
    color: var(--rpu-brand);
}

.rpu-docs small {
    font-size: 12px;
    font-weight: 400;
    color: var(--rpu-muted);
}

/* ---- phones: the tabs become a compact three-up switch, icon over name */
@media (max-width: 767px) {
    .rpu-tabs {
        gap: 8px;
    }

    .rpu-tab {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 6px;
        padding: 14px 8px;
        text-align: center;
    }

    .rpu-tab__ico {
        grid-row: auto;
        width: 30px;
        height: 30px;
    }

    .rpu-tab__ico svg {
        width: 26px;
        height: 26px;
    }

    .rpu-tab__name {
        font-size: 14.5px;
    }

    .rpu-tab__line {
        display: none;
    }

    .rpu-panel__media {
        min-height: 0;
        aspect-ratio: 16 / 10;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rpu-tab,
    .rpu-tab::before,
    .rpu-tab__ico {
        transition: none;
    }

    .rpu-panel.is-enter {
        animation: none;
    }
}

/* spacing that the shared frv list and paragraph rules would otherwise reset */
.rpu .rpu-panel__body .rpu-factors {
    margin: 0 0 26px;
}

.rpu .rpu-panel__body .rpu-label {
    margin: 0 0 14px;
}

.rpu .rpu-panel__body .rpu-facts {
    margin: 0 0 28px;
}

/* both fact tiles share a height; keep each one's text at the top */
.rpu .rpu-fact {
    align-content: start;
}

/* the tab row follows the number of unit types (two since 2026-11-11: apartment, villa) */
.rpu-tabs {
    grid-template-columns: repeat(var(--rpu-n, 3), minmax(0, 1fr));
}
