/* v1337 R3: real screenshot thumbnails for own portfolio demos.
   Scoped to references; preserves approved hero, nav, Digiapuri and behavior. */
html body.ds1337-premium.home-page #yritykset .ds-website-reference:has(> .ds1337-reference-thumb) {
  grid-template-columns:minmax(0,.95fr) minmax(0,1.2fr);
  grid-template-rows:auto auto;
  gap:clamp(12px,1.8vw,22px) clamp(20px,2.4vw,34px);
  align-items:start;
}
html body.ds1337-premium.home-page #yritykset .ds-website-reference > .ds1337-reference-thumb {
  grid-column:1; grid-row:1 / span 2;
}
html body.ds1337-premium.home-page #yritykset .ds-website-reference > .ds-website-reference-copy {
  grid-column:2; grid-row:1; min-width:0;
}
html body.ds1337-premium.home-page #yritykset .ds-website-reference > .ds-website-reference-actions {
  grid-column:2; grid-row:2; min-width:0;
}
html body.ds1337-premium .ds1337-reference-thumb {
  margin:0; min-width:0; width:100%;
}
html body.ds1337-premium .ds1337-reference-thumb > a {
  display:block; border:1px solid #c9dcd8;
  border-radius:clamp(14px,2vw,20px); overflow:hidden;
  box-shadow:0 9px 25px rgba(4,42,57,.12);
  background:#f6faf8;
  transition:box-shadow .18s ease,border-color .18s ease;
}
html body.ds1337-premium .ds1337-reference-thumb > a:hover {
  border-color:#81c9b7;
  box-shadow:0 13px 28px rgba(4,42,57,.18);
}
html body.ds1337-premium .ds1337-reference-thumb > a:focus-visible {
  outline:3px solid #166e9a; outline-offset:4px;
}
html body.ds1337-premium .ds1337-reference-thumb img {
  display:block;width:100%;height:auto;aspect-ratio:8/5;
  object-fit:cover;
}
html body.ds1337-premium .ds1337-reference-thumb figcaption {
  font-size:.875rem;line-height:1.5;color:#4c6871;margin-top:9px;
}
html body.ds1337-premium.seo-page .ds1337-reference-thumb--case {
  max-width:520px;margin:clamp(16px,2vw,24px) 0;
}
@media(max-width:1099px){
  html body.ds1337-premium.home-page #yritykset .ds-website-reference:has(> .ds1337-reference-thumb) {
    grid-template-columns:minmax(0,1fr);grid-template-rows:auto;
  }
  html body.ds1337-premium.home-page #yritykset .ds-website-reference > .ds1337-reference-thumb,
  html body.ds1337-premium.home-page #yritykset .ds-website-reference > .ds-website-reference-copy,
  html body.ds1337-premium.home-page #yritykset .ds-website-reference > .ds-website-reference-actions {
    grid-column:1;grid-row:auto;
  }
}
@media(prefers-reduced-motion:reduce){
  html body.ds1337-premium .ds1337-reference-thumb > a {transition:none}
}

/* R3: the existing approved destination link now contains the thumbnail and its CTA.
   No extra reference destinations or duplicate anchors are added. */
html body.ds1337-premium .ds1337-reference-thumb > a.ds1337-reference-thumb-link {
  display:block; border:1px solid #c9dcd8; background:#f6faf8;
  border-radius:clamp(14px,2vw,20px); overflow:hidden;
  box-shadow:0 9px 25px rgba(4,42,57,.12);
  color:#fff; text-decoration:none;
}
html body.ds1337-premium .ds1337-reference-thumb .ds1337-ref-cta {
  display:flex; align-items:center; justify-content:center; text-align:center;
  padding:12px 18px; min-height:48px; box-sizing:border-box;
  background:#12635d; color:#fff; font-weight:700;
  font-size:clamp(14px,1.2vw,16px); line-height:1.4;
}
html body.ds1337-premium .ds1337-reference-thumb > a:hover .ds1337-ref-cta {background:#0b4e49;}
html body.ds1337-premium .ds1337-reference-thumb > a:focus-visible {outline:3px solid #166e9a;outline-offset:4px;}

/* Esikatselun mittasuhde seuraa valitun kuvan rajausta. */
.pilot-preview { display:block; }
html body.ds1337-premium.home-page #yritykset .ds-website-reference .ds1337-reference-thumb .pilot-preview img,
html body .works .card .pilot-preview img {
  display:block; width:100%; height:auto; aspect-ratio:20/11; object-fit:contain;
}
@media (max-width:600px) {
  html body.ds1337-premium.home-page #yritykset .ds-website-reference .ds1337-reference-thumb .pilot-preview img,
  html body .works .card .pilot-preview img { aspect-ratio:2/3; }
}
