/* Single employee page (CPT tyontekija), GP Element "Työntekijä: yksittäissivu".
   Layout widths and spacing are GB attributes; this file covers what they cannot:
   sticky sidebar, portrait ratio, contact rows, quote visibility, lead paragraph. */
@media only screen and (min-width: 320px) {
    /* The GP content template has no .entry-content wrapper, so GP's own full-width rule
       does not reach the color sections */
    .single-tyontekija .dynamic-content-template > .alignfull {
        margin-left: calc(-100vw / 2 + 100% / 2);
        margin-right: calc(-100vw / 2 + 100% / 2);
        max-width: 100vw;
        width: auto;
    }

    .tyontekija-kuva img {
        width: 100%;
        aspect-ratio: 3 / 4;
        object-fit: cover;
        border-radius: 18px;
        display: block;
    }

    .tyontekija-paluu,
    .tyontekija-yhteys {
        display: flex;
        align-items: center;
        margin-bottom: 0;
    }

    .tyontekija-paluu a,
    .tyontekija-yhteys a {
        text-decoration: none;
        font-weight: 600;
        overflow-wrap: anywhere;
    }

    .tyontekija-paluu { font-size: 14px; }
    .tyontekija-yhteys { font-size: 15px; }

    /* GB sets fill: currentColor on icons, stroke icons need none */
    .tyontekija-paluu .gb-icon svg,
    .tyontekija-yhteys.viivaikoni .gb-icon svg {
        fill: none;
    }

    .tyontekija-paluu .gb-icon,
    .tyontekija-yhteys .gb-icon {
        flex: 0 0 auto;
        margin-right: 12px;
        line-height: 0;
    }

    /* Lead paragraph (ACF ingress) */
    .tyontekija-ingressi {
        font-size: 1.25rem;
        line-height: 1.55;
        font-weight: 500;
        max-width: 68ch;
    }

    .tyontekija-bio .dynamic-entry-content p {
        max-width: 68ch;
    }

    /* Quote (ACF quote): hide the whole block when the field is empty */
    .tyontekija-lainaus:not(:has(.tyontekija-lainaus-teksti)) {
        display: none;
    }

    .tyontekija-lainaus-teksti {
        font-size: 1.1rem;
        font-weight: 500;
        margin-bottom: 0;
    }

    .tyontekija-lainaus-teksti p:last-child {
        margin-bottom: 0;
    }

    /* query-loop-block.css forces a 300px image height and bottom padding on loop items */
    .gb-query-loop-item .tyontekija-kortti .gb-block-image img {
        height: auto;
        padding-bottom: 0;
    }

    .gb-query-loop-item:has(.tyontekija-kortti) {
        padding-bottom: 0;
    }

    .tyontekija-kortti img {
        width: 100%;
        aspect-ratio: 3 / 4;
        object-fit: cover;
        border-radius: 18px;
        display: block;
        transition: transform 1.2s var(--transition-timing-function);
    }

    .tyontekija-kortti .gb-block-image {
        overflow: hidden;
        border-radius: 18px;
        margin-bottom: 14px;
    }

    .tyontekija-kortti:hover img {
        transform: scale(1.04);
    }

    .tyontekija-kortti a {
        text-decoration: none;
    }

    .tyontekija-kortti h2 {
        margin-top: 0;
    }

    /* Long addresses must wrap in the two-column mobile grid */
    .tyontekija-kortti-email {
        overflow-wrap: anywhere;
    }

    @media (max-width: 767px) {
        .tyontekija-kortti-email.gb-headline {
            font-size: 12px;
        }
    }
}

@media only screen and (min-width: 768px) {
    .site .tyontekija-sivupalkki {
        position: sticky;
        top: 120px;
    }
}
