/* From partials/action_buttons_style.dj.html, where it was inline on every page that includes it (2026-11-04). */
  /* ---- The like / dislike / follow component ---------------------
     The same one the work page draws beside its poster, shared by the pages
     that are not the work page: a person, a user's profile and their lists.
     Its rules live in works-page.css, which only the work page loads, so the
     component is restated here rather than pulling a page's whole stylesheet
     in - that file also styles #reviews, .persons-items and .person-thumb,
     which those pages have and would be re-dressed with it.
     ------------------------------------------------------------- */
  .person-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
  }

  .person-actions .btn.work-action {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    grid-auto-flow: column;
    place-items: center;
    width: 40px;
    height: 40px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    line-height: 1;
    background: rgba(128, 128, 128, .14);
    color: inherit;
    transition: background .18s ease, color .18s ease, width .2s ease;
  }

  .person-actions .btn.work-action svg {
    width: 20px;
    height: 20px;
  }

  /* What the rate and follow handlers set when the reader has voted. */
  .person-actions .btn.work-action-like.filled {
    color: var(--primary-color, #96F207);
    background: rgba(150, 242, 7, .16);
  }

  /* Followed: the work page's follow colour (works-page.css), not the like's. */
  .person-actions .btn.work-action-follow.filled,
  .person-actions .btn.work-action-follow[aria-pressed="true"] {
    color: var(--warning-color);
    background: var(--warning-lighten-color);
  }

  .person-actions .btn.work-action-dislike.filled {
    color: #ff6b6b;
    background: rgba(255, 107, 107, .16);
  }

  .person-actions .count {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
  }

  /* The name, as a tooltip under the button. */
  .person-actions .btn.work-action:after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: .25rem .5rem;
    border-radius: .4rem;
    background: rgba(0, 0, 0, .88);
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease;
    pointer-events: none;
    z-index: 3;
  }

  @media (hover: hover) {
    .person-actions .btn.work-action:hover {
      background: rgba(128, 128, 128, .22);
    }

    .person-actions .btn.work-action-follow:hover {
      color: var(--warning-color);
      background: var(--warning-lighten-color);
    }

    .person-actions .btn.work-action:hover:after {
      opacity: 1;
      visibility: visible;
    }

    /* The count opens out of the button, and the tooltip stands down
       while it does - the two would be saying different things in the
       same place. */
    .person-actions .btn.work-action-like .count,
    .person-actions .btn.work-action-dislike .count {
      position: static;
      width: 0;
      height: auto;
      margin: 0;
      clip: auto;
      overflow: hidden;
      opacity: 0;
      transition: width .2s ease, opacity .15s ease, margin .2s ease;
    }

    /* Only the one under the pointer opens. */
    .person-actions .btn.work-action-like:hover,
    .person-actions .btn.work-action-dislike:hover {
      width: 80px;
    }

    .person-actions .btn.work-action-like:hover .count,
    .person-actions .btn.work-action-dislike:hover .count {
      width: 2.4em;
      margin-inline-start: .35rem;
      opacity: 1;
    }

    .person-actions .btn.work-action-like:hover:after,
    .person-actions .btn.work-action-dislike:hover:after {
      opacity: 0;
      visibility: hidden;
    }
  }

  /* No pointer: the counts are simply there, and a tap holds the name,
     which is the only moment a phone has to show it. */
  @media (hover: none) {
    .person-actions .btn.work-action-like,
    .person-actions .btn.work-action-dislike {
      gap: .35rem;
      width: auto;
      min-width: 40px;
      padding-inline: .7rem;
    }

    .person-actions .btn.work-action-like .count,
    .person-actions .btn.work-action-dislike .count {
      position: static;
      width: auto;
      height: auto;
      margin: 0;
      overflow: visible;
      clip: auto;
    }

    .person-actions .btn.work-action:focus:after {
      opacity: 1;
      visibility: visible;
    }
  }
