/* Likes ("Полка"): the heart on posts, the shelf link in the header, hearts on cards. */

/* The button under the title of a post. */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  color: var(--fg);
  font: 600 11px/1.2 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.like-btn svg { flex-shrink: 0; transition: fill 0.2s, color 0.2s; }
.like-btn:hover { border-color: var(--fg); }
.like-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.like-btn[aria-pressed="true"] svg { fill: currentColor; }

/* The same button once more after the text, in the article column. */
.post-end {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  max-width: 680px;
  margin: 48px auto 0;
  padding: 20px var(--gutter) 0;
  box-sizing: content-box;
  border-top: 1px solid var(--line);
}
.post-end p { margin: 0; color: var(--muted); font-size: 15px; }

/* The heart on cards of liked posts: top-right corner of the picture. The pill above makes room for it:
   it moves a little to the left of the centre, keeping clear of the heart. */
.card-like {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  pointer-events: none;
}
.card.is-liked .card-media .pill { left: calc(50% - 17px); max-width: calc(100% - 50px); }

/* The header link: a counter on the heart while the shelf is not empty. */
[data-shelf-link] { position: relative; }
[data-shelf-link][aria-current] { color: var(--accent); }
[data-shelf-link][aria-current] svg { fill: currentColor; }
.shelf-count {
  position: absolute;
  top: -1px;
  right: -5px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font: 700 9px/15px var(--sans);
  letter-spacing: 0;
  text-align: center;
}

@media (max-width: 640px) {
  .card-like { top: 8px; right: 6px; width: 20px; height: 20px; }
  .card-like svg { width: 11px; height: 11px; }
  .card.is-liked .card-media .pill { left: calc(50% - 12px); max-width: calc(100% - 34px); }
}

@media (prefers-reduced-motion: reduce) {
  .like-btn, .like-btn svg { transition: none; }
}
