/* Shared gallery: section guard against horizontal scroll from scaled cards. */
.shared {
  overflow-x: clip;
}

/* Grid: 1 column on phones, 2 from 640px, 3 from 960px. */
.shared-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .shared-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .shared-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Card: framed photo with the caption overlaid on its bottom edge. */
.shared-card {
  min-width: 0;
}

.shared-card figure {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

@media (min-width: 960px) {
  .shared-card figure {
    aspect-ratio: 5 / 4;
  }
}

.shared-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .shared-card img {
    transition: transform var(--dur) var(--ease-out);
  }

  .shared-card figure:hover img {
    transform: scale(1.04);
  }
}

.shared-card figcaption {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: var(--space-1);
  padding: var(--space-8) var(--space-4) var(--space-4);
  background: linear-gradient(to top, rgb(0 0 0 / 0.85), transparent);
}

.shared-card figcaption strong {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.shared-card figcaption span {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Product chips: small mono labels that wrap on narrow cards. */
.shared-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: var(--space-1) 0 0;
  padding: 0;
  list-style: none;
}

.shared-tags li {
  padding: calc(var(--space-1) / 2) var(--space-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--text);
}

/* Empty state: muted note. The hidden attribute controls its visibility. */
.shared-empty {
  max-width: 56ch;
  margin: 0 0 var(--space-8);
  color: var(--muted);
}

/* Custom checkbox row for the share consent in the simulator form. */
.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--muted);
  cursor: pointer;
}

.check input {
  appearance: none;
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  cursor: pointer;
}

.check input::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 6px;
  height: 11px;
  margin: auto;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg) scale(0);
  transition: transform var(--dur-fast) var(--ease-spring);
}

.check input:checked {
  border-color: var(--ember);
  background: var(--ember);
}

.check input:checked::after {
  transform: translateY(-1px) rotate(45deg) scale(1);
}

.check input:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 3px;
}

.check span {
  min-width: 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
}
