/* Copyright Ayers Electronics Inc. All rights reserved. */
/* Getting a title the library does not hold: the search page's switch and its rows, the one button on
   the title's screen, the poster that paints in as the file lands. */

/* ---- the My Library / Everything switch, under the filter row ---- */
.search-scope {
  display: flex;
  flex: none;
  margin-top: 7px;
}
.search-scope.hidden {
  display: none;
}
.search-scope-btn {
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid var(--border-soft);
  font: inherit;
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  background: var(--elevated);
  white-space: nowrap;
}
.search-scope-btn:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}
.search-scope-btn:last-of-type {
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: 0;
}
.search-scope-btn.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.search-scope-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
/* Why the switch is disabled: the Internet Access part that keeps it off and where it changes. */
.search-scope-tag {
  align-self: center;
  margin-left: 12px;
  font-size: var(--type-micro);
  color: var(--muted);
}

/* ---- a title the library does not hold, in the results ---- */
.search-row.beyond .badge {
  text-transform: uppercase;
}

/* ---- the title's screen: one button, its second line, the reason chip ---- */
.details-ask-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
}
.details-ask-btn > * + * {
  margin-top: 2px;
}
.details-ask-label {
  font-weight: 700;
}
.details-ask-sub {
  font-size: var(--type-micro);
  font-weight: 400;
  opacity: 0.8;
}
.details-ask-sub:empty {
  display: none;
}
.details-ask-btn.waiting {
  background: var(--elevated);
  color: var(--text);
  border-color: var(--border);
}
.details-ask-chip {
  display: inline-block;
  margin: -10px 0 22px;
  padding: 4px 12px;
  border: 1px solid var(--error);
  border-radius: var(--radius-pill);
  font-size: var(--type-micro);
  font-weight: 700;
  color: var(--error);
}
.details-ask-chip.hidden {
  display: none;
}
.details-ask-note {
  margin: -10px 0 22px;
  font-size: var(--type-label);
  color: var(--muted);
}
.details-ask-note.hidden {
  display: none;
}

/* ---- the poster paints in clockwise with the real percentage: the grey poster underneath, the same
   poster in colour over it, shown only as far round as the file has landed; the title face takes
   either place when the poster is missing ---- */
.hero-art .ask-greyed {
  filter: grayscale(1);
  opacity: 0.55;
}
@property --ask-fraction {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}
.hero-art .ask-paint {
  -webkit-mask-image: conic-gradient(var(--bg) calc(var(--ask-fraction, 0) * 1turn), transparent 0);
  mask-image: conic-gradient(var(--bg) calc(var(--ask-fraction, 0) * 1turn), transparent 0);
}
/* A registered number interpolates, so a new percentage sweeps round rather than jumping. Below
   the WebView floor the registration is dropped and the fill steps to each percentage instead. */
@media (prefers-reduced-motion: no-preference) {
  .hero-art .ask-paint {
    transition: --ask-fraction var(--ask-fill-ms) linear;
  }
}
#ondemand:not(.asking) #detailsAskBtn,
#ondemand:not(.asking) #detailsAskChip,
#ondemand:not(.asking) #detailsAskNote,
#ondemand:not(.asking) .ask-paint,
#ondemand:not(.asking) .ask-middle,
.hero-art .ask-paint.hidden,
.ask-middle.hidden {
  display: none;
}
.ask-middle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 12px;
  font-size: var(--type-title);
  font-weight: 700;
  color: var(--text);
}
