/* ============================================================
   Phase 73 — Home page product photo responsive fit
   ------------------------------------------------------------
   Goal: the landing-page product photos (hero, daily special and
   the dish grid) scale to the device — they fill their frame
   proportionally on phones, take a proper size on tablets / PCs,
   never overflow the screen, and keep the FULL dish photo visible
   (object-fit:contain — honoring the phase56/57 "no crop" rule).

   Why: phase56/57 lock dish photos to fixed pixel heights and
   force 1-per-row on phones, so images look small / letterboxed
   and don't "fit" the screen; the hero & special photos have no
   viewport cap. This sheet replaces fixed heights with a
   proportional 4:3 frame that scales with the card width, makes
   the grid density responsive per device, and caps the hero /
   special photos to the viewport height on small screens.

   Linked LAST on index.php (after customer-header.php) and scoped
   to .customer-page so it wins the phase39/50/56/57/68/69 cascade
   on the home page only.
   ============================================================ */

/* ---------- Global image safety on the landing page ---------- */
.customer-page img{max-width:100%;}
.customer-page .sk-hero39,
.customer-page .sk-special39,
.customer-page .sk-section39{max-width:100%;min-width:0;}

/* ==========================================================
   1) DISH GRID — responsive columns per device
   ========================================================== */
.customer-page .sk-dish-grid39{
  display:grid!important;
  grid-template-columns:repeat(auto-fill,minmax(232px,1fr))!important;
  gap:clamp(14px,2.2vw,22px)!important;
  align-items:stretch!important;
}

/* Even-height cards so rows line up */
.customer-page .sk-dish-grid39 .sk-dish-card39{
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
  min-width:0!important;
}
.customer-page .sk-dish-grid39 .sk-dish-card39 .sk-dish-body39{
  flex:1 1 auto!important;
}

/* ---------- Dish photo frame: proportional 4:3, scales with card ---------- */
.customer-page .sk-dish-grid39 .sk-dish-card39 .sk-dish-img39{
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:4/3!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  padding:0!important;
  margin:0!important;
  line-height:0!important;
  box-sizing:border-box!important;
  background:linear-gradient(160deg,#f3fbfb,#e6f4f4)!important;
}
/* Full photo, centered, never cropped or stretched */
.customer-page .sk-dish-grid39 .sk-dish-card39 .sk-dish-img39 img{
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  object-position:center center!important;
  display:block!important;
  margin:0!important;
  border-radius:0!important;
  transition:transform .35s ease!important;
}
.customer-page .sk-dish-grid39 .sk-dish-card39:hover .sk-dish-img39 img{
  transform:scale(1.04)!important;
}
/* Emoji fallback (no photo) stays centered and readable */
.customer-page .sk-dish-grid39 .sk-dish-card39 .sk-dish-img39:not(:has(img)){
  font-size:clamp(40px,9vw,58px)!important;
  color:#0c7f84!important;
}

/* ==========================================================
   2) HERO featured photo — fills the glass card, viewport-capped
   ========================================================== */
.customer-page .sk-hero39 .sk-hero-card{
  max-width:100%;
  min-width:0;
  overflow:hidden;
}
.customer-page .sk-hero39 .sk-hero-card img{
  width:100%!important;
  height:clamp(220px,30vw,360px)!important;
  max-height:min(48vh,420px)!important;
  object-fit:cover!important;
  object-position:center center!important;
  border-radius:22px!important;
  display:block!important;
}
.customer-page .sk-hero39 .sk-hero-fallback{
  min-height:clamp(220px,30vw,360px)!important;
  max-height:min(48vh,420px);
  border-radius:22px;
}

/* ==========================================================
   3) DAILY SPECIAL photo — responsive, viewport-capped
   ========================================================== */
.customer-page .sk-special39{max-width:100%;min-width:0;}
/* Photo wrapper expands to the full column width at a 4:3 ratio so the
   special photo shows at its largest reasonable size (no shrink caps). */
.customer-page .sk-special39 > div:first-child{
  width:100%;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:4/3;
  overflow:hidden;
  border-radius:22px;
  line-height:0;
  min-width:0;
}
.customer-page .sk-special39 img{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  object-fit:cover!important;
  object-position:center center!important;
  border-radius:22px!important;
  display:block!important;
}
.customer-page .sk-special39 .sk-hero-fallback{
  width:100%;
  height:100%;
  min-height:0!important;
  max-height:none!important;
}

/* ==========================================================
   Responsive breakpoints
   ========================================================== */

/* Small laptops / large tablets */
@media(max-width:1024px){
  .customer-page .sk-dish-grid39{
    grid-template-columns:repeat(auto-fill,minmax(205px,1fr))!important;
  }
}

/* Tablets */
@media(max-width:900px){
  .customer-page .sk-dish-grid39{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}

/* Phones — 2-up so product photos fit the screen width and more
   of the menu is visible without scrolling */
@media(max-width:680px){
  .customer-page .sk-dish-grid39{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
  }
  .customer-page .sk-dish-grid39 .sk-dish-card39 .sk-dish-body39{
    padding:12px!important;
  }
  .customer-page .sk-hero39 .sk-hero-card img,
  .customer-page .sk-hero39 .sk-hero-fallback{
    height:min(34vh,230px)!important;
    max-height:min(34vh,230px)!important;
    min-height:0!important;
  }
}

/* Very small phones */
@media(max-width:380px){
  .customer-page .sk-dish-grid39{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  .customer-page .sk-dish-grid39 .sk-dish-card39 .sk-dish-body39{
    padding:10px!important;
  }
}

/* Tiny screens — single column keeps cards readable */
@media(max-width:340px){
  .customer-page .sk-dish-grid39{
    grid-template-columns:1fr!important;
  }
}

/* ---------- Reduced motion ---------- */
@media(prefers-reduced-motion:reduce){
  .customer-page .sk-dish-grid39 .sk-dish-card39 .sk-dish-img39 img{
    transition:none!important;
  }
  .customer-page .sk-dish-grid39 .sk-dish-card39:hover .sk-dish-img39 img{
    transform:none!important;
  }
}

/* ---------- Fallback: no aspect-ratio support → keep a sane frame ---------- */
@supports not (aspect-ratio:4/3){
  .customer-page .sk-dish-grid39 .sk-dish-card39 .sk-dish-img39{
    height:170px!important;
    min-height:150px!important;
  }
}
