/* Partow homepage topic cards only. No popup, no absolute/fixed expanded cards.
   A selected card spans two columns INSIDE its original grid. Other cards flow.
   Change --ptv-hie-columns to 3 later if a full-row card is preferred. */
body.home #ptvw8-sections-root .ptvw8-grid,
body.home .ptv-hd-grid,
body.home .ptv-hd-topic-grid,
body.blog #ptvw8-sections-root .ptvw8-grid,
body.blog .ptv-hd-grid,
body.blog .ptv-hd-topic-grid {
  --ptv-hie-columns: 2;
}
body.home #ptvw8-sections-root .ptvw8-grid > .ptv-hie-item-expanded,
body.home .ptv-hd-grid > .ptv-hie-item-expanded,
body.home .ptv-hd-topic-grid > .ptv-hie-item-expanded,
body.blog #ptvw8-sections-root .ptvw8-grid > .ptv-hie-item-expanded,
body.blog .ptv-hd-grid > .ptv-hie-item-expanded,
body.blog .ptv-hd-topic-grid > .ptv-hie-item-expanded {
  grid-column: span var(--ptv-hie-columns) !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  position: static !important;
}
/* Keep expanded players inside the enlarged thumbnail after the responsive reflow.
   Video Wall ordinarily measures the iframe in pixels before expansion. */
body.home .ptv-hie-expanded .ptvw5-playing,
body.blog .ptv-hie-expanded .ptvw5-playing {
  position: relative !important;
  overflow: hidden !important;
}
body.home .ptv-hie-expanded .ptvw5-playing .ptvw5-frame,
body.blog .ptv-hie-expanded .ptvw5-playing .ptvw5-frame {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
}
/* Non-overlay, restrained spring effect on the card's interior.
   The actual grid cell always remains in document flow. */
body.home .ptv-hie-expanded,
body.blog .ptv-hie-expanded {
  transform-origin: center top;
  animation: ptv-hie-pop 380ms cubic-bezier(.22,.86,.3,1) both;
}
@keyframes ptv-hie-pop {
  0% { opacity: .9; filter: brightness(.95); }
  65% { opacity: 1; filter: brightness(1.05); }
  100% { opacity: 1; filter: none; }
}
body.home .ptv-hie-expanded.ptv-hd-card,
body.blog .ptv-hie-expanded.ptv-hd-card {
  border-color: rgba(230,0,27,.73) !important;
  box-shadow: 0 8px 26px rgba(0,0,0,.32) !important;
}
/* At tablet width there are 2 columns; at phone width there is just one.
   The phone already shows a full-width player, so no horizontal enlargement. */
@media (max-width: 600px) {
  body.home .ptv-hd-grid,
  body.home .ptv-hd-topic-grid,
  body.blog .ptv-hd-grid,
  body.blog .ptv-hd-topic-grid { --ptv-hie-columns: 1; }
}
@media (max-width: 520px) {
  body.home #ptvw8-sections-root .ptvw8-grid,
  body.blog #ptvw8-sections-root .ptvw8-grid { --ptv-hie-columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  body.home .ptv-hie-expanded,
  body.blog .ptv-hie-expanded { animation: none !important; }
}
