/*
 * VCard — previous card size; short About preview; location meta + inline fields
 */

.vcardContent {
    --vcard-preview-lines: 5;
    background-color: var(--background-color-main);
    width: min(500px, calc(100vw - 24px)) !important;
    max-width: 100%;
}

.vcardHeader {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 1%, rgba(0, 0, 0, 0.38) 100%);
    background-size: cover;
    background-position: center;
    height: 84px !important;
}

.vcardHeader .headerContent {
    display: flex;
    align-items: center;
    height: 100%;
    min-width: 0;
}

.vcardHeader .displayName {
    padding-top: 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vcardHeader .title {
    font-size: 16px;
    line-height: 1.2;
    margin-top: 2px;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vcardHeader .imageWrapper {
    margin: 8px;
    margin-right: 16px;
    padding: 2px;
    flex-shrink: 0;
}

.vcardHeader .vcard-id {
    min-width: 0;
    flex: 1 1 auto;
    padding-right: 8px;
}

.vcardBody {
    padding: 6px;
    border-top: 1px solid var(--background3);
    max-height: min(220px, 28vh);
    overflow: auto;
}

.vcardFooter {
    border-top: 1px solid var(--background3);
    background-color: var(--background-color-page);
    min-height: 55px;
    line-height: 40px;
    padding-left: 6px;
    padding-right: 6px;
}

.vcardFooter .float-end {
    float: right !important;
}

.vcardPopover {
    max-width: min(700px, calc(100vw - 16px));
    background-color: var(--background-color-page);
    padding: 0 !important;
}

.vcardPopover .popover-body {
    padding: 0 !important;
}

.vcard-fields .vcard-field {
    padding: 0;
    margin: 0 0 4px;
}

.vcard-fields .vcard-field:last-child {
    margin-bottom: 0;
}

.vcard-fields .vcard-field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color-soft, #7a7a7a);
}

.vcard-fields .vcard-field--meta {
    font-size: 13px;
    line-height: 1.35;
    color: var(--text-color-secondary, #999);
    margin-bottom: 6px;
}

.vcard-fields .vcard-field--inline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 6px;
    margin-bottom: 2px;
}

.vcard-fields .vcard-field--inline .vcard-field-label::after {
    content: ':';
}

.vcard-fields .vcard-field--inline .vcard-field-value {
    font-size: 14px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.vcard-fields .vcard-field--long .vcard-field-label {
    margin-bottom: 2px;
}

.vcard-fields .vcard-field--long .vcard-field-value {
    font-size: 14px;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--vcard-preview-lines, 5);
    line-clamp: var(--vcard-preview-lines, 5);
    overflow: hidden;
}

/*
 * Rich (markdown) field: keep the author's formatting.
 * line-clamp is unreliable with block children (<p>), so clamp by height
 * and fade the cut instead.
 */
.vcard-fields .vcard-field--rich .vcard-field-value {
    display: block;
    font-size: 14px;
    line-height: 1.4;
    max-height: calc(var(--vcard-preview-lines, 5) * 1.4em);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 68%, transparent 100%);
}

.vcard-fields .vcard-field--rich .vcard-field-value > :first-child {
    margin-top: 0 !important;
}

.vcard-fields .vcard-field--rich .vcard-field-value p,
.vcard-fields .vcard-field--rich .vcard-field-value ul,
.vcard-fields .vcard-field--rich .vcard-field-value ol,
.vcard-fields .vcard-field--rich .vcard-field-value blockquote,
.vcard-fields .vcard-field--rich .vcard-field-value pre {
    margin: 0 0 6px;
}

.vcard-fields .vcard-field--rich .vcard-field-value ul,
.vcard-fields .vcard-field--rich .vcard-field-value ol {
    padding-left: 18px;
}

.vcard-fields .vcard-field--rich .vcard-field-value h1,
.vcard-fields .vcard-field--rich .vcard-field-value h2,
.vcard-fields .vcard-field--rich .vcard-field-value h3,
.vcard-fields .vcard-field--rich .vcard-field-value h4,
.vcard-fields .vcard-field--rich .vcard-field-value h5,
.vcard-fields .vcard-field--rich .vcard-field-value h6 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 4px;
}

.vcard-fields .vcard-field--rich .vcard-field-value img {
    max-width: 100%;
    height: auto;
}

/* Embeds/attachments would blow up a hover card */
.vcard-fields .vcard-field--rich .vcard-field-value iframe,
.vcard-fields .vcard-field--rich .vcard-field-value video,
.vcard-fields .vcard-field--rich .vcard-field-value .oembed_snippet,
.vcard-fields .vcard-field--rich .vcard-field-value table {
    display: none;
}

.vcard-preview--twig {
    font-size: 14px;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--vcard-preview-lines, 5);
    line-clamp: var(--vcard-preview-lines, 5);
    overflow: hidden;
}

.vcard-empty {
    color: var(--text-color-soft, #7a7a7a);
    font-size: 13px;
    padding: 4px 2px;
}

@media (max-width: 576px) {
    .vcardHeader .displayName {
        font-size: 18px;
    }

    .vcardHeader .title {
        font-size: 14px;
    }
}
