/* Pop Quest v22.6.5 — rendered topic footer, mobile control spacing and Exclusive article media. */

/* The topic renderer places its footer inside the generated topic main. Target the
   actual body/route as well as the component classes so older footer rules cannot
   leave it white. */
body.pq-topic-body #pqv3-app .pq-topic-detail-page footer.pq-footer,
body.pq-topic-body #pqv3-app footer.pq-footer-v423,
#pqv3-app.pq-topic-js-shell .pq-topic-detail-page footer.pq-footer{
  display:block!important;
  width:100vw!important;
  max-width:none!important;
  margin:30px 0 0 calc(50% - 50vw)!important;
  padding:34px max(24px,calc((100vw - 1120px)/2 + 18px)) 36px!important;
  box-sizing:border-box!important;
  background-color:#5f20df!important;
  background-image:linear-gradient(135deg,#35108f 0%,#7d2cff 100%)!important;
  color:#fff!important;
  border:0!important;
  border-radius:0!important;
  min-height:0!important;
}
body.pq-topic-body #pqv3-app footer.pq-footer .pq-footer-links,
#pqv3-app.pq-topic-js-shell footer.pq-footer .pq-footer-links{
  width:100%!important;
  max-width:1120px!important;
  margin:0 auto!important;
}
body.pq-topic-body #pqv3-app footer.pq-footer strong,
body.pq-topic-body #pqv3-app footer.pq-footer a,
#pqv3-app.pq-topic-js-shell footer.pq-footer strong,
#pqv3-app.pq-topic-js-shell footer.pq-footer a{
  color:#fff!important;
}
body.pq-topic-body #pqv3-app .pq-topic-detail-page{
  padding-bottom:0!important;
}

@media(max-width:760px){
  /* Give the count row breathing space above and below, and separate it from
     the follow/share controls instead of allowing borders to visually touch. */
  body.pq-topic-body #pqv3-app .pq-topic-detail-hero .pq-topic-stats,
  #pqv3-app.pq-topic-js-shell .pq-topic-detail-hero .pq-topic-stats{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:10px!important;
    width:100%!important;
    margin:22px 0 16px!important;
  }
  body.pq-topic-body #pqv3-app .pq-topic-detail-hero .pq-topic-stats > span,
  #pqv3-app.pq-topic-js-shell .pq-topic-detail-hero .pq-topic-stats > span{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:0!important;
    min-height:46px!important;
    padding:10px 8px!important;
    box-sizing:border-box!important;
    white-space:nowrap!important;
    text-align:center!important;
    font-size:12px!important;
    line-height:1.15!important;
  }
  body.pq-topic-body #pqv3-app .pq-topic-detail-hero .pq-topic-actions,
  #pqv3-app.pq-topic-js-shell .pq-topic-detail-hero .pq-topic-actions{
    display:grid!important;
    gap:12px!important;
  }
  body.pq-topic-body #pqv3-app .pq-topic-detail-hero .pq-topic-actions > *,
  #pqv3-app.pq-topic-js-shell .pq-topic-detail-hero .pq-topic-actions > *{
    margin:0!important;
  }
  body.pq-topic-body #pqv3-app footer.pq-footer,
  #pqv3-app.pq-topic-js-shell footer.pq-footer{
    width:100vw!important;
    margin:24px 0 0 calc(50% - 50vw)!important;
    padding:26px 18px max(30px,env(safe-area-inset-bottom))!important;
  }
}

@media(max-width:390px){
  body.pq-topic-body #pqv3-app .pq-topic-detail-hero .pq-topic-stats,
  #pqv3-app.pq-topic-js-shell .pq-topic-detail-hero .pq-topic-stats{
    gap:8px!important;
  }
  body.pq-topic-body #pqv3-app .pq-topic-detail-hero .pq-topic-stats > span,
  #pqv3-app.pq-topic-js-shell .pq-topic-detail-hero .pq-topic-stats > span{
    min-height:44px!important;
    padding-inline:6px!important;
    font-size:11.5px!important;
  }
}

/* Exclusive article media should sit on the article centre line regardless of
   whether WordPress emits a figure, a wp-caption wrapper, a paragraph wrapper,
   or a bare image. */
.pq-exclusive-article figure,
.pq-exclusive-article .wp-caption,
.pq-exclusive-article p:has(> img:only-child),
.pq-exclusive-article p:has(> a:only-child > img:only-child){
  width:fit-content!important;
  max-width:100%!important;
  margin:30px auto 0!important;
  text-align:center!important;
}
.pq-exclusive-article img:not(.avatar):not(.emoji){
  display:block!important;
  max-width:100%!important;
  height:auto!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
.pq-exclusive-article figcaption,
.pq-exclusive-article .wp-caption-text,
.pq-exclusive-article img + p,
.pq-exclusive-article p:has(> img:only-child) + p,
.pq-exclusive-article p:has(> a:only-child > img:only-child) + p{
  max-width:760px!important;
  margin:10px auto 28px!important;
  padding:0 8px!important;
  color:#746d86!important;
  font-size:14px!important;
  line-height:1.45!important;
  font-style:italic!important;
  text-align:center!important;
}
