/* top100.css — "Top 100 Chopmarks in Every Script" reference page.
   One row per character: a header (rank + char + reading) above a horizontal
   strip of rounded glyph tiles (Hanzi / Seal / calligraphy faces). Palette and
   tile look mirror the Chopmark Lookup calligraphy strip (.cl-callig-*). */

.top100-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 1rem 0;
}

.top100-row {
  padding: 1rem 0.25rem 1.25rem;
  border-bottom: 1px solid #ece4d1;
}
.top100-row:last-child { border-bottom: 0; }

/* --- Row header ---------------------------------------------------------- */
.top100-rowhead {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin-bottom: 0.7rem;
}
.top100-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #f1e7cf;
  color: #6f5d3e;
  font-size: 0.9rem;
  font-weight: 700;
}
.top100-headchar {
  font-size: 1.55rem;
  line-height: 1;
  color: #4a4030;
  font-weight: 600;
}
.top100-reading {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
}
.top100-pinyin { color: #8a6a26; font-style: italic; font-size: 1rem; }
.top100-meaning { color: #6f5d3e; font-size: 0.92rem; }

/* --- Tile strip ---------------------------------------------------------- */
.top100-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
}
.top100-fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
}
/* Shared rounded tile box (both the text Hanzi glyph and the SVG glyphs).
   Scoped under .markdown-content so the fixed 100px sizing + zeroed margin beat
   the generic `.markdown-content img { height:auto; margin:1rem 0 0 }` rule
   (which otherwise lets the tall seal SVGs grow past the tile). */
.markdown-content .top100-glyph {
  width: 100px;
  height: 100px;
  box-sizing: border-box;
  border: 1px solid #e3dac6;
  border-radius: 6px;
  background: #fdfbf5;
  padding: 6px;
  margin: 0;
  display: block;
}
.markdown-content .top100-glyph--svg {
  object-fit: contain;
  cursor: pointer;   /* opens the site image modal (zoom) */
}
.markdown-content .top100-glyph--svg:hover { border-color: #8a6a26; }
.markdown-content .top100-glyph--text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.4rem;
  line-height: 1;
  color: #2f2a20;
}
.top100-cap {
  margin-top: 0.35rem;
  font-size: 0.76rem;
  line-height: 1.25;
  color: #6f5d3e;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.top100-cap b { font-weight: 600; }
.top100-face { color: #8f8064; font-weight: 400; }

.top100-empty {
  padding: 1rem;
  border: 1px solid #e3dac6;
  border-radius: 8px;
  background: #fdfbf5;
  color: #6f5d3e;
}

/* --- Narrow screens ------------------------------------------------------ */
@media (max-width: 560px) {
  .top100-fig { width: 84px; }
  .markdown-content .top100-glyph { width: 84px; height: 84px; }
  .markdown-content .top100-glyph--text { font-size: 2.9rem; }
  .top100-tiles { gap: 0.7rem 0.75rem; }
}

/* Image-modal white plate for the seal + calligraphy glyph tiles, matching the
   Chopmark Lookup page (chopmark-lookup.css). These are black-ink-on-transparent
   SVGs, invisible on the modal's dark backdrop without a white plate; the seal
   SVGs also declare tiny intrinsic sizes the global modal renders postage-stamp
   small. Force a 500-square (capped to viewport) + white plate. !important beats
   the inline width/height the modal's setImageSize() writes on load. */
.image-modal__img[src*="/data/seal-lookup/svg/"],
.image-modal__img[src*="/data/calligraphy/svg/"] {
  width: min(500px, calc(100vw - 48px)) !important;
  height: min(500px, calc(100vw - 48px)) !important;
  background: #fff;
  padding: 24px;
  box-sizing: border-box;
  object-fit: contain;
}
