/* Instagram — canvas board "5 · Instagram". */

.sgx { background: var(--sg-page); padding: var(--page-gutter) 0; }
.sgx.has-sec-bg { background-color: var(--sg-page) !important; }

.sgx__in {
  margin-inline: var(--page-gutter);
  border-radius: var(--panel-r);
  background: var(--sec-bg, var(--cream));
  color: var(--navy);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 34px;
  padding-top: clamp(34px, 4vw, 52px);
}

.sgx__head { padding-inline: clamp(20px, 4vw, 52px); }

.sgx__title {
  margin: 0;
  max-width: 18ch;
  font-family: var(--f-display);
  font-size: clamp(32px, 3.6vw, 46px);
  line-height: .98;
  color: var(--navy);
}

/* the drift ---------------------------------------------------------------
 * Two identical runs sit end to end and the track shifts by exactly half its
 * width, so the end of the second run is pixel-for-pixel where the first one
 * started and the loop closes invisibly. 60s because these are things to look
 * at, not a ticker.
 */

/* room above and below for the tilt and the hard shadow, which the overflow
   would otherwise clip */
.sgx__scroller { overflow: hidden; display: flex; align-items: center; padding-block: 16px; }

.sgx__track {
  display: flex;
  min-width: max-content;
  animation: sgxMove var(--sgx-secs, 60s) linear infinite;
}

@keyframes sgxMove {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.sgx__scroller[data-sgx-pause]:hover .sgx__track,
.sgx__scroller[data-sgx-pause]:focus-within .sgx__track { animation-play-state: paused; }

.sgx__run { display: flex; gap: 22px; padding-right: 22px; }

.sgx__post {
  flex: none;
  width: 300px;
  height: 400px;
  box-sizing: border-box;
  border: 2px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: color-mix(in srgb, var(--navy) 10%, var(--cream));
  /* stickers on a board: the plum outline, a hard shadow, a hand-stuck tilt */
  box-shadow: 6px 6px 0 var(--line);
  rotate: -1.2deg;
}

.sgx__post:nth-child(even) { rotate: 1.2deg; }

.sgx__post img { width: 100%; height: 100%; object-fit: cover; }

/* the link ---------------------------------------------------------------- */

.sgx__foot {
  padding-bottom: clamp(30px, 3.6vw, 46px);
  display: flex;
  justify-content: center;
  gap: 14px;
}

.sgx__ig {
  width: 48px;
  height: 48px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--amber);
  box-shadow: var(--hard);
  display: grid;
  place-items: center;
  color: var(--plum);
  text-decoration: none;
  transition: translate .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.sgx__ig svg { width: 20px; height: 20px; }
.sgx__ig:hover { background: var(--cream); translate: 2px 2px; box-shadow: 2px 2px 0 var(--line); }

@media (max-width: 760px) {
  .sgx__post { width: 220px; height: 294px; }
  .sgx__run { gap: 16px; padding-right: 16px; }
}

/* A marquee is motion the visitor did not ask for, so it stops entirely. The
   posts stay scrollable by hand instead. */
@media (prefers-reduced-motion: reduce) {
  .sgx__track { animation: none; }
  .sgx__scroller { overflow-x: auto; scroll-snap-type: x mandatory; }
  .sgx__post { scroll-snap-align: center; }
  .sgx__run:nth-child(2) { display: none; }
}
