/* Cutting Room — Essays: Polina Gif video-essay mosaic grid */

.essays-copy {
  text-align: justify; hyphens: auto; max-width: 56ch;
  font-size: 17px; font-weight: 400; line-height: 1.7;
  color: var(--ink); margin-bottom: clamp(24px, 3.4vw, 36px);
}
.essays-copy a { border-bottom: 1px solid var(--ink-dim); }
.essays-copy a:hover { border-color: var(--ink); }

.essay-mosaic {
  display: grid; width: 100%; height: clamp(340px, 36vw, 500px); gap: 4px;
  grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr);
  grid-template-areas: "a a b c" "a a d e";
}
.essay-cell:nth-child(1) { grid-area: a; }
.essay-cell:nth-child(2) { grid-area: b; }
.essay-cell:nth-child(3) { grid-area: c; }
.essay-cell:nth-child(4) { grid-area: d; }
.essay-cell:nth-child(5) { grid-area: e; }

.essay-cell { position: relative; display: block; overflow: hidden; background: var(--panel); }
.essay-thumb {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: grayscale(1) contrast(1.1); transform: scale(1.01);
  transition: transform 0.6s ease, filter 0.6s ease;
}
.essay-cell:hover .essay-thumb, .essay-cell:focus-visible .essay-thumb {
  transform: scale(1.06); filter: grayscale(0.3) contrast(1.1);
}
.essay-cell:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.essay-cell::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 62%); }
.essay-cell::before {
  content: attr(title);
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 12px 12px 10px;
  font-family: var(--font-display);
  font-size: 13px; line-height: 1.25; color: var(--ink);
  pointer-events: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.essay-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(236,233,226,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 2;
  opacity: 0.75; transition: opacity 0.25s ease, transform 0.25s ease;
}
.essay-cell:nth-child(1) .essay-play { width: 58px; height: 58px; }
.essay-cell:nth-child(1) .essay-play::after { border-width: 8px 0 8px 13px; }
.essay-cell:nth-child(1)::before { font-size: 18px; padding: 16px; }
.essay-cell:hover .essay-play { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
.essay-play::after { content: ""; margin-left: 2px; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent var(--ink); }
.essays-sub { margin-top: 20px; font-size: 14px; color: var(--ink-dim); max-width: 56ch; }

@media (max-width: 700px) {
  .essay-mosaic {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(200px, auto) minmax(140px, auto) minmax(140px, auto);
    grid-template-areas: "a a" "b c" "d e";
    height: auto;
    gap: 3px;
  }
  .essay-cell { min-height: 140px; }
  .essay-cell:nth-child(1) { min-height: 200px; }
  .essay-cell::before { font-size: 12px; padding: 10px; }
  .essay-cell:nth-child(1)::before { font-size: 16px; }
  .essays-copy { text-align: left; hyphens: none; font-size: 16px; }
}

.et1 { background-image: url(../assets/images/essays/last-tango-in-paris.jpg); background-size: cover; background-position: center; }
.et2 { background-image: url(../assets/images/essays/godzilla-black-and-white.jpg); background-size: cover; background-position: center; }
.et3 { background-image: url(../assets/images/essays/interstellar-nolan.jpg); background-size: cover; background-position: center; }
.et4 { background-image: url(../assets/images/essays/cgi-knight.jpg); background-size: cover; background-position: center; }
.et5 { background-image: url(../assets/images/essays/animation-devices.jpg); background-size: cover; background-position: center; }
