/* Ask my notes (UX run-06) on /blog/: the question field under the masthead, the watched
   questions under it and the answer sheet (blog/recall.js). Design system v2 (DESIGN.md § 9, «Ask my notes»): putty, ink, the
   blog's one cobalt accent, physical depth, Geist + Geist Mono, light and dark. */

/* ---------- the field in the masthead ---------- */

.ask { margin: 0 0 30px; max-width: 36rem; }
.ask-label { display: block; margin: 0 0 10px; color: var(--t-ink); font: 700 1.125rem/1.2 var(--t-display); letter-spacing: -0.01em; }
.ask-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 8px 8px 10px 10px;
  border-radius: var(--t-r-m);
  background: var(--t-card);
  box-shadow: inset 0 0 0 2px var(--t-line), inset 0 -5px 0 rgba(0, 0, 0, 0.07), 0 16px 30px -24px rgba(0, 0, 0, 0.45);
}
.ask-field:focus-within { box-shadow: inset 0 0 0 2px var(--t-ink), inset 0 -5px 0 rgba(0, 0, 0, 0.07), 0 16px 30px -24px rgba(0, 0, 0, 0.45); }
.ask-field:has(input:focus-visible) { outline: 4px solid var(--t-ink); outline-offset: 4px; }
.ask-v, .ask-who .ask-v {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--t-cobalt);
  color: #fff;
  font: 800 1.25rem/1 var(--t-display);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22);
}
.ask-field input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--t-ink);
  font: 500 1.0625rem/1.3 var(--t-display);
  outline: 0;
}
body.blog .ask-field input:focus-visible { outline: 0; }
.ask-field input::placeholder { color: var(--t-ink-2); opacity: 1; }
.ask-field input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
body.blog .ask-go {
  flex: none;
  min-width: 68px;
  min-height: 46px;
  padding: 0 16px 4px;
  border: 0;
  border-radius: var(--t-r-btn, 10px);
  background: var(--t-cobalt);
  color: #fff;
  font: 700 1rem/1 var(--t-display);
  cursor: pointer;
  box-shadow: inset 0 -5px 0 var(--t-cobalt-deep);
  transition: transform var(--t-fast) ease-out, box-shadow var(--t-fast) ease-out;
}
body.blog .ask-go:active { transform: translateY(3px); box-shadow: inset 0 -2px 0 var(--t-cobalt-deep); }
.ask-hint { margin: 10px 0 0; color: var(--t-ink-2); font-size: 0.875rem; line-height: 1.45; text-wrap: pretty; }
.ask-kbd { display: none; }
@media (hover: hover) and (pointer: fine) { .ask-kbd { display: inline; } }
.ask-hint kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 0.35em;
  border-radius: 5px;
  background: var(--t-surface-2);
  box-shadow: inset 0 -2px 0 var(--t-line);
  color: var(--t-ink);
  font: 600 0.8125rem/1.5 var(--t-mono);
  text-align: center;
}

.ask-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 44px; margin: 14px 0 0; }
.ask-row-label { margin-right: 4px; color: var(--t-ink-2); font: 500 0.75rem/1.4 var(--t-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.ask-chips { display: contents; }
body.blog .ask-chip {
  min-height: 44px;
  padding: 0 14px 2px;
  border: 0;
  border-radius: 999px;
  background: var(--b-key-face);
  color: var(--t-ink);
  font: 600 0.9375rem/1 var(--t-display);
  cursor: pointer;
  box-shadow: var(--b-key-depth);
  transition: background-color var(--t-base) ease, color var(--t-base) ease, transform var(--t-fast) ease-out;
}
body.blog .ask-chip:hover { background: var(--t-cobalt); color: #fff; }
body.blog .ask-chip:active { transform: translateY(2px); box-shadow: var(--b-key-depth-pressed); }
.ask-skel { display: inline-block; width: 84px; height: 44px; border-radius: 999px; background: var(--t-card); box-shadow: inset 0 0 0 1.5px var(--t-line); }
.ask-skel:nth-child(2) { width: 72px; }
.ask-skel:nth-child(3) { width: 96px; }
.ask-row-watch { display: none; }
.ask[data-watching] .ask-row-watch { display: flex; }
.ask-watched { display: inline-flex; align-items: center; border-radius: 999px; box-shadow: inset 0 0 0 2px var(--t-cobalt); }
body.blog .ask-chip-watched { background: transparent; box-shadow: none; border-radius: 999px 0 0 999px; padding-right: 8px; }
body.blog .ask-drop {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0 999px 999px 0;
  background: transparent;
  color: var(--t-ink-2);
  cursor: pointer;
}
body.blog .ask-drop:hover { color: var(--t-ink); background: var(--t-surface-2); }
.ask-watched-new { background: var(--t-cobalt); box-shadow: inset 0 -4px 0 var(--t-cobalt-deep); }
body.blog .ask-watched-new .ask-chip, body.blog .ask-watched-new .ask-drop { color: #fff; }
body.blog .ask-watched-new .ask-chip:hover, body.blog .ask-watched-new .ask-drop:hover { background: var(--t-cobalt-deep); }
.ask-chip-count { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font: 600 0.75rem/1 var(--t-mono); letter-spacing: 0.04em; }
.ask-chip-count::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--t-mint); box-shadow: 0 0 0 2px #fff; }
.ask-status { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (scripting: none) { .ask, .ask-answer { display: none; } }

/* ---------- the answer sheet ---------- */

.ask-answer {
  min-width: 0;
  margin: 0 0 28px;
  padding: 22px 18px 18px;
  border-radius: var(--t-r-l);
  background: var(--t-card);
  box-shadow: var(--b-card-depth);
  animation: ask-in var(--t-slow) var(--t-spring) both;
}
@keyframes ask-in { from { transform: translateY(12px) scale(0.99); } }
.ask-who { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--t-ink-2); font: 500 0.75rem/1.4 var(--t-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.ask-who .ask-v { width: 30px; height: 30px; border-radius: 8px; font-size: 1.0625rem; letter-spacing: 0; }
.ask-title { margin: 14px 0 0; max-width: 30ch; font-size: 1.75rem; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.ask-sub { margin: 10px 0 0; color: var(--t-ink-2); font-size: 1rem; line-height: 1.45; }
.ask-sub-new { color: var(--t-ink); font-weight: 600; }
.ask-new { order: -1; justify-self: start; margin: 0 0 8px; padding: 4px 9px 4px 8px; border-radius: 999px; background: var(--t-cobalt); color: #fff; font: 600 0.6875rem/1.3 var(--t-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.ask-close-title { margin: 22px 0 0; color: var(--t-ink-2); font: 500 0.75rem/1.4 var(--t-mono); letter-spacing: 0.08em; text-transform: uppercase; }

.ask-hits { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 28px; margin: 14px 0 0; padding: 0; list-style: none; }
.ask-hit { position: relative; display: grid; align-content: start; padding: 16px 0 18px; box-shadow: inset 0 1.5px 0 var(--t-line); }
.ask-hit-date { order: 0; color: var(--t-ink-2); font: 500 0.75rem/1.4 var(--t-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.ask-hit-title { order: 1; margin: 6px 0 0; font-size: 1.1875rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; }
.ask-hit-title a { color: var(--t-ink); text-decoration: none; }
.ask-hit-title a::after { content: ""; position: absolute; inset: 6px -8px; border-radius: var(--t-r-s); }
.ask-hit-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.ask-hit-title a:focus-visible { outline: 0; }
.ask-hit-title a:focus-visible::after { outline: 4px solid var(--t-ink); outline-offset: 0; }
.ask-quote { order: 2; margin: 8px 0 0; padding-left: 14px; box-shadow: inset 3px 0 0 var(--t-cobalt); color: var(--t-ink); font-size: 1rem; line-height: 1.5; text-wrap: pretty; }
.ask-quote mark { padding: 0 0.12em; border-radius: 4px; background: rgba(47, 85, 255, 0.16); color: inherit; font-weight: 600; }

.ask-watch { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 18px 0 0; padding: 16px; border-radius: var(--t-r-m); background: var(--t-surface-2); }
.ask-watch-text { flex: 1 1 18rem; margin: 0; font-size: 0.9375rem; line-height: 1.45; text-wrap: pretty; }
body.blog .ask-key {
  min-height: 46px;
  padding: 0 18px 3px;
  border: 0;
  border-radius: var(--t-r-btn, 10px);
  font: 700 0.9375rem/1.1 var(--t-display);
  cursor: pointer;
  transition: transform var(--t-fast) ease-out;
}
body.blog .ask-key-ink { background: var(--t-ink); color: var(--t-surface); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.35); }
body.blog .ask-key-quiet { background: var(--b-key-face); color: var(--t-ink); box-shadow: var(--b-key-depth); }
body.blog .ask-key:active { transform: translateY(2px); }
body.blog .ask-more { margin-top: 6px; }
.ask-private { margin: 14px 0 0; color: var(--t-ink-2); font: 500 0.75rem/1.5 var(--t-mono); }

@media (prefers-color-scheme: dark) {
  .ask-field { box-shadow: inset 0 0 0 2px var(--t-line), inset 0 -5px 0 rgba(0, 0, 0, 0.35), 0 16px 30px -24px rgba(0, 0, 0, 0.8); }
  .ask-field:focus-within { box-shadow: inset 0 0 0 2px var(--t-ink), inset 0 -5px 0 rgba(0, 0, 0, 0.35); }
  .ask-quote { box-shadow: inset 3px 0 0 #8da2ff; }
  .ask-quote mark { background: rgba(141, 162, 255, 0.24); }
  body.blog .ask-key-ink { box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25); }
  .ask-watched { box-shadow: inset 0 0 0 2px #8da2ff; }
}

@media (min-width: 600px) {
  .ask-answer { padding: 26px 26px 22px; }
  .ask-title { font-size: 2.25rem; }
}
@media (min-width: 760px) {
  .ask-hits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  /* A full-width bar under the masthead row and the «Day by day» rings (blog/stories.css, which
     loads first, so this list repeats its "stories" row): the field under the title's column, the
     chips under the topics' column, so the masthead row keeps its height. */
  .blog-index { grid-template-areas: "intro topics" "stories stories" "askform askform" "ask ask" "posts posts"; }
  .blog-index > .ask {
    grid-area: askform;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-areas: "label ." "field rows" "hint rows";
    column-gap: 40px;
    align-items: start;
    max-width: none;
    margin: 0 0 40px;
  }
  .ask-label { grid-area: label; }
  .ask-field { grid-area: field; min-height: 72px; }
  .ask-field input { font-size: 1.1875rem; }
  .ask-hint { grid-area: hint; }
  /* Pinned to the field's top (a single row sits level with it), so more chips grow downwards and move nothing. */
  .ask-rows { grid-area: rows; display: grid; gap: 12px; align-self: start; margin-top: 14px; }
  .ask-rows > .ask-row { margin: 0; }
  .blog-index > .ask-answer { grid-area: ask; margin-bottom: 36px; }
  .ask-answer { padding: 30px 32px 26px; }
  .ask-hits { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ask-title { font-size: 2.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ask-answer { animation: none; }
  body.blog .ask-go, body.blog .ask-chip, body.blog .ask-key { transition: none; }
  body.blog .ask-go:active, body.blog .ask-chip:active, body.blog .ask-key:active { transform: none; }
}
