/* Photos are shared by the trip view and the personal gallery. */
.gallery-trip {
  margin-top: 22px;
}
.gallery-section-head, .gallery-card-actions, .gallery-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gallery-section-head {
  margin-bottom: 16px;
}
.gallery-section-head h2, .gallery-status:empty {
  margin: 0;
}
.gallery-status:empty {
  display: none;
}
.gallery-heading {
  margin-bottom: 24px;
}
.gallery-heading p, .gallery-empty p, .gallery-empty-trip, .gallery-status, .gallery-photo-state {
  color: var(--muted);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}
.gallery-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 5px 14px #173e350a;
}
.gallery-image {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--sage);
}
.gallery-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .24s ease;
}
.gallery-image:hover img {
  transform: scale(1.035);
}
.gallery-image-empty {
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  color: var(--muted);
}
.gallery-card-copy {
  padding: 12px 14px 8px;
}
.gallery-caption {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.gallery-trip-link {
  display: inline-block;
  color: var(--forest);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.gallery-card-actions {
  margin-top: 4px;
  gap: 3px;
}
.gallery-card-actions button {
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 500;
}
.gallery-delete, .gallery-error {
  color: var(--red);
}
.gallery-photo-state {
  font-size: 13px;
  margin: 8px 0 0;
}
.gallery-empty {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 30px;
  text-align: center;
  background: var(--paper);
}
.gallery-empty-trip {
  padding: 18px;
  margin: 0;
}
.gallery-more {
  margin-top: 18px;
}
.gallery-dialog {
  max-width: min(620px, calc(100% - 24px));
}
.gallery-dialog textarea {
  width: 100%;
  resize: vertical;
  margin: 6px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper);
}
.gallery-dialog-actions {
  justify-content: flex-end;
  margin-top: 10px;
}
.gallery-full {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  margin: 0 auto 14px;
  border-radius: 12px;
}
@media (max-width: 560px) {
  .gallery-section-head button, .gallery-more {
    font-size: 13px;
  }
  .gallery-empty {
    padding: 20px 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-image img {
    transition: none;
  }
}
