/* P243: Display original 2:1 news covers without cropping people/text.
   Scoped to the public school's latest news and reader; not applied to awards, hero or videos. */
#news .news-feed-image{overflow:hidden;min-height:0!important;height:auto!important;aspect-ratio:2/1!important;background:#eaf4ef;position:relative!important;display:flex;align-items:center;justify-content:center}
#news .news-feed-image img{display:block;position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-height:none!important;object-fit:contain!important;object-position:center center!important;aspect-ratio:2/1!important}
#news .news-feed-card.is-featured .news-feed-image{aspect-ratio:2/1!important;min-height:0!important;height:auto!important}
#news .news-feed-card:not(.is-featured) .news-feed-image{aspect-ratio:2/1!important;min-height:0!important;height:auto!important}
#newsReaderModal .news-reader-card{max-width:1000px;width:min(1000px,calc(100vw - 24px));max-height:90dvh;overflow-y:auto}
#newsReaderModal .news-reader-image{display:block;width:100%;height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:auto!important;overflow:visible!important;background:#f0f5f1}
#newsReaderModal .news-reader-image[hidden]{display:none!important}
#newsReaderModal .news-reader-image img{display:block!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:auto!important;object-fit:contain!important;object-position:center!important}
#newsReaderModal .news-reader-gallery{display:inline-flex;align-items:center;gap:9px;border:1px solid #b6d2ff;border-radius:10px;background:#edf5ff;color:#1763b0;font:800 14px Sarabun,Arial,sans-serif;text-decoration:none;padding:10px 15px;margin:16px 0 4px}
#newsReaderModal .news-reader-gallery:hover{background:#dfedff}
#newsReaderModal .news-reader-gallery[hidden]{display:none!important}
@media(max-width:680px){#newsReaderModal .news-reader-card{width:calc(100vw - 18px);max-height:92dvh}#newsReaderModal .news-reader-gallery{width:100%;justify-content:center;box-sizing:border-box}}


/* P244 — preserve the ENTIRE uploaded picture; cards and reader scale with viewport.
   Source files cropped by older 16:9 uploaders cannot be reconstructed by CSS:
   replace those covers with an original 2:1 image through news-arrange.php. */
#news .news-feed,
#news .news-feed-card,
#news .news-feed-card.is-featured,
#news .news-feed-copy {min-width:0;max-width:100%;box-sizing:border-box}

/* The picture frame is 2:1, and the whole image must remain visible. */
#news .news-feed-card .news-feed-image,
#news .news-feed-card.is-featured .news-feed-image {
  display:block!important;
  position:relative!important;
  box-sizing:border-box;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:2/1!important;
  overflow:hidden!important;
  background:#eef5f1;
}
#news .news-feed-card .news-feed-image img,
#news .news-feed-card.is-featured .news-feed-image img {
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-height:none!important;
  object-fit:contain!important;
  object-position:center center!important;
  transform:none!important;
}

/* Reader image follows intrinsic pixels, not a fixed 16:9 box. */
#newsReaderModal .news-reader-card {
  box-sizing:border-box!important;
  width:min(1000px,calc(100vw - 28px))!important;
  max-width:100%!important;
  max-height:calc(100dvh - 28px)!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
}
#newsReaderModal .news-reader-image {
  width:100%!important;
  height:auto!important;
  max-height:none!important;
  min-height:0!important;
  aspect-ratio:auto!important;
  overflow:visible!important;
}
#newsReaderModal .news-reader-image img {
  display:block!important;
  position:static!important;
  inset:auto!important;
  width:100%!important;
  max-width:100%!important;
  height:auto!important;
  max-height:none!important;
  min-height:0!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  object-position:center center!important;
  transform:none!important;
}
#newsReaderModal .news-reader-body {min-width:0;overflow-wrap:break-word;box-sizing:border-box}

/* Phones: one fluid news card per row, full-width 2:1 artwork without sideways scroll. */
@media (max-width:760px) {
  #news .news-feed {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:12px!important;
    width:100%!important;
    overflow:visible!important;
    max-height:none!important;
  }
  #news .news-feed-card,
  #news .news-feed-card.is-featured {
    display:flex!important;
    flex-direction:column!important;
    grid-column:1/-1!important;
    grid-row:auto!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
  }
  #news .news-feed-card .news-feed-image,
  #news .news-feed-card.is-featured .news-feed-image {
    flex:0 0 auto!important;
    width:100%!important;
    height:auto!important;
    aspect-ratio:2/1!important;
  }
  #news .news-feed-card .news-feed-copy {
    box-sizing:border-box!important;
    flex:1 1 auto!important;
    width:100%!important;
    min-width:0!important;
    padding:12px 14px!important;
  }
  #newsReaderModal .news-reader-card {
    width:calc(100vw - 16px)!important;
    max-width:calc(100vw - 16px)!important;
    max-height:calc(100dvh - 16px)!important;
    border-radius:14px!important;
  }
  #newsReaderModal .news-reader-image img {width:100%!important;height:auto!important;}
  #newsReaderModal .news-reader-body {padding:15px!important;}
}
@media (max-width:380px) {
  #news .news-feed-card .news-feed-copy {padding:10px 12px!important;}
  #newsReaderModal .news-reader-body {padding:12px!important;}
}

/* P245: Albums use the same 1920×960 cover geometry without clipping. Video art stays 16:9. */
.school-site-body .site-album-card {aspect-ratio:2/1!important;min-height:0!important;max-width:100%;}
.school-site-body .site-album-card img {display:block!important;width:100%!important;height:100%!important;object-fit:contain!important;object-position:center center!important;transform:none!important;}
@media(max-width:760px){.school-site-body .site-album-card{width:100%!important;min-height:0!important;aspect-ratio:2/1!important}}
