/* Serden's trust badges: Serden Approved (Pro and Elite companies) and Verified Review (reviews an admin approved).
   Components/Layout/TrustBadge.razor draws them; this file is loaded on every page outside the admin site, so the
   directory, the company profile and the listing preview share one look. Every rule is under .sd-trust. */

.sd-trust {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    font-family: "Poppins", sans-serif;
    letter-spacing: 0;
    text-transform: none;
}

.sd-trust .sd-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border: 1px solid #D5D8D2;
    border-radius: 10px;
    background-color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    color: #1B211E;
}

/* The S stands a little taller than the words, as in the design, without making the pill taller. The owner asked for it
   20% smaller than the first 1.7em, on both badges. */
.sd-trust .sd-s-mark {
    flex: none;
    width: auto;
    height: 1.36em;
    margin: -0.16em 0 -0.12em;
    color: var(--serden-evergreen, #0A372D);
}

.sd-trust .sd-trust-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 24px;
    height: 24px;
    margin: -4px -6px -4px -1px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #6A716D;
    cursor: pointer;
}

.sd-trust .sd-trust-info svg {
    width: 16px;
    height: 16px;
}

.sd-trust .sd-trust-info:hover,
.sd-trust.is-open .sd-trust-info {
    color: var(--serden-evergreen, #0A372D);
}

.sd-trust .sd-trust-info:focus-visible {
    outline: 2px solid var(--serden-evergreen, #0A372D);
    outline-offset: 1px;
}

/* The larger badge over the company name on the profile. */
.sd-trust--lg .sd-trust-badge {
    gap: 7px;
    padding: 5px 12px 5px 10px;
    border-radius: 12px;
    font-size: 15px;
}

/* The explanation: a deep green card under the badge, with an arrow pointing at it. The padding above the card keeps the
   pointer over the badge while it moves down to the card, so a link in it can be reached with a mouse. */
.sd-trust .sd-trust-tip {
    position: absolute;
    top: 100%;
    left: -8px;
    z-index: 1040;
    display: none;
    width: min(340px, calc(100vw - 32px));
    padding-top: 12px;
    text-align: left;
    white-space: normal;
}

.sd-trust:hover .sd-trust-tip,
.sd-trust.is-open .sd-trust-tip {
    display: block;
}

/* Without a mouse a tap leaves :hover behind, so only the info button opens and closes it. */
@media (hover: none) {
    .sd-trust:hover:not(.is-open) .sd-trust-tip {
        display: none;
    }
}

.sd-trust .sd-trust-tip-inner {
    position: relative;
    padding: 18px 20px 16px;
    border-radius: 16px;
    background-color: var(--serden-evergreen, #0A372D);
    box-shadow: 0 18px 40px rgba(16, 35, 27, .24);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
}

.sd-trust .sd-trust-tip-inner::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 22px;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    background-color: inherit;
    transform: rotate(45deg);
}

.sd-trust .sd-trust-tip .sd-trust-title {
    display: block;
    margin: 0 0 2px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
}

.sd-trust .sd-trust-tip p {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .86);
}

.sd-trust .sd-trust-tip ul {
    margin: 0;
    padding: 0 0 0 18px;
    list-style: disc;
}

.sd-trust .sd-trust-tip li {
    margin: 0 0 7px;
    padding: 0;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(255, 255, 255, .86);
}

.sd-trust .sd-trust-tip li::marker {
    color: #fff;
}

.sd-trust .sd-trust-tip li strong {
    display: block;
    font-weight: 600;
    color: #fff;
}

.sd-trust .sd-trust-tip .sd-trust-note {
    margin: 10px 0 0;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .78);
}

.sd-trust .sd-trust-tip a {
    display: inline-block;
    margin-top: 10px;
    font-weight: 600;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sd-trust .sd-trust-tip a:hover,
.sd-trust .sd-trust-tip a:focus-visible {
    color: var(--serden-sage, #E8EEE8);
}

.sd-trust .sd-trust-tip a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.sd-trust .sd-trust-close {
    display: none;
}

/* On phones the badge can sit anywhere across the screen, so the explanation opens as a sheet along the bottom of it
   instead of under the badge, with its own Close button. */
@media (max-width: 575.98px) {
    .sd-trust .sd-trust-tip {
        position: fixed;
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        z-index: 1080;
        width: auto;
        max-height: calc(100vh - 24px);
        padding-top: 0;
        overflow-y: auto;
    }

    .sd-trust .sd-trust-tip-inner::before {
        display: none;
    }

    .sd-trust .sd-trust-close {
        display: block;
        width: 100%;
        min-height: 44px;
        margin-top: 14px;
        border: 1px solid rgba(255, 255, 255, .5);
        border-radius: 999px;
        background: none;
        font-size: 14px;
        font-weight: 600;
        color: #fff;
    }

    .sd-trust .sd-trust-close:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }
}
