/* note 03: the same hover rule twice, once bare and once behind
   @media (hover: hover), and what the current device reports. Its own file
   because only this note loads it, and because publish.py appends to
   style.css on its own schedule. */
.n-hov { display: grid; gap: 22px; }
.n-hov-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.n-hov-tiles button {
  display: grid;
  gap: 18px;
  align-content: space-between;
  min-height: 118px;
  padding: 16px;
  text-align: left;
  font: 400 12px/1.4 var(--mono);
  color: var(--muted);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: translate .2s, border-color .2s, color .2s;
}
.n-hov-tiles button code { justify-self: start; font-size: 12px; color: var(--paper); }
.n-hov-tiles b {
  font: 400 11px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.n-hov-tiles b::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border: 1px solid currentColor;
  border-radius: 50%;
  vertical-align: 1px;
}
.n-hov-tiles b::after { content: "not hovered"; }
.n-hov-tiles button:focus-visible { outline: 2px solid var(--content); outline-offset: 3px; }

/* the point of the demo: identical declarations, one gated */
.n-hov-tiles .n-hov-bare:hover { translate: 0 -3px; border-color: var(--paper); color: var(--paper); }
.n-hov-tiles .n-hov-bare:hover b::before { background: currentColor; }
.n-hov-tiles .n-hov-bare:hover b::after { content: ":hover matches"; }
@media (hover: hover) {
  .n-hov-tiles .n-hov-gated:hover { translate: 0 -3px; border-color: var(--paper); color: var(--paper); }
  .n-hov-tiles .n-hov-gated:hover b::before { background: currentColor; }
  .n-hov-tiles .n-hov-gated:hover b::after { content: ":hover matches"; }
}

/* what this device reports, read straight off the media queries */
.note-body .n-hov-env { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; font: 400 12px/1.4 var(--mono); color: var(--muted); }
.n-hov-env span { white-space: nowrap; }
.n-hov-env span::after { color: var(--paper); }
.n-hov-env .q-hover::after, .n-hov-env .q-any::after { content: "none"; }
.n-hov-env .q-pointer::after { content: "none"; }
@media (hover: hover) { .n-hov-env .q-hover::after { content: "hover"; } }
@media (any-hover: hover) { .n-hov-env .q-any::after { content: "hover"; } }
@media (pointer: coarse) { .n-hov-env .q-pointer::after { content: "coarse"; } }
@media (pointer: fine) { .n-hov-env .q-pointer::after { content: "fine"; } }

.n-hov-log {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 62px;
  margin: 0;
  padding: 12px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
  font: 400 11px/1 var(--mono);
}
.n-hov-log:empty::before { content: "Events from the last touch or click show up here"; color: var(--muted); padding: 6px 0; }
.n-hov-log li {
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.n-hov-log li span { color: var(--muted); }
.n-hov-log li[data-kind="mouse"], .n-hov-log li[data-kind="click"] { border-color: var(--paper); }
.n-hov-log li[data-kind="touch"] { border-style: dashed; }

@media (max-width: 560px) {
  .n-hov-tiles { gap: 10px; }
  .n-hov-tiles button { min-height: 104px; padding: 12px; }
  .n-hov-tiles button code { font-size: 11px; text-wrap-mode: wrap; white-space: normal; line-height: 1.5; }
  .n-hov-tiles b { font-size: 10px; letter-spacing: .03em; white-space: nowrap; }
  .n-hov-tiles b::before { margin-right: 6px; }
}
