/*
 * Responsive hardening patch
 * Additive overrides for legacy fixed-width layouts.
 */

:root {
  --ore-mobile-breakpoint: 991px;
}

.ore-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 991px) {
  body.is-admin .app-body {
    margin-top: 96px !important;
  }

  body.is-admin nav.navbar.navbar-admin,
  body.is-admin nav.navbar-admin.navbar-expand-lg,
  body.is-admin .navbar.navbar-admin,
  body.is-admin .navbar.navbar-admin.navbar-expand-lg {
    position: static !important;
    top: auto !important;
    min-height: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }

  body.is-admin nav.navbar.navbar-admin > .container,
  body.is-admin .navbar.navbar-admin > .container {
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  body.is-admin .app-header .btn {
    width: auto !important;
  }

  .form-group,
  .form-control,
  textarea,
  select,
  input {
    max-width: 100%;
  }

  #content,
  #pied {
    width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box;
  }

  /* Override legacy inline fixed widths that overflow on phones */
  [style*="width:1170px"],
  [style*="width:1100px"],
  [style*="width:1000px"],
  [style*="width:900px"],
  [style*="width:850px"],
  [style*="width:800px"],
  [style*="width:785px"],
  [style*="width:700px"],
  [style*="width:650px"],
  [style*="width:600px"],
  [style*="width:550px"],
  [style*="width:530px"],
  [style*="width:500px"],
  [style*="width:480px"],
  [style*="width:450px"],
  [style*="width:420px"],
  [style*="width:400px"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  [style*="max-width:500px"],
  [style*="max-width:450px"],
  [style*="max-width:420px"],
  [style*="max-width:400px"],
  [style*="max-width : 300px"],
  [style*="max-width:300px"] {
    max-width: 100% !important;
  }

  /* Keep large media inside viewport */
  img[style*="width:1000px"],
  img[style*="width:900px"],
  img[style*="width:850px"],
  img[style*="width:800px"],
  img[style*="width:700px"],
  img[style*="width:650px"],
  img[style*="width:600px"],
  img[style*="width:550px"],
  img[style*="width:530px"],
  img[style*="width:500px"],
  img[width="1000"],
  img[width="900"],
  img[width="850"],
  img[width="800"],
  img[width="700"],
  img[width="650"],
  img[width="600"],
  img[width="550"],
  img[width="530"],
  img[width="500"] {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  /* Calendar tables: keep readable with horizontal scroll */
  #calendrier {
    min-width: 760px;
    width: 100% !important;
  }

  .nav-icons {
    gap: 16px !important;
    flex-wrap: wrap;
  }

  .search-input {
    width: 100% !important;
  }

  #htmltoimage.wrapper {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 650px;
    margin: 0 auto;
  }
}
