/* =========================================
   WDF Footer -lohko (tumma tausta, tehosteväriä yläreunassa)
   ========================================= */

.wdf-footer {
    position: relative;
    overflow: hidden;
    background: var(--wp--preset--color--primary-dark);
    border-top: var(--wp--custom--border--sign) solid var(--wp--preset--color--accent);
    color: var(--wp--preset--color--base);
    font-size: 1rem;
    line-height: 24px;
}

/* Valinnainen symboli kevyenä taustakuviona oikeassa reunassa */
.wdf-footer__taustasymboli {
    position: absolute;
    right: -136px;
    bottom: -160px;
    width: 680px;
    height: 680px;
    color: color-mix(in srgb, var(--wp--preset--color--base) 5%, transparent);
    z-index: 0;
    pointer-events: none;
}

.wdf-footer__sisalto {
    position: relative;
    z-index: 1;
    max-width: var(--wdf-sisalto-max);
    margin: 0 auto;
    padding: 80px var(--wdf-padding-x) 120px;
    box-sizing: border-box;
}

.wdf-footer__sarakkeet {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr 0.9fr 1.2fr;
    gap: 48px;
}

.wdf-footer__sarake {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wdf-footer__logo {
    width: 160px;
    height: auto;
    display: block;
}

/* Sarakeotsikko korostusvärillä, jotta se erottuu tummasta pohjasta */
.wdf-footer__sarake-otsikko {
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--wp--preset--color--highlight);
    margin: 0;
}

/* Puhelinnumerot erottuvat muusta yhteystietotekstistä */
.wdf-footer__vapaa a[href^="tel:"] {
    font-family: var(--wp--preset--font-family--display);
    font-weight: 900;
    font-size: var(--wp--preset--font-size--large);
    font-variant-numeric: tabular-nums;
}

.wdf-footer__vapaa p {
    margin: 0;
}

.wdf-footer a {
    color: var(--wp--preset--color--base);
    text-decoration: none;
}

.wdf-footer a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Somelinkit: ikonit rivissä, 40 px kosketusalue. Negatiivinen marginaali
   tasaa ensimmäisen ikonin logon ja tekstin reunaan. */
.wdf-footer__some {
    list-style: none;
    margin: 0 0 0 -8px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wdf-footer__some a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--wp--custom--radius--round);
    color: inherit;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.wdf-footer__some svg {
    display: block;
    fill: currentColor;
}

.wdf-footer__some a:hover {
    background: var(--wp--custom--overlay--light);
    color: var(--wp--preset--color--highlight);
    text-decoration: none;
}

/* Teeman fokusväri ei erotu tummalta pohjalta: rengas tekstin värillä */
.wdf-footer__some a:focus-visible {
    outline: var(--wp--custom--focus--width) solid currentColor;
    outline-offset: var(--wp--custom--focus--offset);
}

/* Sivut-lista */
.wdf-footer__lista {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Luottamusmerkit: vaaleat pyöristetyt laatat (sama tyyli kuin avainluvuissa) */
.wdf-footer__merkit {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.wdf-footer__merkki {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wp--preset--color--base);
    border-radius: var(--wp--custom--radius--option, 16px);
    padding: 16px;
    min-height: 72px;
    box-sizing: border-box;
}

.wdf-footer__merkki img {
    max-height: 56px;
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Pariton viimeinen merkki levenee koko riville (esim. leveä palkintologo) */
.wdf-footer__merkki:nth-child(odd):last-child {
    grid-column: span 2;
}

.wdf-footer__merkki-teksti {
    grid-column: span 2;
    border: var(--wp--custom--border--hairline) solid color-mix(in srgb, var(--wp--preset--color--base) 25%, transparent);
    padding: 16px 8px;
    text-align: center;
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 700;
    line-height: 16px;
}

/* Alapalkki */
.wdf-footer__alapalkki {
    position: relative;
    z-index: 1;
    border-top: var(--wp--custom--border--hairline) solid color-mix(in srgb, var(--wp--preset--color--base) 15%, transparent);
}

.wdf-footer__alapalkki-sisalto {
    max-width: var(--wdf-sisalto-max);
    margin: 0 auto;
    padding: 24px var(--wdf-padding-x);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 32px;
    font-size: var(--wp--preset--font-size--small);
    flex-wrap: wrap;
}

.wdf-footer__alahuomio {
    margin-right: auto;
}

.wdf-footer__utility {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

/* Tabletti */
@media (max-width: 1024px) {
    .wdf-footer__sisalto {
        padding-top: 64px;
        padding-bottom: 80px;
    }

    .wdf-footer__sarakkeet {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .wdf-footer__taustasymboli {
        width: 480px;
        height: 480px;
        right: -104px;
        bottom: -120px;
    }
}

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

    .wdf-footer__sarakkeet {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .wdf-footer__taustasymboli {
        width: 304px;
        height: 304px;
        right: -72px;
        bottom: -80px;
    }

    .wdf-footer__alapalkki-sisalto {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .wdf-footer__alahuomio {
        margin-right: 0;
    }
}
