/*
 * The agency page header (/rental/{country}-{code}): a light topographic
 * card with the agency pinned on its base, in place of the old solid green
 * band. Identity on the left, the contour lines and the pin on the right,
 * and the agency's key facts as pills under its name.
 */

.r2e-rental-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 20rem;
    /* The fixed navbar overlaps the top of main by about 27px: the extra
       space-8 on top keeps the avatar's ring out from under it. */
    padding-top: calc(var(--r2e-space-16) + var(--r2e-space-8));
    padding-bottom: var(--r2e-space-16);
    background: var(--r2e-primary-100);
    border-bottom: 1px solid var(--r2e-primary-200);
}

/* The backdrop covers the header and carries the fade, so it follows the
   screen and not the drawing: nothing on the left, a trace (15 %) at the
   middle, full strength from three quarters, so the agency's name and facts
   read clearly (Victor, 2026-11-10). */
.r2e-rental-hero__backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to right, transparent 15%, rgba(0, 0, 0, .15) 50%, rgb(0, 0, 0) 75%);
    mask-image: linear-gradient(to right, transparent 15%, rgba(0, 0, 0, .15) 50%, rgb(0, 0, 0) 75%);
}

/* The map keeps the drawing's own proportions (2400 x 400), so the pin,
   placed in percentages of the same box, always lands on its main summit.
   Six times as wide as it is tall, it covers the header up to about 2000px. */
.r2e-rental-hero__map {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    aspect-ratio: 2400 / 400;
}

/* The contour lines: public/img/topo/agency-topo.svg (black strokes) as a
   mask, painted with the palette. */
.r2e-rental-hero__lines {
    position: absolute;
    inset: 0;
    background: var(--bs-primary);
    opacity: .5;
    -webkit-mask: url("../../img/topo/agency-topo.svg?v=2") center / 100% 100% no-repeat;
    mask: url("../../img/topo/agency-topo.svg?v=2") center / 100% 100% no-repeat;
}

.r2e-rental-hero__map svg {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

/* The phone's portrait drawing (800 x 900), shown under 768px only. */
.r2e-rental-hero__map--phone {
    display: none;
    left: 0;
    right: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 800 / 900;
}

.r2e-rental-hero__map--phone .r2e-rental-hero__lines {
    -webkit-mask-image: url("../../img/topo/agency-topo-phone.svg?v=1");
    mask-image: url("../../img/topo/agency-topo-phone.svg?v=1");
}

.r2e-rental-hero__map--phone .r2e-rental-hero__pin {
    left: 76.25%;
    top: 34.89%;
}

.r2e-rental-hero__trail {
    stroke: var(--bs-danger);
}

.r2e-rental-hero__pin {
    position: absolute;
    left: 86.5%;
    top: 60%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--bs-danger);
    border: 4px solid var(--bs-white);
    box-sizing: border-box;
}

.r2e-rental-hero__pin::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--bs-danger);
    animation: r2e-rental-ping 2.4s ease-out infinite;
}

@keyframes r2e-rental-ping {
    0% { transform: scale(1); opacity: .9; }
    100% { transform: scale(2.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .r2e-rental-hero__pin::after {
        animation: none;
        opacity: 0;
    }
}

.r2e-rental-hero__identity {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--r2e-space-8);
}

.r2e-rental-hero__avatar {
    position: relative;
    flex: none;
    width: 150px;
    height: 150px;
}

/* The dashed ring around the photograph. */
.r2e-rental-hero__avatar::before {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1.5px dashed var(--bs-primary);
}

.r2e-rental-hero__avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--bs-white);
    box-shadow: var(--r2e-shadow-hover);
}

.r2e-rental-hero__verified {
    position: absolute;
    right: -6px;
    bottom: 8px;
    padding: var(--r2e-space-1) var(--r2e-space-2);
    border-radius: var(--r2e-radius-pill);
    background: var(--bs-danger);
    color: var(--bs-white);
    font-size: var(--r2e-text-xs);
    font-weight: 700;
    letter-spacing: var(--r2e-tracking-caps);
    line-height: 1.2;
    white-space: nowrap;
}

.r2e-rental-hero__text {
    display: flex;
    flex-direction: column;
    gap: var(--r2e-space-4);
    min-width: 0;
}

.r2e-rental-hero__heading {
    display: flex;
    flex-direction: column;
    gap: var(--r2e-space-3);
}

.r2e-rental-hero__kicker {
    margin: 0;
    font-size: var(--r2e-text-xs);
    font-weight: 600;
    letter-spacing: var(--r2e-tracking-cta);
    text-transform: uppercase;
    color: var(--r2e-primary-700);
}

.r2e-rental-hero__name {
    margin: 0;
    font-size: var(--r2e-text-4xl);
    font-weight: 700;
    line-height: 1;
    color: var(--bs-secondary);
}

.r2e-rental-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--r2e-space-2) var(--r2e-space-4);
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--r2e-text-lg);
    color: var(--r2e-ink-secondary);
}

.r2e-rental-hero__meta li {
    display: inline-flex;
    align-items: center;
    gap: var(--r2e-space-2);
}

/* The dot between two facts. */
.r2e-rental-hero__meta li + li::before {
    content: "";
    width: 4px;
    height: 4px;
    margin-right: var(--r2e-space-2);
    border-radius: 50%;
    background: var(--bs-primary);
}

.r2e-rental-hero__meta i {
    color: var(--bs-danger);
}

.r2e-rental-hero__rating {
    color: inherit;
    text-decoration: none;
}

.r2e-rental-hero__rating:hover,
.r2e-rental-hero__rating:focus-visible {
    color: var(--bs-secondary);
    text-decoration: underline;
}

.r2e-rental-hero__rating strong {
    color: var(--bs-secondary);
}

.r2e-rental-hero__pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--r2e-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.r2e-rental-hero__pills li {
    display: inline-flex;
    align-items: center;
    gap: var(--r2e-space-2);
    padding: var(--r2e-space-1) var(--r2e-space-3);
    border: 1.5px solid var(--bs-primary);
    border-radius: var(--r2e-radius-pill);
    font-size: var(--r2e-text-sm);
    font-weight: 600;
    color: var(--r2e-primary-800);
    white-space: nowrap;
}

/* Under 1100px the identity block needs the room: the map steps back. */
@media (max-width: 1099.98px) {
    .r2e-rental-hero__map {
        right: -25%;
        opacity: .6;
    }
}

/* Phone (the mL5 mockup): one column, no fixed height. The wide drawing
   gives way to the portrait one, the full width of the screen and taller
   than the header, its summit and pin in the top right beside the avatar.
   The same fade runs from the bottom left corner, where the text sits, up
   to the top right. */
@media (max-width: 767.98px) {
    .r2e-rental-hero {
        min-height: 0;
        padding-top: calc(var(--r2e-space-6) + var(--r2e-space-8));
        padding-bottom: var(--r2e-space-6);
    }

    .r2e-rental-hero__backdrop {
        -webkit-mask-image: linear-gradient(to top right, transparent 15%, rgba(0, 0, 0, .15) 45%, rgb(0, 0, 0) 62%);
        mask-image: linear-gradient(to top right, transparent 15%, rgba(0, 0, 0, .15) 45%, rgb(0, 0, 0) 62%);
    }

    .r2e-rental-hero__map {
        display: none;
    }

    .r2e-rental-hero__map.r2e-rental-hero__map--phone {
        display: block;
        right: auto;
        opacity: 1;
    }

    .r2e-rental-hero__pin {
        width: 16px;
        height: 16px;
        border-width: 3px;
    }

    .r2e-rental-hero__identity {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--r2e-space-4);
    }

    .r2e-rental-hero__text {
        gap: var(--r2e-space-4);
    }

    .r2e-rental-hero__heading {
        gap: var(--r2e-space-2);
    }

    .r2e-rental-hero__avatar {
        width: 96px;
        height: 96px;
    }

    .r2e-rental-hero__avatar::before {
        inset: -7px;
    }

    .r2e-rental-hero__avatar .avatar-img {
        border-width: 3px;
    }

    .r2e-rental-hero__verified {
        right: -14px;
        bottom: 2px;
    }

    .r2e-rental-hero__name {
        line-height: 1.05;
    }

    /* Two fixed lines: where and what, then the rating on its own, so no
       dot is left hanging at the end of a line. */
    .r2e-rental-hero__meta {
        gap: var(--r2e-space-1) var(--r2e-space-2);
        font-size: var(--r2e-text-sm);
    }

    .r2e-rental-hero__meta li + li::before {
        width: 3px;
        height: 3px;
        margin-right: 0;
    }

    .r2e-rental-hero__meta .r2e-rental-hero__meta-rating {
        flex-basis: 100%;
    }

    .r2e-rental-hero__meta .r2e-rental-hero__meta-rating::before {
        display: none;
    }

    .r2e-rental-hero__pills li {
        font-size: var(--r2e-text-xs);
    }
}
