/* =========================================
   Yhteyshenkilö — otsikko + keskitetty henkilökortti
   Kortin tyylit käytössä myös lomakelohkossa (wdf_yhteyshenkilo_kortti)
   ========================================= */

.wdf-yhteyshenkilo {
    /* Täysleveä vaalea tausta; kortti erottuu varjolla */
    margin-inline: calc(50% - 50vw);
    background: var(--wp--preset--color--base);
    color: var(--wp--preset--color--contrast);
}

.wdf-yhteyshenkilo__sisalto {
    max-width: var(--wdf-sisalto-max);
    margin: 0 auto;
    padding: 80px var(--wdf-padding-x);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Otsikko on rakenteessa H2, mutta yksittäisen kortin yllä H2-koko on liian
   raskas: koko, riviväli ja koristeviivan mitat H3:n mukaan */
.wdf-yhteyshenkilo__otsikko {
    margin: 0 0 40px;
    text-align: center;
    font-size: var(--wp--preset--font-size--x-large);
    line-height: round(up, 1.2em, 4px);
}

.wdf-yhteyshenkilo__otsikko::after {
    width: 120px;
    margin-top: 12px;
}

/* Kortti: suorat kulmat, kevyt varjo */
.wdf-yhteyshenkilo__kortti {
    /* Teksti, henkilörengas ja ikonit samaa sävyä */
    --yh-musta: var(--wp--preset--color--contrast);
    color: var(--yh-musta);
    /* Valinnaisen koristesymbolin sijoitus ja rajaus */
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 360px;
    padding: 48px 32px;
    box-sizing: border-box;
    background: var(--wp--preset--color--base);
    box-shadow: 0 12px 32px color-mix(in srgb, var(--wp--preset--color--contrast) 18%, transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Valinnainen koristesymboli kortin yläreunan taustalla: näkyy alapuoliskoltaan
   henkilöikonin takana (wdf_koristesymbolit-asetus) */
.wdf-yhteyshenkilo__symboli {
    position: absolute;
    top: -136px;
    left: 50%;
    width: 216px;
    height: 216px;
    transform: translateX(-50%);
    color: var(--wp--preset--color--surface);
    pointer-events: none;
}

.wdf-yhteyshenkilo__avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border: 3px solid var(--yh-musta);
    border-radius: 50%;
    /* Läpinäkyvä, jotta koristesymboli näkyy renkaan läpi */
    background: transparent;
    color: var(--yh-musta);
}

.wdf-yhteyshenkilo__avatar svg {
    width: 40px;
    height: 40px;
}

/* position: relative nostaa tekstit koristesymbolin päälle */
.wdf-yhteyshenkilo__nimi {
    position: relative;
    margin: 20px 0 0;
    font-family: var(--wp--preset--font-family--display);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: round(up, 1.2em, 4px);
}

.wdf-yhteyshenkilo__titteli {
    position: relative;
    margin: 4px 0 0;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 500;
    color: var(--wp--preset--color--neutral-700);
}

.wdf-yhteyshenkilo__tiedot {
    position: relative;
    list-style: none;
    margin: 32px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
    text-align: left;
}

.wdf-yhteyshenkilo__tiedot a {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 44px; /* kosketuskohteen vähimmäiskoko (WCAG) */
    color: var(--yh-musta);
    font-weight: 500;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.wdf-yhteyshenkilo__tiedot a:hover {
    color: var(--wp--preset--color--primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.wdf-yhteyshenkilo__tiedot a:focus-visible {
    outline: var(--wp--custom--focus--width) solid var(--wp--custom--focus--color);
    outline-offset: var(--wp--custom--focus--offset);
}

/* Pyöreä korostusvärinen ikonimerkki */
.wdf-yhteyshenkilo__ikoni {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--wp--preset--color--highlight);
    color: var(--yh-musta);
}

.wdf-yhteyshenkilo__ikoni svg {
    width: 20px;
    height: 20px;
}

/* Numero samalla painolla kuin sähköpostiosoite */
.wdf-yhteyshenkilo__numero {
    font-variant-numeric: tabular-nums;
}

/* Sähköpostiosoitteen verkkotunnus pysyy yhtenä palana (katko vain @-merkin jälkeen) */
.wdf-yhteyshenkilo__verkkotunnus {
    white-space: nowrap;
}

/* Mobiili */
@media (max-width: 767px) {
    .wdf-yhteyshenkilo__sisalto {
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .wdf-yhteyshenkilo__otsikko {
        margin-bottom: 32px;
    }

    .wdf-yhteyshenkilo__kortti {
        padding: 40px 24px;
    }
}
