.ref-layout .note-column .public-note.note-ref .note-photo,
.ref-layout .note-modal-body .public-note.note-ref .note-photo {
  display: block;
  height: auto;
  aspect-ratio: auto;
  padding: clamp(4px, 5%, 9px) clamp(4px, 5%, 9px) 3px;
}

.ref-layout .public-note.note-ref .note-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 7 / 8;
  object-fit: cover;
}

.ref-layout .public-note.note-ref .note-photo figcaption {
  position: static;
  margin-top: 6px;
  min-height: 1.2em;
  line-height: 1.2;
}

.ref-layout .note-modal-body .public-note.note-ref .note-photo img {
  aspect-ratio: auto;
  object-fit: contain;
}

.ref-layout .public-note.note-ref {
  --note-mark-size: clamp(8px, 2.3vw, 10px);
}

.ref-layout .public-note.note-ref:has(> .ayj-wm-tag) .note-ref-footer {
  padding-right: calc(8.5 * var(--note-mark-size));
}

/* The watermark script appends the mark after the card markup. */
.ref-layout .public-note.note-ref > .ayj-wm-tag {
  position: absolute;
  right: 6%;
  bottom: var(--note-footer-bottom);
  z-index: 5;
  height: var(--note-footer-height);
  display: flex !important;
  align-items: center;
  margin-top: 0 !important;
  font-size: var(--note-mark-size) !important;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .ref-layout .public-note.note-ref {
    --note-mark-row: 25px;
  }

  .ref-layout .note-column .public-note.note-ref {
    height: calc(clamp(215px, 64vw, 250px) + var(--note-mark-row) + 12px);
  }

  .ref-layout .note-modal-body .public-note.note-ref {
    min-height: 320px;
  }

  .ref-layout .note-column .public-note.note-ref .note-figure {
    position: absolute;
    grid-area: auto;
    left: 4.5%;
    top: 15%;
    width: 30%;
    height: auto;
  }

  .ref-layout .public-note.note-ref:has(> .ayj-wm-tag) {
    --note-footer-bottom: max(8px, 4%);
    --note-footer-height: 22px;
    --note-foot-offset: calc(var(--note-footer-bottom) + var(--note-mark-row) + var(--note-footer-height));
  }

  .ref-layout .public-note.note-ref:has(> .ayj-wm-tag) .note-ref-footer {
    grid-area: auto;
    bottom: calc(var(--note-footer-bottom) + var(--note-mark-row));
    padding-inline: 0;
  }

  .ref-layout .public-note.note-ref:has(> .ayj-wm-tag) .note-ref-date-abs {
    bottom: var(--note-footer-bottom);
  }
}
