/* Foodmaker V2 | Central, editable IMAGE SIZE CONTROLS
   Edit only the pixel values under :root and the media queries below.
   Branding: HEIGHT-first max-height; max-width is a safety guard.
   Product/illustration images: WIDTH-first max-width; max-height is a safety guard.
   Every image has width:auto + height:auto + object-fit:contain: NO cropping,
   stretching, or aspect-ratio distortion when a PNG is replaced with another.
   These controls affect DISPLAY SIZE, not original file bytes. See the
   separate offline image-resize toolkit to reduce very large PNG uploads.
*/

:root {
  /* Logo sizing: HEIGHT is the main rule; max-width prevents extra-wide logos
     from pushing the BM/EN switch and navigation off the screen. */
  --fm-header-logo-max-height: 46px;
  --fm-header-logo-max-width: 228px;
  --fm-footer-logo-max-height: 48px;
  --fm-footer-logo-max-width: 238px;

  /* Illustration and product sizing: WIDTH is the main rule, with a secondary
     height limit for portrait images. All dimensions are CSS pixels. */
  --fm-hero-img-max-width: 560px;
  --fm-hero-img-max-height: 475px;
  --fm-story-img-max-width: 350px;
  --fm-story-img-max-height: 350px;
  --fm-product-img-max-width: 150px;
  --fm-product-img-max-height: 188px;
  --fm-about-img-max-width: 520px;
  --fm-about-img-max-height: 350px;
}

/* A safety net for any future ordinary PNG images added to the website. */
img {
  max-width: 100%;
  height: auto;
}

/* HEADER LOGOS: use intrinsic aspect ratio and clamp HEIGHT first. */
.site-header .brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, var(--fm-header-logo-max-width));
  max-height: var(--fm-header-logo-max-height);
  aspect-ratio: auto;
  object-fit: contain;
  flex-shrink: 0;
}

/* FOOTER LOGOS: independent height limits so the header can stay compact. */
.site-footer .footer-brand .brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, var(--fm-footer-logo-max-width));
  max-height: var(--fm-footer-logo-max-height);
  aspect-ratio: auto;
  object-fit: contain;
}

/* IMAGE FILES: max-width is the primary size control; portrait images also
   stay within their visible panel because of the secondary max-height. */
.hero-art .fm-hero-image,
.story-visual > .fm-story-image,
.product-art .product-image,
.abstract-sauce .fm-about-image {
  display: block;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  max-width: 100%;
}

.hero-art .fm-hero-image {
  max-width: min(100%, var(--fm-hero-img-max-width));
  max-height: var(--fm-hero-img-max-height);
}
.story-visual > .fm-story-image {
  max-width: min(100%, var(--fm-story-img-max-width));
  max-height: var(--fm-story-img-max-height);
}
.product-art .product-image {
  max-width: min(92%, var(--fm-product-img-max-width));
  max-height: var(--fm-product-img-max-height);
}
.abstract-sauce .fm-about-image {
  max-width: min(100%, var(--fm-about-img-max-width));
  max-height: var(--fm-about-img-max-height);
}

/* Adapt to responsive containers. Keep these limits proportional to the
   existing layout instead of forcing large assets into mobile columns. */
@media (max-width: 1050px) {
  :root { --fm-product-img-max-height: 181px; }
}
@media (max-width: 720px) {
  :root {
    --fm-header-logo-max-height: 39px;
    --fm-header-logo-max-width: 193px;
    --fm-footer-logo-max-height: 45px;
    --fm-footer-logo-max-width: 225px;
    --fm-hero-img-max-width: 480px;
    --fm-hero-img-max-height: 340px;
    --fm-story-img-max-width: 290px;
    --fm-story-img-max-height: 290px;
    --fm-product-img-max-width: 133px;
    --fm-product-img-max-height: 149px;
    --fm-about-img-max-width: 450px;
    --fm-about-img-max-height: 350px;
  }
}
@media (max-width: 410px) {
  :root {
    --fm-header-logo-max-height: 28px;
    --fm-header-logo-max-width: 139px;
    --fm-footer-logo-max-height: 43px;
    --fm-footer-logo-max-width: 212px;
    --fm-product-img-max-width: 148px;
    --fm-product-img-max-height: 174px;
  }
}
@media (max-width: 340px) {
  :root {
    --fm-header-logo-max-height: 25px;
    --fm-header-logo-max-width: 126px;
  }
}
