/*
 * Digital business cards - /visitkort/<slug>/ and the /visitkort/ index.
 *
 * Everything is scoped under .visitkort. The hugobricks theme styles bare
 * elements globally (h1, p, ul, li, a), so anything this component relies on is
 * reset here rather than inherited.
 */

.visitkort .container {
    max-width: 30rem;
}

/*------------------------*/
/* card shell
/*------------------------*/

.visitkort .vcard {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    padding: 2rem 1.5rem 2.5rem;
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 0.25rem 2rem rgba(38, 50, 56, 0.1);
}

.visitkort .vcard-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.visitkort .vcard-photo {
    position: relative;
    width: 180px;
    height: 180px;
    margin-bottom: 0.75rem;
}

/* Direct child only. The MVP corner badge is an <img> nested inside this same
   wrapper, and it sizes itself from .mvp-corner-badge's width + aspect-ratio -
   a descendant selector here would force it to 180px and stretch the badge. */
.visitkort .vcard-photo > img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.visitkort .vcard-name {
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.visitkort .vcard-function {
    margin: 0;
    padding: 0;
    color: var(--textMedium);
}

.visitkort .vcard-org {
    margin: 0;
    padding: 0;
    font-weight: bold;
    color: var(--accentDarker);
}

/*------------------------*/
/* details list
/*------------------------*/

.visitkort .vcard-details {
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.visitkort .vcard-details li {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--borderLight);
}

.visitkort .vcard-details li:last-child {
    border-bottom: 1px solid var(--borderLight);
}

.visitkort .vcard-details a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.25rem;
    text-decoration: none;
    color: var(--textDark);
}

.visitkort .vcard-details a:hover .vcard-value {
    color: var(--accentDarker);
}

.visitkort .vcard-label {
    color: var(--textMedium);
    font-size: 0.85rem;
    flex: 0 0 auto;
}

.visitkort .vcard-value {
    text-align: right;
    font-weight: bold;
}

/*------------------------*/
/* save button and note
/*------------------------*/

.visitkort .vcard-save {
    width: 100%;
    text-align: center;
    margin: 0;
}

.visitkort .vcard-note {
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--textMedium);
}

/* Reads as one unit with the button it explains, so close the gap there only. */
.visitkort .vcard-save + .vcard-note {
    margin-top: -0.5rem;
}

.visitkort ul.buttons.vcard-links {
    justify-content: center;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

/*------------------------*/
/* QR code
/*------------------------*/

.visitkort .vcard-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--borderLight);
    width: 100%;
}

.visitkort .vcard-qr img {
    width: 160px;
    height: auto;
    image-rendering: pixelated;
}

.visitkort .vcard-qr p {
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
    color: var(--textMedium);
}

.visitkort .vcard-back {
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
}

/*------------------------*/
/* index page
/*------------------------*/

.visitkort .vcard-index {
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* The row itself carries the card, not the link inside it: the download button is
   a sibling of that link and has to sit on the same background. */
.visitkort .vcard-index li {
    list-style: none;
    margin: 0;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.75rem;
    background: var(--light);
}

.visitkort .vcard-index li:hover {
    background: var(--borderLight);
}

.visitkort .vcard-index-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none;
    color: var(--textDark);
}

.visitkort .vcard-index-save {
    flex: 0 0 auto;
}

/* Scoped to the link, not the row. As `.vcard-index img` this ties on specificity
   with the theme's .button.icon img and wins on order, turning the download glyph
   into a 48px round photo. */
.visitkort .vcard-index-link img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.visitkort .vcard-index-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.visitkort .vcard-index .vcard-value,
.visitkort .vcard-index .vcard-label {
    text-align: left;
}
