/**
 * Product glyph map — stacked under type tester in left column.
 */

/* Legacy dummy wrapper — no longer used in theme shell */
.jt-product-test-layout__below {
  display: contents;
}

.jt-product-test-layout__below-spacer {
  display: none;
}

.jt-product-test-layout--solo .jt-product-test-layout__content {
  grid-column: auto;
}

.jt-product-glyphs-standalone {
  margin: 32px 0 56px;
}

.jt-product-glyphs-standalone__shell {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0 30px;
}

.jt-product-glyphs {
  grid-column: 1;
  min-width: 0;
  margin: 0;
  --jt-glyph-font-family: inherit;
}

.jt-product-glyphs .jt-glyph-cell__char {
  font-family: var(--jt-glyph-font-family, inherit), sans-serif !important;
  font-synthesis: none;
  text-rendering: geometricPrecision;
  transform-origin: center center;
}

.jt-product-glyphs__header {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.jt-product-glyphs__total {
  font-variant-numeric: tabular-nums;
}

.jt-product-glyphs__loading {
  margin: 0;
  padding: 24px 16px;
  font-size: 14px;
  color: var(--jt-muted, rgba(255, 255, 255, 0.55));
}

.jt-product-glyphs__viewport {
  position: relative;
  border: 1px solid var(--jt-border);
  border-radius: var(--jt-radius);
  background: var(--jt-surface);
  overflow: hidden;
}

.jt-product-glyphs__viewport.is-expanded .jt-product-glyphs__fade {
  opacity: 0;
  pointer-events: none;
}

.jt-product-glyphs__grid-wrap {
  max-height: 560px;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.jt-product-glyphs__viewport.is-expanded .jt-product-glyphs__grid-wrap {
  max-height: none;
  overflow: visible;
}

.jt-product-glyphs__groups {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.jt-glyph-group {
  padding: 18px 16px 8px;
  border-bottom: 1px solid var(--jt-border);
}

.jt-glyph-group:last-child {
  border-bottom: none;
  padding-bottom: 16px;
}

.jt-glyph-group__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--jt-text);
}

.jt-glyph-group__count {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--jt-muted, rgba(255, 255, 255, 0.55));
}

.jt-product-glyphs__grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 1px;
  background: var(--jt-glyph-cell-border, rgba(255, 255, 255, 0.1));
  border: 1px solid var(--jt-glyph-cell-border, rgba(255, 255, 255, 0.1));
  border-radius: 6px;
  overflow: hidden;
}

.jt-glyph-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 88px;
  padding: 10px 6px 8px;
  background: var(--jt-glyph-cell-bg, rgba(255, 255, 255, 0.04));
  text-align: center;
  cursor: default;
  transition: background 0.15s ease, box-shadow 0.15s ease, z-index 0s;
}

@media (hover: hover) {
  .jt-glyph-cell:hover,
  .jt-glyph-cell:focus-visible,
  .jt-glyph-cell.is-hovered {
    z-index: 2;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  }

  .jt-glyph-cell:hover .jt-glyph-cell__char,
  .jt-glyph-cell:focus-visible .jt-glyph-cell__char,
  .jt-glyph-cell.is-hovered .jt-glyph-cell__char {
    transform: scale(1.12);
    color: #fff;
  }

  .jt-glyph-cell:hover .jt-glyph-cell__name,
  .jt-glyph-cell:focus-visible .jt-glyph-cell__name,
  .jt-glyph-cell.is-hovered .jt-glyph-cell__name {
    color: var(--jt-text);
  }
}

.jt-glyph-cell:focus-visible {
  outline: none;
}

.jt-glyph-cell__char {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  margin-bottom: 6px;
  font-size: 28px;
  line-height: 1;
  color: var(--jt-text);
  transition: transform 0.15s ease, color 0.15s ease;
}

.jt-glyph-cell__char--empty {
  opacity: 0.15;
}

.jt-glyph-cell__name,
.jt-glyph-cell__unicode {
  display: block;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jt-glyph-cell__name {
  color: var(--jt-muted, rgba(255, 255, 255, 0.55));
  margin-bottom: 2px;
}

.jt-glyph-cell__unicode {
  color: rgba(255, 255, 255, 0.38);
  font-size: 9px;
}

.jt-glyph-preview {
  position: fixed;
  z-index: 100050;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  max-width: 220px;
  padding: 18px 16px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(17, 17, 17, 0.96);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  backdrop-filter: blur(8px);
  --jt-glyph-font-family: inherit;
}

.jt-glyph-preview.is-visible {
  display: flex !important;
}

.jt-glyph-preview__char {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 88px;
  margin-bottom: 10px;
  font-size: 72px;
  line-height: 1;
  color: #fff;
  font-family: var(--jt-glyph-font-family, inherit), sans-serif !important;
  transform-origin: center center;
}

.jt-glyph-preview__char--empty {
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--jt-muted, rgba(255, 255, 255, 0.55));
  letter-spacing: 0.02em;
}

.jt-glyph-preview__name {
  margin: 0 0 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.35;
  color: var(--jt-text);
  text-align: center;
  word-break: break-all;
}

.jt-glyph-preview__unicode {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  color: var(--jt-muted, rgba(255, 255, 255, 0.55));
}

.jt-product-glyphs__fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(17, 17, 17, 0) 0%, rgba(17, 17, 17, 0.92) 55%, rgba(17, 17, 17, 1) 100%);
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.jt-product-glyphs__actions {
  display: flex;
  justify-content: center;
  padding: 20px 16px 24px;
  border: 1px solid var(--jt-border);
  border-top: none;
  border-radius: 0 0 var(--jt-radius) var(--jt-radius);
  background: var(--jt-surface);
  margin-top: -1px;
}

.jt-product-glyphs__toggle {
  min-width: 200px;
  min-height: 44px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: transparent;
  color: var(--jt-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.jt-product-glyphs__toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.55);
}

.jt-product-glyphs__empty {
  margin: 0;
  padding: 24px 16px;
  font-size: 14px;
  color: var(--jt-muted, rgba(255, 255, 255, 0.55));
}

@media (max-width: 991px) {
  .jt-product-glyphs {
    grid-column: auto;
  }

  .jt-product-glyphs__grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .jt-product-glyphs-standalone__shell,
  .jt-product-test-layout__shell {
    padding-left: 20px;
    padding-right: 20px;
  }

  .jt-product-glyphs__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
