/* The switches that change how a page looks rather than what is on it: the
   order (a sort that reverses when chosen again) and light/dark. Used by
   /plugins, /collections, and a plugin's own hero — which is drawn in the
   banner block, outside #content, hence the .plugin-hero on the selectors
   below. There the buttons are links, so they carry aria-current where a
   button would carry aria-pressed. */

/* the order and light/dark side by side: both change how the page looks,
   not what is on it */
.directory-view {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
}

#content .directory-sort-option {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  text-decoration: none;
}

/* which way the order runs; only the one in use has an arrow */
.directory-sort-arrow {
  font-size: 12px;
}

.directory-sort-arrow:empty {
  display: none;
}

/* Two buttons that read as one switch rather than as more categories — but a
   wash of light on the page instead of a moulded track. Nothing here is its
   own colour: the ground shows through and the switch takes whatever it is
   sitting on, which on a collection's hero is that collection's own tint. */
.directory-modes {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px;
  /* struck as black at low strength rather than as white: white on the white
     of /plugins and /collections leaves nothing to see, where this reads on
     any ground and still comes out the colour of whatever is behind it */
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.055);
  /* what is behind goes soft under it, so the ruled paper of a hero does not
     run through the middle of the words */
  backdrop-filter: blur(8px) saturate(1.3);
  -webkit-backdrop-filter: blur(8px) saturate(1.3);
}

#content .directory-mode,
#content .directory-sort-option,
.plugin-hero .directory-mode {
  padding: 5px 16px;
  border: 1px solid transparent;
  border-radius: 100px;
  background: none;
  /* stated as black at low strength rather than as a grey, so the ground
     carries through the words as it does through the track */
  color: rgba(0, 0, 0, 0.5);
  font-family: var(--text-font);
  font-size: 14px;
  /* Stated rather than left to `normal`, which asks the font for its own
     idea of a line. A plugin's language pill can read 日本語 or العَرَبِيَّة,
     and the faces that carry those want a taller line than the Latin one —
     which made the pill, and the track around it, a couple of pixels taller
     than the pair beside it. */
  line-height: 1.25;
  font-variation-settings: "wght" 650, "ital" 0;
  /* the hero's are links, and a link underlines itself */
  text-decoration: none;
  cursor: pointer;
  transition: color 0.12s;
}

#content .directory-mode:hover,
#content .directory-sort-option:hover,
.plugin-hero .directory-mode:hover {
  color: rgba(0, 0, 0, 0.85);
}

/* the one that is on: more of the same light, not a key standing up off a
   board — one soft shadow to lift it, and no bevel */
#content .directory-mode[aria-pressed="true"],
#content .directory-sort-option[aria-current="true"],
.plugin-hero .directory-mode[aria-current="true"] {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.82);
  color: #222;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
