/* ==========================================================================
   Mielovia mobile fixes 1.1.1 (plugin) · display fixes for phones and tablets.
   Each block names the theme or plugin whose markup it corrects, so that its
   owner can fold the fix into their own files and then delete the block here.
   Nothing here changes the content, the links or the scripts of the site.
   ========================================================================== */

/* 1 · Theme, mango sheet (#mango). The status "Lot verification pending" never
   wrapped, so on phones the whole room scrolled sideways (1 px at 390 px wide,
   16 px at 360, 36 px at 320). */
.page[data-page="sheet"] dl.spec .badge{white-space:normal;align-items:baseline}

/* 2 · Home sections, "Six materials beyond honey". The tiles cut a 3:4 frame out
   of 4:3 photographs from the middle, which sliced through the labelled jars.
   Each photo is now framed on its jar; phones get square frames. */
.hm-tile[href="#b-royal"] img{object-position:100% 50%}
.hm-tile[href="#b-pollen"] img{object-position:95% 50%}
.hm-tile[href="#b-propolis"] img{object-position:0 50%}
.hm-tile[href="#b-comb"] img,
.hm-tile[href="#b-bread"] img{object-position:97% 50%}
@media (max-width:600px){
  .hm-tile .art{aspect-ratio:1/1}
}

/* 3 · Theme, room headers held upright. The crop of the header photo cut the jar
   of Comb Honey (The Hive) and the bottle of Mielovia Mead (Mead) through their
   labels. Phones show the comb and the whole bottle; upright tablets show the
   whole jar. */
@media (max-width:600px) and (orientation:portrait){
  .page[data-page="hive"] .ph-media img{object-position:18% 50%!important}
  .page[data-page="mead"] .ph-media img{object-position:88% 55%!important}
}
@media (min-width:601px) and (max-width:1100px) and (orientation:portrait){
  .page[data-page="hive"] .ph-media img{object-position:100% 50%!important}
}

/* 4 · Theme, Mead room. Seven bottles in rows of four (two on phones) left the
   last row hanging on the left; every row is now centred. */
@media (max-width:900px){
  .mead .bottles{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-end;column-gap:clamp(8px,1.4vw,20px)}
  .mead .bottles>.bottle{flex:0 0 calc((100% - 3 * clamp(8px,1.4vw,20px)) / 4)}
}
@media (max-width:480px){
  .mead .bottles>.bottle{flex-basis:calc((100% - clamp(8px,1.4vw,20px)) / 2)}
}

/* 5 · Theme, Chocolatiers. "Pairing score" ran under the stroke of the ring,
   which is only 120 px wide on phones. */
@media (max-width:1000px){
  .score-ring .n small{letter-spacing:.06em}
}

/* 6 · Theme, tables on phones ("Measured in this batch" in the mango sheet, the
   lots of the Chocolatiers portal). The last column was cut off at the edge of
   the card; the tables now fit their card. */
@media (max-width:560px){
  .tbl table.data{font-size:.82rem}
  .tbl table.data th,.tbl table.data td{padding-right:8px}
  .tbl table.data td.num{white-space:normal}
}

/* 7 · Theme, mango sheet photo on phones. The caption broke over two lines on
   the brightest part of the photo; it now holds on one line over a soft shade. */
@media (max-width:760px){
  .page[data-page="sheet"] .product-visual::after{content:"";position:absolute;left:0;right:0;bottom:0;height:42%;background:linear-gradient(0deg,rgba(11,8,6,.8),rgba(11,8,6,0));pointer-events:none}
  .page[data-page="sheet"] .product-visual .cap{z-index:1;font-size:.6rem;letter-spacing:.08em}
}

/* 8 · Theme and library visuals, Honey Library cards on phones. When the footer
   of a card wraps, "Request sample" (or "In study") stays on the right, as on
   the cards whose footer holds on one line. */
@media (max-width:480px){
  #libGrid .h-card .foot>.open{margin-left:auto}
}

/* 9 · Home sections, Mango Blossom and Chocolatiers bands, when the photo sits
   above the text (phones held sideways, tablets). The photo frame kept its
   aspect ratio under its height limit, so it shrank to a small picture stuck
   on the left; it now spans the whole width, as on upright phones. */
@media (max-width:980px){
  .hm-choc-media{width:100%}
}
@media (max-width:900px){
  .hm-feature-media{width:100%}
}

/* 10 · Room sections, Laboratory, "Seven shades of honey" in four columns
   (tablets, phones held sideways): the last three shades are centred. */
@media (min-width:521px) and (max-width:980px){
  .mrs-scale{grid-template-columns:repeat(8,minmax(0,1fr))}
  .mrs-scale li{grid-column:span 2}
  .mrs-scale li:nth-child(5):nth-last-child(3){grid-column:2 / span 2}
}

/* 11 · Room sections, The Hive, "A worker's life, day by day": the last stage
   (Forager) no longer hangs on the left when the five stages wrap. */
@media (min-width:641px) and (max-width:1000px){
  .mrs-life-list{grid-template-columns:repeat(6,minmax(0,1fr))}
  .mrs-life-list li{grid-column:span 2}
  .mrs-life-list li:nth-child(4):nth-last-child(2){grid-column:2 / span 2}
}
@media (min-width:381px) and (max-width:640px){
  .mrs-life-list li:last-child:nth-child(odd){grid-column:1 / -1;justify-self:center;width:calc(50% - clamp(6px,.9vw,13px))}
}

/* 12 · Library visuals, enlarged flower on phones held sideways. The caption
   under the picture took most of the height and the flower shrank to a
   thumbnail; picture and caption now sit side by side. */
@media (orientation:landscape) and (max-height:560px){
  .mlv-viewer .mlv-stage{grid-template-columns:auto minmax(0,260px);align-items:center;justify-content:center;column-gap:28px;padding:16px 72px}
  .mlv-viewer .mlv-stage img{max-width:calc(100vw - 432px);max-height:calc(100vh - 32px);max-height:calc(100svh - 32px)}
  .mlv-viewer .mlv-cap{justify-items:start;text-align:left}
  .mlv-viewer .mlv-meta{justify-content:flex-start}
  .mlv-viewer .mlv-prev,.mlv-viewer .mlv-next{top:50%;bottom:auto;transform:translateY(-50%)}
  .mlv-viewer .mlv-prev{left:clamp(12px,2.5vw,32px)}
  .mlv-viewer .mlv-next{right:clamp(12px,2.5vw,32px)}
}

/* 14 · Home sections and theme, the Mango Blossom photo. The plugin shows a photo of the same scene with the
   whole jar in place of the theme's mango.webp (see mielovia-mobile-fixes.php). The jar stands on the right
   (56 % to 85 % of the photo's width). On computers from 901 to 1365 px the home's photo column is taller and
   narrower than the photo, so the frame keeps the jar in view; on phones held sideways the home shows a
   thin strip, centred on the jar's label. */
@media (min-width:901px) and (max-width:1023px){
  .hm-feature-media img[data-mlv-fix="mango-whole"]{object-position:80% 42%}
}
@media (min-width:1024px) and (max-width:1179px){
  .hm-feature-media img[data-mlv-fix="mango-whole"]{object-position:76% 42%}
}
@media (min-width:1180px) and (max-width:1365px){
  .hm-feature-media img[data-mlv-fix="mango-whole"]{object-position:70% 42%}
}
@media (max-width:900px) and (orientation:landscape) and (max-height:560px){
  .hm-feature-media img[data-mlv-fix="mango-whole"]{object-position:50% 55%}
}
