/* Phone and tablet layout for the homepage and the resources page.
   Colors stay in the theme stylesheets. These rules only fix size, stacking, and overflow. */

@media (max-width: 1024px) {
  html,
  body {
    max-width: 100%;
  }

  body .mlf-page,
  body .elementor-location-header,
  body .elementor-location-footer {
    max-width: 100%;
    overflow-x: clip;
  }

  .mlf-header-inner,
  .mlf-footer-inner,
  body .e-con.mlf-wrap,
  .mlf-wrap {
    width: min(1180px, calc(100% - 32px)) !important;
  }

  body .e-con.mlf-hero-sec {
    padding: 108px 0 48px !important;
  }

  body .e-con.mlf-hero-grid,
  body .mlf-hero-grid {
    display: flex !important;
    flex-direction: column !important;
    --flex-direction: column;
    grid-template-columns: minmax(0, 1fr) !important;
    width: min(1180px, calc(100% - 32px)) !important;
    gap: 28px !important;
    align-items: stretch !important;
  }

  body .e-con.mlf-hero-grid > .e-con,
  body .e-con.mlf-hero-copy,
  body .e-con.mlf-pat-stage {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    --width: 100%;
    flex: 1 1 auto !important;
  }

  html body #ciclo .mlf-hero-copy .elementor-widget-heading .elementor-heading-title,
  html body .mlf-hero-copy h1.elementor-heading-title,
  html body .mlf-hero-copy .elementor-heading-title {
    max-width: 100% !important;
    font-size: clamp(32px, 8.6vw, 48px) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.03em !important;
    overflow-wrap: anywhere;
    white-space: normal !important;
  }

  body .mlf-hero-copy .elementor-widget-container,
  body .e-con.mlf-hero-copy {
    overflow: visible !important;
    max-width: 100% !important;
  }

  body .mlf-pat-stage,
  body .e-con.mlf-pat-stage,
  body #ciclo .mlf-cycle-stage {
    min-height: 0 !important;
    justify-content: center !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body .mlf-pat-stage::before {
    width: min(100%, 460px) !important;
    height: 420px !important;
  }

  body .e-con.mlf-pat,
  body #ciclo .mlf-cycle.mlf-cycle,
  body #ciclo .mlf-cycle.mlf-cycle.is-small {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 400px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  body #ciclo .mlf-cycle-slide,
  body #ciclo .mlf-cycle-slide.mlf-cycle-intro {
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box !important;
  }

  body #ciclo .mlf-cycle-intro .mlf-pat-tags,
  body #ciclo .mlf-pat-tags {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 16px !important;
    margin-left: 0 !important;
    align-self: stretch !important;
  }

  body #ciclo .mlf-cycle-intro .mlf-pat-tags .elementor-icon-list-items,
  body #ciclo .mlf-pat-tags .elementor-icon-list-items {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    justify-content: flex-start !important;
  }

  body #ciclo .mlf-cycle-intro .mlf-pat-kicker,
  body #ciclo .mlf-cycle-intro .mlf-pat-kicker p,
  body #ciclo .mlf-cycle-text,
  body #ciclo .mlf-cycle-text p {
    max-width: 100% !important;
    white-space: normal !important;
  }

  body #porta {
    overflow: hidden;
    --mlf-frame: 100%;
  }

  body #porta .e-con.mlf-wrap,
  body #porta .e-con.mlf-sources,
  body.home #porta.is-focus .e-con.mlf-sources {
    width: 100% !important;
    max-width: 100% !important;
  }

  body #porta .mlf-head .elementor-heading-title {
    max-width: 100% !important;
    line-height: 1.05 !important;
    overflow-wrap: anywhere;
  }

  body #approccio .e-con.mlf-quad,
  body #approccio .mlf-quad {
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 767px) {
  body .mlf-sec,
  body .mlf-band.e-con,
  body .mlf-page-intro.e-con {
    --padding-left: 16px;
    --padding-right: 16px;
    --padding-inline-start: 16px;
    --padding-inline-end: 16px;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box;
  }

  body .e-con.mlf-wrap,
  .mlf-wrap,
  body #voci .mlf-voci,
  body #percorso .mlf-path,
  body .mlf-contact,
  body #contatti .mlf-contact {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
  }

  body .mlf-sec .elementor-heading-title,
  body .mlf-page-intro .elementor-heading-title,
  body .elementor-element.resource-hero-section .elementor-heading-title,
  body .elementor-element.resource-hero-section h2,
  body .elementor-element.resource-desc h3 {
    max-width: 100% !important;
    line-height: 1.12 !important;
    overflow-wrap: anywhere;
  }

  body .mlf-sec .elementor-widget-container,
  body .mlf-page-intro .elementor-widget-container,
  body .elementor-element.resource-desc .elementor-widget-container {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  body .elementor-widget-image img,
  body .elementor-widget-theme-post-content img,
  body .entry-content img,
  body .mlf-sec video,
  body .mlf-sec iframe {
    max-width: 100%;
    height: auto;
  }

  body #ciclo .mlf-cycle-intro .mlf-cycle-text p {
    max-width: none;
    font-size: 18px;
  }

  /* Porta l'AI. The resting row stays a sideways carousel inside the section.
     Break, scatter, and hub leave the absolute layout so cards are not stacked on top of each other. */
  body.home #porta.is-break .e-con.mlf-sources,
  body.home #porta.is-scatter .e-con.mlf-sources,
  body.home #porta.is-hub .e-con.mlf-sources {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    gap: 12px;
    background: none;
  }

  body.home #porta.is-break .mlf-sources-rail,
  body.home #porta.is-scatter .mlf-sources-rail,
  body.home #porta.is-hub .mlf-sources-rail {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
  }

  body.home #porta.is-break .mlf-sources-rail > .e-con.mlf-card,
  body.home #porta.is-scatter .mlf-sources-rail > .e-con.mlf-card,
  body.home #porta.is-hub .mlf-sources-rail > .e-con.mlf-card,
  body.home #porta.is-break .mlf-sources-rail > .mlf-card,
  body.home #porta.is-scatter .mlf-sources-rail > .mlf-card,
  body.home #porta.is-hub .mlf-sources-rail > .mlf-card {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 118px !important;
    transform: none !important;
    margin: 0 !important;
  }

  body.home #porta.is-break .mlf-porta-hub,
  body.home #porta.is-scatter .mlf-porta-hub {
    display: none !important;
  }

  body.home #porta.is-hub .mlf-porta-hub {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 22px 18px !important;
    transform: none !important;
    order: -1;
  }

  body.home #porta.is-hub .mlf-porta-hub {
    opacity: 1 !important;
    pointer-events: auto;
  }

  body.home #porta .mlf-porta-hub::before {
    width: 100% !important;
    height: 100% !important;
  }

  body.home #porta .mlf-porta-hub h3 {
    font-size: clamp(22px, 6vw, 30px) !important;
    line-height: 1.15 !important;
    overflow-wrap: anywhere;
  }

  body.home #porta.is-focus {
    --mlf-card-size: calc((100vw - 48px) / 1.35);
  }

  body.home #porta.is-focus .mlf-sources-rail > .mlf-card,
  body.home #porta.is-focus .mlf-sources-rail > .e-con.mlf-card {
    height: auto !important;
    min-height: 168px !important;
  }

  body #porta .mlf-card h3.elementor-heading-title {
    font-size: 16px !important;
    line-height: 1.15 !important;
  }

  body #partiamo .e-con,
  body #sapere .mlf-meet.e-con,
  body #sapere .titleNew1,
  body #sapere .mlf-meet-list {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    --width: 100%;
  }

  body #approccio .mlf-met-detail,
  body #approccio.is-open .mlf-met-frame {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 24px 16px 32px !important;
  }

  body #approccio .mlf-met-detail > article,
  body #approccio .mlf-met-pair,
  body #approccio .mlf-met-steps,
  body #approccio .mlf-met-guards {
    display: block !important;
    width: 100% !important;
    grid-template-columns: 1fr !important;
  }

  body #approccio .mlf-met-venn,
  body #approccio .mlf-met-orbit {
    width: min(280px, 100%) !important;
    height: 260px !important;
    margin-inline: auto;
  }

  body #approccio .mlf-met-nav,
  body #approccio .mlf-met-jump {
    position: static !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin: 0 0 16px;
  }

  body #approccio .mlf-met-card,
  body #approccio .mlf-quad-rail > .e-con.mlf-card {
    height: auto !important;
    min-height: 160px;
  }

  body #fasi .mlf-fasi,
  body #fasi .mlf-fasi-panel,
  body #moduli .mlf-mod-head,
  body #moduli .mlf-mod-body,
  body #moduli .mlf-mod-panel > .mlf-mod-body,
  body #settori .mlf-set-panel.is-on,
  body #settori .mlf-set-grid,
  body #settori .mlf-set-compare,
  body #tecnologie .mlf-tech-top,
  body #tecnologie .mlf-tech,
  body #tecnologie .mlf-tech-split,
  body #tecnologie .mlf-tech-card footer,
  body #appuntamenti .mlf-agenda-feature,
  body #appuntamenti .mlf-agenda-meta,
  body #appuntamenti .mlf-agenda-row,
  body #docenti .mlf-doc-body,
  body #percorso .mlf-path,
  body .e-con.mlf-contact,
  body .e-con.mlf-quotes,
  body .e-con.mlf-chat,
  body .mlf-footer-inner,
  body .mlf-footer-base {
    display: block !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body #fasi .mlf-fasi {
    padding: 8px 0 !important;
    column-gap: 0 !important;
    row-gap: 18px !important;
  }

  body #fasi .mlf-fasi-tabs,
  body #moduli .mlf-moduli-tabs,
  body #settori .mlf-set-tabs,
  body #letture .mlf-read-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
  }

  body #moduli .mlf-mod-panel {
    display: none !important;
    padding: 16px !important;
  }

  body #moduli .mlf-mod-panel.is-on {
    display: block !important;
  }

  body #moduli .mlf-mod-meta,
  body #moduli .mlf-mod-side,
  body #tecnologie .mlf-tech-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 14px;
  }

  body #tecnologie .mlf-tech-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
  }

  body #tecnologie .mlf-tech-tile {
    min-width: 0;
    white-space: normal;
    gap: 10px !important;
    padding: 16px 6px 12px !important;
  }

  body #tecnologie .mlf-tech-tile span {
    width: 40px;
    height: 40px;
  }

  body #tecnologie .mlf-tech-tile strong {
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  body #settori .mlf-set-card,
  body #appuntamenti .mlf-agenda-feature,
  body #contatti .mlf-form-card,
  body .mlf-contact .mlf-form-card,
  body .e-con.mlf-form-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 18px 16px !important;
    box-sizing: border-box;
  }

  body #settori .mlf-set-mid span {
    width: 84px;
    height: 84px;
  }

  body #appuntamenti .mlf-agenda-feature {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: auto !important;
    padding: 20px 16px !important;
    overflow: hidden;
    box-sizing: border-box;
  }

  body #appuntamenti .mlf-agenda-art {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  body #docenti .mlf-doc-cards {
    overflow: hidden !important;
    max-width: calc(100% - 104px) !important;
    margin-inline: auto !important;
  }

  body #docenti .mlf-doc-rail {
    width: 100% !important;
  }

  body #docenti .mlf-doc-card {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    box-sizing: border-box;
  }

  body #docenti .mlf-doc-arrow.is-prev { left: 0 !important; }
  body #docenti .mlf-doc-arrow.is-next { right: 0 !important; }

  body #docenti .mlf-doc-detail dl div,
  body #docenti .mlf-doc-nav,
  body #docenti .mlf-doc-top {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  body #letture .mlf-read-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  body #letture .mlf-read-search,
  body #letture .mlf-read-search input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
  }

  body #letture .mlf-read-title h2 {
    font-size: clamp(28px, 8vw, 40px) !important;
    line-height: 1.12 !important;
  }

  body #letture .mlf-read-frame {
    overflow: hidden;
    max-width: 100%;
  }

  body #letture .mlf-read-card {
    flex: 0 0 86% !important;
    width: 86% !important;
    min-width: 0;
  }

  body #letture .mlf-read-card a,
  body #letture .mlf-read-card strong,
  body #letture .mlf-read-card em {
    overflow-wrap: anywhere;
  }

  body #percorso .mlf-path-title h2,
  body #voci .mlf-voci-title h2,
  body #fasi .mlf-fasi-title h2,
  body #settori .mlf-set-intro h2,
  body #tecnologie .mlf-tech-title h2 {
    max-width: none !important;
    font-size: clamp(28px, 8vw, 40px) !important;
    line-height: 1.12 !important;
  }

  body #percorso .mlf-path-chat {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 420px;
    box-sizing: border-box;
  }

  body #voci .mlf-voci-frame {
    overflow: hidden;
    width: 100%;
  }

  body #voci .mlf-voci-rail {
    gap: 0 !important;
    padding: 8px 0 !important;
  }

  body #voci .mlf-voci-card,
  body #voci .mlf-voci-card:hover,
  body #voci .mlf-voci-card.is-on,
  body #voci .mlf-voci-card.is-on:hover {
    flex: 0 0 calc(100vw - 64px) !important;
    width: calc(100vw - 64px) !important;
    max-width: calc(100vw - 64px) !important;
    min-height: 220px !important;
    margin: 8px 0 !important;
    padding: 22px 18px !important;
    transform: none !important;
    box-sizing: border-box;
  }

  body #voci .mlf-voci-quote,
  body #voci .mlf-voci-quote p,
  body #voci .mlf-voci-card footer {
    position: relative;
    z-index: 5 !important;
  }

  body #voci .mlf-voci-nav {
    position: absolute;
    top: -72px;
    right: 0;
    display: flex;
    gap: 8px;
    margin: 0;
  }

  body #contatti .mlf-form-card input,
  body #contatti .mlf-form-card textarea,
  body .mlf-contact input,
  body .mlf-contact textarea,
  body .mlf-form-card input,
  body .mlf-form-card textarea,
  body .wpcf7 input,
  body .wpcf7 textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  body .mlf-footer {
    padding: 18px 16px !important;
    box-sizing: border-box;
    overflow: hidden;
  }

  body .mlf-footer-base,
  body .mlf-footer .mlf-footer-base {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
  }

  body .mlf-footer .mlf-footer-base p {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    line-height: 1.45 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  #mailpoet_form_1,
  #mailpoet_form_1 form.mailpoet_form {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    justify-self: stretch !important;
    box-sizing: border-box;
  }

  #mailpoet_form_1 form.mailpoet_form .mailpoet_paragraph.form-input {
    min-width: 0;
    flex: 1 1 auto;
  }

  #mailpoet_form_1 form.mailpoet_form input.mailpoet_submit,
  #mailpoet_form_1 form.mailpoet_form button,
  #mailpoet_form_1 form.mailpoet_form .mailpoet_submit,
  .mailpoet_paragraph.mailpoet-submit.btn.last input.mailpoet_submit {
    flex: 0 0 48px !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    white-space: nowrap !important;
    text-indent: -999px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 18px !important;
  }

  .mlf-resources.e-con,
  .mlf-cards.e-con,
  .mlf-paths.e-con,
  .mlf-logos.e-con,
  .mlf-stats.e-con,
  .mlf-programs.e-con,
  .mlf-split.e-con,
  .mlf-two.e-con,
  .mlf-faq-layout.e-con,
  .mlf-cta.e-con {
    grid-template-columns: 1fr !important;
    flex-direction: column !important;
  }

  body .mlf-page-intro.e-con {
    padding-top: 96px !important;
    padding-bottom: 28px !important;
  }

  body .elementor-element.resource-hero-section h2,
  body .elementor-element.resource-desc h3 {
    font-size: clamp(28px, 8vw, 40px) !important;
  }

  body.single .entry-content,
  body.page .entry-content,
  body .elementor-widget-theme-post-content {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  body.single .entry-content img,
  body.page .entry-content img,
  body .elementor-widget-theme-post-content img {
    height: auto;
  }
}

html[data-theme="light"] body .mlf-page-intro .elementor-heading-title,
html[data-theme="light"] body .elementor-element.resource-hero-section .elementor-heading-title,
html[data-theme="light"] body .elementor-element.resource-hero-section h2,
html[data-theme="light"] body .elementor-element.resource-desc h3 {
  color: #10253e !important;
  -webkit-text-fill-color: #10253e !important;
}

@media (max-width: 900px) {
  html body.home #moduli .mlf-mod-id h3,
  html body.home #moduli .mlf-moduli-intro h2,
  html body.home #moduli .mlf-moduli-intro h2.elementor-heading-title,
  html body.home #moduli .mlf-moduli-intro .elementor-heading-title {
    max-width: none !important;
    font-size: 23px !important;
    line-height: 1.15 !important;
  }
}

@media (max-width: 420px) {
  .mlf-header-inner {
    width: calc(100% - 16px) !important;
    gap: 8px;
  }

  .mlf-logo {
    font-size: 14px;
  }

  body.home #porta.is-break .mlf-sources-rail,
  body.home #porta.is-scatter .mlf-sources-rail,
  body.home #porta.is-hub .mlf-sources-rail {
    grid-template-columns: 1fr;
  }
}
