/* ---------------------------------------------------------------------------
   Story shelf — COMPLETE stylesheet.

   This is the whole block. Replace the current shelf CSS with this in full.
   --------------------------------------------------------------------------- */

.story-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
}

.story-shelf__count {
  color: #c8d6f5;
}

.story-shelf__empty {
  color: #c8d6f5;
}

/* A card is a column so its links can be pushed to the bottom — without this,
   a card with a description and a card without put their Download buttons at
   different heights in the same row. */
.story-card {
  display: flex;
  flex-direction: column;
}

.story-cover { position: relative; margin: 0; line-height: 0; }

.story-cover img { display: block; width: 100%; height: auto; border-radius: 6px; }

.story-cover img.story-cover__badge {
  position: absolute;
  right: 4%;
  bottom: 4%;
  width: 22%;
  height: auto;
  border-radius: 0;
  pointer-events: none;
}

.story-card__title {
  color: #ffffff;
  font-size: 1rem;
  margin: 0.75rem 0 0.25rem;

  /* The theme capitalises every word in a heading, which turned
     "Biscuit and Lily Win the Race" into "Biscuit And Lily Win The Race" —
     a story title rendered the way nobody writes a story title, and not what
     the app shows for the same story. The titles are already cased correctly
     in WordPress; this stops the stylesheet second-guessing them. */
  text-transform: none;
}

/* The description, from the story's Description field.
   Colour is the same #c8d6f5 the shelf count uses — dimmer than the white
   title, brighter than the muted .story-card__nodeck, which is the right
   place for it: nodeck is an apology, this is what an SLP reads to decide.
   Clamped to three lines because the tiles are minmax(200px, 1fr) and one
   long description would otherwise tower over its row. No top margin — the
   title already carries 0.25rem beneath it. */
.story-card__summary {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #c8d6f5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* margin-top: auto bottom-aligns the links across a row whichever cards have a
   description and whichever do not. The 0.6rem gap lives in padding rather
   than margin because `auto` collapses to zero on the tallest card in a row —
   precisely the card whose description most needs the breathing room. */
.story-card__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.6rem;
}

.story-card__preview,
.story-card__preview:visited {
  color: #9fc0ff;
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.story-card__preview:hover { color: #ffffff; }

.story-card__download,
.story-card__download:visited {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  background: #f5a623;
  color: #16255c;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;

  /* At five-across, "Download the slides 12 MB" breaks and drops MB onto a
     second line, making that one button taller than every other button in the
     row. The label is short and fixed; it should never wrap. */
  white-space: nowrap;
}

.story-card__download:hover {
  background: #ffb93d;
  color: #16255c;
}

.story-card__filesize {
  font-weight: 500;
  font-size: 0.85em;
  opacity: 0.75;
}

.story-card__nodeck {
  color: #9fb3d9;
  font-size: 0.85rem;
  font-style: italic;
  margin: 0;
}