/* DOSMOS MOBILE IMAGE SAFE V2 — 2026-08-29
   Mobile-only cache-busted visual patch.
   No routing, panel, Supabase, worker, auth, or publish logic changes. */
@media (max-width: 820px){
  /* News article main artwork: preserve the complete 16:9 upload. */
  body[data-page="news"] #detailBanner,
  body[data-page="news"] .portal-detail-banner{
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    aspect-ratio:16 / 9 !important;
    background-size:contain !important;
    background-position:center center !important;
    background-repeat:no-repeat !important;
    background-color:#070707 !important;
    overflow:hidden !important;
  }

  body[data-page="news"] #detailBanner::before,
  body[data-page="news"] .portal-detail-banner::before{
    background:linear-gradient(180deg,transparent 78%,rgba(0,0,0,.10)) !important;
  }

  body[data-page="news"] #detailBanner img,
  body[data-page="news"] .portal-detail-banner img{
    display:block !important;
    width:100% !important;
    height:100% !important;
    max-width:100% !important;
    max-height:100% !important;
    object-fit:contain !important;
    object-position:center center !important;
    background:#070707 !important;
  }

  /* News cards on /news and homepage: no artwork crop on phones. */
  .news-card-media{
    aspect-ratio:16 / 9 !important;
    min-height:0 !important;
    height:auto !important;
    overflow:hidden !important;
    background:#070707 !important;
  }
  .news-card-image{
    display:block !important;
    width:100% !important;
    height:100% !important;
    object-fit:contain !important;
    object-position:center center !important;
    background:#070707 !important;
  }

  /* Event/tournament artwork uses full image on phones. */
  .event-card-media,
  .tournament-card-cover{
    aspect-ratio:16 / 9 !important;
    min-height:0 !important;
    overflow:hidden !important;
    background:#070707 !important;
  }
  .event-card-image,
  .tournament-card-image{
    width:100% !important;
    height:100% !important;
    object-fit:contain !important;
    object-position:center center !important;
    background:#070707 !important;
  }

  /* Gallery thumbnails: preserve image instead of center-cropping on mobile. */
  body[data-page="gallery"] .portal-gallery-item .portal-gallery-image,
  body[data-page="gallery"] .portal-gallery-item > img{
    width:100% !important;
    height:auto !important;
    max-height:none !important;
    aspect-ratio:auto !important;
    object-fit:contain !important;
    object-position:center center !important;
    background:#070707 !important;
  }

  /* Any image placed inside a news article body stays within phone width. */
  body[data-page="news"] .portal-news-content img,
  body[data-page="news"] .portal-rich-text img{
    display:block !important;
    width:auto !important;
    max-width:100% !important;
    height:auto !important;
    max-height:none !important;
    object-fit:contain !important;
    object-position:center center !important;
    margin-left:auto !important;
    margin-right:auto !important;
  }
}

@media (max-width: 430px){
  body[data-page="news"] #detailBanner,
  body[data-page="news"] .portal-detail-banner{
    border-radius:12px !important;
  }
}
