@import url("/chrome.css");

/* =====================================================================
   Drawbang v2 — builder-rendered pages (gallery, day-gallery, drawing
   detail, owner, products, canvas, canvases archive). Shared chrome
   (header/footer/tokens/base typography/btn) lives in chrome.css; this
   file ONLY contains classes that show up on those pages.

   Do NOT mirror chrome rules here — edit chrome.css and both surfaces
   pick the change up. The whole point of this split is to avoid the
   drift we used to get from dual-maintaining .ftr / .hdr / .btn / etc.
   ===================================================================== */

/* =====================================================================
   GALLERY — tight image grid + archive list
   ===================================================================== */
.img-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: calc(6 * 320px);
}
.img-grid li { display: block; aspect-ratio: 1; background: var(--canvas-bg); overflow: hidden; position: relative; }
.img-grid a { display: block; height: 100%; }
.img-grid img { display: block; width: 100%; height: 100%; background: var(--canvas-bg); image-rendering: pixelated; }
@media (max-width: 900px) { .img-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .img-grid { grid-template-columns: repeat(3, 1fr); } }

.gal-archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gal-archive-list li { font-size: var(--t-sm); }
.gal-archive-list a { color: var(--fg); text-decoration: none; }
.gal-archive-list a:hover { color: var(--accent); text-decoration: underline; }
.gal-archive-list .gal-count { color: var(--fg-muted); }

.pager { margin-top: 16px; display: flex; gap: 16px; }
.pager a { color: var(--accent); }
.day-nav { margin-top: 12px; display: flex; gap: 16px; justify-content: space-between; font-size: var(--t-sm); }
.day-nav a { color: var(--accent); }

/* =====================================================================
   DRAWING DETAIL (/d/<id>)
   ===================================================================== */
.dr-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) { .dr-grid { grid-template-columns: 1fr; gap: 16px; } }
.dr-art-wrap { max-width: 320px; width: 100%; }
.dr-art-wrap img {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  background: var(--canvas-bg);
  border: var(--border) solid var(--border-c);
  aspect-ratio: 1;
  image-rendering: pixelated;
}
.dr-meta {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px 12px;
  margin: 0 0 24px;
  font-size: var(--t-sm);
}
.dr-meta dt { color: var(--fg-muted); }
.dr-meta dd { margin: 0; word-break: break-all; }
.mono-trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dr-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }

/* Owner stats block (/keys/<pubkey>) — streaks + badges (#115/#116).
   Same grid shape as .dr-meta so it sits comfortably above the drawings grid. */
.ow-stats {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
  margin: 0 0 24px;
  font-size: var(--t-sm);
}
.ow-stats dt { color: var(--fg-muted); }
.ow-stats dd { margin: 0; }
.ow-badges {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ow-badges li {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--canvas-bg);
  color: var(--fg);
  font-size: var(--t-xs);
  border: 1px solid var(--fg-muted);
}

/* =====================================================================
   PRODUCTS LIST (/products)
   ===================================================================== */
.pr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (max-width: 767px) {
  .pr-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
.pr-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--fg);
  border: var(--border) solid var(--border-c);
  background: var(--bg-elev);
  padding: 12px;
}
.pr-card:hover { border-color: var(--accent); text-decoration: none; }
.pr-art {
  aspect-ratio: 1;
  border: var(--border) solid var(--border-c);
  background: #f4f0e6;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.pr-art img.pr-mockup { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.pr-art img.pr-drawing {
  position: absolute;
  display: block;
  image-rendering: pixelated;
  aspect-ratio: 1;
  height: auto;
  /* tee — centered chest, placeholders 424,354 / 352×432 on a 1200×1200 mockup */
  top: 29.5%;
  left: 35.3%;
  width: 29.3%;
}
.pr-art.pr-art-mug img.pr-drawing {
  /* mug wrap, placeholders 379,249 / 448×816 — square crop centred horizontally */
  top: 35%; left: 36.5%; width: 27%;
}
.pr-art.pr-art-sticker img.pr-drawing {
  /* sticker sheet, placeholders 74,256 / 496×320 — first cell as preview */
  top: 26%; left: 12%; width: 27%;
}
.pr-info { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.pr-name { font-size: var(--t-sm); font-weight: 500; line-height: 1.3; }
.pr-row { font-size: var(--t-xs); color: var(--fg-muted); }
