.photo-memories {
  margin-bottom: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.photo-memories-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.photo-memories-head h2 {
  margin-bottom: 5px;
  font-size: 24px;
}

.photo-memories-head p:last-child,
.photo-memories-head > span {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.photo-memory-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.photo-memory-tile {
  position: relative;
  min-height: 125px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  background: var(--bg);
}

.photo-memory-tile img {
  width: 100%;
  height: 100%;
  min-height: 125px;
  object-fit: cover;
  transition: transform .2s ease;
}

.photo-memory-tile:hover img,
.photo-memory-tile:focus-visible img {
  transform: scale(1.04);
}

.photo-memory-tile span {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  overflow: hidden;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(20, 20, 32, .72);
  color: white;
  font-size: 9px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-photo-count {
  position: absolute;
  right: 11px;
  bottom: 11px;
  padding: 5px 8px;
  border-radius: 99px;
  background: rgba(20, 20, 32, .75);
  color: white;
  font-size: 9px;
}

.memory-photo-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  color: var(--muted);
  font-size: 10px;
}

.memory-open-hint {
  display: block;
  margin-top: 11px;
  color: var(--teal-4);
  font-size: 10px;
  font-weight: 700;
}

.map-photo-section {
  margin: 18px 0;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.map-photo-section h3 {
  margin-bottom: 5px;
  font-size: 16px;
}

.map-photo-section > p {
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 10px;
}

.map-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.map-photo {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: var(--bg);
}

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

.map-photo span {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  overflow: hidden;
  padding: 4px 5px;
  border-radius: 6px;
  background: rgba(20, 20, 32, .72);
  color: white;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-photo-empty {
  padding: 13px;
  border-radius: 11px;
  background: var(--bg);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.detail-photo {
  display: grid;
  place-items: end start;
}

.detail-photo-index {
  margin: 0 0 14px 14px;
  padding: 5px 8px;
  border-radius: 99px;
  background: rgba(20, 20, 32, .72);
  color: white;
  font-size: 9px;
}

.detail-photo-empty {
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.detail-photo-thumbs {
  display: flex;
  gap: 7px;
  padding: 10px 14px;
  overflow-x: auto;
  background: var(--bg);
}

.detail-photo-thumbs button {
  flex: 0 0 58px;
  width: 58px;
  height: 46px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--paper);
}

.detail-photo-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 900px) {
  .photo-memory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .photo-memories {
    padding: 17px;
  }

  .photo-memories-head {
    display: block;
  }

  .photo-memories-head > span {
    display: block;
    margin-top: 8px;
  }

  .photo-memory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .photo-memory-tile,
  .photo-memory-tile img {
    min-height: 105px;
  }

  .map-photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
