/* v47.11 - Only the existing Kokopelli project page and its TV/Films listing.
   Fixes the *parent alignment*, not merely margin:auto on the image itself. */
body.dnj-kokopelli-page .wp-block-post-content .dnj-koko-center-media,
body.dnj-tv-films-index .wp-block-post-content .dnj-koko-center-media {
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  margin-left:auto!important;
  margin-right:auto!important;
  text-align:center!important;
  min-width:0!important;
  max-width:100%!important;
}
body.dnj-kokopelli-page .wp-block-post-content :is(figure.wp-block-image,.dnj-koko-image-wrapper),
body.dnj-kokopelli-page .wp-block-post-content .wp-block-gallery {
  margin-left:auto!important;
  margin-right:auto!important;
  text-align:center!important;
  justify-content:center!important;
}
body.dnj-kokopelli-page .wp-block-post-content .dnj-koko-center-image,
body.dnj-tv-films-index .wp-block-post-content .dnj-koko-center-image {
  display:block!important;
  position:relative!important;
  float:none!important;
  margin-left:auto!important;
  margin-right:auto!important;
  max-width:100%!important;
  object-position:center!important;
}
/* Linked figures and HTML paragraphs need their own centering, too. */
body.dnj-kokopelli-page .wp-block-post-content :is(a,p).dnj-koko-center-holder,
body.dnj-tv-films-index .wp-block-post-content :is(a,p).dnj-koko-center-holder {
  margin-left:auto!important;
  margin-right:auto!important;
  text-align:center!important;
}
body.dnj-kokopelli-page .wp-block-post-content a.dnj-koko-center-holder,
body.dnj-tv-films-index .wp-block-post-content a.dnj-koko-center-holder {
  display:block!important;
  width:fit-content!important;
  max-width:100%!important;
}
/* Ensure the first Kokopelli poster in the TV/Films list is centered even
   before JavaScript loads; supports normal Gutenberg images and old assets. */
body.dnj-tv-films-index .wp-block-post-content figure:has(img[src*="Kokopelli"]),
body.dnj-tv-films-index .wp-block-post-content figure:has(img[alt*="Kokopelli" i]),
body.dnj-tv-films-index .wp-block-post-content figure:has(img.dnj-koko-cover) {
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  margin:0 auto 24px!important;
}
/* Page image blocks can sit inside constrained Gutenberg groups and columns.
   Keep each actual picture at its author-selected size, within the viewport. */
@media(max-width:1120px) {
  body.dnj-kokopelli-page .wp-block-post-content .dnj-koko-center-columns,
  body.dnj-tv-films-index .wp-block-post-content .dnj-koko-center-columns,
  body.dnj-tv-films-index .wp-block-post-content .wp-block-columns:has(img[src*="Kokopelli"]),
  body.dnj-tv-films-index .wp-block-post-content .wp-block-columns:has(img.dnj-koko-cover) {
    box-sizing:border-box!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:clamp(16px,3vw,28px)!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:min(100%,850px)!important;
    max-width:850px!important;
    min-width:0!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  body.dnj-kokopelli-page .wp-block-post-content .dnj-koko-center-column,
  body.dnj-tv-films-index .wp-block-post-content .dnj-koko-center-column {
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    flex:0 1 auto!important;
    flex-basis:auto!important;
    margin-left:auto!important;
    margin-right:auto!important;
    text-align:center!important;
  }
  body.dnj-kokopelli-page .wp-block-post-content .dnj-koko-center-media,
  body.dnj-tv-films-index .wp-block-post-content .dnj-koko-center-media,
  body.dnj-kokopelli-page .wp-block-post-content p.dnj-koko-center-holder,
  body.dnj-tv-films-index .wp-block-post-content p.dnj-koko-center-holder {
    width:100%!important;
    max-width:100%!important;
  }
  body.dnj-tv-films-index .wp-block-post-content .dnj-koko-center-project-grid {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    justify-items:center!important;
    align-items:center!important;
    width:100%!important;
    max-width:850px!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
}
@media(max-width:600px) {
  body.dnj-kokopelli-page .wp-block-post-content .dnj-koko-center-image,
  body.dnj-tv-films-index .wp-block-post-content .dnj-koko-center-image {
    max-width:100%!important;
    height:auto!important;
  }
  body.dnj-tv-films-index .wp-block-post-content img.dnj-koko-center-image {
    max-width:min(100%,350px)!important;
  }
}
