/* UW3D 2.0 v0.1.96: Featured Sites & Scans — card aspect ratio refinement.
   All overrides are limited to the homepage showcase, never /scans/, model or site templates. */
/* A genuine viewport-width showcase, even if a Gutenberg shell has a smaller
   max-width. The equal two panels still use the SAME width and height. */
.uw3d192-home .uw3d192-showcase.uw3d2-shell {
  width:min(calc(100vw - 56px),1980px)!important;
  max-width:1980px!important;
  position:relative;
  margin:0!important; /* prevent inherited shell auto margins from shifting breakout */
  left:50%;
  transform:translateX(-50%);
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:18px!important;
  align-items:stretch;
  box-sizing:border-box;
}
.uw3d192-home .uw3d192-showcase__panel{
  padding:16px 17px 17px;
  min-width:0;
  height:100%;
  box-sizing:border-box;
}
/* Wider side cards: visually balanced horizontal thumbnail + information;
   no third invisible row and no forced vertical cropping of artwork. */
.uw3d192-home .uw3d192-showcase .uw3d193-collection__grid{
  grid-template-columns:minmax(0,.89fr) minmax(0,1.18fr)!important;
  grid-template-rows:repeat(2,minmax(232px,auto))!important;
  gap:10px!important;
  align-items:stretch;
}
.uw3d192-home .uw3d193-collection__grid>article:nth-child(2),
.uw3d192-home .uw3d193-collection__grid>article:nth-child(3){
  display:grid;
  grid-template-columns:minmax(0,49%) minmax(0,51%)!important;
  min-width:0;
  min-height:0;
}
/* Keep image column photo-like instead of thin/tall crop. Use the original
   image and built-in per-site focal points without changing image attachments. */
.uw3d192-home .uw3d193-collection__grid>article:not(:first-child) .uw3d2-card__media,
.uw3d192-home .uw3d193-collection__grid>article:not(:first-child) .uw3d2-site-card__image {
  display:block!important;
  position:relative;
  overflow:hidden!important;
  min-width:0!important;
  height:100%!important;
  background:radial-gradient(ellipse at 52% 50%,#0a3646 0%,#051b26 68%,#03141e 100%)!important;
}
.uw3d192-home .uw3d193-collection__grid>article:not(:first-child) .uw3d2-card__media img,
.uw3d192-home .uw3d193-collection__grid>article:not(:first-child) .uw3d2-card__media-link img,
.uw3d192-home .uw3d193-collection__grid>article:not(:first-child) .uw3d2-site-card__image img {
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  position:absolute!important;
  top:0!important;
  left:0!important;
  display:block!important;
  object-fit:contain!important; /* safe default; JS chooses smart/cover */
  object-position: center center;
  transform:none!important;
  filter:contrast(1.04) saturate(1.02);
}
/* Site-specific image focal point and zoom remain adjustable for Cover.
   In Contain/Smart use full centered image so nothing is cut off. */
.uw3d192-home #featured-sites[data-uw3d196-fit="cover"] .uw3d193-collection__grid>article:not(:first-child) .uw3d2-site-card__image img {
  object-position:var(--uw3d2-site-x,50%) var(--uw3d2-site-y,50%)!important;
  transform:scale(var(--uw3d2-site-zoom,1))!important;
}
.uw3d192-home #featured-sites[data-uw3d196-fit="contain"] .uw3d193-collection__grid>article:not(:first-child) .uw3d2-site-card__image img,
.uw3d192-home #featured-scans[data-uw3d196-fit="contain"] .uw3d193-collection__grid>article:not(:first-child) .uw3d2-card__media img,
.uw3d192-home #featured-scans[data-uw3d196-fit="contain"] .uw3d193-collection__grid>article:not(:first-child) .uw3d2-card__media-link img{object-fit:contain!important}
.uw3d192-home #featured-sites[data-uw3d196-fit="cover"] .uw3d193-collection__grid>article:not(:first-child) .uw3d2-site-card__image img,
.uw3d192-home #featured-scans[data-uw3d196-fit="cover"] .uw3d193-collection__grid>article:not(:first-child) .uw3d2-card__media img,
.uw3d192-home #featured-scans[data-uw3d196-fit="cover"] .uw3d193-collection__grid>article:not(:first-child) .uw3d2-card__media-link img{object-fit:cover!important}
/* Center placeholder artwork, while preserving custom site type/depth badges
   and all configured metadata/icons, captions and buttons. */
.uw3d192-home #featured-sites .uw3d193-collection__grid>article:not(:first-child) .uw3d2-site-card__empty{
  max-width:100%;padding:12px 8px!important;
}
.uw3d192-home .uw3d193-collection__grid>article:not(:first-child) .uw3d2-card__body,
.uw3d192-home .uw3d193-collection__grid>article:not(:first-child) .uw3d2-site-card__body{
  min-width:0;
  padding:12px 12px!important;
}
/* Never force a short height that would cut user-defined data. The minimum
   is reduced gently; content can increase both panels' row heights. */
.uw3d192-home .uw3d192-showcase .uw3d193-collection__viewport{min-width:0;}
@media(max-width:1600px){
  .uw3d192-home .uw3d192-showcase.uw3d2-shell{
    width:min(calc(100vw - 44px),1030px)!important;
    grid-template-columns:1fr!important;
  }
  .uw3d192-home .uw3d192-showcase .uw3d193-collection__grid{
    grid-template-columns:minmax(0,.93fr) minmax(0,1.10fr)!important;
  }
}
@media(max-width:800px){
  .uw3d192-home .uw3d192-showcase.uw3d2-shell{width:calc(100vw - 30px)!important;}
  .uw3d192-home .uw3d192-showcase .uw3d193-collection__grid{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    grid-template-rows:repeat(2,minmax(236px,auto))!important;
  }
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(2),
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(3){grid-template-columns:minmax(0,43%) minmax(0,57%)!important;}
}
@media(max-width:690px){
  .uw3d192-home .uw3d192-showcase .uw3d193-collection__grid{grid-template-columns:1fr!important;grid-template-rows:auto!important;}
  .uw3d192-home .uw3d193-collection__grid>article:first-child{grid-column:1!important;grid-row:auto!important;}
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(2),
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(3){grid-column:1!important;grid-row:auto!important;min-height:215px;grid-template-columns:minmax(0,46%) minmax(0,54%)!important;}
}
@media(max-width:380px){
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(2),
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(3){grid-template-columns:minmax(0,40%) minmax(0,60%)!important;}
}

/* Tablet: retain all 3 cards, favor legible landscape thumbnails. */
@media (min-width:691px) and (max-width:800px) {
  .uw3d192-home .uw3d192-showcase .uw3d193-collection__grid{
    grid-template-columns:1fr!important;grid-template-rows:auto!important;
  }
  .uw3d192-home .uw3d193-collection__grid>article:first-child,
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(2),
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(3){grid-column:1!important;grid-row:auto!important;}
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(2),
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(3){min-height:215px;grid-template-columns:minmax(0,45%) minmax(0,55%)!important;}
}
@media (max-width:690px) {
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(2),
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(3){
    display:flex!important;flex-direction:column!important;min-height:0!important;
  }
  .uw3d192-home .uw3d193-collection__grid>article:not(:first-child) .uw3d2-card__media,
  .uw3d192-home .uw3d193-collection__grid>article:not(:first-child) .uw3d2-site-card__image{
    height:clamp(155px,44vw,240px)!important;min-height:155px!important;flex:none;
    border-right:0!important;border-bottom:1px solid #15566b!important;
  }
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(2) .uw3d2-card__body,
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(3) .uw3d2-card__body,
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(2) .uw3d2-site-card__body,
  .uw3d192-home .uw3d193-collection__grid>article:nth-child(3) .uw3d2-site-card__body{
    min-height:180px!important;
  }
}

/* v0.1.204 — mobile Featured Scans compact card: move depth under location,
   remove the extra DEPTH label there, and reduce required card height. */
@media (max-width:690px) {
  .uw3d192-home #featured-scans .uw3d2-card__mobile-depth{
    display:flex!important;
  }
  .uw3d192-home .uw3d192-showcase #featured-scans .uw3d2-card__metrics > .uw3d2-card__metric--depth,
  .uw3d192-home .uw3d192-showcase #featured-scans .uw3d2-card__metrics > .uw3d2-card__metric:nth-child(3).uw3d2-card__metric--depth{
    display:none!important;
    width:0!important;min-width:0!important;max-width:0!important;
    min-height:0!important;height:0!important;
    padding:0!important;margin:0!important;border:0!important;
    overflow:hidden!important;flex:0 0 0!important;
  }
  .uw3d192-home #featured-scans .uw3d2-card__metrics{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:12px!important;
  }
  .uw3d192-home #featured-scans .uw3d193-collection__grid>article:nth-child(2) .uw3d2-card__body,
  .uw3d192-home #featured-scans .uw3d193-collection__grid>article:nth-child(3) .uw3d2-card__body{
    min-height:150px!important;
  }
}

/* v0.1.205 — on the home page, mobile hamburger must stay at the far right
   and remain independent from the responsive logo width. */
@media (max-width:1050px) {
  body.home .uw3d2-hd-header .uw3d2-header__inner{position:relative!important;}
  body.home .uw3d2-hd-header .uw3d2-menu-toggle{
    position:absolute!important;right:0!important;left:auto!important;top:50%!important;
    transform:translateY(-50%)!important;order:initial!important;margin:0!important;
    z-index:12!important;flex-shrink:0!important;
  }
}
