/* Mobile / tablet landscape footer.
 *
 * Below 1100px the design footer wraps to three columns, so Offices and
 * Certifications land on a second row with an empty third cell. Phone
 * landscape also collapses Solutions into an accordion, which leaves a
 * blank heading beside Company and Support. This sheet fills that wrap,
 * expands Solutions, and left-aligns the columns like the desktop footer.
 */

@media (max-width: 1099px) and (orientation: landscape) {
  html body.erp-body footer.elinom-footer,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer {
    text-align: left !important;
    /* Bottom padding tightened toward ~0.875rem — less empty space under footer. */
    padding: 1.65rem clamp(3.1rem, 5.5vw, 4.25rem) 0.875rem clamp(1.1rem, 3vw, 2.25rem) !important;
    margin-top: 1.75rem !important;
  }

  html body.erp-body footer.elinom-footer .footer-content,
  html body.erp-body footer.elinom-footer .footer-content--design,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-content,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-content--design {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    justify-items: stretch !important;
    align-items: start !important;
    text-align: left !important;
    gap: 1.1rem 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  html body.erp-body footer.elinom-footer .footer-content--design > .footer-section,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-content--design > .footer-section {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    align-items: stretch !important;
    text-align: left !important;
  }

  html body.erp-body footer.elinom-footer .footer-col-offices,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-col-offices {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  html body.erp-body footer.elinom-footer .footer-col-certs-social,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-col-certs-social {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr) !important;
    column-gap: 1.15rem !important;
    row-gap: 0.45rem !important;
    align-items: start !important;
    height: auto !important;
  }

  html body.erp-body footer.elinom-footer .footer-col-certs-social > h4:first-child,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-col-certs-social > h4:first-child {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  html body.erp-body footer.elinom-footer .footer-col-certs-social .footer-cert,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-col-certs-social .footer-cert {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  html body.erp-body footer.elinom-footer .footer-content--design > .footer-section > h4:first-child,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-content--design > .footer-section > h4:first-child {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 1.7rem !important;
    margin-top: 0 !important;
    margin-bottom: 0.7rem !important;
    padding-bottom: 0 !important;
    text-align: left !important;
  }

  html body.erp-body footer.elinom-footer .footer-content--design > .footer-col-solutions > h4:first-child,
  html body.erp-body footer.elinom-footer .footer-content--design > .footer-col-company > h4:first-child,
  html body.erp-body footer.elinom-footer .footer-content--design > .footer-col-support > h4:first-child,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-content--design > .footer-col-solutions > h4:first-child,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-content--design > .footer-col-company > h4:first-child,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-content--design > .footer-col-support > h4:first-child {
    justify-content: center !important;
    text-align: center !important;
  }

  html body.erp-body footer.elinom-footer .footer-drop-trigger,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-drop-trigger {
    cursor: default !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    text-align: center !important;
  }

  html body.erp-body footer.elinom-footer .footer-drop-trigger::after,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-drop-trigger::after {
    display: none !important;
    content: none !important;
  }

  footer.elinom-footer .footer-col-solutions:not(.is-open) .footer-drop-panel,
  footer.elinom-footer .footer-col-solutions .footer-drop-panel,
  html body.erp-body footer.elinom-footer .footer-col-solutions:not(.is-open) .footer-drop-panel,
  html body.erp-body footer.elinom-footer .footer-col-solutions .footer-drop-panel,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-col-solutions:not(.is-open) .footer-drop-panel,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-col-solutions .footer-drop-panel,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-col-solutions.is-open .footer-drop-panel {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding-top: 0 !important;
  }

  html body.erp-body footer.elinom-footer .footer-section > a,
  html body.erp-body footer.elinom-footer .footer-links a,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-section > a,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-links a {
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: left !important;
    width: auto !important;
    max-width: 100% !important;
  }

  html body.erp-body footer.elinom-footer .footer-col-solutions .footer-drop-panel a,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-col-solutions .footer-drop-panel a,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-col-solutions.is-open .footer-drop-panel a {
    text-align: left !important;
  }

  html body.erp-body footer.elinom-footer .footer-contact-emails,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-contact-emails {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    gap: 0.45rem 0.7rem !important;
    width: 100% !important;
  }

  html body.erp-body footer.elinom-footer .footer-offices,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-offices {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
    width: 100% !important;
  }

  html body.erp-body footer.elinom-footer .footer-office-card,
  html body.erp-body footer.elinom-footer .footer-office-card.office-card,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-office-card,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-office-card.office-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    align-items: flex-start !important;
    text-align: left !important;
    padding: 0.7rem 0.75rem !important;
  }

  html body.erp-body footer.elinom-footer .footer-office-card .office-info,
  html body.erp-body footer.elinom-footer .footer-office-card .office-country,
  html body.erp-body footer.elinom-footer .footer-office-card .office-city,
  html body.erp-body footer.elinom-footer .footer-office-card .office-phone,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-office-card .office-info,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-office-card .office-country,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-office-card .office-city,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-office-card .office-phone {
    text-align: left !important;
    justify-content: flex-start !important;
  }

  html body.erp-body footer.elinom-footer .footer-cert,
  html body.erp-body footer.elinom-footer .footer-cert.footer-cert--column,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-cert,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-cert.footer-cert--column {
    justify-content: flex-start !important;
    align-items: stretch !important;
    width: 100% !important;
  }

  /* Connect lives in the offices column above the US card. */
  html body.erp-body footer.elinom-footer .footer-connect,
  html body.erp-body footer.elinom-footer .footer-connect--above-us,
  html body.erp-body footer.elinom-footer .footer-social-lockup,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-connect,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-connect--above-us,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-col-offices .footer-social-lockup {
    grid-column: auto !important;
    grid-row: auto !important;
    margin-top: 0.75rem !important;
    margin-bottom: 0.55rem !important;
    min-height: 0 !important;
    height: auto !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    transform: none !important;
    width: 100% !important;
  }

  html body.erp-body footer.elinom-footer .footer-social-row,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-social-row {
    justify-content: flex-start !important;
    align-items: center !important;
  }

  /* Copyright / legal right-aligned in the footer bar. */
  html body.erp-body footer.elinom-footer .footer-bottom,
  html body.erp-body footer.elinom-footer .footer-bottom--legal-end,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-bottom,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-bottom--legal-end {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    align-items: flex-end !important;
    text-align: right !important;
    margin-top: 0.85rem !important;
    padding: 0.65rem 0 0 !important;
    gap: 0.35rem 0.85rem !important;
    width: 100% !important;
  }

  html body.erp-body footer.elinom-footer .footer-legal-end,
  html body.erp-body footer.elinom-footer .footer-legal,
  html body.erp-body footer.elinom-footer .footer-legal-links,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-legal-end,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-legal,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-legal-links {
    justify-content: flex-end !important;
    align-items: flex-end !important;
    text-align: right !important;
    width: auto !important;
    max-width: 100% !important;
  }
}

/* Keep Solutions / Company / Support on one heading line whenever the
 * three columns share a row (phones in landscape, tablets in either
 * orientation). The accordion <button> otherwise keeps a 44px min-height
 * and drops the Solutions underline below the other two. */
@media (max-width: 1099px) {
  html body.erp-body footer.elinom-footer .footer-col-solutions > h4,
  html body.erp-body footer.elinom-footer .footer-col-company > h4,
  html body.erp-body footer.elinom-footer .footer-col-support > h4,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-col-solutions > h4,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-col-company > h4,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-col-support > h4 {
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    height: 1.7rem !important;
    min-height: 1.7rem !important;
    max-height: 1.7rem !important;
    margin-top: 0 !important;
    margin-bottom: 0.7rem !important;
    padding: 0 !important;
    line-height: 1.15 !important;
    overflow: hidden !important;
  }

  html body.erp-body footer.elinom-footer .footer-drop-trigger,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-drop-trigger {
    appearance: none !important;
    -webkit-appearance: none !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 0.4rem !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 1.7rem !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: inherit !important;
    font: inherit !important;
    letter-spacing: inherit !important;
    text-transform: inherit !important;
  }

  html body.erp-body footer.elinom-footer .footer-drop-trigger::after,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-drop-trigger::after {
    width: 0.38rem !important;
    height: 0.38rem !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }
}

/* Compact the short landscape viewport so legal links sit with the columns. */
@media (max-width: 1099px) and (max-height: 500px) and (orientation: landscape) {
  html body.erp-body footer.elinom-footer,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer {
    padding-top: 1.2rem !important;
    /* Bottom padding tightened toward ~0.875rem. */
    padding-bottom: 0.875rem !important;
  }

  html body.erp-body footer.elinom-footer .footer-content--design,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-content--design {
    gap: 0.85rem 0.9rem !important;
  }

  html body.erp-body footer.elinom-footer .footer-bottom,
  html body.erp-body footer.elinom-footer .footer-bottom--legal-end,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-bottom,
  html[data-active-module="landing"] body.erp-body footer.elinom-footer .footer-bottom--legal-end {
    margin-top: 0.55rem !important;
    padding-top: 0.45rem !important;
  }
}
