/* Metal pages (/metals/*): the grid of shapes a metal is sold in. Builds on styles.css and tools.css tokens.
   Each card shows one frame of the homepage picker's rendered sprite (img/stock/shapes-<key>.webp, 9 frames,
   160 x 120 each, in the order round, flat, square, hex, plate, sheet, roundTube, squareTube, angle). */
.shape-sec h2 { margin: 0 0 6px; font: 700 clamp(1.5rem, 3vw, 2rem)/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.shape-sec > .fine { margin: 0 0 16px; }
.shape-sec > .fine:last-child { margin: 14px 0 0; }

.shape-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 228px), 1fr)); }
.shape-card { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; background: var(--card); border: 1px solid var(--line); }
.shape-card:hover { border-color: var(--line2); }

.shape-art { margin: 0; border-bottom: 1px solid var(--line); background: radial-gradient(70% 80% at 50% 70%, rgba(255,106,19,.10), transparent 70%), var(--bg); }
.shape-frame { position: relative; overflow: hidden; aspect-ratio: 4 / 3; }
.shape-frame img { display: block; width: 900%; max-width: none; height: 100%; }
.shape-card[data-shape="flat"] .shape-frame img { margin-left: -100%; }
.shape-card[data-shape="square"] .shape-frame img { margin-left: -200%; }
.shape-card[data-shape="hex"] .shape-frame img { margin-left: -300%; }
.shape-card[data-shape="plate"] .shape-frame img { margin-left: -400%; }
.shape-card[data-shape="sheet"] .shape-frame img { margin-left: -500%; }
.shape-card[data-shape="roundTube"] .shape-frame img { margin-left: -600%; }
.shape-card[data-shape="squareTube"] .shape-frame img { margin-left: -700%; }
.shape-card[data-shape="angle"] .shape-frame img { margin-left: -800%; }
.shape-art figcaption { padding: 5px 12px; border-top: 1px solid var(--line); font: 500 .65625rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.shape-body { padding: 14px 16px 4px; min-width: 0; }
.shape-body h3 { margin: 0 0 10px; font: 700 1.375rem/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.shape-grades { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.shape-grades li { padding: 3px 8px; border: 1px solid var(--line2); font: 500 .78125rem/1.3 var(--sans); color: var(--text); }
.shape-facts { margin: 0; display: grid; gap: 0; }
.shape-facts div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.shape-facts dt { font: 600 .6875rem/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.shape-facts dd { margin: 0; font: 500 .84375rem/1.5 var(--mono); font-variant-numeric: tabular-nums; color: var(--text); }

.tool a.shape-quote { margin: 10px 16px 16px; min-height: 44px; display: flex; align-items: center; justify-content: center; }

/* Phones: picture on the left, facts on the right, the link full width below. */
@media (max-width: 560px) {
  .shape-card { grid-template-columns: 104px minmax(0, 1fr); grid-template-rows: auto auto; }
  .shape-art { align-self: start; margin: 12px 0 0 12px; border: 1px solid var(--line); }
  .shape-body { padding: 12px 12px 0; }
  .shape-body h3 { font-size: 1.25rem; }
  .shape-grades { margin-bottom: 8px; }
  .shape-grades li { font-size: .75rem; }
  .shape-facts div { flex-direction: column; padding: 5px 0; }
  .shape-art figcaption { padding: 4px 6px; font-size: .59375rem; letter-spacing: .06em; white-space: nowrap; }
  .shape-facts dd { font-size: .8125rem; }
  .tool a.shape-quote { grid-column: 1 / -1; margin: 10px 12px 12px; }
}
