/* The feature cards on the item page (Dali, 11-12): what an item has, in pictures, at the top of
   its About section. Builds on lab.css and content.css: their tokens, type and spacing. Nothing
   here is smaller than 12px. Everything is prefixed `ab-`.
   features.js writes the markup, features-data.js holds the cards.
   The cards were first a layout test with a bar to switch between four layouts. Dali chose the
   fourth ("we're going with D, remove the other ones"), so the bar is gone, and so are its
   styles: the Pets & Creatures pages, which borrowed them last, are gone too. */

/* ---------- The block: the first thing in About ---------- */
/* Dali (11-12): the cards "above the video/ about text (but still part of the about section)".
   The block stands where About starts, 72px under the facts (56px under 900px). Its first line
   is the About heading itself, which features.js moves up out of the row; then the cards, as
   wide as the page and with no heading of their own. The row (text | video) follows 44px under
   them (32px under 900px), closer than a section would be, so the cards read as part of
   About. */
.ab-over { margin-top: 72px; }
.ab-over + .ct-irow--about { margin-top: 44px; }
/* The heading's line is the screenshots row's (.ct-shotsec__head, content.css): the heading on
   the left with 20px under it, and the carousel's arrows, when there are any, on the right. */
.ab-over__head { align-items: flex-end; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 20px; }
.ab-over__head h2.nb-heading { margin: 0; min-width: 0; }
/* On a page in another language: the line that says the cards are in English. */
.ab-feats__note { color: var(--muted); font-size: 13.5px; margin: -10px 0 18px; }

/* ---------- The cards ---------- */
/* The card's shape comes from the pets mock-up (removed 2026-11-13): a 16 to 9 picture, a white
   title, one short text. Four to a row. */
.ab-cards { display: grid; gap: 28px var(--col-gap); grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.ab-card { min-width: 0; }
/* The picture is a button: it opens that screenshot in the page's lightbox. */
.ab-card__pic { aspect-ratio: 16 / 9; background: #111319; border: 0; border-radius: var(--radius-m); cursor: zoom-in; display: block; overflow: hidden; padding: 0; width: 100%; }
.ab-card__pic img { height: 100%; object-fit: cover; transition: transform .3s; width: 100%; }
.ab-card__pic:hover img { transform: scale(1.03); }
.ab-card__pic:focus-visible { outline: 2px solid var(--flare); outline-offset: 2px; }
.ab-card h3 { color: #fff; font-size: 17px; font-weight: 800; line-height: 1.3; margin: 12px 0 0; }
/* Written to fit two lines on a desktop. Where a narrower card needs more it stops at three;
   the whole text stays in the page for a screen reader. */
.ab-card p { color: var(--wall); display: -webkit-box; font-size: 14.5px; -webkit-line-clamp: 3; line-clamp: 3; line-height: 1.55; margin: 4px 0 0; overflow: hidden; -webkit-box-orient: vertical; }

/* ---------- More than four cards: one row that drifts and loops ---------- */
/* Dali (11-12): "if it's more than 4 cards, make it a carousel". It is the site's own drifting
   row (CT.driftRow in core.js), built like the item page's screenshots row and its "More for"
   row: their round arrows (.ct-shotsec__nav, 34px on a phone) and their fade at the edges
   (48px, 20px on a phone).
   A card is as wide as in the plain row at the same screen width, and the gap is the same: four
   fill the row on a desktop, two on a tablet, and on a phone one with the next showing. The
   widths come from the scroller's own width (container units), since the track inside is as
   wide as its three copies. The scroller is 5px bigger all round for the focus outline of a
   card's picture (4px). */
.ab-row__view { --fade: 48px; container-type: inline-size; margin: -5px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; padding: 5px; scrollbar-width: none; }
.ab-row__view::-webkit-scrollbar { display: none; }
.is-loop .ab-row__view {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent); mask-image: linear-gradient(90deg, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
}
.ab-row__track { display: flex; width: max-content; }
.ab-row__set { display: flex; gap: var(--col-gap); list-style: none; margin: 0; padding: 0; }
.is-loop .ab-row__set { padding-right: var(--col-gap); }
.ab-row__set > .ab-card { flex: none; width: calc((100cqw - 3 * var(--col-gap)) / 4); }

@media (max-width: 1100px) {
  /* A tablet: two to a row. */
  .ab-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ab-row__set > .ab-card { width: calc((100cqw - var(--col-gap)) / 2); }
}
@media (max-width: 900px) {
  .ab-over { margin-top: 56px; }
  .ab-over + .ct-irow--about { margin-top: 32px; }
}
@media (max-width: 640px) {
  /* A phone: one row that scrolls sideways, a card at a time, with the next one showing at the
     edge. The row runs to the edges of the screen; the page itself never scrolls sideways. */
  .ab-cards { display: flex; gap: 12px; margin-inline: calc(-1 * clamp(16px, 2.5vw, 36px)); overflow-x: auto; overscroll-behavior-x: contain; padding-inline: clamp(16px, 2.5vw, 36px); scroll-padding-inline: clamp(16px, 2.5vw, 36px); scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ab-cards::-webkit-scrollbar { display: none; }
  .ab-card { flex: 0 0 78%; scroll-snap-align: start; }
  .ab-card h3 { font-size: 16px; }
  .ab-card p { font-size: 14px; }
  /* The carousel on a phone: the same card and gap as the swipe row above, inside the page's
     margins like the screenshots row, with that row's 20px fade. */
  .ab-row__view { --fade: 20px; }
  .ab-row__set { gap: 12px; }
  .is-loop .ab-row__set { padding-right: 12px; }
  .ab-row__set > .ab-card { flex: none; scroll-snap-align: none; width: 78cqw; }
}
@media (prefers-reduced-motion: reduce) {
  .ab-card__pic img { transition: none; }
  .ab-card__pic:hover img { transform: none; }
}
