<script>
  window.onload = function () {
    // ========================= masonry =========================
    var grid = document.querySelector('.pgrid');
    var msnry = new Masonry(grid, {
      itemSelector: '.pgrid-item',
      columnWidth: '.pgrid-sizer',
      percentPosition: true,
    });
    imagesLoaded(grid).on('progress', function () {
      msnry.layout();
    });
    
    enquire.register("screen and (max-width:769px)", {
      match: function () {
        document.querySelectorAll('.pgrid-i