/* The likes dialog from likes.ftl and the list htmx loads into it from likes-list.ftl. Colors meet
   WCAG AA contrast. Rules are scoped to the dialog because editions render it inside a widget whose
   styles reach bare elements such as p and h2. */
.likes-dialog {
  width: min(440px, calc(100vw - 32px));
  max-width: none;
  max-height: min(620px, calc(100vh - 64px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  background-color: #ffffff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24), 0 2px 8px rgba(15, 23, 42, 0.08);
  color: #3b4f68;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
}
/* Only while open: a closed dialog has to keep the browser's display: none */
.likes-dialog[open] {
  display: flex;
  animation: likes-dialog-in 0.18s ease-out;
}
.likes-dialog::backdrop {
  background-color: rgba(15, 23, 42, 0.5);
}
html:has(.likes-dialog[open]) {
  overflow: hidden;
}
/* Fills the dialog, so a click that lands on the dialog element itself was on the backdrop */
.likes-dialog .likes-dialog-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.likes-dialog .likes-dialog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px 20px;
  border-bottom: 1px solid #eceef1;
}
.likes-dialog .likes-dialog-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0360b8, #2a8cf0);
  color: #ffffff;
}
.likes-dialog .likes-dialog-title {
  flex: 1;
  margin: 0;
  color: #1b2b44;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}
.likes-dialog .likes-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: transparent;
  color: #5b6168;
  cursor: pointer;
}
.likes-dialog .likes-dialog-close:hover {
  background-color: #f0f1f3;
  color: #1b2b44;
}
.likes-dialog .likes-dialog-body {
  flex: 1;
  min-height: 0;
  padding: 4px 20px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.likes-dialog p {
  margin: 0;
}
.likes-dialog .likes-summary {
  margin: 14px 0 6px;
  color: #5b6168;
  font-size: 14px;
}
.likes-dialog .likes-people {
  margin: 0;
  padding: 0;
  list-style: none;
}
.likes-dialog .likes-person {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -8px;
  padding: 10px 8px;
  border-radius: 10px;
}
.likes-dialog .likes-person:hover {
  background-color: #f5f7fa;
}
.likes-dialog .likes-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #e8edf3;
  object-fit: cover;
}
.likes-dialog .likes-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #e1effe;
  color: #0360b8;
  font-size: 15px;
  font-weight: 700;
}
.likes-dialog .likes-person-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.likes-dialog .likes-person-name {
  color: #1b2b44;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
/* Stretches the name's link over the whole row, so the row is one large target */
.likes-dialog .likes-person-name::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
}
.likes-dialog .likes-person-name:hover {
  text-decoration: underline;
}
.likes-dialog .likes-person-job {
  color: #5b6168;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.likes-dialog .likes-more {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}
.likes-dialog .likes-more-btn {
  padding: 8px 20px;
  border: 1px solid #c9d3df;
  border-radius: 999px;
  background-color: #ffffff;
  color: #0360b8;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.likes-dialog .likes-more-btn:hover {
  background-color: #f0f7ff;
}
/* htmx marks the button while its page loads */
.likes-dialog .likes-more-btn.htmx-request,
.likes-dialog .likes-more-btn[disabled] {
  opacity: 0.7;
  cursor: progress;
}
.likes-dialog .likes-more-error {
  margin-top: 8px;
  color: #a61b1b;
  font-size: 13.5px;
  text-align: center;
}
.likes-dialog .likes-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 28px 8px 8px;
  text-align: center;
}
.likes-dialog .likes-message-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 8px;
  border-radius: 50%;
  background-color: #e1effe;
  color: #0175e4;
}
.likes-dialog .likes-message-title {
  color: #1b2b44;
  font-size: 16px;
  font-weight: 700;
}
.likes-dialog .likes-message-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 12px;
}
.likes-dialog .likes-message a:not(.likes-button) {
  color: #0360b8;
  font-weight: 600;
  text-decoration: underline;
}
.likes-dialog .likes-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 8px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background-color: #0360b8;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.likes-dialog .likes-message-actions .likes-button {
  margin-top: 0;
}
.likes-dialog .likes-button:hover {
  background-color: #024a8f;
  color: #ffffff;
  text-decoration: none;
}
.likes-dialog button:focus-visible,
.likes-dialog a:focus-visible {
  outline: 2px solid #0175e4;
  outline-offset: 2px;
}
.likes-dialog .likes-skeleton {
  padding-top: 10px;
}
.likes-dialog .likes-skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.likes-dialog .likes-skeleton-avatar,
.likes-dialog .likes-skeleton-lines span {
  background: linear-gradient(90deg, #eef1f5 25%, #f7f9fb 50%, #eef1f5 75%);
  background-size: 200% 100%;
  animation: likes-shimmer 1.2s ease-in-out infinite;
}
.likes-dialog .likes-skeleton-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.likes-dialog .likes-skeleton-lines {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
}
.likes-dialog .likes-skeleton-lines span {
  height: 12px;
  border-radius: 6px;
}
.likes-dialog .likes-skeleton-lines span:first-child {
  width: 55%;
}
.likes-dialog .likes-skeleton-lines span:last-child {
  width: 35%;
}
@keyframes likes-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes likes-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}
/* Phones: a sheet along the bottom of the screen */
@media (max-width: 480px) {
  .likes-dialog {
    width: 100%;
    max-height: 85vh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .likes-dialog[open],
  .likes-dialog .likes-skeleton-avatar,
  .likes-dialog .likes-skeleton-lines span {
    animation: none;
  }
}
