.main-content .entry-content > *:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.is-style-wide):not(.wp-block-heading:has(+ .alignwide)) {
    max-width: var(--wp--style--global--content-size);
    width: calc(100% - 50px);
    margin-left: auto;
    margin-right: auto;
}

/* Sivun reunaväli on kaikilla sivutyypeillä 25px (= yllä oleva calc(100% - 50px)).
   Kontillisissa pohjissa (single, 404, sivupohjat) reunavälin antaa kontti, joten
   sisältö täyttää sen eikä saa toista 25px:ää päälle. */
@media (max-width: 991px) {
    .main-content > .container {
        max-width: none;
        padding-left: 25px;
        padding-right: 25px;
    }
}

/* Sama :not-lista kuin yllä, jotta spesifisyys pysyy ylemmän säännön yläpuolella. */
.main-content .container .entry-content > *:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.is-style-wide):not(.wp-block-heading:has(+ .alignwide)) {
    width: 100%;
}

/* Korttiruudukko (digitaali_create_grid, Toimipisteet): sarakkeiden välistys
   ulkoreunoilta pois, jotta korttien reunat ovat otsikon linjassa. */
.row.dg-grid {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.alignwide .container {
    max-width: 100%;
    padding-right: 0;
    padding-left: 0;
}

.alignwide .alignwide {
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;  
}

.alignfull {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.alignwide {
    width: calc(100% - 50px);
	max-width: calc(var(--wp--style--global--wide-size));
    margin-left: auto;
    margin-right: auto;
}
/* PKS (18.11.2026): one 50 px content line on desktop. Full-width constrained groups give their content
   25 px padding + 25 px inset = 50 px; wide blocks outside them (footer, Tarinoita työmailta, Uutiset,
   archive titles) only had the 25 px inset. Same for section headings above a wide block. */
@media (min-width: 992px) {
    .alignwide,
    .main-content .entry-content > .wp-block-heading:has(+ .alignwide) {
        width: calc(100% - 100px);
    }
    .wp-block-group.alignfull.is-layout-constrained > .alignwide,
    .wp-block-group.alignfull.is-layout-constrained > .wp-block-heading:has(+ .alignwide) {
        width: calc(100% - 50px);
    }
}

/* Constrained-layoutin alignwide-ryhmä (CTA, Intro, Yhteydenottolomake) saa corelta
   has-global-padding-reunavälin. Alignwide antaa jo 25px reunan, joten mobiilissa
   sisältö jäi 50px:iin muiden osioiden 25px:n sijaan. */
.alignwide.has-global-padding {
    padding-left: 0;
    padding-right: 0;
}

/* Osion otsikko leveän lohkon yläpuolella (esim. Referenssit, Tapahtumat, Artikkelinostot)
   saa lohkon leveyden, jotta otsikko alkaa korttien reunasta eikä sisällön kapeammasta
   palstasta. Otsikko on erillinen otsikkolohko (README: TÄRKEIN SÄÄNTÖ), joten sen
   leveyttä ei tarvitse muistaa asettaa käsin. Toimii myös ryhmien sisällä
   (.is-layout-constrained) ja editorissa (alla). */
.main-content .entry-content > .wp-block-heading:has(+ .alignwide),
.is-layout-constrained > .wp-block-heading:has(+ .alignwide) {
    width: calc(100% - 50px);
    max-width: var(--wp--style--global--wide-size);
    margin-left: auto;
    margin-right: auto;
}
.main-content .container .entry-content > .wp-block-heading:has(+ .alignwide),
.alignwide > .wp-block-heading:has(+ .alignwide) {
    width: 100%;
}
/* Editorin kanvas: juurisäiliö on flow-asettelu, joten sama leveys kuin .alignwide-säännöllä. */
.is-root-container > .wp-block-heading:has(+ .alignwide) {
    width: calc(100% - 50px);
    max-width: var(--wp--style--global--wide-size);
}

.alignwide > .iframe-container {
    width: 100%;
    max-width: none;
}
.alignwide .alignwide {
    width: 100%;
    max-width: 100%;
}
:where(.wp-block-group.has-background) {
    padding: 100px 0;
}

.is-style-dg-small-y-paddings {
    padding-top: 25px;
    padding-bottom: 25px;
}

@media (min-width: 782px) {
    .is-style-dg-small-y-paddings {
        padding-top: 50px;
        padding-bottom: 50px;
    }
}

.is-style-dg-big-y-paddings {
    padding-top: 50px;
    padding-bottom: 50px;
}

/* 75 px up to 1280 px, growing to 100 px at 1920 px (laptop scale, see the heading sizes below). */
@media (min-width: 782px) {
    .is-style-dg-big-y-paddings {
        padding-top: clamp(75px, 25px + 3.906vw, 100px);
        padding-bottom: clamp(75px, 25px + 3.906vw, 100px);
    }
}

/* Tekstiin päättyvä osio (Intro): kappaleen 25px marginaali kasvatti alapaddingia,
   alla 75px ja yllä 50px. !important, koska p:n marginaali on pakotettu. */
.is-style-dg-big-y-paddings > :last-child,
.is-style-dg-big-y-paddings > .alignwide > :last-child {
    margin-bottom: 0 !important;
}

.is-style-dg-small-bottom-margin {
    margin-bottom: 25px;
}

@media (min-width: 782px) {
    .is-style-dg-small-bottom-margin {
        margin-bottom: 50px;
    }
}

.is-style-dg-big-bottom-margin {
    margin-bottom: 50px;
}

@media (min-width: 782px) {
    .is-style-dg-big-bottom-margin {
        margin-bottom: 100px;
    }
}

@media (max-width: 799px) {
    .is-layout-constrained:not(.alignwide) > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
        max-width: calc(100% - 50px) !important;
    }
}


/* Fluid heading sizes: min at 360px viewport, max at 1200px, linear in between.
   Middle term = min + (max - min) * (100vw - 360px) / 840px, with 1rem = 18px
   (html font-size in starter.scss). Same viewport range as theme.json fluid.
   Max sizes from the XD layout (1920 px artboard): h1 70px, h2 50, h3 40, h4 30, h5 25.
   The html prefix beats Bootstrap's h1–h6 rules, which load after this file in the
   editor canvas; component classes (.dg-card__title etc.) still win. */
/* Laptop scale (18.11.2026, customer: "100 % is mush on a laptop, 75 % zoom looks right"): h1–h3 stay at
   75 % of the XD size up to a 1280 px viewport and grow linearly to the full size at 1920 px (the XD
   artboard). Laptop line = 0.75 × max at 1280 → max at 1920. Phones keep the mobile line (min() picks it). */
:root {
    --dg-fs-h1: clamp(2.6rem, min(2.048rem + 2.762vw, max(2.917rem, 0.972rem + 2.734vw)), 3.889rem);
    --dg-fs-h2: clamp(1.9rem, min(1.524rem + 1.881vw, max(2.083rem, 0.694rem + 1.953vw)), 2.778rem);
    --dg-fs-h3: clamp(1.6rem, min(1.333rem + 1.333vw, max(1.667rem, 0.556rem + 1.563vw)), 2.222rem);
}
/* theme.json presets with the same max sizes follow the same curve. */
body {
    --wp--preset--font-size--xx-large: var(--dg-fs-h1);
    --wp--preset--font-size--x-large: var(--dg-fs-h2);
}
html h1, html .h1 { font-size: var(--dg-fs-h1); }
html h2, html .h2 { font-size: var(--dg-fs-h2); }
html h3, html .h3 { font-size: var(--dg-fs-h3); }
html h4, html .h4 { font-size: clamp(1.35rem, 1.214rem + 0.679vw, 1.667rem); }
html h5, html .h5 { font-size: clamp(1.2rem, 1.119rem + 0.405vw, 1.389rem); }
html h6, html .h6 { font-size: 1rem; }

/* Line heights of multi-line headings in the XD layout: h2 50/60, h3 40/48, h4 30/40
   (Bootstrap default 1.1). h1 keeps 1.1 (XD 70/75). */
html h2, html .h2,
html h3, html .h3 { line-height: 1.2; }
html h4, html .h4 { line-height: 1.33; }

@media (max-width: 500px) {
    h1, h2, h3, h4 {
        hyphens: auto;
    }
    /* English words are short enough to wrap whole ("prop-erty's" otherwise). */
    html:lang(en) :is(h1, h2, h3, h4) {
        hyphens: manual;
    }
}

/* Headings navy as in the XD layout (#111731; the layout's #020D26 is the same navy), body text stays dark.
   Via a custom property so that any wrapper with its own text color (white on navy, cover, footer) still
   passes its color down: there the property becomes currentColor = the inherited color. */
:root { --dg-heading-color: var(--wp--preset--color--secondary); }
.has-text-color,
.wp-block-cover,
.site-footer { --dg-heading-color: currentColor; }
h1, h2, h3, h4, h5, h6 { color: var(--dg-heading-color); }

.wp-block-heading, 
p {
    margin-bottom: 25px !important;
}

p {
    line-height: 1.5;
}

/* h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
    margin-bottom: 15px;
} */

.dg-cards-grid {
    justify-content: center;
}
.dg-cards-grid > [class*="col-"] {
    padding: 30px !important;
    position: relative;
}

.dg-cards-grid .dg-card {
    width: 100%;
    height: 100%;
}

:where(.wp-block-group.has-background) {
    padding: 50px 0 !important;
}
:where(.alignwide.wp-block-group.has-background) {
    padding: 50px !important;
}
/* Laptop scale: 75 px up to 1280 px → 100 px at 1920 px, same as is-style-dg-big-y-paddings. */
@media (min-width: 782px) {
    :where(.wp-block-group.has-background) {
        padding: clamp(75px, 25px + 3.906vw, 100px) 0 !important;
    }
    :where(.alignwide.wp-block-group.has-background) {
        padding: clamp(75px, 25px + 3.906vw, 100px) !important;
    }
}

.dg-card {
    position: relative;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

@media (min-width: 500px) {
    .dg-card {
        padding: 50px;
    }
}

.dg-grid > [class*='col-'] > .dg-card {
    height: 100%;
}

.dg-card >.gb-container,
.dg-card.gb-container >.gb-container {
    padding: 0;
}
.dg-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.dg-card .dg-card-icon figure {
    width: 80px;
    height: 45px;
    overflow: hidden;
    margin: 0 auto 20px auto;
}
.dg-card .dg-card-icon figure img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.wp-block-columns.dg-cards .wp-block-column {
    position: relative;
}
.wp-block-columns.dg-cards .wp-block-column .dg-card {
    width: 100%;
    height: 100%;
}

.wp-block-columns.is-layout-flex.dg-cards {
    gap: 25px;
}

.wp-block-group.alignfull.is-layout-constrained {
    padding-left: 25px !important;
    padding-right: 25px !important;
}

/* Wrapperilla on jo 25px sivugutteri (yllä). Mobiilissa/tabletissa (<992px) sen sisällä
   oleva alignwide ei siksi tarvitse omaa calc(100% - 50px) -insettiään (.alignwide rivi ~27)
   — muuten tulee tuplagutteri ja liikaa tyhjää reunoille. Alignwide täyttää sisältöalueen
   ja linjautuu otsikon kanssa. Desktopilla alignwiden oma inset + max-width säilyy. */
@media (max-width: 991px) {
    .wp-block-group.alignfull.is-layout-constrained > .alignwide {
        width: 100%;
    }
}
/* Same double gutter from the max-width: calc(100% - 50px) rule below 800px (above): the full-width
   group already has its 25px padding, so its children use the full content width (PKS 23.10.2026). */
@media (max-width: 799px) {
    .wp-block-group.alignfull.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
    .wp-block-group.alignfull.is-layout-constrained > .wp-block-heading:has(+ .alignwide) {
        max-width: 100% !important;
        width: 100%;
    }
}
/* Same inside a column: a constrained group in a column (e.g. the intro's ingress, contentSize 903) is already within
   the page gutter, so its text must not lose another 50 px on the right (PKS 2.11.2026). */
@media (max-width: 799px) {
    .wp-block-column .wp-block-group.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
        max-width: 100% !important;
    }
}

.wp-block-group.is-style-content-paddings,
.is-style-content-paddings-global {
    padding: 50px !important;
}

.is-style-tiny-content-paddings-global {
    padding: 50px 25px !important;
}

@media (min-width: 500px) {
    .is-style-tiny-content-paddings-global {
        padding: 50px !important;
    }
}

.wp-block-group.is-style-content-paddings-big,
.is-style-content-paddings-big-global {
    padding: 50px 25px !important;
}
@media (min-width: 500px) {
    .wp-block-group.is-style-content-paddings-big,
    .is-style-content-paddings-big-global {
        padding: 50px !important;
    }
}
@media (min-width: 1300px) {
    .wp-block-group.is-style-content-paddings-big,
    .is-style-content-paddings-big-global {
        padding: clamp(75px, 25px + 3.906vw, 100px) !important;
    }
}

/* Card content paddings: 25px mobile, 50px desktop */
.is-style-card-content-paddings {
    padding: 25px;
}
@media (min-width: 992px) {
    .is-style-card-content-paddings {
        padding: 50px;
    }
}

.dg-rounded {
    border-radius: 50px;
}

.wp-block-embed__wrapper .embed-responsive {
    position: absolute;
    top: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

/* --- YouTube-facade -------------------------------------------------------
   Markup: inc/content-filters.php → dg_youtube_facade()
   Logiikka: js/javascripts.js
   Esikatselukuva + play-nappi; oikea iframe ladataan vasta klikistä, jotta
   Googleen ei mene pyyntöjä eikä evästeitä ennen käyttäjän valintaa.

   KUVASUHDE: core antaa .wp-block-embed__wrapperille 56.25 %:n ::before-
   välikkeen (wp-has-aspect-ratio). Facade asemoidaan sen sisään absoluuttisesti
   täsmälleen kuten core tekee omille iframeilleen → kuvasuhde lasketaan kertaalleen.
   ÄLÄ lisää tähän .ratio-kääreitä tai omaa aspect-ratiota upotuksen sisälle:
   se oli aiemman toteutuksen vika (figure 1294 px, video 647 px). */
.dg-video-facade {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: var(--wp--preset--color--black);
}

/* Upotuslohkon sisällä kuvasuhde tulee coren välikkeestä → aspect-ratio ei päde,
   koska korkeus on määritelty insetillä */
.wp-block-embed__wrapper > .dg-video-facade {
    position: absolute;
    inset: 0;
}

.dg-video-facade__poster {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dg-video-facade__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.dg-video-facade__icon {
    width: 50px;
    height: auto;
    transition: transform .15s ease-out;
}

/* Desktopilla isompi nappi; mobiilissa 100px olisi 32 % videon leveydestä.
   Koko klikkialue on silti aina koko facade, joten kosketuskohde ei kapene. */
@media (min-width: 782px) {
    .dg-video-facade__icon {
        width: 100px;
    }
}

.dg-video-facade__icon-bg {
    fill: var(--wp--preset--color--black);
    fill-opacity: .75;
}

.dg-video-facade__icon-arrow {
    fill: var(--wp--preset--color--white);
}

.dg-video-facade__play:hover .dg-video-facade__icon,
.dg-video-facade__play:focus-visible .dg-video-facade__icon {
    transform: scale(1.1);
}

/* YouTube-punainen on tarkoituksella kovakoodattu eikä theme.json:n paletista:
   se on YouTuben tunnusväri, jonka käyttäjä tunnistaa play-napiksi, eikä se
   muutu sivuston brändivärien mukana. ÄLÄ vaihda tätä paletin muuttujaan.
   (Linjaus 5.8.2026: hover aina YouTube-punainen kaikissa projekteissa.) */
.dg-video-facade__play:hover .dg-video-facade__icon-bg,
.dg-video-facade__play:focus-visible .dg-video-facade__icon-bg {
    fill: #f00;
    fill-opacity: 1;
}

.dg-video-facade.is-playing iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Osioiden välit (testisivu "Välistystesti").
   Kaksi väritöntä osiota peräkkäin: paddingit summautuisivat (100 + 100) eikä
   värinvaihto erota osioita → jälkimmäisen yläpadding pois. Samanväriset
   taustavärilliset: inc/section-spacing.php (generoidaan paletista). */
.entry-content > .is-style-dg-big-y-paddings:not(.has-background) + .is-style-dg-big-y-paddings:not(.has-background) {
    padding-top: 0;
}

/* Taustavärillinen laatikko tai cover ilman täyttä leveyttä: tavallinen lohkoväli
   seuraavaan sisältöön (muuten seuraava otsikko on kiinni laatikon reunassa). */
.entry-content > .wp-block-group.has-background:not(.alignfull):has(+ :not(.alignfull)),
.entry-content > .wp-block-cover:not(.alignfull):has(+ :not(.alignfull)) {
    margin-bottom: 25px;
}

/* Cover-sisältölaatikko: max-width rajaa laatikon leveyden,
   WP Coverin contentPosition hoitaa vaakasuuntaisen sijoituksen (center-right / center-left). */
.is-style-dg-content-cover {
    width: 100%;
    max-width: 560px;
}

/* Cover-blokki jonka sisällä dg-content-cover: padding ja aspect-ratio unset,
   jotta min-height toimii ilman WP:n default-aspect-ratiota */
.wp-block-cover:has(.is-style-dg-content-cover) {
    padding: 50px;
    aspect-ratio: unset;
}

/* Desktop ≥992px: iso korkeus overlay-näkymälle. !important voittaa inline min-heightin. */
@media (min-width: 992px) {
    .wp-block-cover:has(.is-style-dg-content-cover) {
        min-height: 800px !important;
    }

    /* Täysleveä cover (cover-sisaltolaatikko-*-tayslevea): laatikko alignwide-linjaan,
       ei kiinni selaimen reunaan. Sama laskenta kuin .dg-hero:ssa (cover.css). */
    .wp-block-cover.alignfull:has(.is-style-dg-content-cover) {
        padding-left: max(25px, calc((100% - var(--wp--style--global--wide-size)) / 2));
        padding-right: max(25px, calc((100% - var(--wp--style--global--wide-size)) / 2));
    }
}

/* Mobiili/tabletti (<992px) cover muuttuu pystystäkattuun rakenteeseen:
   kuva ensin, sisältölaatikko alle */
@media (max-width: 991px) {
    .wp-block-cover:has(.is-style-dg-content-cover) {
        display: block;
        padding: 0;
        min-height: 0;
        height: auto;
    }

    .wp-block-cover:has(.is-style-dg-content-cover) .wp-block-cover__image-background {
        position: relative;
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 2;
        object-fit: cover;
    }

    /* Cover-overlay pois (ei tarvita kun sisältölaatikko on erillään) */
    .wp-block-cover:has(.is-style-dg-content-cover) .wp-block-cover__background {
        display: none;
    }

    .wp-block-cover:has(.is-style-dg-content-cover) .wp-block-cover__inner-container {
        position: relative;
        width: 100%;
    }

    /* Sisältölaatikko täysleveäksi mobiilissa */
    .wp-block-cover:has(.is-style-dg-content-cover) .is-style-dg-content-cover {
        max-width: 100%;
    }

    /* Täysleveässä laatikko on reunasta reunaan kuten taustavärillinen osio →
       teksti sivun 25 px:n reunalinjaan (medium-content-paddings antaisi 50 px). */
    .wp-block-cover.alignfull:has(.is-style-dg-content-cover) .is-style-dg-content-cover {
        padding-left: 25px !important;
        padding-right: 25px !important;
    }
}

/* Lainaus (core/quote, oletustyyli): tekstin sekaan tuleva lainaus — pystyviiva päävärillä
   vasemmalla. Iso keskitetty nosto on erillinen tyyli Sitaatti (alla), jonka säännöt ovat
   tarkempia ja ohittavat nämä. */
.wp-block-quote {
    margin: 0 0 var(--wp--preset--spacing--25, 25px);
    padding: 0 0 0 var(--wp--preset--spacing--25, 25px);
    border-left: 4px solid var(--wp--preset--color--primary);
}
.wp-block-quote p {
    font-size: 1.1rem;
    font-style: italic;
}
.wp-block-quote > p:last-of-type {
    margin-bottom: 0 !important; /* p:n yleissääntö on !important */
}
.wp-block-quote cite {
    display: block;
    margin-top: var(--wp--preset--spacing--10, 10px);
    font-size: inherit; /* editorin .wp-block-quote cite pienensi nimen 0.8125em:iin */
    font-style: normal;
    font-weight: 700;
}

/* Sitaatti (core/quote, block style "Sitaatti" → is-style-dg-sitaatti; patterns/sitaatti.php).
   Iso keskitetty lainaus, koristeellinen lainausmerkki pääväreissä kuten Suosituksissa.
   Lainausmerkki = images/icon-quote.svg CSS-maskina: muoto ei riipu projektin fontista,
   väri tulee pääväristä. Projektin oma ikoni: korvaa tiedosto. */
.wp-block-quote.is-style-dg-sitaatti {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    border: 0;
    text-align: center;
}
.wp-block-quote.is-style-dg-sitaatti::before {
    content: "";
    display: block;
    width: 48px;
    height: 36px;
    margin: 0 auto var(--wp--preset--spacing--25, 25px);
    background-color: var(--wp--preset--color--primary);
    -webkit-mask: url("../../../images/icon-quote.svg") no-repeat center / contain;
    mask: url("../../../images/icon-quote.svg") no-repeat center / contain;
}
.wp-block-quote.is-style-dg-sitaatti p {
    font-size: var(--wp--preset--font-size--large);
    line-height: 1.5;
    font-style: italic;
}
.wp-block-quote.is-style-dg-sitaatti > p:last-of-type {
    margin-bottom: 0 !important;
}
.wp-block-quote.is-style-dg-sitaatti cite {
    display: block;
    margin-top: var(--wp--preset--spacing--25, 25px);
    font-size: inherit; /* editorin .wp-block-quote cite pienensi nimen 0.8125em:iin */
    font-style: normal;
    font-weight: 700;
}

/* Uutiskirje (patterns/uutiskirje.php): teksti vasemmalla, tilauskenttä + nappi oikealla;
   alle 782 px sarakkeet allekkain. Kenttä on paikanvaraaja (disabled) → näytetään kuten
   aktiivinen kenttä, jotta ulkoasu vastaa lopullista. Reuna 1 px border-strong kuten lomakkeissa
   (WCAG 1.4.11). */
.dg-newsletter__columns .wp-block-column > :last-child {
    margin-bottom: 0 !important;
}
.dg-newsletter__form {
    gap: 10px;
    align-items: stretch !important; /* kenttä napin korkuiseksi */
}
.dg-newsletter__input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 50px;
    padding: 0 15px;
    border: 1px solid var(--wp--custom--color--border-strong);
    background: #fff;
    color: inherit;
    font: inherit;
}
.dg-newsletter__input:disabled {
    cursor: not-allowed;
    opacity: 1;
}
.dg-newsletter__form .wp-block-buttons,
.dg-newsletter__form .wp-block-button {
    margin: 0 !important;
}
@media (max-width: 599px) {
    .dg-newsletter__form {
        flex-wrap: wrap !important;
    }
    .dg-newsletter__input,
    .dg-newsletter__form .wp-block-buttons,
    .dg-newsletter__form .wp-block-button,
    .dg-newsletter__form .wp-block-button__link {
        width: 100%;
        max-width: none;
    }
}

/* Artikkelinosto (src/blocks/artikkelinosto): otsikkolinkki otsikon näköisenä kuten
   50/50-patterneissa; alleviivaus hoverissa ja fokuksessa. Nappi on saman linkin
   visuaalinen osa (aria-hidden, tabindex -1), joten otsikko on ainoa kohde. */
.dg-artikkelinosto h2 a {
    color: inherit;
    text-decoration: none;
}
.dg-artikkelinosto h2 a:hover,
.dg-artikkelinosto h2 a:focus-visible {
    text-decoration: underline;
}

/* Askeleet (patterns/askeleet.php): numero CSS-laskurilla askeleen järjestyksestä,
   joten lisäys, poisto ja siirto eivät vaadi numeroiden korjausta. */
.dg-steps {
    counter-reset: dg-step;
}
.dg-steps__item {
    counter-increment: dg-step;
}
/* Kortin padding = is-style-card-content-paddings (25 → 50 px). !important, koska
   taustavärillisen ryhmän :where(.wp-block-group.has-background) { padding: 50px 0 !important }
   ohittaisi sen ja teksti menisi kiinni kortin reunoihin. */
.wp-block-group.dg-steps__item {
    padding: 25px !important;
}
@media (min-width: 992px) {
    .wp-block-group.dg-steps__item {
        padding: 50px !important;
    }
}
.dg-steps__item::before {
    content: counter(dg-step);
    display: block;
    margin-bottom: var(--wp--preset--spacing--20, 20px);
    font-size: var(--wp--preset--font-size--xx-large);
    font-weight: 700;
    line-height: 1;
    color: var(--wp--preset--color--primary);
}
.dg-steps__item > :last-child {
    margin-bottom: 0 !important;
}
/* Otsikosta korttiin 50 px desktopilla, kuten Korttinostoissa (otsikon pakotettu 25 px
   ei riitä; gridin oma ylämarginaali sulautuisi siihen). */
@media (min-width: 783px) {
    .wp-block-heading:has(+ .dg-steps) {
        margin-bottom: 50px !important;
    }
}
/* Alle 782 px allekkain: muuten 3 askelta jakautuisi 2 + 1 tablettileveydellä. */
@media (max-width: 781px) {
    .dg-steps {
        grid-template-columns: 1fr !important;
    }
    /* Numero otsikon vasemmalle → kortti lyhenee; muu sisältö otsikon linjassa. */
    .dg-steps__item {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 15px var(--wp--preset--spacing--20, 20px);
        align-items: start; /* numero ja otsikon ensimmäinen rivi samalta yläreunalta */
    }
    .dg-steps__item::before {
        grid-column: 1;
        grid-row: 1;
        margin-bottom: 0;
    }
    /* Välit gridin gapilla: otsikon pakotettu 25 px:n marginaali siirtäisi sen
       numeron keskilinjasta. */
    .dg-steps__item > * {
        grid-column: 2;
        margin-block: 0 !important;
    }
}

/* Estä horizontal scroll (negatiiviset marginit bleed-elementeissä).
   clip eikä hidden — clip ei riko position: sticky -toimintaa lapsielementeissä. */
body {
    overflow-x: clip;
}

/* ==========================================================================
   50/50 reunaan asti (patterns/50-50-*-levea.php) — dg-media-bleed-right / -left
   Kuva venyy selaimen reunaan ja koko osion korkeuteen; teksti pysyy alignwide-
   linjassa (sarakkeessa is-style-content-paddings-excluding-left/-right).
   Mallina pel-tuotteen leveät variantit, suhde pidetty 50/50:nä.
   ========================================================================== */
/* Taustavärillisen osion automaattinen padding (yllä :where(.wp-block-group.has-background))
   pois: kuva ulottuu osion ylä- ja alareunaan, tekstisarakkeella on oma padding. */
.wp-block-group.alignfull.has-background:has(> .dg-media-bleed-right, > .dg-media-bleed-left) {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
/* Korkeus: min. 500 px tai tekstin korkeus, kumpi suurempi. Kuva on absoluuttinen eikä
   vaikuta korkeuteen → osiot ovat yhtä korkeita kuvan kuvasuhteesta ja näytön leveydestä
   riippumatta; kuva rajautuu (object-fit: cover). */
@media (min-width: 782px) {
    .wp-block-columns.dg-media-bleed-right,
    .wp-block-columns.dg-media-bleed-left {
        align-items: stretch;
        min-height: 500px;
    }
    .wp-block-columns.dg-media-bleed-right > .wp-block-column:last-child,
    .wp-block-columns.dg-media-bleed-left > .wp-block-column:first-child {
        position: relative;
        align-self: stretch;
    }
    /* Leveys = sarake + tila selaimen reunaan: max(25px, …) kattaa sivun reunavälin
       kun ikkuna on kapeampi kuin wide-size, muuten (100vw - wide-size) / 2. */
    .wp-block-columns.dg-media-bleed-right > .wp-block-column:last-child .wp-block-image,
    .wp-block-columns.dg-media-bleed-left > .wp-block-column:first-child .wp-block-image {
        position: absolute;
        top: 0;
        bottom: 0;
        width: calc(100% + max(25px, (100vw - var(--wp--style--global--wide-size)) / 2));
        max-width: none;
        margin: 0;
    }
    .wp-block-columns.dg-media-bleed-right > .wp-block-column:last-child .wp-block-image {
        left: 0;
    }
    .wp-block-columns.dg-media-bleed-left > .wp-block-column:first-child .wp-block-image {
        right: 0;
    }
    .wp-block-columns.dg-media-bleed-right > .wp-block-column:last-child .wp-block-image img,
    .wp-block-columns.dg-media-bleed-left > .wp-block-column:first-child .wp-block-image img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}
/* Mobiilissa kuva täysleveäksi yli 25 px:n reunavälin ja 3:2-muotoon, teksti 50 px ylä/ala. */
@media (max-width: 781px) {
    .wp-block-columns.dg-media-bleed-right > .wp-block-column:last-child .wp-block-image,
    .wp-block-columns.dg-media-bleed-left > .wp-block-column:first-child .wp-block-image {
        width: calc(100% + 50px);
        max-width: none;
        margin-left: -25px;
        margin-right: -25px;
    }
    .wp-block-columns.dg-media-bleed-right > .wp-block-column:last-child .wp-block-image img,
    .wp-block-columns.dg-media-bleed-left > .wp-block-column:first-child .wp-block-image img {
        display: block;
        width: 100%;
        aspect-ratio: 3 / 2; /* sama korkeus kuvasta riippumatta */
        height: auto;
        object-fit: cover;
    }
    .wp-block-column.dg-bleed-text {
        padding-top: 50px !important;
        padding-bottom: 50px !important;
    }
}

/* Navbar */
#main-navbar {
    position: relative;
    width: 100%;
}
@media (max-width: 1199px) {
    #main-navbar.menu-open {
        max-height: 100vh;
        overflow-y: auto;
    }
}

/* Masthead sticky kaikilla näytöillä — sisältää vain navigaation (yläkuva on
   siirretty headerin ulkopuolelle), joten sticky toimii koko sivun matkan.
   Hide-on-scroll-down / show-on-scroll-up: js lisää luokan dg-masthead-hidden. */
#masthead {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #fff;
    transition: transform 0.3s ease;
}
#masthead.dg-masthead-hidden {
    transform: translateY(-100%);
}

/* Article cards */
/* News post hero (header's dynamic hero, 450 px in the theme) on desktop as tall as the image heroes of the
   service pages (575, XD). */
@media (min-width: 992px) {
    .single-post .dg-hero--dynamic { min-height: 575px; }
}

/* Long article titles (news post, single reference) on phones: the theme's 47 px h1 ran to 7–8 lines. */
@media (max-width: 767px) {
    html .single-post .entry-content > h1,
    html .dg-ref-intro .dg-ref-title { font-size: 34px; line-height: 1.2; }
}

/* Muita ajankohtaisia (inc/related-posts.php) on white: the article's bottom padding already separates it,
   so no second top padding (would be ~200 px). */
.main-content + .dg-artikkelinostot:not(.has-background) { padding-top: 0 !important; }

/* PKS: same family as the reference card (.dg-ref-card): landscape image, light blue text box, navy Bai Jamjuree
   title, outline-navy arrow button ("Lue lisää"). Date above the title for news. */
.article-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 5px;
    overflow: hidden;
    background: var(--wp--preset--color--light-blue);
}
.article-card .dg-post-thumbnail { margin: 0; aspect-ratio: 398 / 225; overflow: hidden; }
.article-card .dg-post-thumbnail a,
.article-card .dg-post-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }
.article-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 45px 40px 50px;
}
.article-card .post-date { margin: 0 0 10px; font-size: 16px; font-weight: 500; line-height: 22px; color: var(--wp--preset--color--dark-gray); }
html .article-card .entry-title {
    margin: 0 0 17px !important;
    font-family: var(--wp--preset--font-family--bai-jamjuree);
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
    hyphens: manual;
}
.article-card .entry-title a { color: var(--wp--preset--color--secondary); }
.article-card .entry-title a:hover,
.article-card .entry-title a:focus-visible { text-decoration: underline; }
.article-card .entry-content {
    margin: 0 0 35px;
    font-size: 18px;
    font-weight: 500;
    line-height: 27px;
    color: var(--wp--preset--color--dark-gray);
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card-footer {
    margin-top: auto;
}
html .article-card-footer .wp-block-button { margin: 0 !important; }
@media (max-width: 767px) {
    .article-card__body { padding: 35px 25px 40px; }
}
/* Korttiotsikko ilman alleviivausta: kortti erottuu linkkinä jo rakenteestaan ja Lue lisää -napista. */
.article-card .entry-title a,
.article-nosto .entry-title a {
    text-decoration: none;
}

/* ==============================================
   RESPONSIVE SPACING HELPERS
   ============================================== */

/* Responsive spacer: small on mobile, larger on desktop */
.dg-spacer-responsive {
    height: var(--wp--preset--spacing--5) !important;
    margin-block-start: 0 !important;
}
@media (min-width: 782px) {
    .dg-spacer-responsive {
        height: var(--wp--preset--spacing--50) !important;
    }
}

/* Responsive margin-bottom: spacing-50 mobile, spacing-100 desktop */
.dg-mb-responsive-100 {
    margin-bottom: var(--wp--preset--spacing--50) !important;
}
@media (min-width: 782px) {
    .dg-mb-responsive-100 {
        margin-bottom: var(--wp--preset--spacing--100) !important;
    }
}

/* Responsive margin-bottom: late breakpoint (992px) variant */
.dg-mb-responsive-100-992 {
    margin-bottom: var(--wp--preset--spacing--50) !important;
}
@media (min-width: 992px) {
    .dg-mb-responsive-100-992 {
        margin-bottom: var(--wp--preset--spacing--100) !important;
    }
}

/* Late collapse - columns stack at 992px instead of WP default 782px
   Uses double class selector to override WP core !important rules */
.wp-block-columns.dg-collapse-late {
    flex-wrap: nowrap !important;
}
.wp-block-columns.dg-collapse-late > .wp-block-column {
    flex-basis: 50% !important;
}
@media (max-width: 991px) {
    .wp-block-columns.dg-collapse-late {
        flex-wrap: wrap !important;
    }
    .wp-block-columns.dg-collapse-late > .wp-block-column {
        flex-basis: 100% !important;
    }
}

/* Hero Slider (digitaali/hero-slider) */
.dg-hero-slider {
    position: relative;
    overflow: hidden;
}
.dg-hero-slider .hero-slider-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 0;
}
.dg-hero-slider .hero-slider-image.active {
    opacity: 1;
    z-index: 1;
}
.dg-hero-slider .wp-block-cover__background {
    z-index: 2;
}
.dg-hero-slider .wp-block-cover__inner-container {
    z-index: 3;
    position: relative;
}
/* Pause/play -painike (WCAG 2.2.2 Pause, Stop, Hide) — pakollinen automaattivaihdolle,
   joten huomaamaton eikä piilotettu: näkyvä ympyrä 29 px (::before), klikattava alue
   edelleen 44 px (läpinäkyvä nappi). Valkoinen ikoni tummalla pohjalla erottuu
   kuvasta riippumatta (1.4.11). */
.dg-hero-slider-pause {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 4;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: .7;
    transition: opacity .2s ease;
}
.dg-hero-slider-pause::before {
    content: "";
    position: absolute;
    inset: 7.5px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    transition: background .2s ease;
}
.dg-hero-slider-pause:hover,
.dg-hero-slider-pause:focus-visible {
    opacity: 1;
}
.dg-hero-slider-pause:hover::before,
.dg-hero-slider-pause:focus-visible::before {
    background: rgba(0, 0, 0, 0.85);
}
.dg-hero-slider-pause:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -6px;
}
.dg-hero-slider-pause-icon {
    position: relative; /* ::before-ympyrän päälle */
    display: inline-block;
    width: 9px;
    height: 10px;
    background: linear-gradient(
        to right,
        currentColor 0,
        currentColor 35%,
        transparent 35%,
        transparent 65%,
        currentColor 65%,
        currentColor 100%
    );
}
.dg-hero-slider-pause.is-paused .dg-hero-slider-pause-icon {
    background: currentColor;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    margin-left: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .dg-hero-slider-pause,
    .dg-hero-slider-pause::before { transition: none; }
}

/* ==========================================================================
   Hero Slider, sisältöslidet (digitaali/hero-slides)
   Slide = core/cover. Slider-alustus: src/blocks/hero-slides/view.js.
   Nuolet ja pisteet tyylitellään tässä (ei slick-theme.css:ää).
   ========================================================================== */
.dg-hero-slides {
    position: relative; /* pysäytysnappi + navigaatio asemoidaan tähän */
}

/* Ennen slick-alustusta näkyisivät kaikki slidet allekkain — hero-kokoisena se
   on iso hyppy. Näytetään vain ensimmäinen kunnes slick on alustanut. */
.dg-hero-slides__track:not(.slick-initialized) > .dg-hero-slides__slide:not(:first-child) {
    display: none;
}

/* Slide-wrapper: slick mitoittaa tämän (float + inline width), Kansikuva täyttää
   sen. Ks. render.php:n kommentti siitä miksi cover ei voi olla slide itse. */
.dg-hero-slides__slide > .wp-block-cover {
    width: 100%;
}
/* Slideotsikot samankokoisiksi: ensimmäisen sliden otsikko on h1 (sivun pääotsikko, index.js
   template), muut h2 — koko ei saa vaihdella slidesta toiseen. Sama koko kuin yläkuvan h1.
   Editorissa valittu fonttikoko (has-*-font-size) pätee edelleen. */
.dg-hero-slides__slide h2.wp-block-heading:not([class*="-font-size"]) {
    font-size: clamp(2.6rem, 2.048rem + 2.762vw, 3.889rem);
}

/* ⚠️ ÄLÄ lisää tänne `.slick-track { display: flex }` -equal-height-temppua
   (kuten Suosituksissa on). Slickin fade-tila lataa slidet floatteina ja siirtää
   ne päällekkäin negatiivisella `left`-arvolla — flex kumoaa floatin, jolloin
   siirto ei enää osu ja slidet lentävät viewportin ulkopuolelle (mitattu:
   slide-leveys 3784 px, aktiivinen slide x ≈ 7568). Herossa slide on 1-up ja
   korkeus tulee Kansikuvan omasta min-heightista, joten equal-heightia ei
   tarvita. */

/* Pisteet (view.js luo sisällön) — hero-kuvan päällä, alareunassa keskellä */
.dg-hero-slides__nav {
    position: absolute;
    z-index: 4;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* itse palkki ei nappaa klikkejä hero-sisällöltä */
}
.dg-hero-slides__nav > * {
    pointer-events: auto;
}

/* Nuolet sliden laidoilla, pystykeskitettynä kuvan päälle */
.dg-hero-slides__arrows {
    position: absolute;
    z-index: 4;
    inset: 0;
    pointer-events: none; /* vain nuolet nappaavat klikit */
}
.dg-hero-slides__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background-color .2s ease;
}
.dg-hero-slides__arrow::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}
.dg-hero-slides__arrow--prev { left: 20px; }
.dg-hero-slides__arrow--prev::before { transform: translate(-30%, -50%) rotate(135deg); }
.dg-hero-slides__arrow--next { right: 20px; }
.dg-hero-slides__arrow--next::before { transform: translate(-70%, -50%) rotate(-45deg); }
.dg-hero-slides__arrow:hover,
.dg-hero-slides__arrow:focus-visible {
    background: rgba(0, 0, 0, 0.85);
}

/* Slickin pisteet (ul.slick-dots) — sama visuaalinen kieli kuin Suosituksissa,
   mutta vaalea koska ne ovat kuvan päällä. */
/* Piste on visuaalisesti 10 px, mutta klikkausalue 25 px (WCAG 2.2 / 2.5.8
   Target Size Minimum vaatii vahintaan 24x24). Nappi on lapinakyva kehys ja
   itse piste piirretaan ::before-elementilla keskelle, joten ulkoasu sailyy.
   gap on 0, koska kohdealueet eivat saa mennä paallekkain. */
.dg-hero-slides__nav .slick-dots {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.dg-hero-slides__nav .slick-dots li {
    margin: 0;
    width: auto;
    height: auto;
}
.dg-hero-slides__nav .slick-dots li button {
    position: relative;
    width: 25px;
    height: 25px;
    padding: 0;
    font-size: 0;
    line-height: 0;
    color: transparent;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.dg-hero-slides__nav .slick-dots li button::before {
    display: block;
    content: "";
    position: absolute;
    inset: 7.5px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transition: background-color .2s ease;
}
.dg-hero-slides__nav .slick-dots li.slick-active button::before {
    background: #fff;
}
.dg-hero-slides__nav .slick-dots li button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

/* Pysäytysnappi on jaettu digitaali/hero-sliderin kanssa (.dg-hero-slider-pause).
   Nostetaan se navigaation vasemmalle puolelle, ettei se jää pisteiden alle. */
.dg-hero-slides .dg-hero-slider-pause {
    bottom: 10px;
    right: 10px;
}

/* Editori: slidet näkyvät allekkain (Slick ei aja editorissa) → näytetään
   kaikki, jotta jokaista slidea voi muokata. */
.dg-hero-slides--editor .wp-block-cover + .wp-block-cover {
    margin-top: 25px;
}

/* Data List (digitaali/data-list) */
/* Koko lista on yksi <dl> (rivit <div>-ryhminä). Nollataan selaimen/Bootstrapin
   dl-marginaali, jotta ulkoasu pysyy samana kuin rivikohtaisilla dl-elementeillä. */
.dg-data-list {
    margin: 0;
}
.dg-menu-row {
    border-bottom: 1px solid var(--wp--custom--color--border-subtle);
    margin-bottom: 0;
    align-items: center;
}
.dg-menu-row dd,
.dg-menu-row dt {
    margin: 0;
    padding: 15px 0;
}
.dg-menu-row .general-data-list-description {
    display: block;
    font-size: .8rem;
}

/* Info-rivi (digitaali/info-rivi) — otsikko vasemmalla 30 %, vapaa sisältö oikealla.
   Peräkkäiset rivit erottuvat viivalla; viimeiseltä viiva ja alapadding pois.
   Mobiilissa otsikko sisällön yläpuolelle. */
.dg-info-rivi {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 50px;
    padding: 25px 0;
    border-bottom: 1px solid var(--wp--custom--color--border);
}
.dg-info-rivi:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.dg-info-rivi__title {
    flex: 0 0 30%;
    max-width: 30%;
    font-weight: 700;
    line-height: 1.5; /* = p:n rivikorkeus → otsikko ja arvo samalla linjalla, väli ylä- ja alapuolella sama */
}
.dg-info-rivi__content {
    flex: 1;
    min-width: 0;
}
.dg-info-rivi--no-title .dg-info-rivi__content {
    flex: 0 0 100%;
}
.dg-info-rivi__content > :first-child { margin-top: 0; }
.dg-info-rivi__content > :last-child { margin-bottom: 0 !important; } /* p:n yleissääntö on !important */

@media (max-width: 767px) {
    .dg-info-rivi__title,
    .dg-info-rivi__content {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Kuvagalleria (digitaali/kuvagalleria) ja Kuvaslider (digitaali/kuvaslider) */
.dg-gallery-wrapper,
.dg-slider-wrapper {
    margin-bottom: 25px;
}

/* =====================================================
   FOOTER MENU (main_menu) — desktop-sarakkeet + mobiili-accordion
   Scripti footer.php:ssä vaihtaa .is-open-luokan mobiilissa.
   ===================================================== */

/* Desktop: logo ensimmäisenä sarakkeena, valikkosarakkeet sen vieressä.
   Valikkokääre on display:contents, jotta sen sarakkeet ovat logon kanssa
   samassa flex-rivissä ja yhtä leveitä. */
@media (min-width: 992px) {
    .site-footer-top {
        display: flex;
        flex-wrap: wrap;
        gap: 2rem;
    }
    .site-footer-menu-cols { display: contents !important; }
    .site-footer-top > .site-footer-col,
    .site-footer-menu-cols .site-footer-col {
        flex: 1 1 180px;
        min-width: 180px;
    }
}

.site-footer-menu-section {
    position: relative;
}

.site-footer-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 1rem;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
}

.site-footer-heading a {
    text-decoration: none;
}

.site-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer-links li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.site-footer-menu-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    line-height: 0;
}

.site-footer-menu-toggle-icon {
    width: 13px;
    height: auto;
    transition: transform 0.3s ease;
    filter: brightness(0) invert(1);
}

.site-footer-menu-toggle[aria-expanded="true"] .site-footer-menu-toggle-icon {
    transform: rotate(180deg);
}

.site-footer-menu-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (max-width: 991px) {
    .site-footer-menu-cols-mobile .site-footer-menu-section {
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        padding: 1rem 0;
    }
    .site-footer-menu-cols-mobile .site-footer-menu-section .site-footer-heading {
        margin-bottom: 0;
    }
    /* Suljettuna myös visibility: hidden — pelkkä max-height jätti linkit Tab-järjestykseen
       näkymättöminä (WCAG 2.4.7). Piilotus vasta sulkeutumisanimaation jälkeen (viive 0.3s),
       avattaessa näkyviin heti. */
    .site-footer-menu-cols-mobile .site-footer-menu-section .site-footer-links {
        max-height: 0;
        overflow: hidden;
        visibility: hidden;
        transition: max-height 0.3s ease, margin 0.3s ease, visibility 0s linear 0.3s;
        margin: 0;
    }
    .site-footer-menu-cols-mobile .site-footer-menu-section.is-open .site-footer-links {
        max-height: 500px;
        margin-top: 1rem;
        visibility: visible;
        transition-delay: 0s;
    }
    .site-footer-menu-cols-mobile .site-footer-menu-section .site-footer-links li {
        margin-bottom: 0;
    }
    .site-footer-menu-cols-mobile .site-footer-menu-section .site-footer-links a {
        display: block;
        padding: 0.5rem 0;
    }
}
/* Ilmestyvä teksti (inc/cover-effects.php, Peite-lohkon kytkin): otsikon kirjaimet häivyttäen
   järjestyksessä. Pelkkä opacity → rivitys ja &shy;-tavutus ennallaan. Askel --dg-reveal-step
   tulee PHP:stä (25 ms, pitkässä otsikossa lyhyempi). Ilman animaatiota (reduced motion, CSS
   puuttuu) kirjaimet näkyvät heti, koska näkymättömyys on vain keyframeissa. */
@media (prefers-reduced-motion: no-preference) {
    .dg-reveal__c {
        animation: dg-reveal .4s ease-out both;
        animation-delay: calc(var(--i) * var(--dg-reveal-step, 25ms) + .1s);
    }
}
/* Muu sisältö (peitteen suorat lapset otsikon jälkeen: ingressi, napit) kokonaisina kun
   otsikko on valmis (--dg-reveal-after PHP:stä), 0,15 s porrastus. */
@media (prefers-reduced-motion: no-preference) {
    .dg-reveal-cover .wp-block-cover__inner-container > :not(.dg-reveal) {
        animation: dg-reveal .6s ease-out both;
        animation-delay: calc(var(--dg-reveal-after, 1s) + var(--dg-reveal-j, 0) * .15s);
    }
    .dg-reveal-cover .wp-block-cover__inner-container > :nth-child(3) { --dg-reveal-j: 1; }
    .dg-reveal-cover .wp-block-cover__inner-container > :nth-child(4) { --dg-reveal-j: 2; }
    .dg-reveal-cover .wp-block-cover__inner-container > :nth-child(n+5) { --dg-reveal-j: 3; }
}
@keyframes dg-reveal {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Skip link (saavutettavuus) — piilossa kunnes saa fokuksen */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    word-wrap: normal !important;
}

.skip-link.screen-reader-text:focus {
    /* dark-gray eikä primary: paletissa ei ole primary-dark-väriä (tausta jäi läpinäkyväksi),
       ja tumma tausta on luettava minkä tahansa projektin päävärin kanssa. */
    background-color: var(--wp--preset--color--dark-gray);
    color: var(--wp--preset--color--white);
    clip: auto !important;
    clip-path: none;
    display: block;
    font-size: 1rem;
    font-weight: 600;
    height: auto;
    width: auto;
    left: 10px;
    top: 10px;
    padding: 15px 25px;
    line-height: 1;
    text-decoration: underline;
    z-index: 100000;
}

/* Gutenberg-keskitetty kuva: figure on block-elementti joka levenee 100%,
   joten classic-ajan .aligncenter{margin:auto} ei keskitä. display:table
   kutistaa figuren kuvan levyiseksi → auto-marginaalit keskittävät. */
figure.wp-block-image.aligncenter {
    display: table;
    margin-left: auto;
    margin-right: auto;
}

/* ── Logot-blokki (digitaali/logos): ruudukko + vierivä ticker ── */
.dg-logos-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}
.dg-logo {
    position: relative;
    width: 220px;
    height: 100px;
    margin: 25px;
    overflow: hidden;
}
.dg-logo img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
/* Ticker-variantti */
.dg-logo-ticker {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 25px 0;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
}
.dg-logo-ticker .dg-track {
    display: flex;
    align-items: center;
    will-change: transform;
}
.dg-logo-ticker .dg-logos-grid {
    flex-wrap: nowrap;
    justify-content: flex-start;
    flex-shrink: 0;
}
.dg-logo-ticker .dg-logo {
    width: 150px;
    height: 80px;
    flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) {
    .dg-logo-ticker .dg-track { transform: none !important; }
}
/* Tickerin pysäytysnappi (WCAG 2.2.2). Nappi on tickerin ULKOPUOLELLA, koska
   .dg-logo-ticker maskaa reunansa läpinäkyväksi ja söisi napin näkyvistä.
   Tyyli peritään .dg-hero-slider-pause -luokasta, tässä vain asemointi. */
.dg-logos {
    position: relative;
}
.dg-logo-ticker-pause {
    bottom: 0;
    right: 0;
}


/* ==========================================================================
   Haitari (accordion) — natiivi blokki digitaali/accordion + accordion-item
   ========================================================================== */
.dg-accordion {
    margin-top: 0;
    margin-bottom: 0;
}
.dg-accordion-item {
    border-bottom: 1px solid var(--wp--preset--color--light-gray);
}
.dg-accordion-header {
    margin: 0 !important;
    padding: 0;
    font-size: inherit;
    line-height: 1.2;
}
.dg-accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    margin: 0;
    padding: 20px 0;
    background: transparent;
    border: 0;
    text-align: left;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.dg-accordion-title {
    flex: 1 1 auto;
    font-size: var(--wp--preset--font-size--large, 1.5rem);
    font-weight: 700;
    line-height: 1.25;
    transition: color .2s ease;
}
.dg-accordion-trigger:hover .dg-accordion-title,
.dg-accordion-trigger:focus-visible .dg-accordion-title {
    color: var(--wp--preset--color--primary);
}
.dg-accordion-trigger:focus-visible {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 3px;
}
/* Chevron-ikoni reunoista — perii värin currentColorista (toimii myös tummalla taustalla) */
.dg-accordion-icon {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .3s ease;
}
.dg-accordion-item.is-open > .dg-accordion-header .dg-accordion-icon {
    transform: rotate(225deg);
}
/* Paneeli: grid-template-rows 0fr→1fr animoi korkeuden ilman max-height-hakkeria */
.dg-accordion-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .3s ease;
}
.dg-accordion-item.is-open > .dg-accordion-panel {
    grid-template-rows: 1fr;
}
.dg-accordion-panel[hidden] {
    display: none;
}
.dg-accordion-panel-inner {
    overflow: hidden;
    min-height: 0;
}
.dg-accordion-panel-inner > *:first-child {
    margin-top: 0;
}
.dg-accordion-panel-inner > *:last-child {
    margin-bottom: 20px;
}
@media (prefers-reduced-motion: reduce) {
    .dg-accordion-panel,
    .dg-accordion-icon,
    .dg-accordion-title {
        transition: none;
    }
}


/* ==========================================================================
   Liitetiedostot (digitaali/attachments) — ladattavat tiedostot listana
   Korvaa vanhan inc/components/attachment-list-functions.php inline-CSS:n.
   ========================================================================== */
.dg-attachments-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.dg-attachments-list .dg-attachment {
    margin: 15px 0;
}
.dg-attachments-list .dg-attachment__link {
    display: inline-flex;
    max-width: 100%;
    flex-wrap: nowrap;
    align-items: center;
    gap: 15px;
    padding: 10px;
    color: inherit;
    text-decoration: none;
}
.dg-attachments-list .dg-attachment__link:hover {
    text-decoration: underline;
}
.dg-attachments-list .dg-attachment__link:focus-visible {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 2px;
    text-decoration: underline;
}
.dg-attachments-list .dg-attachment__icon {
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    object-fit: contain;
}
.dg-attachments-list .dg-attachment__body {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    word-break: break-word;
}
.dg-attachments-list .dg-attachment__meta {
    margin-top: 2.5px;
    font-size: var(--wp--preset--font-size--small, 0.9rem);
    color: var(--wp--preset--color--dark-gray);
}

/* Ruudukko (layout: grid) — kansikuvalliset kortit, koko kortti on yksi linkki.
   Sarakkeet: 4 → 3 tabletilla, 2 mobiilissa — myös kapeimmalla, koska yhden sarakkeen
   pystykansi olisi ~480 px korkea. */
.dg-attachments-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--wp--preset--spacing--25) var(--wp--preset--spacing--25);
    margin: 0;
    padding: 0;
    list-style: none;
}
.dg-attachments--cols-2 .dg-attachments-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dg-attachments--cols-4 .dg-attachments-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dg-attachments-grid .dg-attachment__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}
.dg-attachments-grid .dg-attachment__link:hover .dg-attachment__text {
    text-decoration: underline;
}
/* Fokusrengas koko kortille — kortti on linkin kohde */
.dg-attachments-grid .dg-attachment__link:focus-visible {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 4px;
}
.dg-attachments-grid .dg-attachment__link:focus-visible .dg-attachment__text {
    text-decoration: underline;
}
.dg-attachments-grid .dg-attachment__cover {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: var(--wp--preset--spacing--15);
    /* Kansi on paperia: kevyt varjo erottaa sen valkoisesta taustasta ilman kehystä */
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
    transition: box-shadow .2s ease, transform .2s ease;
}
.dg-attachments-grid .dg-attachment__link:hover .dg-attachment__cover,
.dg-attachments-grid .dg-attachment__link:focus-visible .dg-attachment__cover {
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
    transform: translateY(-3px);
}
.dg-attachments-grid .dg-attachment__icon {
    width: 50px;
    height: 50px;
    margin-bottom: var(--wp--preset--spacing--15);
    object-fit: contain;
}
.dg-attachments-grid .dg-attachment__body {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    word-break: break-word;
}
.dg-attachments-grid .dg-attachment__text {
    font-weight: 700;
}
.dg-attachments-grid .dg-attachment__meta {
    margin-top: var(--wp--preset--spacing--5);
    font-size: var(--wp--preset--font-size--small, 0.9rem);
    color: var(--wp--preset--color--dark-gray);
}
@media (max-width: 991px) {
    .dg-attachments--cols-4 .dg-attachments-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 781px) {
    .dg-attachments-grid,
    .dg-attachments--cols-3 .dg-attachments-grid,
    .dg-attachments--cols-4 .dg-attachments-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
    .dg-attachments-grid .dg-attachment__cover,
    .dg-attachments-grid .dg-attachment__link:hover .dg-attachment__cover {
        transition: none;
        transform: none;
    }
}


/* ==========================================================================
   Suositukset (digitaali/testimonials) — Slick-karuselli
   Slider-alustus: src/blocks/testimonials/view.js. Vain core slick.css ladataan
   (render.php); nuolet + pisteet tyylitellään alla teeman muuttujilla.
   ========================================================================== */
.dg-testimonials {
    --dg-t-gap: 25px;
}
.dg-testimonials__title {
    text-align: center;
    margin-top: 0;
    margin-bottom: var(--wp--preset--spacing--50, 50px);
}
/* Ennen slick-alustusta (ja editorin SSR-esikatselu): näytä kortit rivissä
   ettei tule pinottua FOUC-välähdystä. */
.dg-testimonials-slider:not(.slick-initialized) {
    display: flex;
    gap: var(--dg-t-gap);
    overflow: hidden;
}
.dg-testimonials-slider:not(.slick-initialized) .dg-testimonial {
    flex: 0 0 calc(33.333% - (var(--dg-t-gap) * 2 / 3));
}
/* Slick: equal-height kortit (flex-track-temppu, vaatii rows:0 view.js:ssä) +
   slidejen väli. */
.dg-testimonials-slider .slick-track {
    display: flex;
}
.dg-testimonials-slider .slick-slide {
    height: auto;
}
/* Slidejen gutter (alla) sisensi reunimmaiset kortit 12,5 px lohkon reunasta →
   kortit eivät olleet nuolten ja muiden lohkojen linjassa. */
.dg-testimonials-slider .slick-list {
    margin: 0 calc(var(--dg-t-gap) / -2);
}
.dg-testimonial {
    padding: 0 calc(var(--dg-t-gap) / 2); /* slidejen väli (gutter) */
}
.dg-testimonial__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    padding: 25px;
    background: var(--wp--preset--color--light-gray);
    border-radius: 6px;
}
@media (min-width: 992px) {
    .dg-testimonial__card { padding: 50px; }
}
/* Iso lainausmerkki currentColorin sijaan primary-värillä, dekoratiivinen */
.dg-testimonial__quote {
    position: relative;
    margin: 0;
    padding-top: 50px;
    font-style: italic;
    line-height: 1.5;
}
/* Sama lainausmerkki-SVG kuin Sitaatissa (images/icon-quote.svg, maski + pääväri). */
.dg-testimonial__quote::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 30px;
    background-color: var(--wp--preset--color--primary);
    -webkit-mask: url("../../../images/icon-quote.svg") no-repeat center / contain;
    mask: url("../../../images/icon-quote.svg") no-repeat center / contain;
}
.dg-testimonial__quote > *:first-child { margin-top: 0; }
.dg-testimonial__quote > *:last-child { margin-bottom: 0; }
.dg-testimonial__cite {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: auto; /* työntää nimen kortin alareunaan → tasaus */
    padding-top: 25px;
    font-style: normal;
}
.dg-testimonial__avatar img {
    display: block;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}
.dg-testimonial__name {
    font-weight: 700;
    line-height: 1.2;
}
/* Navigaatio (view.js luo) — yhteinen Korttinostot-karusellin kanssa */
.dg-testimonials__nav,
.dg-korttinostot__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}
.dg-testimonials__arrow,
.dg-korttinostot__arrow,
.dg-vertailu__arrow {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--wp--preset--color--dark-gray);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: background-color .2s ease, color .2s ease;
}
.dg-testimonials__arrow::before,
.dg-korttinostot__arrow::before,
.dg-vertailu__arrow::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}
.dg-testimonials__arrow--prev,
.dg-korttinostot__arrow--prev { order: 1; }
.dg-testimonials__arrow--prev::before,
.dg-korttinostot__arrow--prev::before,
.dg-vertailu__arrow--prev::before { transform: translate(-30%, -50%) rotate(135deg); }
.dg-testimonials__arrow--next,
.dg-korttinostot__arrow--next { order: 3; }
.dg-testimonials__arrow--next::before,
.dg-korttinostot__arrow--next::before,
.dg-vertailu__arrow--next::before { transform: translate(-70%, -50%) rotate(-45deg); }
.dg-testimonials__arrow:hover,
.dg-testimonials__arrow:focus-visible,
.dg-korttinostot__arrow:hover,
.dg-korttinostot__arrow:focus-visible,
.dg-vertailu__arrow:not(:disabled):hover,
.dg-vertailu__arrow:focus-visible {
    background: var(--wp--preset--color--primary);
    color: #fff;
    border-color: var(--wp--preset--color--primary);
}
/* Slickin pisteet (ul.slick-dots) palkkeina — tyylitellään teeman mukaan, ei slick-themea.
   Palkit vierekkäin ilman väliä → luetaan edistymispalkkina. Kohdealue 45 × 25 px
   (WCAG 2.5.8), palkki visuaalisesti 6 px. */
.dg-testimonials__nav .slick-dots,
.dg-korttinostot__nav .slick-dots {
    order: 2;
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.dg-testimonials__nav .slick-dots li,
.dg-korttinostot__nav .slick-dots li {
    margin: 0;
    width: auto;
    height: auto;
}
.dg-testimonials__nav .slick-dots li button,
.dg-korttinostot__nav .slick-dots li button {
    position: relative;
    width: 45px;
    height: 25px;
    padding: 0;
    font-size: 0;
    line-height: 0;
    color: transparent;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.dg-testimonials__nav .slick-dots li button::before,
.dg-korttinostot__nav .slick-dots li button::before {
    display: block;
    content: "";
    position: absolute;
    inset: 9.5px 0; /* palkki 45 × 6 px, kohdealue 25 px korkea */
    background: color-mix(in srgb, var(--wp--preset--color--dark-gray) 12%, transparent);
    transition: background-color .2s ease;
}
.dg-testimonials__nav .slick-dots li.slick-active button::before,
.dg-korttinostot__nav .slick-dots li.slick-active button::before {
    background: var(--wp--preset--color--primary);
}
.dg-testimonials__nav .slick-dots li button:focus-visible,
.dg-korttinostot__nav .slick-dots li button:focus-visible {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: -2px;
}


/* ==========================================================================
   UKK / FAQ (digitaali/faq) — natiivi <details>-haitari (ei JS:ää)
   ========================================================================== */
.dg-faq-item {
    margin-bottom: 15px;
}
.dg-faq__column > .dg-faq-item:last-child,
.dg-faq > .dg-faq-item:last-child {
    margin-bottom: 0;
}
/* Kysymys harmaana laatikkona, nuoli oikealla (ilme ennen 14.10.2026 UKK-patternista). */
.dg-faq-question {
    display: block;
    position: relative;
    padding: 15px 60px 15px 25px;
    list-style: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.05); /* sama tausta myös hoverissa ja auki — ei vaihtoa eikä viivaa */
}
.dg-faq-question::-webkit-details-marker {
    display: none; /* Safari/Chrome oletuskolmio pois */
}
.dg-faq-question::marker {
    content: "";
}
.dg-faq-question:focus-visible {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 2px;
}
/* Chevron reunaviivoilla currentColorista — näkyy taustasta riippumatta.
   Suljettu osoittaa alas, auki ylös. */
.dg-faq-question::after {
    content: "";
    position: absolute;
    right: 25px;
    top: 50%;
    width: 10px;
    height: 10px;
    margin-top: -7.5px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
}
.dg-faq-item[open] > .dg-faq-question::after {
    margin-top: -2.5px;
    transform: rotate(225deg);
}
.dg-faq-answer {
    padding: 20px 25px;
}
.dg-faq-answer > *:first-child { margin-top: 0; }
.dg-faq-answer > *:last-child { margin-bottom: 0 !important; } /* p:n yleissääntö on !important */
/* Kaksi saraketta automaattisesti kun kysymyksiä on yli 3: rivit jaetaan sarakkeisiin
   render.php:ssä (ei CSS-monikolumnia, joka siirtäisi rivejä sarakkeesta toiseen haitaria
   avattaessa). Sarakeväli 100 px.
   Alle 992 px allekkain. */
@media (min-width: 992px) {
    .dg-faq--columns-2 {
        display: flex;
        align-items: flex-start;
        gap: var(--wp--preset--spacing--100);
    }
    .dg-faq--columns-2 > .dg-faq__column {
        flex: 1 1 0;
        min-width: 0;
    }
}
@media (max-width: 991.98px) {
    /* Allekkain: sarakkeen viimeisen kysymyksen marginaali on nollattu → väli tässä. */
    .dg-faq--columns-2 > .dg-faq__column + .dg-faq__column {
        margin-top: 15px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .dg-faq-question,
    .dg-faq-question::after {
        transition: none;
    }
}


/* ==========================================================================
   Ankkurinavigaatio (digitaali/anchor-nav) — sivun sisäiset pikalinkit
   Smooth scroll tulee teeman scroll-behavior:smooth-asetuksesta (_reboot.scss).
   ========================================================================== */
/* Kiinteä yläpalkki ei peitä ankkurikohdetta kun siihen hypätään. Säädä
   tarvittaessa projektin yläpalkin korkeuden mukaan. */
html {
    scroll-padding-top: 100px;
}
.dg-anchor-nav__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 25px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.dg-anchor-nav__item {
    margin: 0;
}
.dg-anchor-nav__link {
    display: inline-block;
    padding: 10px 0;
    color: inherit;
    font-size: var(--wp--preset--font-size--small, 0.9rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-decoration: none;
    border-bottom: 2px solid currentColor;
    transition: color .2s ease, border-color .2s ease;
}
.dg-anchor-nav__link:hover,
.dg-anchor-nav__link:focus-visible {
    color: var(--wp--preset--color--primary);
    border-bottom-color: var(--wp--preset--color--primary);
    text-decoration: none;
}
/* Osion alavalikko (digitaali/osionavi): nykyinen sivu. Paksumpi viiva
   (box-shadow, ei siirrä asettelua), jottei tila erotu pelkällä värillä. */
.dg-anchor-nav__link[aria-current="page"] {
    color: var(--wp--preset--color--primary);
    border-bottom-color: var(--wp--preset--color--primary);
    box-shadow: 0 2px 0 var(--wp--preset--color--primary);
}
@media (prefers-reduced-motion: reduce) {
    .dg-anchor-nav__link { transition: none; }
}

/* Mobiili (< 992 px): linkit yhdellä vaakasuunnassa vieritettävällä rivillä.
   - Keskitys auto-marginaaleilla, ei justify-content: center — center leikkaisi
     ylivuotavan rivin alun ulottumattomiin.
   - Kurkistus: reunan linkki jää osittain näkyviin, ja view.js:n luokat
     häivyttävät sen reunan jonka takana on lisää (is-more-start / is-more-end).
   - scroll-padding: Tab-fokuksella vieritetty linkki pysähtyy häivytyksen ulkopuolelle.
   - Ei scroll-snapia: ristiriidassa sivun scroll-behavior: smoothin kanssa. */
@media (max-width: 991.98px) {
    .dg-anchor-nav__list {
        --dg-fade-start: 0px;
        --dg-fade-end: 0px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-padding-inline: 50px;
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--dg-fade-start), #000 calc(100% - var(--dg-fade-end)), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 var(--dg-fade-start), #000 calc(100% - var(--dg-fade-end)), transparent 100%);
    }
    .dg-anchor-nav__list::-webkit-scrollbar {
        display: none;
    }
    .dg-anchor-nav__list.is-more-start { --dg-fade-start: 50px; }
    .dg-anchor-nav__list.is-more-end { --dg-fade-end: 50px; }
    .dg-anchor-nav__item {
        flex: 0 0 auto;
    }
    .dg-anchor-nav__item:first-child { margin-left: auto; }
    .dg-anchor-nav__item:last-child { margin-right: auto; }
    .dg-anchor-nav__link {
        white-space: nowrap;
    }
}

/* ==========================================================================
   Korttinostot — natiivi blokki digitaali/korttinostot
   Kortti = kuva + otsikko + teksti + valinnainen linkki. Linkki on otsikossa;
   kortin muu pinta tehdään klikattavaksi ::after-peitolla, jolloin ruudunlukija
   saa yhden siistin linkin eikä otsikko+ingressi+nappi -pötköä.
   ========================================================================== */
.dg-korttinostot__title {
    margin-bottom: var(--wp--preset--spacing--50, 50px);
}
.dg-korttinostot__grid {
    display: grid;
    gap: var(--wp--preset--spacing--25, 25px);
    grid-template-columns: 1fr;
}
@media (min-width: 783px) {
    .dg-korttinostot--cols-2 .dg-korttinostot__grid { grid-template-columns: repeat(2, 1fr); }
    .dg-korttinostot--cols-3 .dg-korttinostot__grid { grid-template-columns: repeat(3, 1fr); }
    .dg-korttinostot--cols-4 .dg-korttinostot__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
    .dg-korttinostot--cols-4 .dg-korttinostot__grid { grid-template-columns: repeat(4, 1fr); }
}

/* Kumoaa WP:n is-layout-flow -marginaalit gridin sisällä (ks. README). */
.dg-korttinostot__grid > * {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}

.dg-korttinostot__card {
    display: flex;
    flex-direction: column;
    background: var(--wp--preset--color--white);
    height: 100%;
}
.dg-korttinostot__card--linked {
    position: relative; /* ::after-peiton ankkuri */
}
.dg-korttinostot__media {
    margin: 0;
}
.dg-korttinostot__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.dg-korttinostot__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--wp--preset--spacing--20, 20px);
}
.dg-korttinostot__card-title {
    margin-top: 0;
    margin-bottom: var(--wp--preset--spacing--10, 10px);
}
.dg-korttinostot__card-text {
    margin-top: 0;
    margin-bottom: var(--wp--preset--spacing--20, 20px);
}
.dg-korttinostot__button {
    margin-top: auto; /* napit samalle linjalle vaikka tekstit ovat eri mittaisia */
}

/* Korttiotsikko ilman alleviivausta (sama linjaus kuin .article-card): kortti erottuu
   linkkinä jo rakenteestaan ja napista. */
/* Kaksi luokkaa, jotta voittaa yleisen a:hover-alleviivauksen (kuten .article-card). */
.dg-korttinostot .dg-korttinostot__link {
    text-decoration: none;
}

/* Koko kortin klikkausalue. Linkki pysyy otsikossa, joten saavutettava nimi
   on pelkkä otsikko — peitto on vain hiiren mukavuutta varten. */
.dg-korttinostot__card--linked .dg-korttinostot__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* CTA-kortti erottuu taustavärillä. */
.dg-korttinostot__card--cta {
    background: var(--wp--preset--color--light-gray);
    justify-content: center;
}

/* Kortin tyyli: taustakuva (cardStyle: cover). Kuva täyttää kortin, teksti ja nappi keskellä
   tummennuksen päällä. Kuva ja tummennus ovat kortin oman pinon pohjalla (isolation), jotta
   otsikkolinkin ::after-peitto kattaa yhä koko kortin. CTA-kortti pysyy omana tyylinään. */
.dg-korttinostot--cover .dg-korttinostot__card:not(.dg-korttinostot__card--cta) {
    position: relative;
    isolation: isolate;
    min-height: 450px;
    justify-content: center;
    background: var(--wp--preset--color--dark-gray);
    color: var(--wp--preset--color--white);
    text-align: center;
}
.dg-korttinostot--cover .dg-korttinostot__card:not(.dg-korttinostot__card--cta) .dg-korttinostot__media {
    position: absolute;
    inset: 0;
    z-index: -1;
}
.dg-korttinostot--cover .dg-korttinostot__card:not(.dg-korttinostot__card--cta) .dg-korttinostot__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    transition: background-color .2s ease;
}
.dg-korttinostot--cover .dg-korttinostot__card:not(.dg-korttinostot__card--cta) .dg-korttinostot__image {
    height: 100%;
    aspect-ratio: auto;
}
.dg-korttinostot--cover .dg-korttinostot__card:not(.dg-korttinostot__card--cta) .dg-korttinostot__body {
    flex: 0 1 auto;
    align-items: center;
    padding: var(--wp--preset--spacing--50, 50px) var(--wp--preset--spacing--25, 25px);
}
.dg-korttinostot--cover .dg-korttinostot__card:not(.dg-korttinostot__card--cta) .dg-korttinostot__link {
    color: inherit;
}
.dg-korttinostot--cover .dg-korttinostot__card:not(.dg-korttinostot__card--cta) .dg-korttinostot__link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}
.dg-korttinostot--cover .dg-korttinostot__card:not(.dg-korttinostot__card--cta) .dg-korttinostot__button {
    margin-top: 0;
}
.dg-korttinostot--cover .dg-korttinostot__card--linked:not(.dg-korttinostot__card--cta):hover .dg-korttinostot__media::after {
    background: rgba(0, 0, 0, .6);
}
/* Nappi (Ääriviiva, valkoinen) täyttyy koko kortin hoverilla — kortin peitto ottaa hiiren,
   joten napin oma :hover ei laukea. */
.dg-korttinostot--cover .dg-korttinostot__card--linked:hover .wp-block-button.is-style-outline-white .wp-block-button__link {
    background-color: var(--wp--preset--color--white) !important;
    border-color: var(--wp--preset--color--white);
    color: var(--wp--preset--color--dark-gray);
}

/* Ensimmäinen kortti täysleveänä (highlightFirst, vain ruudukko). Taustakuvakortissa
   leveä kuvasuhde 16:7 desktopilla ja isompi otsikko. */
.dg-korttinostot--highlight-first .dg-korttinostot__grid > :first-child {
    grid-column: 1 / -1;
}
@media (min-width: 992px) {
    .dg-korttinostot--cover.dg-korttinostot--highlight-first .dg-korttinostot__grid > :first-child {
        aspect-ratio: 16 / 7;
    }
    .dg-korttinostot--cover.dg-korttinostot--highlight-first .dg-korttinostot__grid > :first-child .dg-korttinostot__card-title {
        font-size: var(--wp--preset--font-size--x-large, 2.2rem);
        margin-bottom: var(--wp--preset--spacing--20, 20px);
    }
}
@media (prefers-reduced-motion: reduce) {
    .dg-korttinostot--cover .dg-korttinostot__media::after { transition: none; }
}

/* Karuselli (Esitystapa: karuselli). Slick: src/blocks/korttinostot/view.js; nuolet ja
   pisteet Suositusten säännöissä yllä. Näkyvien korttien määrä = --dg-k-cols. */
.dg-korttinostot--carousel {
    --dg-k-cols: 1;
    --dg-k-gap: var(--wp--preset--spacing--25, 25px);
}
@media (min-width: 783px) {
    .dg-korttinostot--carousel.dg-korttinostot--cols-2 { --dg-k-cols: 2; }
    .dg-korttinostot--carousel.dg-korttinostot--cols-3 { --dg-k-cols: 3; }
    .dg-korttinostot--carousel.dg-korttinostot--cols-4 { --dg-k-cols: 2; }
}
@media (min-width: 992px) {
    .dg-korttinostot--carousel.dg-korttinostot--cols-4 { --dg-k-cols: 4; }
}
/* Ennen alustusta ja editorin esikatselussa yksi rivi, ei pinottua välähdystä. */
.dg-korttinostot--carousel .dg-korttinostot__grid:not(.slick-initialized) {
    display: flex;
    gap: var(--dg-k-gap);
    overflow: hidden;
}
.dg-korttinostot--carousel .dg-korttinostot__grid:not(.slick-initialized) > * {
    flex: 0 0 calc((100% - (var(--dg-k-cols) - 1) * var(--dg-k-gap)) / var(--dg-k-cols));
}
.dg-korttinostot--carousel .dg-korttinostot__grid.slick-initialized {
    display: block;
}
/* Väli marginaalina: slick vähentää sen sliden leveydestä, lista levenee saman verran. */
.dg-korttinostot--carousel .slick-list {
    margin: 0 calc(var(--dg-k-gap) / -2);
}
.dg-korttinostot--carousel .slick-track {
    display: flex; /* equal-height, vaatii rows:0 */
}
.dg-korttinostot--carousel .slick-slide {
    height: auto;
    margin: 0 calc(var(--dg-k-gap) / 2) !important;
}
/* Slickin `.slick-initialized .slick-slide { display: block }` kumoaisi kortin flexin,
   jolloin napit eivät asetu samalle linjalle. */
.dg-korttinostot--carousel .slick-initialized .slick-slide {
    display: flex;
}
/* Otsikkorivi: otsikko keskellä, nuolet oikeassa reunassa. Mobiilissa nuolet
   keskitettyinä otsikon alle, ettei keskitetty otsikko jää niiden alle. */
.dg-testimonials__head,
.dg-korttinostot__head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: var(--wp--preset--spacing--20, 20px); /* mobiilissa otsikon ja nuolten väli */
    margin-bottom: var(--wp--preset--spacing--25, 25px);
}
.dg-testimonials__head .dg-testimonials__title,
.dg-korttinostot__head .dg-korttinostot__title {
    margin: 0 !important;
}
.dg-testimonials__arrows,
.dg-korttinostot__arrows {
    display: flex;
    gap: 10px;
    justify-self: center;
}
/* Ei otsikkoa eikä nuolia (kaikki kortit mahtuvat näkyviin) → ei tyhjää riviä. */
.dg-testimonials__head--no-title:has(> .dg-testimonials__arrows:empty),
.dg-korttinostot__head--no-title:has(> .dg-korttinostot__arrows:empty),
.dg-testimonials__arrows:empty,
.dg-korttinostot__arrows:empty {
    display: none;
}
@media (min-width: 783px) {
    .dg-testimonials__head,
    .dg-korttinostot__head {
        grid-template-columns: minmax(90px, 1fr) auto minmax(90px, 1fr);
        margin-bottom: var(--wp--preset--spacing--50, 50px);
    }
    .dg-testimonials__head .dg-testimonials__title,
    .dg-korttinostot__head .dg-korttinostot__title { grid-column: 2; }
    .dg-testimonials__arrows,
    .dg-korttinostot__arrows { grid-column: 3; grid-row: 1; justify-self: end; }
    .dg-testimonials__head--no-title,
    .dg-korttinostot__head--no-title { margin-bottom: var(--wp--preset--spacing--25, 25px); }
}

/* Ei looppia → reunassa nuoli on pois käytöstä. */
.dg-testimonials__arrow.slick-disabled,
.dg-korttinostot__arrow.slick-disabled {
    opacity: .35;
    cursor: default;
    pointer-events: none;
}

/* ==========================================================================
   Videot — natiivi blokki digitaali/videot
   YouTube-videot renderöityvät teeman facadena (.dg-video-facade), joka hoitaa
   oman kuvasuhteensa. Muut providerit tarvitsevat .iframe-container-kääreen,
   koska sisältösuodatin ei aja lohkon renderöinnissä (ks. render.php).
   ========================================================================== */
.dg-videot__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--wp--preset--spacing--25, 25px);
}
@media (min-width: 783px) {
    .dg-videot--cols-2 .dg-videot__grid { grid-template-columns: repeat(2, 1fr); }
    .dg-videot--cols-3 .dg-videot__grid { grid-template-columns: repeat(3, 1fr); }
}

/* Kumoaa WP:n is-layout-flow -marginaalit gridin sisällä (ks. README). */
.dg-videot__grid > * {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
}

.dg-videot__item {
    margin: 0;
}
.dg-videot__title {
    margin-top: var(--wp--preset--spacing--10, 10px);
    font-weight: 600;
}

/* Ladattu video: sama 16:9 kuin upotuksilla. */
.dg-videot__video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background-color: var(--wp--preset--color--black);
}

/* Provider-iframe (esim. Vimeo) palautuu kiinteämittaisena → venytetään soluun. */
.dg-videot__embed .iframe-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}
.dg-videot__embed .iframe-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==========================================================================
   Toimipisteet (digitaali/toimipisteet) ja Aukioloajat (digitaali/aukioloajat)
   Kortti = .dg-card. Markup: inc/components/toimipisteet-functions.php.
   ========================================================================== */
/* [email]-lyhytkoodin @ (span.at). Frontille sääntö tulee inline-tyylinä wp_headissa
   (digitaali_email_link_assets); editorin kanvakseen vain tämän tiedoston kautta. */
.editor-styles-wrapper span.at:before {
    content: '@';
}
.dg-shop-card__title {
    margin-bottom: 5px;
}
/* Kappaleiden marginaalit !importantilla: yleissääntö `p { margin-bottom: 25px !important }`
   (tämän tiedoston alussa) ohittaisi ne muuten. */
.dg-shop-card__location {
    margin-bottom: 15px !important;
}
.dg-shop-card__contact {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}
.dg-shop-card__contact li {
    margin-bottom: 5px;
}
.dg-opening-hours__list {
    margin: 0 0 15px;
}
.dg-opening-hours__row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.dg-opening-hours__row dt {
    font-weight: 600;
}
.dg-opening-hours__row dd {
    margin: 0;
    text-align: right;
}
.dg-opening-hours__subtitle {
    margin: 20px 0 5px !important;
    font-weight: 600;
}
.dg-opening-hours__info {
    margin: 0 !important;
}

/* ==========================================================================
   Tiedote (inc/notice.php) — yläpalkin alla, kävijä voi sulkea
   ========================================================================== */
.dg-notice {
    padding: 15px 0;
    background-color: var(--wp--preset--color--dark-gray);
    color: var(--wp--preset--color--white);
}
.dg-notice[hidden] {
    display: none;
}
.dg-notice__inner {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    max-width: var(--wp--style--global--wide-size);
    margin: 0 auto;
    padding: 0 25px;
}
.dg-notice__content {
    flex: 1;
}
.dg-notice__content > :last-child {
    margin-bottom: 0 !important; /* p:n yleissääntö on !important */
}
.dg-notice a {
    color: inherit;
    text-decoration: underline;
}
.dg-notice__close {
    flex: none;
    padding: 5px;
    border: 0;
    background: none;
    color: inherit;
    line-height: 0;
    cursor: pointer;
}
.dg-notice__close svg {
    fill: currentColor;
}
.dg-notice__close:focus-visible,
.dg-notice a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ==========================================================================
   Tilastot-pattern (patterns/tilastot.php): luku ja selite tiiviisti allekkain.
   p:n yleissääntö (margin-bottom 25px !important) kumotaan, väli tulee gapista.
   ========================================================================== */
/* Kaksi luokkaa: editorissa ryhmän flex-asettelun gap (25 px) ohitti yhden luokan säännön. */
.wp-block-group.dg-stats__item {
    gap: 5px;
}
.dg-stats__item p {
    margin-bottom: 0 !important;
}
/* Juoksevat numerot (js/stats-count-up.js): alkuperäinen luku näkymättömänä määrää leveyden
   (osio ei hypi), laskuri samassa ruudussa päällä. */
.dg-count {
    display: inline-grid;
}
.dg-count > * {
    grid-area: 1 / 1;
}
.dg-count__final {
    opacity: 0;
}
.dg-count__run {
    font-variant-numeric: tabular-nums;
}
@media print {
    .dg-count__final { opacity: 1; }
    .dg-count__run { display: none; }
}

/* === Hakutulossivu (search.php, inc/search-results.php) ===
   Tulokset ryhmitelty sisältötyypeittäin, jokainen ryhmä omalla kortillaan.
   Vain ryhmien kehys ja suodatinnapit tyylitellään täällä, kortit tuovat
   oman ilmeensä. p-marginaalit !importantilla, koska teeman p-sääntö on sellainen. */
.dg-search-header { margin-bottom: 50px; }
.dg-search-header h1 span { color: var(--wp--preset--color--secondary); }
.dg-search-summary { margin-bottom: 25px !important; }

.dg-search-form { display: flex; gap: 10px; max-width: 500px; }
/* 404-sivun hakukenttä keskellä otsikon ja etusivulinkin alla. */
.error-404__search { margin-top: var(--wp--preset--spacing--50, 50px); }
.error-404__search .dg-search-form { margin: 0 auto; }
.dg-search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 15px;
    background-color: var(--wp--preset--color--light-gray);
    border: 0;
}

.dg-search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 50px;
}
.dg-search-filter {
    display: inline-flex;
    align-items: center;
    gap: 7.5px;
    padding: 5px 15px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 100px;
    color: var(--wp--preset--color--dark-gray);
    text-decoration: none;
    font-size: 0.9rem;
}
.dg-search-filter:hover,
.dg-search-filter:focus-visible {
    border-color: var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--secondary);
    text-decoration: none; /* Bootstrapin a:hover-alleviivaus voittaisi pelkän .dg-search-filterin */
}
.dg-search-filter.is-active {
    background-color: var(--wp--preset--color--secondary);
    border-color: var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--white);
}
.dg-search-count { opacity: 0.75; }

/* ==========================================================================
   Vertailutaulukko (digitaali/vertailutaulukko) — desktopilla taulukko, alle 992 px
   korttislider (view.js). Nuolet: Suositusten/Korttinostojen yhteiset säännöt yllä.
   ========================================================================== */
.dg-vertailu__table-wrap {
    overflow-x: auto; /* paljon sarakkeita kapealla desktopilla → vierittyy, ei leviä */
}
.dg-vertailu__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.dg-vertailu__table th,
.dg-vertailu__table td {
    padding: 15px 20px;
    border: 0;
    text-align: center;
    vertical-align: middle;
}
.dg-vertailu__table tbody th {
    text-align: left;
    font-weight: 700;
}
.dg-vertailu__table thead tr:first-child td:first-child,
.dg-vertailu__table tbody th {
    width: 25%;
}
.dg-vertailu__table tbody tr:nth-child(odd) > * {
    background-color: var(--wp--preset--color--light-gray);
}
.dg-vertailu__names th {
    font-size: var(--wp--preset--font-size--large, 1.5rem);
    line-height: 1.2;
    padding-bottom: 20px;
}
.dg-vertailu__images td {
    padding-bottom: 0;
}
.dg-vertailu__image {
    display: block;
    width: 100%;
    max-width: 220px;
    height: 160px;
    object-fit: contain;
    margin: 0 auto;
}
.dg-vertailu__table tfoot td {
    padding-top: 25px;
}
/* Korostettu sarake: ohut pääväritausta koko sarakkeen läpi, nimi päävärillä. */
.dg-vertailu__table .is-highlight,
.dg-vertailu__table tbody tr > .is-highlight {
    background-color: color-mix(in srgb, var(--wp--preset--color--primary) 8%, transparent);
}
.dg-vertailu__table tbody tr:nth-child(odd) > .is-highlight {
    background-color: color-mix(in srgb, var(--wp--preset--color--primary) 13%, var(--wp--preset--color--light-gray));
}
.dg-vertailu__names .is-highlight {
    color: var(--wp--preset--color--primary);
}

/* ✓ / – kuvakkeina */
.dg-vertailu__icon {
    display: inline-block;
    vertical-align: middle;
}
.dg-vertailu__icon--yes {
    width: 10px;
    height: 18px;
    border-right: 3px solid var(--wp--preset--color--primary);
    border-bottom: 3px solid var(--wp--preset--color--primary);
    transform: rotate(45deg) translate(-2px, -2px);
}
.dg-vertailu__icon--no {
    width: 14px;
    height: 2px;
    background-color: currentColor;
    opacity: .5;
}

/* Mobiili: kortit + navigaatio */
.dg-vertailu__mobile {
    display: none;
}
.dg-vertailu__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: var(--wp--preset--spacing--25, 25px);
}
.dg-vertailu__counter {
    order: 2;
    min-width: 4em;
    text-align: center;
    font-weight: 700;
}
.dg-vertailu__arrow--prev { order: 1; }
.dg-vertailu__arrow--next { order: 3; }
.dg-vertailu__arrow:disabled {
    opacity: .3;
    cursor: default;
}
.dg-vertailu__card {
    padding: 0 0 var(--wp--preset--spacing--20, 20px);
}
.dg-vertailu__card.is-highlight {
    background-color: color-mix(in srgb, var(--wp--preset--color--primary) 8%, transparent);
}
.dg-vertailu__card-header {
    padding: var(--wp--preset--spacing--20, 20px) var(--wp--preset--spacing--15, 15px);
    text-align: center;
}
.dg-vertailu__card-header .dg-vertailu__image {
    margin-bottom: var(--wp--preset--spacing--15, 15px);
}
.dg-vertailu__card-title {
    margin: 0;
}
.dg-vertailu__card.is-highlight .dg-vertailu__card-title {
    color: var(--wp--preset--color--primary);
}
.dg-vertailu__card-rows {
    margin: 0;
}
.dg-vertailu__card-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 15px;
}
.dg-vertailu__card-row:nth-child(odd) {
    background-color: var(--wp--preset--color--light-gray);
}
.dg-vertailu__card-row dt {
    font-weight: 700;
}
.dg-vertailu__card-row dd {
    margin: 0;
    text-align: right;
}
.dg-vertailu__card-cta {
    padding: var(--wp--preset--spacing--20, 20px) 15px 0;
    text-align: center;
}
.dg-vertailu__cards .slick-track {
    display: flex; /* kortit yhtä korkeiksi */
}
.dg-vertailu__cards .slick-slide {
    height: auto;
}
@media (max-width: 991px) {
    .dg-vertailu__table-wrap { display: none; }
    .dg-vertailu__mobile { display: block; }
}

/* ==========================================================================
   Uutislistaus (digitaali/uutislistaus) — aihenapit = hakusivun suodatinnapit
   (.dg-search-filter), kuukausi Bootstrapin form-select. Kortit content-card.php.
   ========================================================================== */
.dg-uutislistaus__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--wp--preset--spacing--20, 20px);
    margin-bottom: var(--wp--preset--spacing--25, 25px);
}
.dg-uutislistaus__filters .dg-search-filters {
    margin-bottom: 0;
}
.dg-uutislistaus__month {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--wp--preset--spacing--10, 10px);
    margin: 0;
}
.dg-uutislistaus__month label {
    font-weight: 700;
}
.dg-uutislistaus__month .form-select {
    width: auto;
}
.dg-uutislistaus__status {
    margin-bottom: var(--wp--preset--spacing--20, 20px);
    font-size: var(--wp--preset--font-size--small, 0.9rem);
}
.dg-uutislistaus__grid {
    transition: opacity .2s ease;
}
.dg-uutislistaus__grid[aria-busy="true"] {
    opacity: .5;
}
.dg-uutislistaus__more {
    display: flex;
    justify-content: center;
    margin-top: var(--wp--preset--spacing--50, 50px);
}
.dg-uutislistaus__more[hidden] {
    display: none;
}
@media (prefers-reduced-motion: reduce) {
    .dg-uutislistaus__grid { transition: none; }
}

.dg-search-group { margin-bottom: 50px; }
.dg-search-group__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.dg-search-group__title { margin: 0 !important; }
.dg-search-group__count {
    margin-left: 7.5px;
    color: var(--wp--preset--color--primary);
}
.dg-search-group__more { margin: 0 !important; font-size: 0.9rem; }

/* Sivutulokset: kompakti rivi, ei korttia. Polku ("Palvelut › Huolto")
   erottaa samannimiset alasivut. */
.dg-search-rows { margin: 0; padding: 0; list-style: none; }
.dg-search-row {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.dg-search-row__image {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    object-fit: cover;
}
.dg-search-row__body { min-width: 0; }
.dg-search-row__title {
    font-weight: 700;
    text-decoration: none;
    color: var(--wp--preset--color--dark-gray);
}
/* Koko rivi klikattava, mutta linkin nimi pysyy pelkkänä otsikkona. */
.dg-search-row__title::after { content: ""; position: absolute; inset: 0; }
.dg-search-row:hover .dg-search-row__title,
.dg-search-row__title:focus-visible { color: var(--wp--preset--color--secondary); }
.dg-search-row__excerpt {
    margin: 5px 0 0 !important;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 575px) {
    .dg-search-row { gap: 15px; }
    .dg-search-row__image { flex-basis: 64px; width: 64px; height: 64px; }
}

/* === Yläpalkin haku (template-parts/header/header-search.php) ===
   Mobiili: kenttä aina näkyvissä valikon alla (DOM-järjestys), nappi piilossa.
   Desktop: 44×44-ikoninappi, paneeli avautuu sen alle (.is-open, js/javascripts.js).
   Suljettu paneeli display:none → ei sarkainjärjestyksessä. */
.dg-header-search { position: relative; }
.dg-header-search__toggle { display: none; }
.dg-header-search__form { display: flex; gap: 10px; }
.dg-header-search__form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 15px;
    background-color: var(--wp--preset--color--light-gray);
    border: 1px solid var(--wp--custom--color--border-strong);
}

@media (min-width: 992px) {
    .dg-header-search__toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        background: transparent;
        border: 0;
        color: var(--wp--preset--color--dark-gray);
        cursor: pointer;
    }
    .dg-header-search__toggle:hover,
    .dg-header-search.is-open .dg-header-search__toggle { color: var(--wp--preset--color--primary); }
    .dg-header-search__toggle:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: 2px;
    }
    .dg-header-search__panel {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        z-index: 1010;
        width: min(420px, calc(100vw - 32px));
        padding: 15px;
        background: var(--wp--preset--color--white);
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    }
    .dg-header-search.is-open .dg-header-search__panel { display: block; }
}

/* Footerin alarivi: pienet linkit vasemmalla, some-ikonit oikealla
   (footer.php → .site-footer-bottom). Mobiilissa allekkain, linkit ylempänä.
   Erotin "|" on CSS:ää vaihtoehtoisella tyhjällä tekstillä, joten ruudunlukija
   ei lue sitä linkkien välissä. Mobiilissa linkit allekkain ilman erotinta,
   jottei rivittyessä rivin alkuun jää roikkuvaa viivaa. */
.site-footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}
.site-footer-links-bottom {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
}
.site-footer-links-bottom li { padding: 0.25rem 0; }
.site-footer-links-bottom a {
    color: inherit;
    text-decoration: underline;
}
.site-footer-links-bottom a:hover { text-decoration: none; }
/* Ikonien .5rem-marginaali kumotaan, jotta reunat linjautuvat sisältöön. */
.site-footer .some-icons {
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}
/* SVG on inline-elementti tekstirivin peruslinjalla → ikoni istui 2 px alempana
   kuin linkkiteksti. Flex keskittää sen linkkinsä sisään; korkeus säilyy ennallaan.
   !important, koska linkin Bootstrap-luokka .d-block on !important. */
.site-footer .some-icons a {
    display: flex !important;
    align-items: center;
    height: 2.4rem;
}
@media (min-width: 992px) {
    .site-footer-bottom {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-top: 2.5rem;
    }
    .site-footer .some-icons { margin-left: auto; justify-content: flex-end; }
    .site-footer-links-bottom { display: flex; flex-wrap: wrap; }
    .site-footer-links-bottom li { padding: 0; }
    .site-footer-links-bottom li + li::before {
        content: "|";
        content: "|" / "";
        margin: 0 0.6rem;
    }
}

/* Murupolku yläkuvan alla (functions.php → dg_breadcrumbs_after_hero). Sivuilla ilman yläkuvaa murupolku
   nousee negatiivisella marginaalilla sisältöalueen yläpaddingiin (starter.scss); yläkuvan alla ei ole
   paddingia, joten marginaalit nollataan — yläkuvan yläpuolelle ei jää tyhjää tilaa. */
.digitaali-breadcrumbs.digitaali-breadcrumbs--after-hero {
    margin-top: 0;
    margin-bottom: 0;
}

/* Murupolun kappale: starter.scss antaa margin-bottom: 0, mutta yleissääntö `p { margin-bottom: 25px !important }`
   ohittaa sen → !important tässäkin (kuten muissa komponenteissa). Koskee kaikkia murupolkuja. */
.digitaali-breadcrumbs #breadcrumbs {
    margin-bottom: 0 !important;
}
/* Murupolun linkit alleviivattuina: tekstirivin sisällä linkki ei saa erottua pelkällä
   värillä (WCAG 1.4.1, axe link-in-text-block; kontrasti vaihtuu projektin väreillä). */
.digitaali-breadcrumbs #breadcrumbs a {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

/* Murupolku alignwide-levyisenä (luokka functions.php:n digitaali_get_breadcrumbs()). Sisempi Bootstrap-.container
   ei saa kaventaa tai sisentää tekstiä: teksti ja alaviiva alkavat alignwide-reunasta kuten muu leveä sisältö. */
.digitaali-breadcrumbs.alignwide > .container {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}


/* ==========================================================================
   Henkilöstö (digitaali/personnel, inc/components/personnel-functions.php) — henkilökortti.
   Siirretty wp_head-inline-tyylistä 13.10.2026, jotta editorin kanvas näyttää saman.
   ========================================================================== */
.person {
    width: 420px;
    max-width: 97%;
    margin: auto;
    text-align: center;
}
.person .info {
    padding: 1.5rem;
}

.person .person-name {
    margin-bottom: 1rem;
}
.person .person-role {
    display: block;
}
.person .maddr {
    word-break: break-all;
}

.personnel-category { margin-bottom: 3rem; }
.personnel-category-title { margin-bottom: 4rem; }

#personnel .person { margin-bottom: 2rem;}

figure.person-image {
    position: relative;
    overflow: hidden;
    width: 100%;
}
figure.person-image::before {
    content: "";
    display: block;
    padding-top: 75%;
}
figure.person-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ==========================================================================
   Kuvaslider (digitaali/kuvaslider, inc/components/slick-slider-functions.php).
   Siirretty wp_head-inline-tyylistä 13.10.2026, jotta editorin kanvas saa samat tyylit.
   ========================================================================== */
.dg-component-slick {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease;
    -webkit-transition: opacity 1s ease;
}
.dg-component-slick.slick-initialized {
    visibility: visible;
    opacity: 1;
}

.dg-component-slick .dg-component-slick-image {
    overflow: hidden;
    background-size: cover;
    background-position: center;
}
.dg-component-slick .dg-component-slick-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dg-component-slick.dg-one-image-slider .dg-component-slick-image {
    background-size: contain;
}
.dg-component-slick .slick-arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    width: 35px;
    height: 35px;
    color: transparent !important;
    background-color: transparent;
    background-repeat: no-repeat;
    background-size: contain;
    border: 0;
}
.dg-component-slick .slick-arrow:hover {
    cursor: pointer;
    opacity: .5;
}
.dg-component-slick .slick-arrow.slick-prev,
.dg-component-slick .slick-arrow.slick-next {
    background-size: 45px;
    background-position: center;
}
.dg-component-slick .slick-arrow.slick-prev {
    left: 12px;
    background-image: url('../../../images/arrow-white-left.svg');
    transform: translateY(-50%);
}
.dg-component-slick .slick-arrow.slick-next {
    right: 12px;
    transform: translateY(-50%);
    background-image: url('../../../images/arrow-white-right.svg');
}
@media (min-width: 992px) {
    .dg-component-slick .slick-arrow.slick-prev {
        left: 20px;
    }
    .dg-component-slick .slick-arrow.slick-next {
        right: 20px;
    }
}

.dg-component-slick .slick-dots {
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.dg-component-slick .slick-dots li button {
    display: block;
    width: 15px;
    height: 15px;
    margin: 3px;
    border-radius: 50%;
    border: 0;
    font-size: 0px;
    color: transparent;
}


/* ==========================================================================
   Editorin kanvas = front (13.10.2026). Vain .editor-styles-wrapperin sisällä —
   frontissa nämä eivät vaikuta.
   ========================================================================== */
/* Kanvaksen juurella on 25 px reunaväli (theme.json root padding). WP levittää ylätason
   täysleveät lohkot sen yli negatiivisilla marginaaleilla, mutta teeman .alignfull
   (width/max-width 100 %) piti ne säilön levyisinä → editorissa 50 px kapeampi kuin
   frontissa. Leveä (alignwide) on frontissa 100 % - 50 px eli sama kuin kanvaksen juuren
   sisäleveys. */
.editor-styles-wrapper .is-root-container.has-global-padding > .alignfull {
    width: auto;
    max-width: none;
}
.editor-styles-wrapper .is-root-container.has-global-padding > .alignwide {
    width: 100%;
}
/* 50/50 reunaan asti: editori antaa kuvalle inline-tyylin height: auto, joka ohitti
   teeman height: 100 % → kuva ei ulottunut sarakkeen alareunaan. */
@media (min-width: 782px) {
    .editor-styles-wrapper .dg-media-bleed-right > .wp-block-column:last-child .wp-block-image img,
    .editor-styles-wrapper .dg-media-bleed-left > .wp-block-column:first-child .wp-block-image img {
        height: 100% !important;
    }
}
/* Uutiskirje: editorissa flex-lapsena on HTML-lohkon kääre eikä kenttä itse, ja hallinnan
   input:disabled-tyyli harmaannutti kentän. */
.editor-styles-wrapper .dg-newsletter__input:disabled {
    background: #fff;
    border-color: var(--wp--custom--color--border-strong);
    color: inherit;
}
.editor-styles-wrapper .dg-newsletter__form > .wp-block-html {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}
/* Kuvaslider: Slick ei käynnisty editorissa, ja käynnistymätön slider on frontissa piilossa
   kunnes Slick on valmis → editorissa sama rivi kuin frontissa (4 rinnakkain, yhden kuvan
   tilassa 1). Vain ensimmäiset näkyvät, kuten slider ennen selaamista. */
.editor-styles-wrapper .dg-component-slick:not(.slick-initialized) {
    display: flex;
    overflow: hidden;
    visibility: visible;
    opacity: 1;
}
.editor-styles-wrapper .dg-component-slick:not(.slick-initialized) > .slick-item {
    flex: 0 0 25%;
    min-width: 0;
}
.editor-styles-wrapper .dg-component-slick.dg-one-image-slider:not(.slick-initialized) > .slick-item {
    flex-basis: 100%;
}
/* Ikoni (kuvan tyyli "Iconi"): editorin flex-asettelu nollasi frontin 20 px alamarginaalin. */
.editor-styles-wrapper figure.wp-block-image.is-style-dg-icon {
    margin-bottom: 20px !important;
}
/* Ninja Forms -lohkon esikatselu (iframe) mittaa korkeutensa ennen kuin lomake on
   piirtynyt → jää selaimen oletukseen 150 px ja lomake katkeaa. Vähimmäiskorkeus näyttää
   pohjalomakkeen kokonaan (`wp dg lomakepohja`, ~740 px); pidempi lomake leikkautuu. */
.editor-styles-wrapper .wp-block-ninja-forms-form .nf-iframe-overlay iframe {
    width: 100%; /* lisäosan width="auto" ei ole kelvollinen → selaimen oletus 300 px */
    min-height: 740px;
}


/* =====================================================
   PKS: HEADER, ON-CALL PILL, MOBILE MENU, FOOTER (XD layout)
   Desktop navigation from 1200px (navbar-expand-xl): the XD header
   (logo, 6 links, on-call pill, language) does not fit below that.
   ===================================================== */

/* Header bar: white, ~125px tall on desktop (XD). Mobile white too (Antti 23.10.2026; XD mobile artboard is light blue). */
#main-navbar {
    padding: 13px 0;
    background: var(--wp--preset--color--white);
}
@media (min-width: 1200px) {
    #main-navbar {
        padding: 26px 0;
        background: var(--wp--preset--color--white);
    }
    #main-navbar .main-menu > li > a.nav-link {
        padding: 0 20px;
        font-size: 18px;
        font-weight: 500;
        line-height: 1.5;
        color: var(--wp--preset--color--secondary);
    }
    #main-navbar .main-menu > li > a.nav-link:hover,
    #main-navbar .main-menu > li.current-menu-item > a.nav-link,
    #main-navbar .main-menu > li.current-menu-ancestor > a.nav-link {
        color: var(--wp--preset--color--primary);
    }
    #main-navbar .main-menu li.yamm-fw > a.nav-link {
        padding-right: 8px;
        /* inline-block (needed for the caret beside it) sat on the baseline of the li's 30.6 px line box,
           2 px lower than the other top-level links (display: block at the top of their li). */
        vertical-align: top;
    }
    .dg-header-actions {
        display: flex;
        align-items: center;
        gap: 20px;
        margin-left: 20px;
    }
}
/* 1200–1599px: same bar, tighter so it fits on one row. */
@media (min-width: 1200px) and (max-width: 1599px) {
    #main-navbar .main-menu > li > a.nav-link {
        padding: 0 10px;
        font-size: 16px;
    }
    .dg-header-actions { gap: 12px; margin-left: 10px; }
    .dg-oncall--header .dg-oncall__label {
        /* number only; label stays for screen readers */
        position: absolute !important;
        width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
}

/* Language links (WPML) — layout: plain "English" after the pill. */
.dg-header-actions .lang-selector a {
    font-weight: 500;
    color: var(--wp--preset--color--secondary);
    text-decoration: none;
}
.dg-header-actions .lang-selector a:hover { color: var(--wp--preset--color--primary); }

/* On-call pill: navy label + accent number in one tel: link (XD 363 × 48). */
.dg-oncall {
    display: inline-flex;
    align-items: stretch;
    min-height: 48px;
    border-radius: 29px;
    background: var(--wp--preset--color--secondary);
    font-size: 16px;
    line-height: 1.5;
    text-decoration: none !important;
    white-space: nowrap;
}
.dg-oncall__label,
.dg-oncall__number {
    display: inline-flex;
    align-items: center;
    padding: 0 30px;
}
.dg-oncall__label {
    font-weight: 600;
    color: var(--wp--preset--color--white);
}
.dg-oncall__number {
    padding: 0 25px;
    border-radius: 29px;
    background: var(--wp--preset--color--accent);
    font-weight: 500;
    color: var(--wp--preset--color--secondary);
    transition: background-color 0.2s ease;
}
.dg-oncall:hover .dg-oncall__number,
.dg-oncall:focus-visible .dg-oncall__number {
    background: var(--wp--preset--color--white);
}
/* Footer: outlined label on navy. */
.dg-oncall--footer {
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--wp--preset--color--accent);
}
/* Mobile: fixed to the bottom of the viewport (XD iPhone artboard). */
.dg-oncall-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 16px;
    z-index: 900;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.dg-oncall-sticky .dg-oncall {
    pointer-events: auto;
    box-shadow: 0 6px 20px rgba(17, 23, 49, 0.25);
}
@media (max-width: 1199px) {
    /* Room for the sticky pill under the footer: inside the navy bottom bar, not as white body padding. */
    .site-footer-footer { padding-bottom: calc(1rem + 80px) !important; }
    .dg-oncall__label { padding: 0 20px; }
    .dg-oncall__number { padding: 0 20px; }
}
@media (max-width: 380px) {
    .dg-oncall { font-size: 14px; }
    .dg-oncall__label, .dg-oncall__number { padding: 0 14px; }
}

/* Mobile menu (no open state in XD → theme menu in layout colours). */
@media (max-width: 1199px) {
    #dg-nav-icon {
        width: 28px;
        height: 20px;
        margin: 6px 0 4px;
    }
    #dg-nav-icon span {
        height: 2px;
        background: var(--wp--preset--color--secondary);
    }
    #dg-nav-icon span:nth-child(1) { top: 0; }
    #dg-nav-icon span:nth-child(2),
    #dg-nav-icon span:nth-child(3) { top: 9px; }
    #dg-nav-icon span:nth-child(4) { top: 18px; }
    #dg-nav-icon.open span:nth-child(1),
    #dg-nav-icon.open span:nth-child(4) { top: 9px; }

    #navbar-collapse-area .main-menu {
        margin-top: 20px !important;
    }
    #navbar-collapse-area .main-menu > li {
        border-bottom: 1px solid rgba(17, 23, 49, 0.15);
    }
    #main-navbar #navbar-collapse-area .main-menu > li > a.nav-link {
        padding: 14px 0;
        font-size: 20px;
        font-weight: 500;
        color: var(--wp--preset--color--secondary);
    }
    #main-navbar-container .dg-yamm-sub-items > .dropdown-menu > li > a.dropdown-item {
        padding: 10px 0 10px 16px !important;
        font-size: 17px !important;
        font-weight: 500;
        color: var(--wp--preset--color--secondary);
        border-bottom: 0;
    }
    #navbar-collapse-area .dg-yamm-sub-items > .dropdown-menu { padding-bottom: 10px; }
    /* Caret as tall as the top-level link row (padding 14px × 2 + line-height 34px = 62px), not the
       whole li — the li grows when the submenu opens and the caret must stay on the row. */
    #navbar-collapse-area li.yamm-fw > a.nav-link + .dg-caret {
        top: 0;
        bottom: auto;
        right: 0;
        width: 44px;
        height: 62px;
    }
    .dg-header-actions {
        padding: 20px 0 10px;
        font-size: 18px;
    }
}

/* Button with arrow circle (XD "Pyydä tarjous ↗"): wrapper class like dg-button-small. */
.dg-button-arrow .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding-top: 6px;
    padding-bottom: 6px;
    padding-right: 6px;
}
.dg-button-arrow .wp-block-button__link::after {
    content: "";
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--wp--preset--color--accent) url(../../../images/icon-arrow-up-right-navy.svg) center / 10.36px no-repeat; /* svg viewBox in XD px */
}
.dg-button-arrow .wp-block-button__link:hover::after,
.dg-button-arrow .wp-block-button__link:focus-visible::after {
    background-color: var(--wp--preset--color--white);
}
/* Narrow screens: a long label wraps to two lines → more vertical padding so the text does not touch
   the border (6px only works next to the 36px circle on one line). */
@media (max-width: 1199px) {
    .dg-button-arrow .wp-block-button__link {
        padding-top: 10px;
        padding-bottom: 10px;
        line-height: 1.3;
        text-align: left;
    }
}

/* Footer: navy with faint vertical lines (XD texture), 4 columns from 1200px.
   Background = XD "Rectangle 3" (soft gradient, blue glow top right + bottom left), placed as in the layout:
   image 2070 px wide at x -23, y -1427 on a 1920 artboard → vw units so the crop stays the same. */
.site-footer {
    position: relative;
    isolation: isolate;
    background-image: url(../../../images/footer-bg.jpg);
    background-repeat: no-repeat;
    background-size: 107.8vw auto;
    background-position: -1.2vw -74.32vw;
    padding-top: 100px !important;
    padding-bottom: 70px !important;
    font-size: 17px;
    font-weight: 500;
}
/* Stacked footer is far taller than the layout's crop: show the whole gradient instead. */
@media (max-width: 991px) {
    .site-footer {
        background-size: cover;
        background-position: center 65%;
    }
}
/* Vertical lines = the XD footer's stripes as such (images/footer-raidat.svg, 1920 × 738, converted from the XD
   symbol: each line fades out downwards and the ends form the layout's wave). Scaled with the width like the
   gradient; on stacked layouts at natural size so the lines stay as far apart as in the layout. */
.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url(../../../images/footer-raidat.svg) center top / 100vw auto no-repeat;
    opacity: 0.6; /* the XD values looked too bright on the page */
    pointer-events: none;
}
@media (max-width: 991px) {
    .site-footer::before { background-size: 1920px auto; }
}
.site-footer-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 50px;
}
.site-footer-head .navbar-brand img { width: 112px; }
.site-footer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 40px;
}
.site-footer-brand p {
    max-width: 350px;
    line-height: 28px;
}
.site-footer .site-footer-heading {
    margin-bottom: 18px;
    font-family: var(--wp--preset--font-family--bai-jamjuree);
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
    color: var(--wp--preset--color--accent);
}
.site-footer .site-footer-heading a { color: inherit; }
.site-footer .site-footer-links li { margin: 0; line-height: 35px; }
.site-footer .site-footer-links a { font-size: 18px; text-decoration: none; }
.site-footer .site-footer-links a:hover { text-decoration: underline; }
@media (min-width: 1200px) {
    .site-footer-top {
        display: grid;
        /* XD column starts 140 / 696 / 1106 / 1478 px of a 1640px row */
        grid-template-columns: 556fr 410fr 372fr 302fr;
        gap: 0;
    }
    .site-footer-top > .site-footer-col,
    .site-footer-menu-cols .site-footer-col { min-width: 0; }
    .site-footer-side { display: flex; justify-content: flex-start; }
}
.site-footer-side .wp-block-image { margin: 0; }

/* Contact row: icon boxes in accent tint. */
.site-footer-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 40px;
    margin: 80px 0 0;
    padding: 0;
    list-style: none;
    font-size: 18px;
}
.site-footer-contact li {
    display: flex;
    align-items: center;
    gap: 22px;
}
.site-footer-contact a { display: flex; align-items: center; gap: 22px; text-decoration: none; }
.site-footer-contact a[href^="tel:"] { display: inline; color: inherit; } /* inside the "Asiakaspalvelu" text, not a flex row */
.site-footer-contact__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 5px;
    background: rgba(110, 201, 255, 0.12);
    color: var(--wp--preset--color--accent);
}
.site-footer-contact__icon svg { width: auto; height: 20px; }
.site-footer-contact__icon--plain {
    width: auto;
    background: none;
    color: var(--wp--preset--color--white);
}
.site-footer-contact__icon--plain svg { height: 29px; }
@media (max-width: 1199px) {
    .site-footer { padding-top: 60px !important; }
    .site-footer-brand { margin-bottom: 30px; }
    .site-footer-side { margin-top: 30px; }
    .site-footer-contact { flex-direction: column; align-items: flex-start; margin-top: 40px; }
}
/* Bottom bar: "Tietosuojaseloste | Design by Digitaali", clearly smaller than the footer text (17–18 px). The
   separator is an empty pseudo-element line (nothing for screen readers to read). */
.site-footer-footer .container.design-by {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    line-height: 22px;
}
.site-footer-footer .design-by { font-size: inherit; }
.site-footer-footer__links .site-footer-links-bottom { display: flex; flex-wrap: wrap; font-size: inherit; }
.site-footer-footer__links .site-footer-links-bottom li { padding: 0; }
.site-footer-footer__links .site-footer-links-bottom a { text-decoration: none; }
.site-footer-footer__links .site-footer-links-bottom a:hover,
.site-footer-footer__links .site-footer-links-bottom a:focus-visible { text-decoration: underline; }
.site-footer-footer__links .site-footer-links-bottom li + li::before,
.site-footer-footer__links::after {
    content: "";
    flex: none;
    width: 1px;
    height: 18px; /* taller than the 14 px text, centred on the row */
    margin: 0 12px;
    background: currentColor;
}
.site-footer-footer__links,
.site-footer-footer__links .site-footer-links-bottom,
.site-footer-footer__links .site-footer-links-bottom li { display: flex; align-items: center; }
@media (max-width: 767px) {
    /* Phones: "Design by" centred on its own row under the links, no separator before it. */
    .site-footer-footer .container.design-by { flex-direction: column; row-gap: 12px; }
    .site-footer-footer__links::after { display: none; }
}
/* Footer contact row: long e-mail must not run past the edge on narrow phones. */
.site-footer-contact .maddr { overflow-wrap: anywhere; }

/* PKS front page hero, class dg-hero--front on the cover (XD "Web 1920 – 1"): H1 Bai Jamjuree Light 70/80, ingress 659px wide.
   Mobile artboard: content in the middle of the screen, not on the bottom edge where the
   sticky on-call pill sits. */
.dg-hero--front h1 {
    font-weight: 300;
    line-height: 1.143;
}
.dg-hero--front .is-style-lead {
    max-width: 659px;
    line-height: 1.6; /* hero gaps below are pixel-measured with this */
}
/* Visually equal gaps: title glyphs → ingress glyphs = ingress → button (≈ 48 desktop, 44 mobile, pixel-measured).
   The block gap (25) collapses with these margins. */
html .dg-hero--front .is-style-lead { margin-bottom: 33px !important; }
@media (min-width: 1200px) {
    html .dg-hero--front h1 { margin-bottom: 27px !important; }
    html .dg-hero--front .is-style-lead { margin-bottom: 42px !important; }
}
@media (max-width: 1199px) {
    .dg-hero--front.is-position-bottom-left {
        align-items: center;
    }
    .dg-hero--front .wp-block-cover__inner-container {
        padding-bottom: 90px;
    }
}
/* XD (Rectangle 1355, rotated 180°): darkens downwards — transparent at the top, #040508 at
   82 % opacity at the bottom, over the lower 89 % (963/1082 px) of the hero. */
.dg-hero--front::before {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 89%;
    z-index: 1;
    background: linear-gradient(to top, rgba(4, 5, 8, 0.82), rgba(17, 23, 48, 0));
    pointer-events: none;
}
.dg-hero--front .wp-block-cover__inner-container { z-index: 2; }
/* Hero text on the same 50 px line as the content sections below it (constrained full-width groups: 25 px
   group padding + 25 px child inset). cover.css has 25 px, which left the hero text 25 px further left on
   992–1690 px screens. From 1690 px the wide-size centring wins as before (140 px at 1920). */
@media (min-width: 992px) {
    html .dg-hero { /* html: cover.css loads after this file */
        padding-left: max(50px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important;
        padding-right: max(50px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important;
    }
}
/* Laptop scale: inner top/bottom space 85/100 → 50/60 below 1920 px, so the text + button fit in the first
   screen (at 1280 × 720 the content was taller than the hero and the button fell under the fold). */
@media (min-width: 1200px) and (max-width: 1919px) {
    .dg-hero--front .wp-block-cover__inner-container {
        padding-top: 50px !important;
        padding-bottom: 60px !important;
    }
}

/* =====================================================
   PKS front page: "Huolenpitoa kiinteistön sähköteknisille ratkaisuille" (XD Web 1920 – 1, y 1290–2075).
   Navy section (core group .dg-toimialat) + heading + Hover-kortit block.
   ===================================================== */
/* Section spacing = theme is-style-dg-big-y-paddings. !important below: the theme forces margin-bottom: 25px on headings. */
.dg-toimialat > h2 {
    font-weight: 300;
    margin-bottom: 50px !important;
}
@media (min-width: 782px) {
    .dg-toimialat > h2 { margin-bottom: 85px !important; } /* XD: heading → cards 81–90px */
}

/* Hover-kortit block (src/blocks/hover-kortit): XD cards 398 × 541, radius 5, gap 16. Hover/focus turns
   the card white: title becomes a small grey label, arrow + heading + text appear (XD pasteboard note
   "Tekstilaatikko hoverina"). Touch devices and the editor show the text on a darker gradient. */
.dg-hover-kortit {
    container-type: inline-size;
    display: grid;
    grid-template-columns: repeat(var(--dg-hover-cols, 4), minmax(0, 1fr));
    gap: 16px;
}
@media (max-width: 1199px) {
    .dg-hover-kortit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
    .dg-hover-kortit { grid-template-columns: 1fr; }
}
.dg-hover-kortti {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-height: 420px;
    padding: 45px;
    border-radius: 5px; /* no overflow: hidden — the card may grow with its text; image + layers round themselves */
    background: var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--white);
}
/* Desktop: XD proportions (398 × 541) as the minimum; min-height: auto lets a long text grow the card
   (all cards in the row stretch to the same height), same height at rest and on hover. */
@media (min-width: 1200px) {
    /* Min height from the column width (container query), not aspect-ratio: aspect-ratio would stop
       the cards of a row stretching to the tallest one. */
    .dg-hover-kortti {
        min-height: calc((100cqw - (var(--dg-hover-cols, 4) - 1) * 16px) / var(--dg-hover-cols, 4) * 541 / 398);
    }
}
@media (max-width: 599px) {
    .dg-hover-kortti { padding: 30px; }
}
.dg-hover-kortti__image {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    opacity: 0.73; /* XD: image group at 73 % over the navy card background (darkens + tints like the hero) */
}
/* XD: black → transparent over the top 60 %, 65 % opacity (darkens upwards). */
.dg-hover-kortti::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), rgba(17, 23, 48, 0) 60%);
    transition: background-color 0.3s ease;
}
.dg-hover-kortti .dg-hover-kortti__title {
    margin: 0;
    text-align: right;
    font-size: 25px !important;
    font-weight: 300;
    line-height: 35px;
    color: inherit;
    transition: opacity 0.3s ease;
}
/* XD hover label: one line, 14px grey, 23px from the top and 33px from the right. */
.dg-hover-kortti__label {
    position: absolute;
    top: 23px;
    right: 33px;
    left: 33px;
    text-align: right;
    font-family: var(--wp--preset--font-family--bai-jamjuree);
    font-size: 14px;
    font-weight: 500;
    line-height: 28px;
    color: #9a9a9a;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.dg-hover-kortti__panel {
    align-self: stretch;
    margin-top: 40px;
}
/* Hover-capable devices: the title is absolutely positioned (top right) so it takes no layout space and
   the panel starts where XD puts the arrow (98px from the card top) → height 541 like XD, identical at
   rest and on hover. Touch devices keep the title in the flow (title and text are visible together). */
@media (hover: hover) {
    .dg-hover-kortti .dg-hover-kortti__title {
        position: absolute;
        top: 45px;
        right: 45px;
        left: 45px;
    }
    .dg-hover-kortti__panel { margin-top: 53px; }
}
@media (hover: hover) and (max-width: 599px) {
    .dg-hover-kortti .dg-hover-kortti__title { top: 30px; right: 30px; left: 30px; }
    .dg-hover-kortti__panel { margin-top: 68px; }
}
.dg-hover-kortti__panel::before {
    content: "";
    display: block;
    width: 32px;
    height: 32px;
    margin-bottom: 42px;
    background: #1d1d1b;
    -webkit-mask: url(../../../images/icon-arrow-down-left-thin.svg) center / contain no-repeat;
    mask: url(../../../images/icon-arrow-down-left-thin.svg) center / contain no-repeat; /* XD: thin ↙, 1.4px */
}
.dg-hover-kortti .dg-hover-kortti__heading {
    margin: 0 0 18px;
    font-size: 20px !important;
    font-weight: 500;
    line-height: 28px;
    color: var(--wp--preset--color--secondary);
}
.dg-hover-kortti__link { color: inherit; text-decoration: none; }
.dg-hover-kortti__link::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.dg-hover-kortti__text {
    margin: 0 !important;
    font-size: 17px;
    line-height: 25px;
    color: var(--wp--preset--color--dark-gray);
}

/* Laptop scale (1200–1919 px): the hidden hover text sets the card height, and in a 283 px card (1280) it ran
   to 16 lines → 719 px tall cards. Tighter padding and text: 494 px at 1280, XD proportions from ~1440. */
@media (hover: hover) and (min-width: 1200px) and (max-width: 1919px) {
    .dg-hover-kortti { padding: 30px; }
    .dg-hover-kortti .dg-hover-kortti__title { top: 30px; right: 30px; left: 30px; }
    .dg-hover-kortti__panel { margin-top: 40px; }
    .dg-hover-kortti__panel::before { width: 26px; height: 26px; margin-bottom: 24px; }
    .dg-hover-kortti .dg-hover-kortti__heading { margin-bottom: 10px; font-size: 18px !important; line-height: 24px; }
    .dg-hover-kortti__text { font-size: 15px; line-height: 22px; }
}

/* Panel hidden with opacity only: visibility: hidden would take the link out of the tab order, and a
   transform on the panel would become the containing block of the link's ::after (card not clickable). */
@media (hover: hover) {
    .dg-hover-kortti__panel {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .dg-hover-kortti__link::after { pointer-events: auto; } /* whole linked card clickable at rest too */
    .dg-hover-kortti--link { cursor: pointer; }
    .dg-hover-kortti:hover::before,
    .dg-hover-kortti:focus-within::before {
        background: var(--wp--preset--color--white);
    }
    /* The title only fades (keeps its layout size); the one-line label takes its place. */
    .dg-hover-kortti:hover .dg-hover-kortti__title,
    .dg-hover-kortti:focus-within .dg-hover-kortti__title { opacity: 0; }
    .dg-hover-kortti:hover .dg-hover-kortti__label,
    .dg-hover-kortti:focus-within .dg-hover-kortti__label { opacity: 1; }
    .dg-hover-kortti:hover .dg-hover-kortti__panel,
    .dg-hover-kortti:focus-within .dg-hover-kortti__panel {
        opacity: 1;
        pointer-events: auto;
    }
}
.dg-hover-kortti:has(.dg-hover-kortti__link:focus-visible) {
    outline: 2px solid var(--wp--preset--color--accent);
    outline-offset: 3px;
}
.dg-hover-kortti__link:focus-visible { outline: 0; }
/* Touch devices + editor preview: text always visible, white on a darker gradient. */
@media (hover: none) {
    .dg-hover-kortti::before { background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), rgba(4, 5, 8, 0.8)); }
    .dg-hover-kortti .dg-hover-kortti__heading,
    .dg-hover-kortti__text { color: var(--wp--preset--color--white); }
    .dg-hover-kortti__panel::before { display: none; }
    /* Linked card on touch: one tap goes to the link; a white arrow is the only cue. */
    .dg-hover-kortti--link .dg-hover-kortti__panel::before { display: block; background: var(--wp--preset--color--white); }
}
.editor-styles-wrapper .dg-hover-kortti::before { background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), rgba(4, 5, 8, 0.8)) !important; }
.editor-styles-wrapper .dg-hover-kortti__panel { opacity: 1 !important; }
.editor-styles-wrapper .dg-hover-kortti .dg-hover-kortti__heading,
.editor-styles-wrapper .dg-hover-kortti__text { color: var(--wp--preset--color--white) !important; }
.editor-styles-wrapper .dg-hover-kortti .dg-hover-kortti__title { font-size: 25px !important; color: var(--wp--preset--color--white) !important; }
.editor-styles-wrapper .dg-hover-kortti__panel::before { display: none; }
.editor-styles-wrapper .dg-hover-kortti { aspect-ratio: auto; min-height: 420px; } /* all text visible in the narrower canvas */
.editor-styles-wrapper .dg-hover-kortti .dg-hover-kortti__title { position: static; } /* text always visible in the editor → no overlap */
.editor-styles-wrapper .dg-hover-kortti__panel { margin-top: 40px; }
.editor-styles-wrapper .dg-hover-kortti__label { display: none; }
@media (prefers-reduced-motion: reduce) {
    .dg-hover-kortti::before, .dg-hover-kortti__title, .dg-hover-kortti__panel { transition: none !important; }
}

/* =====================================================
   PKS front page: service boxes "Kiinteistön sähkötekniikan hallinta ja ylläpito" and
   "Kiinteistöjen energiatehokkuus" (XD Web 1920 – 1, y 2258–3250). Wide pale-blue box (radius 5,
   is-style-big-content-paddings), text left, link list right (list block style dg-link-list).
   ===================================================== */
.dg-link-box {
    border-radius: 5px;
}
.dg-link-box > .wp-block-columns {
    margin: 0;
    gap: 50px 100px;
}
.dg-link-box p { max-width: 752px; } /* XD text width */
/* Side by side: fixed 400px link column (aligned in every box like XD), text column takes the rest. */
@media (min-width: 1200px) {
    .dg-link-box > .wp-block-columns > .wp-block-column:first-child { flex: 1 1 0 !important; }
    .dg-link-box > .wp-block-columns > .wp-block-column:last-child { flex: 0 0 400px !important; }
}
@media (max-width: 1399px) {
    .dg-link-box h2 br { display: none; } /* XD line breaks only where the text column is wide enough */
}
/* Columns 65/35 from 1200px; stacked below (side by side the text column gets too narrow). The XD
   line breaks in the headings only apply when the columns are side by side. */
@media (max-width: 1199px) {
    .dg-link-box > .wp-block-columns { flex-wrap: wrap !important; }
    .dg-link-box > .wp-block-columns > .wp-block-column { flex-basis: 100% !important; }
}

/* List block style "Linkkilista (nuoli)": no bullets, thin ↙ arrow above, Bai Jamjuree SemiBold 20/28,
   42px rhythm (XD), hover → accent (XD shows the first link in accent). */
ul.is-style-dg-link-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
ul.is-style-dg-link-list::before {
    content: "";
    display: block;
    width: 42px;
    height: 42px;
    margin-bottom: 38px;
    background: var(--wp--preset--color--secondary);
    -webkit-mask: url(../../../images/icon-arrow-down-left-thin.svg) center / contain no-repeat;
    mask: url(../../../images/icon-arrow-down-left-thin.svg) center / contain no-repeat;
}
ul.is-style-dg-link-list li {
    margin: 0 0 14px;
    padding: 0;
    font-family: var(--wp--preset--font-family--bai-jamjuree);
    font-size: 20px;
    font-weight: 600;
    line-height: 28px;
}
ul.is-style-dg-link-list li:last-child { margin-bottom: 0; }
ul.is-style-dg-link-list a {
    color: var(--wp--preset--color--secondary);
    text-decoration: none;
}
ul.is-style-dg-link-list a:hover,
ul.is-style-dg-link-list a:focus-visible {
    color: var(--wp--preset--color--accent);
}

/* =====================================================
   PKS 50/50 sections (XD Component 6, e.g. front page "Miksi valita PKS Service"): Bai Jamjuree
   Regular heading (Bootstrap's .h3 class would make it 600), 50px below the heading. Text → button 68px
   (≈100 baseline to baseline; the XD's 128 looked too airy, Antti 28.10.2026).
   !important beats the theme's forced 25px heading/paragraph margin.
   ===================================================== */
.dg-50-50-block .wp-block-heading {
    font-weight: 400;
    margin-bottom: 50px !important;
}
.dg-50-50-block p:has(+ .wp-block-buttons) {
    margin-bottom: 68px !important;
}
/* XD line breaks only where the first line fits the column (~475px). Narrower: natural wrap. */
@media (max-width: 1399px) {
    .dg-50-50-block .wp-block-heading br { display: none; }
}
/* No automatic hyphenation (theme default below 500px): it split the company name "Ser-vice".
   Long compound words get &shy; at the compound boundary instead. */
@media (max-width: 500px) {
    .dg-50-50-block .wp-block-heading { hyphens: manual; }
}

/* Text link with navy arrow circle (XD "Katso kaikki uutiset ↗"), e.g. section header links. */
.dg-link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--wp--preset--font-family--manrope);
    font-size: 16px;
    font-weight: 700; /* XD Manrope Bold */
    color: var(--wp--preset--color--secondary);
    text-decoration: none;
}
.dg-link-arrow::after {
    content: "";
    flex: none;
    width: 33px;
    height: 33px;
    border-radius: 50%;
    background: var(--wp--preset--color--secondary) url(../../../images/icon-arrow-up-right-white.svg) center / 11.28px no-repeat; /* XD: 33px circle, arrow 1.09× the button arrow */
    transition: background-color 0.2s;
}
.dg-link-arrow:hover,
.dg-link-arrow:focus-visible {
    color: var(--wp--preset--color--secondary);
    text-decoration: underline;
}
.dg-link-arrow:hover::after,
.dg-link-arrow:focus-visible::after {
    background-color: var(--wp--preset--color--accent);
    background-image: url(../../../images/icon-arrow-up-right-navy.svg);
}

/* =====================================================
   Artikkelinostot, layout "Nosto + lista" (XD Web 1920 – 1 "Uutiset & ajankohtaista", y 4200–4950):
   first article large (image 949×439 radius 5 over two columns, text in the third), the rest as
   date + title rows in three columns. Date Bai Bold 16/28, titles Manrope Medium 25/35 and 18/28.
   ===================================================== */
.dg-uutisnostot__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    margin-bottom: 50px;
}
.dg-uutisnostot__header h2 { margin: 0 !important; }
.dg-uutisnostot__footer { margin-top: 50px; }
.dg-uutisnostot__feature,
.dg-uutisnostot__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 25px;
}
.dg-uutisnostot__feature { align-items: start; }
.dg-uutisnostot__image {
    grid-column: 1 / span 2;
    margin: 0 100px 0 0;
    aspect-ratio: 949 / 439;
    border-radius: 5px;
    overflow: hidden;
}
.dg-uutisnostot__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dg-uutisnostot__text::before {
    content: "";
    display: block;
    width: 39px;
    height: 39px;
    margin-bottom: 33px; /* XD: arrow top → date baseline 92.4 */
    background: #1d1d1b;
    -webkit-mask: url(../../../images/icon-arrow-down-right-thin.svg) center / contain no-repeat;
    mask: url(../../../images/icon-arrow-down-right-thin.svg) center / contain no-repeat; /* XD: thin ↘, exported from vector data */
}
.dg-uutisnostot__date {
    display: block;
    color: #747474; /* XD; 4.7:1 on white */
    font-family: var(--wp--preset--font-family--bai-jamjuree);
    font-size: 16px;
    font-weight: 700;
    line-height: 28px;
}
html .dg-uutisnostot__title,
html .dg-uutisnostot__list-title {
    font-family: var(--wp--preset--font-family--manrope);
    font-weight: 500;
}
html .dg-uutisnostot__title {
    margin: 9px 0 23px;
    font-size: 25px;
    line-height: 35px;
}
.dg-uutisnostot__text p {
    font-size: 17px;
    font-weight: 500;
    line-height: 28px;
}
.dg-uutisnostot__title a,
.dg-uutisnostot__list-title a {
    color: inherit;
    text-decoration: none;
}
.dg-uutisnostot__title a:hover,
.dg-uutisnostot__title a:focus-visible,
.dg-uutisnostot__list-title a:hover,
.dg-uutisnostot__list-title a:focus-visible {
    text-decoration: underline;
}
.dg-uutisnostot__list {
    margin: 100px 0 0;
    padding: 0;
    list-style: none;
}
.dg-uutisnostot__list li { margin: 0; }
html .dg-uutisnostot__list-title {
    margin: 0;
    font-size: 18px;
    line-height: 28px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 1199px) {
    .dg-uutisnostot__image { margin-right: 0; }
}
@media (min-width: 768px) {
    .dg-uutisnostot__footer { display: none; }
}
@media (max-width: 767px) {
    .dg-uutisnostot__header .dg-link-arrow { display: none; }
    .dg-uutisnostot__image { aspect-ratio: 3 / 2; }
}
/* Stacked below 992px: image full width (3:2 on phones), list one per row, titles wrap (max two lines). */
@media (max-width: 991px) {
    .dg-uutisnostot__feature,
    .dg-uutisnostot__list {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 25px;
    }
    .dg-uutisnostot__image { grid-column: auto; }
    .dg-uutisnostot__text::before { display: none; }
    .dg-uutisnostot__list { margin-top: 50px; }
    html .dg-uutisnostot__list-title {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

/* =====================================================
   Referenssinosto (digitaali/referenssinosto, XD Web 1920 – 1 "Tarinoita työmailta", Component 11):
   pale-blue section with the footer's vertical lines fading out, header row like Uutiset, image 1640×710
   radius 5, white box 674 wide (radius 5 top left) flush to the image's bottom right corner.
   Box: padding-left 138 (8.41 % of 1640), title Manrope Medium 25/35 (max 367.5), text 17/28 (max 332).
   ===================================================== */
.dg-referenssinosto {
    position: relative;
    isolation: isolate;
}
.dg-referenssinosto.has-background::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    /* XD: lines every 33px at full strength for ~220px, gone by ~330px (measured from the layout) */
    background: repeating-linear-gradient(90deg, rgba(110, 201, 255, 0.12) 0 1px, transparent 1px 33px);
    -webkit-mask-image: linear-gradient(to bottom, #000 220px, transparent 330px);
    mask-image: linear-gradient(to bottom, #000 220px, transparent 330px);
    pointer-events: none;
}
.dg-referenssinosto__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    margin-bottom: 50px;
}
.dg-referenssinosto__header h2 { margin: 0 !important; }
.dg-referenssinosto__footer { margin-top: 50px; }
.dg-referenssinosto__card {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    min-height: 710px;
    border-radius: 5px;
    overflow: hidden;
}
.dg-referenssinosto__image {
    position: absolute;
    inset: 0;
    margin: 0;
}
.dg-referenssinosto__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dg-referenssinosto__box {
    position: relative;
    width: max(41.1%, 480px);
    min-height: 571px;
    padding: 100px 40px 90px 8.41%;
    border-radius: 5px 0 0 0;
    background: var(--wp--preset--color--white);
}
html .dg-referenssinosto__title {
    max-width: 367.5px;
    margin: 0 0 30px !important;
    font-family: var(--wp--preset--font-family--manrope);
    font-size: 25px;
    font-weight: 500;
    line-height: 35px;
    letter-spacing: 0;
    text-transform: none;
    hyphens: manual; /* theme hyphenates below 500px: split "ra-kennuksen" */
}
.dg-referenssinosto__title a {
    color: var(--wp--preset--color--secondary);
    text-decoration: none;
}
.dg-referenssinosto__title a:hover,
.dg-referenssinosto__title a:focus-visible { text-decoration: underline; }
html .dg-referenssinosto__excerpt {
    max-width: 332px;
    margin: 0 0 45px !important; /* XD 45px; theme forces p margin-bottom 25px !important */
    font-size: 17px;
    font-weight: 500;
    line-height: 28px;
    color: var(--wp--preset--color--dark-gray);
    display: -webkit-box;
    -webkit-line-clamp: 6; /* XD: six lines, cut with an ellipsis */
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Outline button on white: accent border like everywhere else, gray text (XD #4A4A4A). */
.dg-referenssinosto .wp-block-button.is-style-outline-white .wp-block-button__link { color: #4a4a4a; }
/* Hover state on the whole box: the title link's ::after overlay takes the pointer, so the button's own :hover never
   fires. Same as other outline buttons: accent fill, navy text, white arrow circle. Also on keyboard focus of the title. */
.dg-referenssinosto__box:hover .wp-block-button.is-style-outline-white .wp-block-button__link,
.dg-referenssinosto__box:has(.dg-referenssinosto__title a:focus-visible) .wp-block-button.is-style-outline-white .wp-block-button__link {
    background-color: var(--wp--preset--color--accent) !important;
    border-color: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--secondary);
}
.dg-referenssinosto__box:hover .dg-button-arrow .wp-block-button__link::after,
.dg-referenssinosto__box:has(.dg-referenssinosto__title a:focus-visible) .dg-button-arrow .wp-block-button__link::after {
    background-color: var(--wp--preset--color--white);
}
/* Whole box clickable through the title link (button is aria-hidden). */
.dg-referenssinosto__title a::after {
    content: "";
    position: absolute;
    inset: 0;
}
@media (min-width: 768px) {
    .dg-referenssinosto__footer { display: none; }
}
@media (max-width: 767px) {
    .dg-referenssinosto__header .dg-link-arrow { display: none; }
}
/* Stacked below 992px: image 3:2 on top, box full width below it. */
@media (max-width: 991px) {
    .dg-referenssinosto__card {
        display: block;
        min-height: 0;
    }
    .dg-referenssinosto__image {
        position: static;
        aspect-ratio: 3 / 2;
    }
    .dg-referenssinosto__box {
        width: auto;
        min-height: 0;
        padding: 40px 25px 50px;
        border-radius: 0;
    }
    .dg-referenssinosto__title,
    .dg-referenssinosto__excerpt { max-width: none; }
}

/* =====================================================
   CTA-kaksikko (XD Web 1920 – 1 "Hoidetaan kiinteistösi sähkötekniikka ajan tasalle", y 6280–6830):
   core blocks (columns 66.25/33.75, gap 25, boxes min 547 radius 5 as block attributes). Here only what
   blocks cannot express: the arrow circle of the navy outline button, the phone pill and line breaks.
   ===================================================== */
/* Navy outline button: navy circle with accent arrow; on hover the button fills navy → accent circle. */
.dg-button-arrow.is-style-outline-navy .wp-block-button__link::after {
    background-color: var(--wp--preset--color--secondary);
    background-image: url(../../../images/icon-arrow-up-right-accent.svg);
}
.dg-button-arrow.is-style-outline-navy .wp-block-button__link:hover::after,
.dg-button-arrow.is-style-outline-navy .wp-block-button__link:focus-visible::after {
    background-color: var(--wp--preset--color--accent);
    background-image: url(../../../images/icon-arrow-up-right-navy.svg);
}
/* Phone pill around [company-emergency-phone] (XD 193 × 62, Manrope SemiBold 20, accent + navy 1px). */
.dg-phone-pill a {
    display: inline-flex;
    align-items: center;
    min-height: 60px;
    padding: 0 34px;
    border: 1px solid var(--wp--preset--color--secondary);
    border-radius: 30px;
    background: var(--wp--preset--color--accent);
    font-size: 20px;
    font-weight: 600;
    color: var(--wp--preset--color--secondary);
    text-decoration: none !important; /* buttons never underline, also on hover */
    white-space: nowrap;
    transition: background-color 0.2s;
}
.dg-phone-pill a:hover,
.dg-phone-pill a:focus-visible {
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--secondary);
}
/* Heading: no automatic hyphenation (theme hyphenates below 500px: split "kiinteistö-si"). */
.wp-block-group:has(> .dg-cta-pari) > .wp-block-heading { hyphens: manual; }
@media (max-width: 1399px) {
    .dg-cta-pari p br { display: none; } /* XD line breaks only on wide boxes, like the 50/50 headings */
}
/* Below 992px the narrow navy box got ~280px: stack both, height from content. */
@media (max-width: 991px) {
    .dg-cta-pari { flex-wrap: wrap !important; row-gap: 25px; }
    .dg-cta-pari > .wp-block-column { flex-basis: 100% !important; }
    .dg-cta-pari > .wp-block-column > .wp-block-group { min-height: 0 !important; }
}

/* =====================================================
   PKS service pages (XD "Huolto ja kunnossapito"). Built from core blocks and the 50/50 / link box /
   divided columns patterns; here only what the blocks cannot express.
   ===================================================== */
/* Image-only hero (featured image, no text; XD 1920 × 575 under the header). */
@media (max-width: 767px) {
    .dg-hero--image { min-height: 300px !important; }
}
/* Wide screens: the heroes grow with the viewport above 1920 px (30vw = 575 at 1920, max 760), otherwise a 2560 px
   screen shows only a third of the image height and faces are cut off. Single reference 510 → max 680 likewise.
   News post hero has no focal point setting: people photos default to the upper part. */
@media (min-width: 992px) {
    /* Laptop scale: 75 % (431 / 383) at 1280 px → XD size at 1920 px; on low screens at most the viewport
       height minus header + the start of the intro, so the page title shows on the first screen. */
    .dg-hero--image,
    .single-post .dg-hero--dynamic {
        min-height: min(clamp(431px, max(143.75px + 22.5vw, 30vw), 760px), max(300px, 100svh - 330px)) !important;
    }
    .single-dg_reference .dg-hero--image {
        min-height: min(clamp(383px, max(127.5px + 19.92vw, 26.6vw), 680px), max(300px, 100svh - 330px)) !important;
    }
    .single-post .dg-hero--dynamic .wp-block-cover__image-background { object-position: 50% 25%; }
}

/* Link box on navy: arrow in the text color; plain (non-link) items Bai Medium as in the XD. */
.dg-link-box.has-text-color ul.is-style-dg-link-list::before { background: currentColor; }
ul.is-style-dg-link-list li:not(:has(a)) { font-weight: 500; }

/* Tummansininen linkkilaatikko palvelusivulla (XD 1640 × 557): more room than the front page box,
   161 px above/below the content and 140 px at the sides. */
@media (min-width: 1300px) {
    .wp-block-group.dg-link-box--xl { padding: 161px 140px !important; }
}
.dg-link-box--xl .wp-block-heading { margin-bottom: 18px !important; } /* XD heading → text 50 */
.dg-link-box--xl .wp-block-heading + p { margin-top: 0; }

/* 50/50 on service pages (XD Component 6 instances "Vuosihuolto", "UPS", "Kompensointi", "Käytönjohto"):
   text 117 px in, content vertically centred with ~84 px above/below, box at least 626 px, heading max
   631 px and text max 523 px wide, 60 px under the heading, 90 px from a list to the button. The image
   only covers the column (absolute), so a portrait image no longer sets the height. */
.dg-50-50--palvelu .dg-content-wrapper > .wp-block-heading { max-width: 631px; margin-bottom: 60px !important; }
.dg-50-50--palvelu .dg-content-wrapper > p,
.dg-50-50--palvelu .dg-content-wrapper > ul { max-width: 523px; }
.dg-50-50--palvelu .dg-content-wrapper > ul { margin-bottom: 67px !important; } /* list → button ≈100, same as text → button */
/* Stacked (< 992 px): the XD's large heading gap (50 / 60 px) is too airy on a phone → the theme's normal 25 px. */
@media (max-width: 991px) {
    .dg-50-50-block .wp-block-heading,
    .dg-50-50--palvelu .dg-content-wrapper > .wp-block-heading { margin-bottom: 25px !important; }
    /* text / list → button: 68 / 67 px on desktop (XD), 35 px stacked */
    .dg-50-50-block p:has(+ .wp-block-buttons),
    .dg-50-50--palvelu .dg-content-wrapper > ul { margin-bottom: 35px !important; }
}
@media (min-width: 992px) {
    .dg-50-50--palvelu > .wp-block-column { min-height: 626px; }
    .dg-50-50--palvelu > .wp-block-column.is-style-content-paddings-big-global {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .dg-50-50--palvelu figure.is-style-image-fullheight-cover { position: relative; height: 100%; }
    .dg-50-50--palvelu figure.is-style-image-fullheight-cover img { position: absolute; inset: 0; }
    .dg-50-50--palvelu > .wp-block-column:first-child { border-radius: 5px 0 0 5px; overflow: hidden; }
    .dg-50-50--palvelu > .wp-block-column:last-child { border-radius: 0 5px 5px 0; overflow: hidden; }
}
@media (min-width: 1300px) {
    .dg-50-50--palvelu > .wp-block-column.is-style-content-paddings-big-global { padding: 84px 60px 84px 117px !important; }
}
@media (max-width: 991px) {
    .dg-50-50--palvelu figure.is-style-image-fullheight-cover { aspect-ratio: 3 / 2; }
    /* Portrait photo in the 3:2 crop: keep the head in view (add class dg-img-focus-top to the image block). */
    .dg-50-50--palvelu figure.is-style-image-fullheight-cover.dg-img-focus-top img { object-position: 50% 10%; }
}

/* Vaalea laatikko kahdella sarakkeella ja erotinviivalla (XD 1640 × 671, line #E5E5E5 at the middle,
   right column text 146 px after the line). 50 px under the headings and before the buttons. */
.dg-divided-box .wp-block-column > p { max-width: 523px; }
/* Stacked (mobile): the theme's own heading and text margins, a bit more room around the divider. */
@media (min-width: 782px) {
    .dg-divided-box .wp-block-heading { margin-bottom: 62px !important; } /* XD heading → text 92 */
    .dg-divided-box p:has(+ .wp-block-buttons) { margin-bottom: 68px !important; } /* text → button ≈100 */
}
@media (max-width: 781px) {
    .dg-divided-box .wp-block-columns.is-style-dg-divided-columns > .wp-block-column:not(:first-child) { padding-top: 40px; }
    .dg-divided-box .wp-block-columns.is-style-dg-divided-columns > .wp-block-column:not(:last-child) { padding-bottom: 40px; }
}
/* Divider #E5E5E5 (also the horizontal one when stacked); columns.css loads later, hence the extra class. */
.dg-divided-box .wp-block-columns.is-style-dg-divided-columns > .wp-block-column:not(:first-child) { border-color: #e5e5e5; }
/* On the pale-blue box the grey line looks muddy: a blue a few steps darker than the background. */
.dg-divided-box.has-pale-blue-background-color .wp-block-columns.is-style-dg-divided-columns > .wp-block-column:not(:first-child) { border-color: #d0e9f8; }
/* XD line breaks in the headings only where the columns are wide enough. */
@media (max-width: 1599px) {
    .dg-divided-box .wp-block-heading br { display: none; }
}
@media (min-width: 782px) {
    /* Equal outer widths so the line stays in the middle whatever the paddings are. */
    .dg-divided-box .wp-block-columns.is-style-dg-divided-columns > .wp-block-column { flex: 0 0 50%; min-width: 0; }
}
@media (min-width: 1200px) {
    .dg-divided-box .wp-block-columns.is-style-dg-divided-columns > .wp-block-column:not(:first-child) { padding-left: 80px; }
}
@media (min-width: 1600px) {
    .dg-divided-box .wp-block-columns.is-style-dg-divided-columns > .wp-block-column:not(:first-child) { padding-left: 146px; }
}
@media (min-width: 1300px) {
    .wp-block-group.dg-divided-box { padding: 80px 138px 92px !important; }
}
/* Large on-call row: "Sähköpäivystys 24/7" + pill (XD 251 × 66, Manrope SemiBold 25). */
html .dg-phone-pill--large {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px 36px; /* pill next to the label, or under it without an indent when it does not fit */
    margin: 53px 0 27px !important; /* XD: text baseline → pill top 59, pill bottom → text baseline 47 */
    font-size: 25px;
    font-weight: 500;
    line-height: 30px;
    color: var(--wp--preset--color--secondary);
}
.dg-phone-pill--large a {
    min-height: 66px;
    padding: 0 44px;
    border: 0;
    border-radius: 39px;
    font-size: 25px;
}
html .dg-phone-pill--large + p { margin-top: 0; }
@media (max-width: 781px) {
    html .dg-phone-pill--large { margin-top: 25px !important; } /* theme's paragraph spacing */
}


/* Ruksilista (is-style-dg-check-list): XD "Path 15" check (17 × 13, stroke 2.835, square ends) centred on
   the first 28px line (top 7.7), text 33 px in. */
ul.is-style-dg-check-list {
    margin: 0 0 25px;
    padding: 0;
    list-style: none;
}
ul.is-style-dg-check-list li {
    position: relative;
    margin: 0 0 15px;
    padding-left: 33px;
    line-height: 28px;
}
ul.is-style-dg-check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 17px;
    height: 13px;
    background: url(../../../images/icon-check.svg) center / contain no-repeat;
}

/* Nuolisarakkeet (XD "Muiden sähköteknisten ratkaisuiden huoltotyöt"): thin ↙ arrow, Bai Medium 20/28
   heading straight above the 17/25 text, 72 px in from the column edge. */
.dg-arrow-cards > .wp-block-column::before {
    content: "";
    display: block;
    width: 42px;
    height: 42px;
    margin-bottom: 38px;
    background: var(--wp--preset--color--secondary);
    -webkit-mask: url(../../../images/icon-arrow-down-left-thin.svg) center / contain no-repeat;
    mask: url(../../../images/icon-arrow-down-left-thin.svg) center / contain no-repeat;
}
/* Space above the cards (XD text → arrows ~130 on desktop); less on narrower screens. */
.wp-block-columns.dg-arrow-cards { margin-top: 50px; }
@media (min-width: 782px) {
    .wp-block-columns.dg-arrow-cards { margin-top: 80px; }
}
@media (min-width: 1200px) {
    .wp-block-columns.dg-arrow-cards { margin-top: 130px; }
}
.dg-arrow-cards .wp-block-heading { margin-bottom: 0 !important; }
.dg-arrow-cards .wp-block-heading + p { margin-top: 25px !important; } /* XD heading → text 25 */
@media (min-width: 1200px) {
    .dg-arrow-cards > .wp-block-column { padding: 0 40px 0 72px; }
    .dg-arrow-cards > .wp-block-column > p { max-width: 246px; } /* XD text width; the heading may run wider */
    /* Two-column variant (company page "Vastuullisuus"): longer texts, same width as the other boxes. */
    .dg-arrow-cards--wide > .wp-block-column > p { max-width: 523px; }
    /* Six cards (Huolto: "Muiden sähköteknisten ratkaisuiden huoltotyöt"): two rows of three. */
    .dg-arrow-cards--three { flex-wrap: wrap !important; row-gap: 70px; }
    .dg-arrow-cards--three > .wp-block-column { flex: 0 0 calc((100% - 32px) / 3) !important; }
}
@media (min-width: 782px) and (max-width: 1199px) {
    .dg-arrow-cards { flex-wrap: wrap !important; row-gap: 50px; }
    .dg-arrow-cards > .wp-block-column { flex-basis: calc(50% - 8px) !important; }
}

/* Pystyraidat (class dg-stripes on a full-width group): accent lines every 33 px, full strength for
   ~220 px, gone by ~330 px (same as the Tarinoita työmailta section). */
.dg-stripes {
    position: relative;
    isolation: isolate;
}
.dg-stripes::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: repeating-linear-gradient(90deg, rgba(110, 201, 255, 0.07) 0 1px, transparent 1px 33px);
    -webkit-mask-image: linear-gradient(to bottom, #000 220px, transparent 330px);
    mask-image: linear-gradient(to bottom, #000 220px, transparent 330px);
    pointer-events: none;
}

/* Dark form sections (Tilauslomake, Tarjouspyyntö = navy + dg-stripes) use the footer's background: the XD gradient
   (images/footer-bg.jpg) and the footer's fading line wave (images/footer-raidat.svg) instead of the plain lines. */
.dg-stripes.has-secondary-background-color {
    background-image: url(../../../images/footer-bg.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}
.dg-stripes.has-secondary-background-color::before {
    background: url(../../../images/footer-raidat.svg) center top / 100vw auto no-repeat;
    -webkit-mask-image: none;
    mask-image: none;
    opacity: 0.6;
}
@media (max-width: 991px) {
    .dg-stripes.has-secondary-background-color::before { background-size: 1920px auto; }
}

/* Tumma lomake (class dg-form-dark on the wrapper; XD huoltotilaus): fields 53 px, accent tint, white
   text, two columns (container class dg-nf-half), message full width. */
.dg-form-dark .nf-form-cont { max-width: 1291px; margin: 0 auto; }
.dg-form-dark .nf-form-cont .nf-form-content nf-fields-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 36px;
}
.dg-form-dark .nf-form-cont .nf-form-content nf-fields-wrap > nf-field { grid-column: 1 / -1; }
.dg-form-dark .nf-form-cont .nf-form-content nf-fields-wrap > nf-field:has(.dg-nf-half) { grid-column: auto; }
.dg-form-dark .nf-form-cont .nf-form-content .nf-field-container { margin-bottom: 13px; }
/* Equal 13 px gaps everywhere: the hidden field (e.g. palvelu = page title) left a 5 px grid row, and the inline-block
   textarea a 9 px line-box gap under it. The hidden input still submits (Ninja Forms reads its model, not the DOM). */
.dg-form-dark .nf-form-cont .nf-form-content nf-fields-wrap > nf-field:has(.hidden-container) { display: none; }
.dg-form-dark .nf-form-cont .nf-form-content textarea { display: block; }
/* File Uploads (NF 7 Liite): the plugin's grey progress track shows even when empty → thin accent bar, track invisible. */
.dg-form-dark .nf-form-cont .nf-fu-progress { height: 4px; margin: 10px 0 0; background: transparent; box-shadow: none; border-radius: 2px; }
.dg-form-dark .nf-form-cont .nf-fu-progress-bar { background-color: var(--wp--preset--color--accent); box-shadow: none; font-size: 0; }
.dg-form-dark .nf-form-cont .files_uploaded p { margin: 8px 0 0 !important; font-size: 14px; }
.dg-form-dark .nf-form-cont .file_upload-container .nf-field-description { margin-top: 6px; font-size: 14px; line-height: 1.5; }
.dg-form-dark .nf-form-cont .file_upload-container .nf-fu-fileinput-button { font-size: 15px; }
.dg-form-dark .nf-form-cont .file_upload-container .nf-field-description p { margin: 0 !important; }
/* Upload as its own box (like the fields: radius 5, field padding), a bit more room above than between fields. */
.dg-form-dark .nf-form-cont .nf-form-content .file_upload-container {
    margin-top: 27px;
    padding: 22px 26px 24px;
    border-radius: 5px;
    background: rgba(110, 201, 255, 0.08);
}
.dg-form-light .nf-form-cont .nf-form-content .file_upload-container { background: var(--wp--preset--color--light-blue); } /* a shade darker than the section, not white like the fields */
.dg-form-dark .nf-form-cont .nf-form-content input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]),
.dg-form-dark .nf-form-cont .nf-form-content select,
.dg-form-dark .nf-form-cont .nf-form-content textarea {
    height: 53px;
    padding: 0 26px;
    border: 0;
    border-radius: 5px;
    background: rgba(110, 201, 255, 0.08);
    font-size: 18px;
    font-weight: 500; /* XD Manrope Medium (fields and placeholders) */
    color: var(--wp--preset--color--white);
}
.dg-form-dark .nf-form-cont .nf-form-content textarea { height: 355px; padding-top: 14px; }
.dg-form-dark .nf-form-cont .nf-form-content input::placeholder,
.dg-form-dark .nf-form-cont .nf-form-content textarea::placeholder { color: var(--wp--preset--color--white); opacity: 1; }
.dg-form-dark .nf-form-cont .nf-form-content input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]):focus,
.dg-form-dark .nf-form-cont .nf-form-content select:focus,
.dg-form-dark .nf-form-cont .nf-form-content textarea:focus { background: rgba(110, 201, 255, 0.16); color: var(--wp--preset--color--white); }
.dg-form-dark .nf-form-cont .nf-form-content select option { color: var(--wp--preset--color--dark-gray); }
.dg-form-dark .nf-form-cont .nf-form-content .listselect-wrap .nf-field-element div { border: 0; }
.dg-form-dark .nf-form-cont .nf-form-content .html-container,
.dg-form-dark .nf-form-cont .nf-form-content .checkbox-container { text-align: center; }
.dg-form-dark .nf-form-cont .nf-form-content .html-container a { color: inherit; }
.dg-form-dark .nf-form-cont .nf-form-content .checkbox-container .nf-field-label { color: var(--wp--preset--color--white); }
.dg-form-dark .nf-form-cont .nf-form-content .checkbox-container .field-wrap { justify-content: center; }
.dg-form-dark .nf-form-cont .nf-form-content .submit-container { text-align: center; }
@media (max-width: 767px) {
    .dg-form-dark .nf-form-cont .nf-form-content nf-fields-wrap { grid-template-columns: minmax(0, 1fr); }
    .dg-form-dark .nf-form-cont .nf-form-content textarea { height: 200px; }
}

/* Service page heading ↔ text spacing from the XD (baselines): intro H1 → ingress 75 and the eyebrow
   14 px lower, "Muiden …" H2 → text 44, order form H2 → text 117. Classes on the blocks. */
.dg-intro-eyebrow { padding-top: 14px; } /* padding: flow layout zeroes the first child's margin */
html .dg-intro-title { margin-bottom: 38px !important; }
.dg-intro-title { hyphens: manual; } /* compound breaks via &shy; in the content */
@media (max-width: 1199px) {
    .dg-intro-title br { display: none; }
}
html .dg-tight-title { margin-bottom: 7px !important; }
.dg-tight-title + p { margin-top: 0; }
html .dg-form-title { margin-bottom: 83px !important; }
/* Select: same indent as the text fields, thin white chevron on the right (XD). */
.dg-form-dark .nf-form-cont .nf-form-content select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 60px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff' stroke-width='1.4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 24px center;
    background-size: 12px 7px;
}
.dg-form-dark .nf-form-cont .nf-form-content .listselect-wrap .nf-field-element::after { display: none; }
/* Privacy link underlined, consent: white 15 px square + Manrope Medium 18 (XD). */
.dg-form-dark .nf-form-cont .nf-form-content .html-container a { text-decoration: underline; }
.dg-form-dark .nf-form-cont .nf-form-content .html-container { margin-top: 18px; } /* message field → privacy text 40 */
.dg-form-dark .nf-form-cont .nf-form-content .checkbox-container .nf-field-label label { font-weight: 500; font-size: 18px; }
.dg-form-dark .nf-form-cont .nf-form-content .checkbox-container .ninja-forms-req-symbol { color: inherit; }
.dg-form-dark .nf-form-cont .nf-form-content input[type=checkbox] {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    width: 15px !important; /* NF and Bootstrap size the checkbox through several rules */
    height: 15px !important;
    margin: 0;
    padding: 0 !important; /* Bootstrap's field padding made it 30 × 25 */
    border: 0;
    border-radius: 0;
    background: var(--wp--preset--color--white) center / 11px 8px no-repeat;
    vertical-align: middle;
}
.dg-form-dark .nf-form-cont .nf-form-content input[type=checkbox]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 11'%3E%3Cpath d='M1.2 5.6 5.4 9.6 13.8 1.2' fill='none' stroke='%23111731' stroke-width='2'/%3E%3C/svg%3E");
}
.dg-form-dark .nf-form-cont .nf-form-content input[type=checkbox]:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
/* Submit = outline-white + arrow circle (input has no ::after → circle and arrow as backgrounds). */
.dg-form-dark .nf-form-cont .nf-form-content input[type=submit],
.dg-form-dark .nf-form-cont .nf-form-content input[type=button] {
    height: auto;
    min-height: 48px;
    padding: 6px 54px 6px 24px;
    border: 1px solid var(--wp--preset--color--accent);
    border-radius: 30px;
    background:
        url(../../../images/icon-arrow-up-right-navy.svg) right 19px center / 10.36px no-repeat,
        radial-gradient(circle 18px at calc(100% - 24px) 50%, var(--wp--preset--color--accent) 17.5px, transparent 18px);
    font-size: 16px;
    font-weight: 600;
    color: var(--wp--preset--color--white);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.dg-form-dark .nf-form-cont .nf-form-content input[type=submit]:hover,
.dg-form-dark .nf-form-cont .nf-form-content input[type=button]:hover,
.dg-form-dark .nf-form-cont .nf-form-content input[type=button]:focus-visible {
    background-color: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--secondary);
}

/* Ruksilista pudotusvalikkona (NF checkbox list, container class dg-nf-dropdown; JS in javascripts.js).
   XD "Viestin aihe": closed = the dark 53px field with a chevron; open = white panel 53/54px padding, rows
   Manrope Medium 16/45 #191919 with #E8E8E8 lines, navy check (stroke 1.5) on the right of a chosen row. */
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown .nf-field-element { position: relative; }
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown.is-enhanced .nf-field-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown__toggle {
    position: relative;
    display: block;
    width: 100%;
    height: 53px;
    padding: 0 60px 0 26px;
    border: 0;
    border-radius: 5px;
    background: rgba(110, 201, 255, 0.08) !important; /* NF's button reset makes it transparent */
    font-size: 18px;
    font-weight: 500;
    color: var(--wp--preset--color--white);
    text-align: left;
    cursor: pointer;
}
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown__toggle span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown__toggle::after {
    content: "";
    position: absolute;
    right: 24px;
    top: 50%;
    width: 12px;
    height: 7px;
    margin-top: -3.5px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 0.2s;
}
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown.is-open .dg-nf-dropdown__toggle { border-radius: 5px 5px 0 0; }
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown.is-open .dg-nf-dropdown__toggle::after { transform: rotate(180deg); }
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown__toggle:hover,
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown.is-open .dg-nf-dropdown__toggle { background-color: rgba(110, 201, 255, 0.16) !important; }
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown__toggle:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown ul {
    margin: 0 !important;
    padding: 53px 50px 53px 54px !important; /* NF's list reset */
    list-style: none;
    border-radius: 0 0 5px 5px;
    background: var(--wp--preset--color--white);
}
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown.is-enhanced ul {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 53px;
    z-index: 20;
    box-shadow: 0 12px 30px rgba(2, 13, 38, 0.25);
}
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown.is-enhanced.is-open ul { display: block; }
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown li {
    position: relative;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #e8e8e8;
}
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown li:last-child { border-bottom: 0; }
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown li label {
    display: block;
    margin: 0;
    padding: 0 40px 0 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 45px;
    color: var(--wp--preset--color--dark-gray);
    cursor: pointer;
}
/* The checkbox covers the row (whole row clickable, focusable); the check is drawn on the row. */
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown li input[type=checkbox] {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    opacity: 0;
    cursor: pointer;
}
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown li:has(input:checked)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 17px;
    height: 13px;
    margin-top: -6.5px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 13'%3E%3Cpath d='M1.4173 6.1413 6.1414 10.8654 15.5881 1.4171' fill='none' stroke='%23111731' stroke-width='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
    pointer-events: none;
}
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown li:has(input:focus-visible) { outline: 2px solid var(--wp--preset--color--accent); outline-offset: -2px; }
.dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown li:hover label { color: var(--wp--preset--color--primary); }
@media (max-width: 767px) {
    .dg-form-dark .nf-form-cont .nf-form-content .dg-nf-dropdown ul { padding: 25px 25px 25px 26px !important; }
}
/* Error text on navy: NF's red is ~3.6:1 there; light red passes 4.5:1. */
.dg-form-dark .nf-form-cont .nf-error-msg,
.dg-form-dark .nf-form-cont .nf-error-msg a { color: #ff9a9a; }
/* Hidden fields (e.g. Työtilaus "palvelu" = page title) take no room in the grid. */
.dg-form-dark .nf-form-cont .nf-form-content .nf-field-container.hidden-container { margin: 0; }

/* Vaalea lomake (wrapper classes "dg-form-dark dg-form-light", XD Yhteystiedot): the dark form's layout on a pale
   blue section — white fields with #191919 text, navy privacy text, accent outline submit with navy text. */
.dg-form-light .nf-form-cont .nf-form-content input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]),
.dg-form-light .nf-form-cont .nf-form-content select,
.dg-form-light .nf-form-cont .nf-form-content textarea,
.dg-form-light .nf-form-cont .nf-form-content .dg-nf-dropdown__toggle {
    background: var(--wp--preset--color--white) !important;
    color: #191919;
}
.dg-form-light .nf-form-cont .nf-form-content input::placeholder,
.dg-form-light .nf-form-cont .nf-form-content textarea::placeholder { color: #191919; }
.dg-form-light .nf-form-cont .nf-form-content input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]):focus,
.dg-form-light .nf-form-cont .nf-form-content select:focus,
.dg-form-light .nf-form-cont .nf-form-content textarea:focus { outline: 2px solid var(--wp--preset--color--accent); color: #191919; }
.dg-form-light .nf-form-cont .nf-form-content .dg-nf-dropdown__toggle::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23191919' stroke-width='1.4'/%3E%3C/svg%3E");
}
.dg-form-light .nf-form-cont .nf-form-content .dg-nf-dropdown.is-enhanced ul { box-shadow: 0 6px 16px rgba(17, 23, 49, 0.1); }
.dg-form-light .nf-form-cont .nf-form-content .html-container,
.dg-form-light .nf-form-cont .nf-form-content .checkbox-container .nf-field-label { color: var(--wp--preset--color--secondary); }
.dg-form-light .nf-form-cont .nf-form-content input[type=submit],
.dg-form-light .nf-form-cont .nf-form-content input[type=button] { color: var(--wp--preset--color--secondary); }
.dg-form-light .nf-form-cont .nf-error-msg,
.dg-form-light .nf-form-cont .nf-error-msg a { color: #c00000; }
/* Title → fields 108 (baseline, XD). */
html .dg-form-title.dg-form-title--light { margin-bottom: 96px !important; }

/* Yhteystiedot hero (XD): emergency phone stacked (label above the pill), contact items with a 59 px icon box
   (accent 9 %) and the text 42 px below it (baseline), four equal columns 140 px under the button. */
html .dg-phone-pill--stacked {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px; /* XD's 4 px looked cramped */
    margin: 37px 0 0 !important; /* label baseline 26 above the H1 baseline */
    color: var(--wp--preset--color--white);
}
html .dg-contact-hero .dg-intro-title { margin-bottom: 43px !important; } /* H1 → text 80 */
.dg-contact-hero .wp-block-buttons { margin-top: 40px; } /* collapses with the text's 25 → text baseline → button 50 */
.wp-block-columns.dg-contact-items { margin-top: 140px; }
html .dg-contact-item {
    position: relative;
    margin: 0 !important;
    padding: 80px 20px 0 0;
    font-size: 18px;
    line-height: 30px;
}
.dg-contact-item a,
.dg-contact-item .maddr { color: inherit; text-decoration: none; }
.dg-contact-item::before,
.dg-contact-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 59px;
    height: 59px;
}
.dg-contact-item::before { border-radius: 5px; background: rgba(110, 201, 255, 0.09); }
.dg-contact-item::after {
    background: var(--wp--preset--color--accent);
    -webkit-mask: center / 25px 28px no-repeat;
    mask: center / 25px 28px no-repeat;
}
.dg-contact-item--location::after { -webkit-mask-image: url(../../../images/icon-location.svg); mask-image: url(../../../images/icon-location.svg); }
.dg-contact-item--phone::after { -webkit-mask-image: url(../../../images/icon-phone-mobile.svg); mask-image: url(../../../images/icon-phone-mobile.svg); -webkit-mask-size: 17px 26px; mask-size: 17px 26px; }
.dg-contact-item--mail::after { -webkit-mask-image: url(../../../images/icon-mail.svg); mask-image: url(../../../images/icon-mail.svg); -webkit-mask-size: 25px 25px; mask-size: 25px 25px; }
.dg-contact-item--home::after { -webkit-mask-image: url(../../../images/icon-home.svg); mask-image: url(../../../images/icon-home.svg); -webkit-mask-size: 23px 23px; mask-size: 23px 23px; }
@media (max-width: 781px) {
    /* Stacked: icon box on the left of the text like the footer's contact row. */
    .wp-block-columns.dg-contact-items { margin-top: 60px; row-gap: 20px; }
    html .dg-contact-item { min-height: 59px; padding: 14px 0 0 79px; } /* not flex: it would drop the space before the phone link */
    html .dg-phone-pill--stacked { margin-top: 30px !important; }
}

/* Yhteyshenkilöt (Henkilöstö-lohko, class dg-personnel--pks; XD Yhteystiedot): 214 px round photo, name Bai 25
   46 px under it, role Manrope Bold 16, phone and email Medium 18/28; cards 414 px apart, content left aligned,
   the row centred. Heading → photos 119 (baseline). */
html .dg-people-title { margin-bottom: 117px !important; }
.dg-personnel--pks .dg-personnel-grid.row {
    justify-content: center;
    gap: 60px 144px;
    margin: 0;
}
.dg-personnel--pks .dg-personnel-grid.row > * { flex: 0 0 270px; width: 270px; max-width: 100%; padding: 0; margin: 0; }
.dg-personnel--pks .person { width: auto; max-width: none; margin: 0; text-align: left; }
.dg-personnel--pks .person .info { padding: 0; }
.dg-personnel--pks figure.person-image { width: 214px; margin: 0 0 22px; border-radius: 50%; }
.dg-personnel--pks figure.person-image::before { padding-top: 100%; }
/* Portrait photos (XD: image top flush with the mask's top): crop from the top so the head isn't cut. */
.dg-personnel--pks figure.person-image img { object-position: 50% 0; }
html .dg-personnel--pks .person .person-name {
    margin: 0 0 22px !important;
    font-family: var(--wp--preset--font-family--bai-jamjuree);
    font-size: 25px;
    font-weight: 400;
    line-height: 30px;
}
.dg-personnel--pks .person-roles { margin-bottom: 8px; font-size: 16px; font-weight: 700; line-height: 22px; }
.dg-personnel--pks .phonenumbers,
.dg-personnel--pks .person-email-addresses { font-size: 18px; font-weight: 500; line-height: 28px; color: #171717; }
.dg-personnel--pks .phonenumbers a,
.dg-personnel--pks .person-email-addresses a,
.dg-personnel--pks .maddr { color: inherit; text-decoration: none; word-break: normal; overflow-wrap: anywhere; } /* theme's break-all split "pksservice.f|i" */
@media (max-width: 781px) {
    /* Phones: the desktop gaps (108 / 129 from the XD) are too loose; one centred column under the centred heading. */
    html .dg-form-title.dg-form-title--light { margin-bottom: 40px !important; }
    html .dg-people-title { margin-bottom: 50px !important; }
    .dg-personnel--pks .person { text-align: center; }
    .dg-personnel--pks figure.person-image { margin-left: auto; margin-right: auto; }
}

/* Yksittäinen referenssi (patterns/referenssi.php, XD Referenssi): navy bar 84 px with the client | date (Manrope
   Bold 20), pale blue intro (H1 70/85 max 854, lead centred), 854 px content column: headings #4A4A4A, text
   Manrope Medium 17/28, quote box, 5 px image corners, summary box, navy CTA and the back link. */
.wp-block-group.dg-ref-meta { min-height: 84px; padding: 0 25px !important; gap: 0; font-size: 20px; font-weight: 700; line-height: 35px; }
.dg-ref-meta > * { margin: 0 !important; }
.dg-ref-meta > * + *::before {
    content: "";
    display: inline-block;
    width: 1px;
    height: 32px;
    margin: 0 19px;
    background: currentColor;
    vertical-align: middle;
}
html .dg-ref-intro .dg-ref-title { max-width: 854px; margin: 0 auto 42px !important; line-height: 1.215; hyphens: manual; } /* 70/85 */
.dg-ref-intro .dg-ref-title + p { margin-bottom: 0 !important; }
.dg-ref-content { --dg-heading-color: #4a4a4a; }
.dg-ref-content > * { margin-top: 0 !important; }
.dg-ref-content > p,
.dg-ref-content > ul { font-size: 17px; font-weight: 500; line-height: 28px; }
html .dg-ref-content > p { margin-bottom: 28px !important; }
html .dg-ref-content > h2 { margin-bottom: 50px !important; line-height: 1.2; hyphens: manual; } /* 50/60 */
html .dg-ref-content > h3 { margin-bottom: 42px !important; line-height: 1.25; hyphens: manual; } /* 40/50 */
@media (max-width: 781px) {
    html .dg-ref-intro .dg-ref-title { margin-bottom: 30px !important; }
    html .dg-ref-content > h2,
    html .dg-ref-content > h3 { margin-bottom: 30px !important; }
}
html .dg-ref-content > p:has(+ .wp-block-quote) { margin-bottom: 77px !important; }
html .dg-ref-content > p:has(+ .dg-ref-summary),
html .dg-ref-content > p:has(+ .dg-ref-cta) { margin-bottom: 72px !important; }
.wp-block-group.dg-ref-content { padding-bottom: 60px !important; } /* CTA → back link (single-dg_reference.php) */
.dg-ref-content > .wp-block-image { margin-bottom: 65px !important; }
.dg-ref-content > .wp-block-image img { border-radius: 5px; }

/* Sitaatti (PKS, XD Referenssi): pale blue box, navy 63 px circle with a white quote mark over its top left
   corner, quote Manrope Regular 25/40 navy, name Medium 16. */
.wp-block-quote.is-style-dg-sitaatti {
    position: relative;
    max-width: 854px;
    margin-top: 0 !important;
    margin-bottom: 66px !important;
    padding: 65px 95px 60px 113px !important;
    background: var(--wp--preset--color--pale-blue);
    color: var(--wp--preset--color--secondary);
    text-align: left;
}
.wp-block-quote.is-style-dg-sitaatti::before {
    position: absolute;
    top: -22px;
    left: 31px;
    width: 63px;
    height: 63px;
    margin: 0;
    border-radius: 50%;
    background: var(--wp--preset--color--secondary);
    -webkit-mask: none;
    mask: none;
}
.wp-block-quote.is-style-dg-sitaatti::after {
    content: "";
    position: absolute;
    top: -22px;
    left: 31px;
    width: 63px;
    height: 63px;
    background: var(--wp--preset--color--white);
    -webkit-mask: url("../../../images/icon-quote.svg") no-repeat center / 22px auto;
    mask: url("../../../images/icon-quote.svg") no-repeat center / 22px auto;
}
.wp-block-quote.is-style-dg-sitaatti p { font-size: 25px; font-weight: 400; line-height: 40px; font-style: normal; }
.wp-block-quote.is-style-dg-sitaatti cite { margin-top: 33px; font-size: 16px; font-weight: 500; line-height: 22px; }
@media (max-width: 767px) {
    .wp-block-quote.is-style-dg-sitaatti { padding: 60px 25px 35px 30px !important; }
    .wp-block-quote.is-style-dg-sitaatti p { font-size: 21px; line-height: 32px; }
}

.dg-ref-summary { margin-top: 0 !important; margin-bottom: 47px !important; padding: 46px 62px 56px 73px !important; }
html .dg-ref-summary .dg-ref-summary__title { margin: 0 0 16px !important; font-size: 18px; font-weight: 700; line-height: 25px; color: var(--wp--preset--color--secondary); }
.dg-ref-summary ul.is-style-dg-check-list { margin: 0; font-size: 17px; font-weight: 500; }
.dg-ref-summary ul.is-style-dg-check-list li { margin: 0; padding-left: 44px; line-height: 32px; }
.dg-ref-summary ul.is-style-dg-check-list li::before {
    top: 10px;
    background: var(--wp--preset--color--secondary);
    -webkit-mask: url(../../../images/icon-check.svg) center / contain no-repeat;
    mask: url(../../../images/icon-check.svg) center / contain no-repeat;
}
@media (max-width: 767px) {
    .dg-ref-summary { padding: 35px 25px !important; }
}

.dg-ref-cta { margin-top: 0 !important; margin-bottom: 0 !important; padding: 92px 40px 93px !important; text-align: center; }
html .dg-ref-cta .dg-ref-cta__title { margin: 0 0 32px !important; font-size: 40px; font-weight: 300; line-height: 48px; hyphens: manual; }
@media (max-width: 767px) {
    .dg-ref-cta { padding: 60px 25px !important; }
    html .dg-ref-cta .dg-ref-cta__title { font-size: 30px; line-height: 38px; }
    .dg-ref-cta .dg-ref-cta__title br { display: none; }
}

/* Back link: navy 33 px circle with an up-left arrow before the text (XD "Palaa takaisin asiakastarinoihin"). */
/* Printed by single-dg_reference.php below the content, aligned with the 854 px column; back link baseline → footer 87. */
html .entry-content > .dg-ref-back { box-sizing: content-box; max-width: 854px !important; margin: 0 auto !important; padding: 0 var(--dg-ref-gutter, 25px) 71px; }
html .dg-ref-back .dg-link-back { display: flex; margin: 0 !important; font-size: 16px; font-weight: 700; }
.dg-link-back a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--wp--preset--color--secondary);
    text-decoration: none;
}
.dg-link-back a::before {
    content: "";
    flex: none;
    width: 33px;
    height: 33px;
    border-radius: 50%;
    background: var(--wp--preset--color--secondary) url(../../../images/icon-arrow-up-left-white.svg) center / 11.28px no-repeat;
}
.dg-link-back a:hover,
.dg-link-back a:focus-visible { text-decoration: underline; }
/* Job ad (template-parts/post/content-dg_job.php): apply button after the text, back link like the reference's. */
html .entry-content > .dg-job-apply { margin-top: 40px !important; }
html .entry-content > .dg-job-back { margin-top: 60px !important; font-size: 16px; font-weight: 700; }
/* Deadline clearly visible (card + ad page): navy bold instead of the grey news date. */
.article-card.type-dg_job .post-date,
.type-dg_job .entry-meta .post-date { color: var(--wp--preset--color--secondary); font-weight: 700; }

/* Lead text block (XD Käytönjohto "Vapauta resurssejasi …"): H2 → 20 px lead 74, lead → text 60, text → button 45
   (baselines). Class dg-lead-block on the wide group. */
html .dg-lead-block > .wp-block-heading { margin-bottom: 37px !important; hyphens: manual; } /* auto split "kiinteistö-si" */
/* Service page boxes: no automatic hyphenation below 500px ("Es-poossa", "ta-loyhtiöille"); long compounds break via &shy;. */
html .dg-link-box .wp-block-heading,
html .dg-divided-box .wp-block-heading,
html .dg-arrow-cards .wp-block-heading,
html .dg-tight-title { hyphens: manual; }
html .dg-lead-block > p:first-of-type { margin-bottom: 30px !important; }
html .dg-lead-block > p:has(+ .wp-block-buttons) { margin-bottom: 38px !important; }
/* Order form without the 50/50 above it (Käytönjohto): title → text 85, text → fields 67 (baselines). */
html .dg-form-title.dg-form-title--tight { margin-bottom: 51px !important; }

/* UKK (XD Käytönjohto, Component 10): pale blue 48 px question bar, Manrope Bold 18 24 px in, questions 23 px
   apart, columns 34 px apart (803 + 34 + 803 = 1640), answer Medium 16/28 without indent. */
.dg-faq-item { margin-bottom: 23px; }
html .dg-faq-section > .wp-block-heading { margin-bottom: 56px !important; } /* heading baseline → questions 68 */
.dg-faq-question {
    padding: 10px 56px 11px 24px;
    font-size: 18px;
    line-height: 27px;
    color: var(--wp--preset--color--secondary);
    background: var(--wp--preset--color--pale-blue);
}
.dg-faq-question::after { right: 24px; }
.dg-faq-answer {
    padding: 23px 0 12px;
    font-size: 16px;
    font-weight: 500;
    line-height: 28px;
}
.dg-faq-answer a { color: inherit; text-decoration: underline; }
@media (min-width: 992px) {
    .dg-faq--columns-2 { gap: 34px; }
}
@media (max-width: 991.98px) {
    .dg-faq--columns-2 > .dg-faq__column + .dg-faq__column { margin-top: 23px; }
}

/* =====================================================
   Referenssikortit (Referenssit-lohko, template-parts/post/content-card-reference.php; XD "Referenssit"):
   398 px cards (4 × 398 + 3 × 16 = 1640), rows 34 px apart, 16:9 image, light blue box: padding 65/30/81/59,
   title Bai Medium 20/28, excerpt Manrope Medium 18/27 max 5 lines, "Lue tarina" outline navy + arrow.
   ===================================================== */
.dg-referenssit__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px 16px;
}
.dg-referenssit--cols-4 .dg-referenssit__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1199px) {
    .dg-referenssit__grid,
    .dg-referenssit--cols-4 .dg-referenssit__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
    .dg-referenssit__grid,
    .dg-referenssit--cols-4 .dg-referenssit__grid { grid-template-columns: minmax(0, 1fr); }
}
.dg-ref-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 5px;
    overflow: hidden;
    background: var(--wp--preset--color--light-blue);
}
.dg-ref-card__image {
    margin: 0;
    aspect-ratio: 398 / 225;
    overflow: hidden;
}
.dg-ref-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dg-ref-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 65px 30px 81px 59px; /* XD: box top → title baseline 87; the title may run wider than the 290px text */
}
html .dg-ref-card__title {
    margin: 0 0 17px !important;
    font-family: var(--wp--preset--font-family--bai-jamjuree);
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
    hyphens: manual; /* theme hyphenates headings below 500px; compound breaks come from &shy; */
}
.dg-ref-card__title a {
    color: var(--wp--preset--color--secondary);
    text-decoration: none;
}
.dg-ref-card__title a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.dg-ref-card__title a:hover,
.dg-ref-card__title a:focus-visible { text-decoration: underline; }
.dg-ref-card:focus-within { outline: 2px solid var(--wp--preset--color--primary); outline-offset: 2px; }
.dg-ref-card__title a:focus-visible { outline: none; }
html .dg-ref-card__excerpt {
    max-width: 290px;
    margin: 0 0 43px !important; /* XD last line → button baseline 75 */
    font-size: 18px;
    font-weight: 500;
    line-height: 27px;
    color: var(--wp--preset--color--dark-gray);
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dg-ref-card .wp-block-buttons { margin-top: auto; }
@media (max-width: 1399px) {
    .dg-ref-card__body { padding: 40px 30px 50px; }
}

/* Megamenu caret on desktop: hit area 24×24 (WCAG 2.5.8). The 12 px icon keeps its place (box grows to the right,
   into the old 1rem right margin, and down/up symmetrically). */
@media (min-width: 1200px) {
    html li.yamm-fw > a.nav-link + .dg-caret {
        width: 24px;
        height: 24px;
        margin-top: -8.5px;
        margin-bottom: -4.5px;
        margin-right: calc(1rem - 9px);
        background-position: 1.5px center;
        /* centred on the link text after the link moved 2 px up (vertical-align: top above) */
        position: relative;
        top: -2px;
        right: auto; /* yamm-custom-styles.css sets right: 10px, which takes effect once positioned */
    }
}

/* Front page "Seuraa meitä somessa": Elfsight LinkedIn feed edge to edge like the XD (one row of 8 cards,
   46 px sides at 1920). Group "LinkedIn-syöte" (dg-some-feed) inside the 25 px padded full-width section;
   columns per screen size are set in the Elfsight widget (8 / 6 / 4 / 3 / 1). */
.wp-block-group.is-layout-constrained > .wp-block-group.dg-some-feed { /* beats the theme's < 800 px .alignfull.is-layout-constrained > * rule */
    width: auto !important; /* < 800 px the section gives its children width: 100 % */
    max-width: none !important;
    margin-left: -25px !important;
    margin-right: -25px !important;
    padding-left: 25px;
    padding-right: 25px;
}
@media (min-width: 992px) {
    .wp-block-group.is-layout-constrained > .wp-block-group.dg-some-feed {
        padding-left: 50px;
        padding-right: 50px;
    }
}

/* Feed "Lataa lisää" (outline navy in the Elfsight theme): hover like the site's outline-navy buttons
   (navy fill, white text) instead of Elfsight's 10 % overlay, which looked grey. es- classes are Elfsight's
   stable hooks; the generated sc- classes change. */
.dg-some-feed .es-load-more-button {
    transition: background-color 0.2s ease, color 0.2s ease;
}
.dg-some-feed .es-load-more-button:hover,
.dg-some-feed .es-load-more-button:focus-visible {
    background-color: var(--wp--preset--color--secondary) !important;
    color: var(--wp--preset--color--white) !important;
}
.dg-some-feed .es-load-more-button:hover *,
.dg-some-feed .es-load-more-button:focus-visible * { color: inherit !important; }
/* The overlay span also holds the label and the padding: only its grey tint goes, never hide it. */
.dg-some-feed .es-load-more-button .es-button-base-overlay { background-color: transparent !important; }

