/* Content-led responsive rules for gallery containers and short-viewport layouts. */

/* Tablet (1-2-1-2 editorial rhythm — prevents orphan 6th card at 2 columns). */
@container work (max-width: 1120px) {
  #work .cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 52px 24px;
  }
  #work .cards .project {
    grid-column: auto;
  }
  #work .cards .project:first-child,
  #work .cards .project:nth-child(4) {
    grid-column: 1 / -1;
    width: 84%;
    justify-self: center;
  }
  #work .cards .project .visual {
    aspect-ratio: 1.38;
  }
  #work .cards .project:first-child .visual,
  #work .cards .project:nth-child(4) .visual {
    aspect-ratio: 1.5;
  }
}

/* Single column when container cannot hold two readable previews side by side. */
@container work (max-width: 703px) {
  #work .cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }
  #work .cards .project:first-child,
  #work .cards .project:nth-child(4) {
    width: 100%;
  }
  #work .cards .project .visual,
  #work .cards .project:first-child .visual,
  #work .cards .project:nth-child(4) .visual {
    aspect-ratio: 1.28;
  }
}

@media (max-height: 500px) {
  .project-cta {
    min-height: max(320px, 80svh);
    padding-block: 24px;
  }
  .project-cta h2 {
    font-size: clamp(28px, 7svh, 48px);
    margin-bottom: 20px;
  }
}
