/* Apply only on screens <= 768px wide */
@media (max-width: 768px) {

    /* Make page containers more mobile-friendly */
    .main-container,
    .container {
      padding-left: 1rem;
      padding-right: 1rem;
      box-sizing: border-box;
    }
  
    /* Make images scale properly */
    img {
      max-width: 100%;
      height: auto;
    }
  
    /* Fix horizontal scrolling tables */
    table {
      display: block;
      overflow-x: auto;
      white-space: nowrap;
    }
  
    /* Optional: slightly smaller font for better mobile layout */
    html {
      font-size: 15px;
    }


        .columns {
          display: block !important;
        }
      
        .results-list,
        .map {
          width: 100% !important;
          max-width: 100% !important;
        }
      
        .map-container {
          height: 300px !important;
          margin-top: 1rem;
        }
      
        .box {
          margin-bottom: 1rem;
        }
      
        .results-list {
          max-height: none !important;
        }
      
  }
  
/* Phones: keep form fields at 16px. The 15px base above makes iOS Safari zoom the whole page
   whenever a smaller field is focused. */
@media (max-width: 768px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]),
    select,
    textarea,
    .input,
    .textarea,
    .select select {
      font-size: 16px;
    }

    /* Pop-ups: let a long title wrap instead of running off the card, and let the footer
       buttons drop onto a second row. */
    .modal-card-title {
      flex-shrink: 1;
      min-width: 0;
      white-space: normal;
      overflow-wrap: anywhere;
      line-height: 1.25;
    }

    .modal-card-foot {
      flex-wrap: wrap;
      row-gap: 0.5rem;
    }

    .modal-card-foot .button {
      white-space: normal;
      height: auto;
      max-width: 100%;
    }
}

/* Below the width where the menu collapses to the burger: logo and burger share one row.
   The logo link sits outside the navbar's container, so on its own it took a full row above
   the burger. `display: contents` lifts the brand and the menu up beside it; the open menu
   still takes a full row underneath. */
@media (max-width: 1023px) {
    nav.navbar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
    }

    nav.navbar > a.navbar-item {
      flex: 1 1 0;
      min-width: 0;
      justify-content: flex-start;
      padding: 0.5rem 0.75rem;
    }

    /* A tap leaves the link in its hover state on a touchscreen; without this the logo keeps
       a grey block behind it. */
    nav.navbar > a.navbar-item:hover,
    nav.navbar > a.navbar-item:focus {
      background-color: transparent;
    }

    nav.navbar > a.navbar-item img {
      margin: 0 !important;
      max-height: 44px !important;
    }

    nav.navbar > .container {
      display: contents;
    }

    nav.navbar .navbar-brand {
      flex: 0 0 auto;
      min-height: 0;
    }

    nav.navbar .navbar-menu {
      flex: 0 0 100%;
    }
}

@media (max-width: 768px) {
    /* Logged-in pages: the shell's section, its container and the page's own section each added
       side padding, leaving a 240px column on a 390px screen. Keep the outer one only. */
    .container.app-two-column,
    #app-content > .section,
    #app-content > .section > .container {
      padding-left: 0;
      padding-right: 0;
    }

    /* Cookie banner: about a quarter of the screen at full size. Smaller text, buttons a
       finger can hit. */
    #cookie-consent-banner {
      padding: 0.6rem 0.9rem !important;
    }

    #cookie-consent-banner p {
      font-size: 13px;
      line-height: 1.35;
    }

    #cookie-consent-banner .button {
      min-height: 40px;
      font-size: 14px;
    }
}

/* Sign in / sign up / register: the form is centred in a full-height purple backdrop, which on a
   phone showed as an empty purple band above and below a full-width form. Start the form
   straight under the header instead. */
@media (max-width: 600px) {
    #fullpage-form-wrapper {
      min-height: 0;
      justify-content: flex-start;
      background: none;
    }

    #fullpage-form {
      margin: 0;
      padding: 1.25rem 1rem 2rem;
      box-shadow: none;
    }
}
