/* Keep the first portfolio image close to the section title on phones. */
@media (max-width: 800px) {
  #media { padding-top: 40px; }
  #media .portfolio-gallery { margin-top: 16px; }
  .portfolio-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    margin-bottom: 16px;
    padding: 0 0 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .portfolio-tabs button,
  .portfolio-tabs button:last-child {
    flex: 0 0 auto;
    grid-column: auto;
    width: auto;
    white-space: nowrap;
    text-align: center;
    scroll-snap-align: start;
  }
  .portfolio-gallery .gallery-group { padding-top: 16px; }
  .portfolio-gallery .gallery-group-head { display: none; }
}
