/* The notebook's Glyphs tab */

/* ---- Glyphs tab: a dictionary ---- */

/* Title with its information tooltip */
.notebook-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* On the title's right: a mouse icon for each click, with what it does in a tooltip */
.click-hints {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.click-hint {
  display: inline-flex;
  color: rgba(43, 33, 24, 0.6);
  cursor: help;
  transition: color 0.2s ease;
}

.click-hint svg {
  width: 19px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.click-hint svg .click-hint-button {
  fill: currentColor;
  stroke: none;
}

.click-hint:hover,
.click-hint:focus-visible {
  color: var(--forest-darkest);
  outline: none;
}

.info-text {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 3;
  padding: 8px 12px;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--stone-light);
  background: var(--forest-darkest);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.click-hint:hover .info-text,
.click-hint:focus-visible .info-text {
  opacity: 1;
}

/* The index: a grid of glyphs, each with its meaning underneath */
.glyph-index {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 4px;
  margin-top: 12px;
}

.glyph-index-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 6px 2px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.glyph-index-cell:hover {
  background: rgba(43, 33, 24, 0.06);
}

/* The glyph whose entry is open */
.glyph-index-cell.is-selected {
  background: rgba(217, 182, 92, 0.22);
}

.glyph-index-cell .glyph {
  pointer-events: none; /* the whole cell is the button */
}

.index-meaning {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-handwriting);
  font-size: 1.15rem;
  line-height: 1.1;
}

.index-meaning.is-confirmed {
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
}

.index-meaning.is-unknown {
  color: rgba(43, 33, 24, 0.4);
}


/* The entry, on the right page */
.glyph-entry h4 {
  margin: 14px 0 4px;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(43, 33, 24, 0.6);
}

.entry-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.notebook .glyph.entry-glyph {
  width: 88px;
  height: 88px;
  font-size: 1.2rem;
}

.entry-head .glyph-meaning {
  font-size: 1.9rem;
}

.entry-head .glyph-meaning.is-confirmed {
  font-size: 1.6rem;
  font-weight: 700;
}

.entry-status {
  margin: 10px 0 0;
  font-style: italic;
  color: rgba(43, 33, 24, 0.75);
}

/* The category, in its colour (as in the reply popup) */
.entry-category {
  width: fit-content;
  margin: 6px 0 0;
  padding: 1px 10px;
  font-size: 0.9rem;
  color: var(--forest-darkest);
  background: var(--cat-colour, var(--stone-light));
  border-radius: 999px;
}

.entry-places {
  margin: 0;
  padding-left: 1.1em;
}

.entry-place {
  padding: 1px 0;
  font: inherit;
  font-size: 1rem;
  text-align: left;
  color: var(--forest-darkest);
  background: none;
  border: none;
  border-bottom: 1px dotted rgba(43, 33, 24, 0.4);
  cursor: pointer;
}

.entry-place:hover,
.entry-place:focus-visible {
  color: #6b4a14;
  border-bottom-color: currentColor;
  outline: none;
}

.entry-none {
  margin: 0;
  font-style: italic;
  color: rgba(43, 33, 24, 0.6);
}

.entry-alongside {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.notebook .entry-alongside .glyph {
  width: 44px;
  height: 44px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Category dropdown in an entry, until the glyph is confirmed (coloured once one is chosen) */
.entry-category-choice {
  display: inline-block;
  margin-top: 6px;
}

.entry-category-select {
  padding: 1px 8px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--forest-darkest);
  background: var(--cat-colour, transparent);
  border: 1px dashed rgba(43, 33, 24, 0.5);
  border-radius: 999px;
  cursor: pointer;
}

.entry-category-choice:not([data-category="Unsorted"]) .entry-category-select {
  border-style: solid;
  border-color: transparent;
}
