/* Home community showcase — the Discover gallery previewed under the bookshelf (Kim, 2026-08-17).
 *
 * Its own file rather than another 200 lines on components.css (25k lines and edited by concurrent
 * sessions); comic-home.css and kids-mv.css are the existing precedent for a home-page band owning
 * its stylesheet.
 *
 * NO frame and NO pager arrow (Kim, 2026-08-17). The dashed edge was meant to read as "a notice
 * from elsewhere", but on a page that is otherwise plain paper it read as a box drawn around the
 * cards; the band now sits on the same ground as everything else and is separated by space alone.
 * Colour still comes from the artwork — the only hues declared here are the four product-line
 * accents, matched to discover.css so a picture book is the same green on both pages. */

/* With the frame gone the inline margin and padding go with it: they existed only to cancel each
   other out so the cards lined up with the Recent grid below. At zero and zero they still do, and
   the band is now separated from its neighbours by space rather than by an edge. */
.rk-comm-section {
  position: relative;
  margin-block-start: 34px;
}

.rk-comm-section[hidden] {
  display: none;
}

/* Matched to discover.css so a work keeps its colour across both pages. */
.rk-comm-card.is-picture-book { --comm-kind: #2f8f6b; }
/* A pop-up book is a picture book in a different FORM, so it keeps the picture-book hue rather than
   claiming a fifth product line. What sets it apart is the platform's own accent on the card edge —
   one line of difference, which is as loud as quiet-paper gets. */
.rk-comm-card.is-popup {
  border-color: color-mix(in srgb, var(--rk-emerald) 38%, var(--rk-line));
}

.rk-comm-card.is-popup:hover,
.rk-comm-card.is-popup:focus-visible {
  border-color: var(--rk-emerald);
}
.rk-comm-card.is-animation { --comm-kind: #3f74a8; }
.rk-comm-card.is-comic { --comm-kind: #c1663a; }
.rk-comm-card.is-image { --comm-kind: #7a6bb0; }

/* ── heading row ─────────────────────────────────────────────────────────── */

/* Size, weight, family and colour all come from `.section-title` / `.section-note` — the shared
   classes the bookshelf, Recent and the comic band already use. NOTHING here may restate a type
   size: a heading that sets its own is exactly how this band ended up looking like a different
   product. Only the sparkle's alignment is local. */
.rk-comm-head .section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rk-comm-spark {
  display: inline-flex;
  color: var(--rk-emerald);
}

/* Tied to the heading's own size so it tracks `.section-title` instead of pinning a pixel value. */
.rk-comm-spark svg {
  width: 0.72em;
  height: 0.72em;
  stroke-width: 1.7;
}

.rk-comm-sub {
  margin-block-start: 4px;
}

/* ── the strip ───────────────────────────────────────────────────────────── */

/* 18px gap = the Recent grid's gap. The two bands sit one above the other, so any difference in
   rhythm reads as a mistake rather than a distinction. */
.rk-comm-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding-block-end: 2px;
}

.rk-comm-row::-webkit-scrollbar {
  display: none;
}

/* THIS CARD IS THE RECENT CARD (`.continue-card`), with one column swapped.
   Same 116px cover, same 144px height, same three-column grid, same radius / border / paper fill —
   three per screen, exactly like the Recent grid, with the rest scrolling. Recent's third column
   holds a ⋯ menu; this one holds the like count. Deliberately NOT `composes`/`@extend` of the real
   class: `.continue-card` lives in components.css and carries click, hover and menu behaviour this
   band does not have, so borrowing the selector would inherit a contract instead of a geometry. */
.rk-comm-card {
  flex: 0 0 calc((100% - 36px) / 3);
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  block-size: 144px;
  padding: 10px;
  border: 1px solid var(--rk-line);
  border-radius: var(--rk-radius);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--rk-shadow-card);
  overflow: hidden;
  cursor: pointer;
  text-align: start;
  transition: border-color 160ms ease, transform 160ms ease;
}

.rk-comm-card:hover,
.rk-comm-card:focus-visible {
  border-color: var(--rk-card-hover-border);
  transform: translateY(-2px);
}

.rk-comm-card:focus-visible {
  outline: 2px solid var(--rk-focus-ring);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .rk-comm-card {
    transition: none;
  }

  .rk-comm-card:hover,
  .rk-comm-card:focus-visible {
    transform: none;
  }
}

/* 116 square, 12px radius — the Recent card's cover, to the pixel. */
.rk-comm-card > img,
.rk-comm-art-blank {
  inline-size: 116px;
  block-size: 116px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.rk-comm-art-blank {
  background: var(--cloth, var(--rk-paper-2));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.rk-comm-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-inline-size: 0;
}

.rk-comm-kind {
  align-self: flex-start;
  padding: 2px 9px;
  border: 1px solid color-mix(in srgb, var(--comm-kind) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--comm-kind) 9%, var(--rk-surface));
  color: var(--comm-kind);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
}

/* Recent's title weight and size, capped at two lines: titles in this feed run long and a card that
   grows to fit one of them would break the fixed row height. */
.rk-comm-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.4;
  color: var(--rk-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rk-comm-by {
  margin: 0;
  font-size: 0.86rem;
  color: var(--rk-ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rk-comm-by.is-author { display: flex; align-items: center; gap: 6px; }
.rk-comm-by.is-author > span:last-child { overflow: hidden; min-width: 0; text-overflow: ellipsis; }
.rk-comm-author-avatar { display: grid; width: 22px; height: 22px; flex: 0 0 22px; overflow: hidden; place-items: center; border: 1px solid var(--rk-line); border-radius: 50%; background: var(--rk-emerald-soft); color: var(--rk-emerald); font-size: 9px; font-weight: 850; }
.rk-comm-author-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* The Recent card's ⋯ slot, holding a number instead. Aligned to the same edge so the two bands'
   right-hand rails line up. */
.rk-comm-likes {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: center;
  padding-inline-end: 4px;
  color: var(--rk-ink-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.rk-comm-likes svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}

/* ── narrow ──────────────────────────────────────────────────────────────────
   Both breakpoints are the Recent grid's, not ones chosen here. Recent goes three-up → one-up at
   1020 and shrinks its cover at 680; a band that reflowed on its own schedule would spend the whole
   range between the two breakpoints looking like a different component. */

@media (max-width: 1020px) {
  .rk-comm-card {
    flex: 0 0 100%;
  }
}

@media (max-width: 680px) {
  .rk-comm-section {
    margin-block-start: 24px;
  }

  /* `.rk-section-header` stacks itself at this width; the only thing to undo is the centred
     alignment set above, which would otherwise win on cascade order and centre the stacked column. */
  /* The Recent card's own narrow rule, to the pixel. */
  .rk-comm-card {
    grid-template-columns: 88px minmax(0, 1fr) auto;
    block-size: 120px;
  }

  .rk-comm-card > img,
  .rk-comm-art-blank {
    inline-size: 88px;
    block-size: 88px;
  }
}
