/* Work panel: clicking "Work" slides in every project cover (same slide as the phone menu).
   Clicking the empty area around the covers closes it.
   Built by work-menu.js; the project list lives there. */

.work-panel {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: black;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1), visibility 0s linear 0.4s;
}

.work-panel.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1), visibility 0s;
}

/* Desktop: a gap-free grid. Six columns: the two newest projects take half the row each,
   the next three a third each, so both rows are full and everything fits on one screen. */
.work-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  min-height: 100%;
  align-content: center;
}

.work-item {
  grid-column: span 2;
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: black;
}

.work-item:nth-child(-n + 2) {
  grid-column: span 3;
}

.work-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

/* Caption on hover, same look as the gallery's covers: a see-through black gradient
   with the dates and credits centred on it */
.work-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0 5%;
  text-align: center;
  color: white;
  font-family: 'SyneMono', monospace;
  font-size: clamp(0.8rem, 1.3vw, 1.4rem);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.65) 50%, rgba(0, 0, 0, 0.25));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.work-caption p {
  margin: 0;
}

@media (hover: hover) {
  .work-item:hover .work-caption {
    opacity: 1;
  }
}


/* Phones and touch screens: one vertical stack, full width, each cover at its own shape */
@media not all and (hover: hover) and (min-width: 769px) {
  .work-grid {
    display: block;
    min-height: 0;
  }

  .work-item {
    aspect-ratio: auto;
  }

  .work-item img {
    height: auto;
  }
}
