/* ── Ask the library (templates/ask.html, templates/ask_macros.html) ──
   A request, what was understood of it as parts that can be taken away,
   and the answer: one work large, or a few picks in a grid. Mobile first;
   on a television (data-tv) everything is larger and the parts are
   reached with the remote like any row. Colours are the site's tokens. */

.ask {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.ask-head { margin-bottom: 1.25rem; }
/* Its face, size and weight are every section title's (.page-title). */
.ask-title { margin: 0 0 0.75rem; }

.ask-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}
.ask-input {
  flex: 1 1 10rem;
  min-width: 0;
  min-height: 48px;
  padding: 0.65rem 1.25rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  /* The shape of every search field on the site. */
  border-radius: var(--field-radius);
}
.ask-input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}
.ask-input::placeholder { color: var(--text-dim); }

.ask-voice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  min-width: 48px;
  padding: 0 0.9rem;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--tint-strong);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.ask-voice[hidden] { display: none; }
.ask-voice .icon { width: 1.25rem; height: 1.25rem; }
.ask-voice:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.ask-voice[aria-pressed="true"] {
  background: var(--live);
  border-color: var(--live);
  color: var(--on-live);
}
@media (max-width: 480px) {
  .ask-voice-label { display: none; }
}
.ask-go { min-height: 48px; }

.ask-voice-note {
  margin: 0.6rem 0 0;
  max-width: 48rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.ask-voice-note[hidden] { display: none; }
.ask-voice-note .btn { margin: 0.5rem 0.5rem 0 0; }

/* What was understood: one chip a part, each with its "take away". */
.ask-understood { margin: 0 0 1rem; }
.ask-understood-title {
  display: inline;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0.5rem 0 0;
}
.ask-parts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}
.ask-part {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem 0.2rem 0.15rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--accent-tint);
  font-size: 0.95rem;
}
.ask-part--unmet {
  background: transparent;
  border-style: dashed;
  color: var(--text-muted);
}
.ask-part-label { white-space: nowrap; }
.ask-part-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  border-radius: 999px;
  color: var(--text-muted);
}
.ask-part-remove:hover { background: var(--bg-hover); color: var(--text); }
.ask-part-remove .icon { width: 0.9rem; height: 0.9rem; }
@media (pointer: coarse) {
  .ask-part-remove { min-width: 44px; min-height: 44px; }
}
.ask-instead,
.ask-dropped {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.ask-instead a,
.ask-dropped a,
.ask-all a,
.ask-counts a,
.ask-examples a { color: var(--accent-text); }

.ask-why {
  margin: 0.5rem 0 1.25rem;
  font-size: 1.05rem;
}
.ask-note {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.ask-section-title {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.75rem;
}

/* A work: its picture, then what it is and what plays it. */
.ask-work {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  padding: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 100%;
}
.ask-work-art {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: calc(var(--radius) / 2);
  background: var(--surface);
}
/* The work's letter sits behind its picture and shows where the picture
   fails (app.js takes a failed image away), as on every card. */
.ask-work-art > * { grid-area: 1 / 1; }
.ask-work-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ask-work-initial {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dim);
}
.ask-work-text { min-width: 0; }
.ask-work-medium {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.ask-work-title {
  margin: 0.15rem 0 0.2rem;
  font-size: 1.05rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.ask-work-title a { color: var(--text); }
.ask-work-part,
.ask-work-by {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.ask-work-note {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--warning);
}
.ask-work-rights {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}
.ask-licence {
  display: inline-block;
  padding: 0 0.4rem;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--text-muted);
}
.ask-work-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
}
.ask-work-moment {
  font-size: 0.85rem;
  color: var(--accent-text);
}

/* The one answer: larger, its picture beside it on a wide screen. */
.ask-work--lead {
  grid-template-columns: minmax(0, 1fr);
  padding: 1rem;
}
.ask-work--lead .ask-work-title { font-size: 1.5rem; }
.ask-work--lead .ask-work-art { max-width: 20rem; }
@media (min-width: 640px) {
  .ask-work--lead { grid-template-columns: 20rem minmax(0, 1fr); gap: 1.25rem; }
}

.ask-picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ask-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}
.ask-count-note { font-size: 0.85rem; color: var(--text-muted); }
.ask-all { margin: 0; }

.ask-intro { max-width: 48rem; }
.ask-lede { font-size: 1.05rem; line-height: 1.55; }
.ask-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}
.ask-examples a {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  background: var(--tint);
}
.ask-examples a:hover { background: var(--bg-hover); }
.ask-privacy { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }

/* On a television: larger, and the microphone first in reach. */
:root[data-tv] .ask { max-width: none; padding: 2rem 4rem 4rem; }
:root[data-tv] .ask-input,
:root[data-tv] .ask-voice,
:root[data-tv] .ask-go { min-height: 64px; font-size: 1.4rem; }
:root[data-tv] .ask-voice .icon { width: 1.8rem; height: 1.8rem; }
:root[data-tv] .ask-part { font-size: 1.2rem; }
:root[data-tv] .ask-work-title { font-size: 1.3rem; }
:root[data-tv] .ask-work--lead .ask-work-title { font-size: 2rem; }

/* The answer's block above the results on /search, inside the page's
   gutters, its heading in line with what it holds. */
.ask-found {
  margin: 1.5rem var(--gutter);
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.section.ask-found > .section-title { padding-inline: 0; }
.ask-found .ask-why { margin: 0.5rem 0 0.75rem; }
.ask-found .ask-understood { margin: 0; }
