/* What the two browsing pages share — the catalogue and Mes peintures: the
   search row above, the grid of colours below.

   The tile is the paint itself: its face is the colour, its name sits under
   it, and nothing is asked of the network. Each page keeps what only it shows
   — the range pill and the collection marks on the catalogue, the brand ·
   range line of the hue reading on Mes peintures. */

/* ---------- search row ---------- */
.bar{display:flex;gap:12px;align-items:center;padding:10px 20px 12px;flex-wrap:wrap}
.bar .count{font-size:13px;color:var(--ink-2);font-variant-numeric:tabular-nums;margin-left:auto;white-space:nowrap}
.search{position:relative;flex:1 1 260px;max-width:420px}
.search input::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}
.search input{
  width:100%;min-height:var(--ctl-h);padding:0 34px;border:1px solid var(--line);
  background:var(--panel);border-radius:var(--radius-s);outline:none;
}
.search > svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);width:15px;height:15px;color:var(--ink-3)}
.search .clr{position:absolute;right:6px;top:50%;transform:translateY(-50%);border:0;background:none;cursor:pointer;color:var(--ink-3);padding:4px;line-height:0;border-radius:var(--radius-s)}
.search .clr:hover{background:var(--panel-2);color:var(--ink)}
@media (hover:none){ .search .clr{width:44px;height:44px;display:grid;place-items:center;padding:0} }
/* ---------- the tile ---------- */
.grid{
  display:grid;gap:14px;
  grid-template-columns:repeat(auto-fill,minmax(158px,1fr));
}
.card{
  border:1px solid var(--line);background:var(--panel);border-radius:var(--radius);
  cursor:pointer;text-align:left;padding:0;position:relative;
  display:flex;flex-direction:column;transition:transform .13s,box-shadow .13s,border-color .13s;
  /* offscreen cards are neither laid out nor painted — CSS-only virtualisation */
  content-visibility:auto;contain-intrinsic-size:auto 210px;
}
.card:hover{transform:translateY(-2px);box-shadow:var(--shadow);border-color:var(--ink-3);z-index:5}
.card:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media (hover:none){ .card:active{transform:scale(.98)} }
/* the card's face is the paint's colour, gradient included; a medium or a
   varnish, having none, is hatched as it is on paper */
.sw{aspect-ratio:4/3;position:relative;background:var(--panel-2);
    border-radius:calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0}
.sw.nocol{background:var(--hatch)}
.meta{padding:9px 10px 11px;display:flex;flex-direction:column;gap:3px;flex:1}
.meta .nm{font-size:13.5px;font-weight:560;line-height:1.3;letter-spacing:-.005em}

/* phone: the search takes its own line, the grid tightens to smaller cards */
@media (max-width:600px){
  .bar{gap:8px;padding:8px 14px 10px}
  .search{flex:1 1 100%;max-width:none}
  .grid{grid-template-columns:repeat(auto-fill,minmax(106px,1fr));gap:10px}
  .card{contain-intrinsic-size:auto 155px}
  .meta{padding:7px 8px 8px;gap:2px}
  .meta .nm{font-size:12.5px;line-height:1.25}
}

/* ---------- the long press (lib/longpress.js) ---------- */
/* At the finger a tile has no buttons: a press held on it shelves the paint.
   The bar fills along the bottom edge while the press arms — one may still
   lift and nothing happens — and the browser's own gestures step aside so
   the selection bubble never opens under the thumb. */
@media (hover:none){
  .card{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
}
.card.pressing{transform:scale(.98)}
/* the bar fills along the TOP edge: the thumb is on the tile, and what it
   covers teaches nothing */
.card.pressing::after{
  content:'';position:absolute;left:0;top:0;height:4px;width:0;z-index:3;
  border-radius:0 99px 99px 0;background:var(--ok);
  animation:obhold var(--hold, 700ms) linear forwards;
}
@keyframes obhold{ from{width:0} to{width:100%} }
@media (prefers-reduced-motion:reduce){ .card.pressing{transform:none} }

/* the one-off line that teaches the gesture, under the search row */
.lphint{
  margin:0 20px 10px;padding:8px 12px;border-radius:var(--radius-s);
  background:var(--panel-2);color:var(--ink-2);font-size:12.5px;
}
@media (max-width:600px){ .lphint{margin:0 14px 8px} }
