@import url('https://fonts.googleapis.com/css2?family=Tinos:ital,wght@0,400;0,700;1,400;1,700&display=swap');
::root {
  --prevLeft: 0;
  --prevTop: 0;
  --nCols: 18;
  --nRows: 15;

}

body {
  margin: 0;
  background-color: black;
  overflow-x: hidden;
  font-family: 'Tinos', serif;
}

.grid {
  display: grid;
  grid-template-columns: repeat(var(--nCols,18), 1fr);
  grid-template-rows: repeat(var(--nRows,15), 1fr);
  width: 100vw;
  height: 100vh;
  position: relative;
}

.thumbnail {
  width: 100%;
  height: 100%;
  overflow: hidden;
  object-fit: cover;
  display: block;
  cursor: crosshair;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 9;
  display: none;
  pointer-events: none;
}

.preview-container {
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  z-index: 10;
  width: 400px;
  height: 400px;
  transform: translate3d(var(--prevLeft, -100vw), var(--prevTop, 100vh), 0);
  pointer-events: none;
}

.preview {
  width: 100%;
  height: auto;
  max-width: 500px;
  max-height: 500px;
}

.preview-text {
  width: 100%;
  padding: 10px;
  background: black;
  color: white;
  font-family: 'Tinos', serif;
  font-size: 14px;
  box-sizing: border-box;
}

.close-preview {
  display: none;
}

.close-preview:hover {
  background: rgba(0, 0, 0, 0.9);
}

.special-preview {
  text-align: center;
  position: fixed;
  bottom: calc(100vh/var(--nRows, 15));
  top: unset;
  left: calc(200vh/var(--nCols, 18));
  transform: unset;
  height: auto;
}
.special-preview img{
  display: none;
}

/* Mobile */
@media screen and (max-width: 768px) {
  :root {
    --nCols: 5;
  }

  body {
    overflow-y: auto;
    height: auto;
  }

  .grid {
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: minmax(calc(100vw / 5), auto);
    height: auto;
    position: relative;
    display: grid;
    gap: 0;
    touch-action: pan-y;
  }

  .thumbnail {
    aspect-ratio: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .thumbnail[data-src*="p=0.jpg"] {
    grid-column: 5;
    grid-row: 31;
    width: calc(100vw / 5);
    height: calc(100vw / 5);
    z-index: 8;
    position: relative;
  }
  

  .preview-container {
    width: 90vw;
    height: auto;
    left: 50%;
    top: 10%;
    transform: translateX(-50%);
    bottom: 20px;
    pointer-events: initial;
  }

  .preview {
    max-width: 100%;
    max-height: 60vh;
  }

  .preview-text {
    font-size: 12px;
    padding: 20px;
    background: black;
    font-family: 'Tinos', serif;
  
  }
  
  .special-preview {
    text-align: center;
    padding-top: 0px;
    padding-right: 0px;
  }

  .overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    pointer-events: auto;
  }
}

  

