/* Every tile in the notebooks that opens something (a word, a kanji or hanzi, a radical, a sound, a kana) feels like
   a button: pointed at, it lifts a little; pressed, it sinks and takes on the notebook's colour. */
.wt,
.kt,
.rt,
.pc,
.rows .cell:has(.gl) {
  transition:
    transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.2s,
    background-color 0.2s,
    border-color 0.2s;
}
@media (hover: hover) {
  .wt:hover,
  .kt:hover,
  .rt:hover,
  .pc:hover,
  .rows .cell:has(.gl):hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 8px 18px -10px rgba(10, 16, 14, 0.45);
  }
}
.wt:active,
.kt:active,
.rt:active,
.pc:active,
.rows .cell:has(.gl:active),
.wt.pressing,
.kt.pressing,
.rt.pressing,
.pc.pressing,
.rows .cell:has(.gl.pressing) {
  transform: scale(0.95);
  border-color: var(--accent);
  background-color: color-mix(in srgb, var(--accent) 14%, var(--paper));
  box-shadow: none;
  transition-duration: 0.08s;
}

/* the kana chart: the whole cell, letters and rōmaji, is the button. The kana button stretches over its cell, and
   the one open (or last opened) is marked on the whole cell, not with a small box around the letter. */
.rows .cell {
  position: relative;
}
.rows .cell .gl::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
}
.rows .cell .gl,
.rows .cell .gl:hover,
.rows .cell .gl.sel {
  outline: none;
  background: none;
}
.rows .cell:has(.gl.sel) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--ink);
}
.rows .cell:has(.gl:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.rows .cell .gl:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .wt,
  .kt,
  .rt,
  .pc,
  .rows .cell:has(.gl) {
    transition: none;
  }
  .wt:hover,
  .kt:hover,
  .rt:hover,
  .pc:hover,
  .rows .cell:has(.gl):hover {
    transform: none;
  }
}
