/* The story list (views/stories.js): progress, review language, search, filters, story cards. */

.sl .page-head { margin-bottom: 18px; }

/* ---------------------------------------------------------------- progress */

.sl-progress { display: grid; gap: 8px; margin-top: 8px; max-width: 520px; }
.sl-progress-text { font-weight: 800; }
.sl-bar {
  display: block; height: 8px; overflow: hidden;
  border-radius: 4px; background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.sl-bar-fill {
  display: block; width: 0; height: 100%;
  border-radius: 4px; background: var(--sage);
  transition: width 300ms ease-out;
}

/* ---------------------------------------------------------------- controls */

.sl-controls { display: grid; gap: 12px; margin-bottom: 12px; }
.sl-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.sl-lang-wrap { display: grid; gap: 6px; flex: none; max-width: 100%; }
.sl-ctl-label { font-weight: 800; font-size: 14px; line-height: 19px; color: var(--ink-soft); }
.sl-ctl-hint { font-size: 13px; line-height: 18px; color: var(--ink-soft); }
.sl-search { position: relative; flex: 1 1 260px; min-width: 0; max-width: 480px; }
.sl-search > .ic {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-soft); --ic-b: var(--ink-soft); pointer-events: none;
}
.sl-search .sl-search-input { padding-left: 46px; }
.sl-chips { gap: 8px; }
.sl-count { min-height: 22px; margin-bottom: 8px; font-size: 14px; }
@media (max-width: 599px) {
  .sl-lang-wrap { flex: 1 1 100%; }
  .sl-lang { display: flex; width: 100%; }
  .sl-search { flex-basis: 100%; max-width: none; }
  /* Each chip group is one row that scrolls sideways (edge to edge), so the first cards show sooner.
     The block padding keeps the focus ring from being clipped. */
  .sl-chips {
    gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin: -5px calc(-1 * var(--gutter)); padding: 5px var(--gutter);
    scroll-padding-inline: var(--gutter);
  }
  .sl-chips::-webkit-scrollbar { display: none; }
  .sl-chips .chip { flex: none; padding: 0 12px; }
}

/* ---------------------------------------------------------------- grid and cards */

.sl-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 600px) { .sl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .sl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .sl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.sl-item { display: flex; min-width: 0; }
.sl-card {
  display: flex; flex-direction: column; width: 100%; min-width: 0;
  overflow: hidden;
  color: var(--ink); text-decoration: none;
  transition: box-shadow 150ms ease-out, transform 150ms ease-out;
}
.sl-card:hover { color: var(--ink); box-shadow: var(--shadow-pop); }
.sl-card:active { transform: translateY(1px); }
.sl-card:focus-visible { outline-offset: 3px; }

.sl-cover { aspect-ratio: 4 / 3; overflow: hidden; background: var(--sunken); }
.sl-cover img { width: 100%; height: 100%; object-fit: cover; }
.sl-cover-none { display: grid; place-items: center; }
/* Calm placeholders for stories without a cover (stable tint per story). */
.tint-mustard { background: var(--warn-bg); color: #C99A33; --ic-b: var(--paper); }
.tint-sage { background: var(--ok-bg); color: var(--sage); --ic-b: var(--paper); }
.tint-blue { background: var(--info-bg); color: var(--dusty-blue); --ic-b: var(--paper); }
.tint-blush { background: var(--primary-bg); color: var(--blush); --ic-b: var(--paper); }
/* The story's own accent colour (StoryCard.accent, set as --accent), softened onto paper. */
@supports (background: color-mix(in srgb, red 50%, white)) {
  .sl-cover-none.has-accent {
    background: color-mix(in srgb, var(--accent) 22%, var(--paper));
    color: color-mix(in srgb, var(--accent) 85%, var(--ink));
  }
}

.sl-body { display: grid; align-content: start; gap: 6px; padding: 14px 16px 16px; min-width: 0; }
.sl-title { font-size: 19px; line-height: 24px; }
.sl-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0;
  color: var(--ink-soft); font-size: 14px; line-height: 20px;
}
.sl-meta > span { display: inline-flex; align-items: center; }
.sl-meta > span + span::before { content: '·'; margin: 0 8px; color: var(--hairline-strong); }
.sl-moon { color: var(--ink-soft); }
.sl-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.sl-sent { display: inline-flex; align-items: center; gap: 6px; }

/* Phones: one column of side-by-side cards (cover left), so more stories fit on a screen. */
@media (max-width: 599px) {
  .sl-grid { gap: 12px; }
  .sl-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: stretch; }
  .sl-cover { aspect-ratio: auto; min-height: 100%; }
  .sl-cover-none .ic { width: 32px; height: 32px; }
  .sl-body { padding: 12px 12px 12px 14px; gap: 4px; }
  .sl-title { font-size: 17px; line-height: 22px; }
  .sl-meta { font-size: 13px; line-height: 18px; }
}
@media (max-width: 359px) {
  .sl-card { grid-template-columns: 88px minmax(0, 1fr); }
}
