/* Pinterest-style pins for the existing gallery. Load after landing-v4.css.
   Native columns keep the DOM/buttons/dialog flow intact; images stay whole. */
.gesture-section.page-width {
  width: calc(100% - 32px);
  max-width: 1180px;
}

.gesture-gallery {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 32px auto 0;
  padding: 6px;
  list-style: none;
  column-count: 2;
  column-gap: 14px;
  column-fill: balance;
  text-align: left;
}

.gesture-gallery > li {
  display: inline-block;
  width: 100%;
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  vertical-align: top;
  break-inside: avoid;
  page-break-inside: avoid;
}

.gesture-gallery .gesture-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  color: var(--ink, #342b27);
  text-align: left;
  box-shadow: 0 2px 8px #342b2709;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.gesture-gallery .gesture-image {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  border-radius: 16px;
  overflow: hidden;
  background: var(--ivory, #f8f2e8);
}

.gesture-gallery .gesture-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  transform: none;
  transition: none;
}

/* Never zoom or crop a hand, an object, or the actual gesture on hover. */
.gesture-gallery .gesture-card:hover .gesture-image img {
  transform: none;
}

.gesture-gallery .gesture-quality {
  display: inline-block;
  grid-column: 1 / -1;
  justify-self: start;
  max-width: calc(100% - 24px);
  margin: 11px 12px 0;
  padding: 3px 7px;
  border-radius: 6px;
  background: #f5efe8;
  color: var(--wine, #783642);
  font-family: var(--body, Arial, sans-serif);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-transform: none;
  overflow-wrap: break-word;
}

.gesture-gallery .gesture-name {
  min-width: 0;
  margin: 8px 0 13px 12px;
  padding: 0;
  color: var(--ink, #342b27);
  font-family: var(--body, Arial, sans-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.08px;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.gesture-gallery .gesture-arrow {
  align-self: end;
  justify-self: end;
  margin: 0 11px 14px 7px;
  padding: 0;
  color: var(--wine, #783642);
  font-size: 16px;
  line-height: 1;
}

.gesture-gallery .gesture-card:focus-visible {
  outline: 3px solid var(--wine, #783642);
  outline-offset: 3px;
  box-shadow: 0 4px 16px #342b2714;
}

/* Teaching first; the unchanged daily action is available on request. */
.gesture-dialog .gesture-lesson {
  margin: 18px 0 22px;
  font-size: 17px;
  line-height: 1.7;
  text-align: left;
}

.gesture-dialog .gesture-action {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #d7c7b5;
  text-align: left;
}

.gesture-dialog .gesture-action summary {
  min-height: 44px;
  padding: 10px 0;
  color: var(--wine, #783642);
  font-family: var(--body, Arial, sans-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}

.gesture-dialog .gesture-action summary:focus-visible {
  outline: 2px solid var(--wine, #783642);
  outline-offset: 3px;
}

.gesture-dialog .gesture-action #gesture-text {
  margin: 12px 0 0;
  text-align: left;
}

@media (hover: hover) {
  .gesture-gallery .gesture-card:hover {
    box-shadow: 0 8px 22px #342b2714;
    transform: translateY(-2px);
  }
}

@media (min-width: 700px) {
  .gesture-section.page-width {
    width: calc(100% - 64px);
  }

  .gesture-gallery {
    column-count: 3;
    column-gap: 20px;
    margin-top: 36px;
  }

  .gesture-gallery > li {
    margin-bottom: 24px;
  }

  .gesture-gallery .gesture-name {
    margin-top: 9px;
    font-size: 15px;
  }
}

@media (min-width: 1024px) {
  .gesture-gallery {
    column-count: 4;
    column-gap: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gesture-gallery .gesture-card {
    transition: none;
  }

  .gesture-gallery .gesture-card:hover {
    transform: none;
  }
}

@media (forced-colors: active) {
  .gesture-gallery .gesture-quality {
    border: 1px solid CanvasText;
    color: CanvasText;
    background: Canvas;
  }

  .gesture-gallery .gesture-card:focus-visible {
    outline-color: Highlight;
  }
}
