/* POB Article Reading UI V9 / Selected Stories thumbnail aspect correction.
 * Staging front page only: section marker is added by home-cards.js.
 * The image file is never transformed or cropped. Only the display box is aligned.
 */
@media screen and (max-width: 600px) {
  .pob-selected-stories-v8 .pob-v8-card.pob-v8-card-ready {
    display: grid !important;
    grid-template-columns: 124px minmax(0, 1fr) !important;
    align-items: start !important;
    column-gap: 12px !important;
    padding: 12px !important;
    box-sizing: border-box !important;
    min-width: 0;
  }
  .pob-selected-stories-v8 .pob-v8-card > .pob-v8-media {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 124px !important;
    min-width: 124px !important;
    max-width: 124px !important;
    height: 70px !important;
    min-height: 70px !important;
    max-height: 70px !important;
    aspect-ratio: 16 / 9 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    align-self: start !important;
    position: relative;
    padding: 0 !important;
    margin: 0 !important;
    background: #edf3ef;
    border-radius: 6px;
  }
  .pob-selected-stories-v8 .pob-v8-card > .pob-v8-media picture,
  .pob-selected-stories-v8 .pob-v8-card > .pob-v8-media figure,
  .pob-selected-stories-v8 .pob-v8-card > .pob-v8-media a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    border: 0;
  }
  .pob-selected-stories-v8 .pob-v8-card > .pob-v8-media img,
  .pob-selected-stories-v8 .pob-v8-card > .pob-v8-media picture img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
  }
  /* Also handle a direct <img> as the card's media child; do not stretch it. */
  .pob-selected-stories-v8 .pob-v8-card > img.pob-v8-media {
    display: block !important;
    object-fit: contain !important;
    object-position: center center !important;
  }
  .pob-selected-stories-v8 .pob-v8-card > .pob-v8-copy {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0;
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: left;
  }
  .pob-selected-stories-v8 .pob-v8-copy h3,
  .pob-selected-stories-v8 .pob-v8-copy .post-title,
  .pob-selected-stories-v8 .pob-v8-copy .post-card-title,
  .pob-selected-stories-v8 .pob-v8-copy .pob-card-title,
  .pob-selected-stories-v8 .pob-v8-copy strong {
    font-size: 15px !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere;
  }
  .pob-selected-stories-v8 .pob-v8-copy time,
  .pob-selected-stories-v8 .pob-v8-copy small,
  .pob-selected-stories-v8 .pob-v8-copy .post-date {
    font-size: 12px !important;
    line-height: 1.5 !important;
  }
}
@media screen and (max-width: 350px) {
  .pob-selected-stories-v8 .pob-v8-card.pob-v8-card-ready {
    grid-template-columns: 105px minmax(0, 1fr) !important;
    column-gap: 10px !important;
    padding: 10px !important;
  }
  .pob-selected-stories-v8 .pob-v8-card > .pob-v8-media {
    width: 105px !important;
    min-width: 105px !important;
    max-width: 105px !important;
    height: 59px !important;
    min-height: 59px !important;
    max-height: 59px !important;
  }
}

/* V10: compact selected-stories cards. Place category under the thumbnail.
 * This layout runs only after v10 JS has identified the actual category badge.
 * Cards with nonstandard markup retain the safe V9 presentation.
 */
@media screen and (max-width: 600px) {
  .pob-selected-stories-v8 .pob-v8-card.pob-v10-compact-card {
    grid-template-rows: 70px auto !important;
    row-gap: 5px !important;
    align-content: start !important;
    align-items: start !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 10px 12px !important;
  }
  .pob-selected-stories-v8 .pob-v10-compact-card > .pob-v8-media {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
  .pob-selected-stories-v8 .pob-v10-compact-card > .pob-v10-category-under-thumb {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: start !important;
    width: 124px;
    max-width: 124px;
    box-sizing: border-box;
    display: block;
    padding: 3px 5px;
    margin: 0;
    color: #21658f;
    background: #eaf4fa;
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.45;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pob-selected-stories-v8 .pob-v10-compact-card > .pob-v8-copy {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    min-height: 0 !important;
    height: auto !important;
    align-self: start !important;
  }
  .pob-selected-stories-v8 .pob-v10-original-category {
    display: none !important;
  }
  .pob-selected-stories-v8 .pob-v10-compact-card .pob-v8-copy h3,
  .pob-selected-stories-v8 .pob-v10-compact-card .pob-v8-copy .post-title,
  .pob-selected-stories-v8 .pob-v10-compact-card .pob-v8-copy .post-card-title,
  .pob-selected-stories-v8 .pob-v10-compact-card .pob-v8-copy .pob-card-title {
    margin-top: 0 !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
  }
}
@media screen and (max-width: 350px) {
  .pob-selected-stories-v8 .pob-v8-card.pob-v10-compact-card {
    grid-template-rows: 59px auto !important;
    row-gap: 4px !important;
    padding: 9px 10px !important;
  }
  .pob-selected-stories-v8 .pob-v10-compact-card > .pob-v10-category-under-thumb {
    width: 105px;
    max-width: 105px;
    font-size: 10.5px;
  }
}
