/* Meow Factor — responsive layer.
   Every page keeps its original inline styles (unchanged desktop look).
   These rules only kick in below the breakpoints, and only touch the
   handful of properties needed to reflow the layout on small screens. */

/* ---- shared page shell (index/servizi/portfolio/chi-siamo/contatti) ---- */
@media (max-width: 1024px) {
  .mf-shell { padding: 24px !important; }
}
@media (max-width: 680px) {
  .mf-shell { padding: 12px !important; }
}

/* ---- header / nav ---- */
@media (max-width: 780px) {
  .mf-header {
    flex-wrap: wrap !important;
    justify-content: center !important;
    row-gap: 16px !important;
    text-align: center;
  }
  .mf-header-actions {
    flex-wrap: wrap !important;
    justify-content: center !important;
    width: 100%;
  }
  #mf-nav {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 10px 18px !important;
    font-size: 15.5px !important;
    width: 100%;
  }
}

/* ---- generic horizontal padding shrink (sections / big panels) ---- */
@media (max-width: 1024px) {
  .mf-pad { padding-left: 40px !important; padding-right: 40px !important; }
}
@media (max-width: 680px) {
  .mf-pad { padding-left: 20px !important; padding-right: 20px !important; }
}
@media (max-width: 420px) {
  .mf-pad { padding-left: 16px !important; padding-right: 16px !important; }
}

/* ---- grids that should stack on small screens ---- */
/* Always let grid tracks shrink below their content's min-content width,
   otherwise equal "1fr" columns refuse to shrink and get clipped by the
   card's overflow:hidden at in-between viewport widths ("grid blowout"). */
.mf-grid > * { min-width: 0; }
@media (max-width: 800px) {
  .mf-grid { grid-template-columns: 1fr !important; }
  .mf-grid > div { border-right: none !important; }
}

/* ---- fixed-width children inside a stacking grid (e.g. thumbnail + text rows) ---- */
@media (max-width: 800px) {
  .mf-fixed-w { width: 100% !important; }
}

/* ---- fixed-height media: keep proportions readable on small screens ---- */
@media (max-width: 800px) {
  .mf-img-fixed { height: 240px !important; min-height: 0 !important; }
  .mf-img-hero { height: 280px !important; min-height: 0 !important; }
}
@media (max-width: 480px) {
  .mf-img-fixed { height: 200px !important; }
  .mf-img-hero { height: 220px !important; }
}

/* ---- decorative hero visual wrapper (index.html) ---- */
@media (max-width: 800px) {
  .mf-hero-visual { min-height: 280px !important; }
}

/* ---- oversized display headings ---- */
@media (max-width: 780px) {
  .mf-h1 { font-size: 38px !important; line-height: 1.1 !important; }
  .mf-h2 { font-size: 30px !important; line-height: 1.16 !important; }
  .mf-h3 { font-size: 26px !important; line-height: 1.2 !important; }
}
@media (max-width: 420px) {
  .mf-h1 { font-size: 32px !important; }
  .mf-h2 { font-size: 26px !important; }
}

/* ---- thin dividers between flex columns that wrap on small screens ---- */
@media (max-width: 800px) {
  .mf-divider { display: none !important; }
}

/* ---- footer ---- */
@media (max-width: 680px) {
  .mf-footer {
    flex-direction: column !important;
    gap: 14px !important;
    text-align: center;
  }
}

/* ---- demo pages (Ombraverde / Piccolo Elfo): fluid root, wrapping nav ---- */
@media (max-width: 780px) {
  .mf-demo-header {
    flex-wrap: wrap !important;
    justify-content: center !important;
    row-gap: 14px !important;
    text-align: center;
  }
  .mf-demo-nav {
    flex-wrap: wrap !important;
    justify-content: center !important;
    width: 100%;
  }
}
