/* view-transition */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* VIEW TRANSITION ON DETAIL */

/* resolve the ID on the wrapper, pass it down to the image */

[id^="vt-detail-"] {
  view-transition-name: attr(id type(<custom-ident>));
  view-transition-class: vt-detail;
}
::view-transition-group(.vt-detail) {
  animation-duration: 1s;
  animation-timing-function: cubic-bezier(.2,.8,.2,1);
}

/* VIEW TRANSITION ON IMAGE */

/* resolve the ID on the wrapper, pass it down to the image */
[id^="vt-img-"] {
  --vt: attr(id type(<custom-ident>));
}
[id^="vt-img-"] img.el-image {
  view-transition-name: var(--vt);
  view-transition-class: vt-img;
}
::view-transition-group(.vt-img) {
  animation-duration: 1s;
  animation-timing-function: cubic-bezier(.2,.8,.2,1);
}


/* VIEW TRANSITION ON TITLE*/

/* Blog view: H3 with a vt-title ID → name the link inside it */
h3[id^="vt-title-"] {
  --vt: attr(id type(<custom-ident>));
}
h3[id^="vt-title-"] a {
  display: inline-block;            /* one box that hugs the text */
  view-transition-name: var(--vt);
  view-transition-class: vt-title;
}

/* Single view: H1 with a vt-title ID → name the heading itself */
h1[id^="vt-title-"] {
  width: fit-content;
  view-transition-name: attr(id type(<custom-ident>));
  view-transition-class: vt-title;
}

::view-transition-group(.vt-title){
  animation-duration: 1s;
  animation-timing-function: cubic-bezier(.2,.8,.2,1);
}
