/*
 * hyd-browse.css
 *
 * Browsing refinements. It loads after hyd-retro.css and before hyd-boot.css (see the link
 * order in hyd-world.html).
 *
 * Order: hidden guards, the metro layer toggle in the atlas title bar, the photo browse bar
 * (area select, subject chips, shuffle, clear), the route follow button on the player map, the
 * 700 px breakpoint and the reduced-motion overrides.
 *
 * Dormant selectors: 14 of the 20 class and id names written in this file match no element
 * on the shipped page (6 Oct 2026). Nine appear in neither hyd-world.html nor any script it
 * loads: the photo browse bar (.photo-browse, #photo-subjects, #shuffle-scraps and the rest)
 * and a few places and roll helpers. Five more are only named in hyd-world.js, which never
 * creates them: #metro-layer-toggle, #metro-map-controls, .map-key and .map-footnote (the
 * Metro layer, switched off; hyd-world.js hides or queries them if they exist) and #roll (old
 * bookmarks to it are redirected to the Photos player). The rules are kept exactly as shipped:
 * this pass only adds comments and blank lines.
 */

/* Focused browsing refinements, using the existing purple desktop tokens. */

/* !important: the hidden attribute must win over the display values these controls get
   elsewhere. This is the global [hidden] rule from hyd-world.css, restated for these controls.
   Only #route-follow is on the page today; the other four are dormant (see the header). */
#metro-map-controls[hidden],
#places .map-key[hidden],
#places .map-footnote[hidden],
#clear-photo-filters[hidden],
#route-follow[hidden] {
  display: none !important;
}

/* Metro layer toggle: small bevelled button at the right of the atlas (Places map) title bar.
   Pressed inverts the bevel. Dormant: no element in hyd-world.html (6 Oct 2026); hyd-world.js
   only touches it if it exists. */
.atlas-window-bar #metro-layer-toggle {
  margin-left: auto;
  margin-right: 12px;
  padding: 3px 9px;
  min-height: 24px;
  font:
    11px Tahoma,
    sans-serif;
  border: 1px solid;
  border-color: #bfa3cf #614973 #614973 #bfa3cf;
  border-radius: 3px;
  background: linear-gradient(#584364, #33223f);
  color: #f7ecff;
  box-shadow: inset 0 1px #e2c9f122;
}

.atlas-window-bar #metro-layer-toggle[aria-pressed='true'] {
  background: #20152d;
  border-color: #664d79 #cdb6db #cdb6db #664d79;
  color: #f3cae8;
}

/* Hide the decorative icons in the map invitation (dormant: no .map-invitation markup) and in
   the first span of the atlas title bar. */
#places .map-invitation svg {
  display: none;
}

#places .atlas-window-bar > span:first-child svg {
  display: none;
}

/* Photo roll collection tools spacing, then the photo browse bar (.photo-browse): area select,
   subject chips, shuffle and clear controls. Dormant: no markup or script mentions these
   names (grep, 6 Oct 2026). */
#roll .collection-tools {
  margin-bottom: 12px;
}

/* Browse bar container, a bevelled purple panel. */
.photo-browse {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 22px;
  padding: 11px 12px;
  background: linear-gradient(145deg, #2b203a, #1b1227);
  border: 1px solid;
  border-color: #8c739c #42324f #42324f #8c739c;
  box-shadow: 2px 3px #080410;
  border-radius: 4px;
}

/* Area label and select. */
.photo-area-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font:
    11px Tahoma,
    sans-serif;
  color: #ddc5eb;
}

.photo-area-label select {
  font:
    12px 'Hyd Instrument',
    Arial,
    sans-serif;
  color: #fff1ff;
  background: #170f22;
  border: 1px solid;
  border-color: #684f7b #b89acb #b89acb #684f7b;
  border-radius: 2px;
  min-height: 34px;
  max-width: 190px;
  padding: 5px 26px 5px 9px;
}

/* Subject chips (#photo-subjects): pressed chips light up, hover brightens them. */
#photo-subjects {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 470px;
}

#photo-subjects button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  min-height: 34px;
  color: #e6d0f0;
  background: #271a34;
  border: 1px solid #786087;
  border-radius: 3px;
  font:
    12px 'Hyd Instrument',
    Arial,
    sans-serif;
  box-shadow: 1px 2px #0d0717;
  transition:
    background 0.15s,
    translate 0.15s;
}

#photo-subjects button > span {
  font-size: 15px;
  color: #dcb4e3;
}

#photo-subjects button[aria-pressed='true'] {
  background: linear-gradient(#785787, #4a325c);
  border-color: #d7b8e7;
  color: #fff;
  box-shadow:
    inset 0 1px #eddbfc40,
    1px 2px #0b0511;
}

#photo-subjects button:hover {
  background: #493158;
}

/* Shuffle button. */
#roll .photo-browse #shuffle-scraps {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  white-space: nowrap;
  padding: 8px 14px;
  background: linear-gradient(#745384, #412a53);
  border-color: #dec1ed #745482 #745482 #dec1ed;
  color: #fff;
}

#shuffle-scraps svg {
  width: 18px;
  height: 18px;
  flex: none;
}

#roll .photo-browse #shuffle-scraps:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Clear filters link. */
#roll #clear-photo-filters {
  font:
    11px 'Hyd Instrument',
    Arial,
    sans-serif;
  padding: 6px 3px;
  border: 0;
  border-bottom: 1px dotted #ad88bd;
  background: none;
  color: #dfbedd;
}

/* !important: the chips set box-shadow through the #photo-subjects id selector, which out-ranks
   this class based pressed state, so the shadow reset needs !important. */
.photo-browse button:active:not(:disabled) {
  translate: 1px 1px;
  box-shadow: none !important;
}

/* Keyboard focus ring for the area select. */
.photo-browse select:focus-visible {
  outline: 2px solid #f2b8df;
  outline-offset: 3px;
}

/* Route follow button on the player map title bar (#route-follow). hyd-world.js sets
   aria-pressed; pressed shows an inset bevel. */
#cinema .route-title #route-follow {
  margin-left: auto;
  width: 22px;
  min-height: 20px;
  font:
    15px/1 Tahoma,
    sans-serif;
  padding: 1px;
}

#cinema .route-title #route-follow[aria-pressed='true'] {
  border-style: inset;
  background: #aab9c3;
  color: #162a34;
}

#cinema .route-title {
  gap: 4px;
}

/* Up to 700px wide: the browse bar wraps, controls grow to 38px tall and the atlas toggle
   shrinks. */
@media (max-width: 700px) {
  .photo-browse {
    gap: 10px;
    padding: 10px;
  }

  .photo-area-label {
    flex: 1 1 auto;
  }

  .photo-area-label select {
    max-width: none;
    width: 100%;
    min-height: 38px;
  }

  .photo-browse #photo-subjects {
    order: 3;
    flex-basis: 100%;
  }

  #photo-subjects button {
    flex: 1 0 auto;
    min-height: 38px;
  }

  #roll .photo-browse #shuffle-scraps {
    margin-left: 0;
    min-height: 38px;
  }

  .photo-browse #clear-photo-filters {
    order: 4;
  }

  #roll .frame-shelf-bar {
    gap: 8px;
  }

  #roll .frame-shelf-bar > span:first-child {
    font-size: 10px;
  }

  #roll .frame-shelf-bar #roll-status {
    font-size: 10px;
  }

  .atlas-window-bar #metro-layer-toggle {
    font-size: 10px;
    margin-right: 8px;
  }
}

/* Reduced motion: chips change colour without a transition. */
@media (prefers-reduced-motion: reduce) {
  #photo-subjects button {
    transition: none;
  }
}

/* Same when motion is switched off with the header toggle (body.motion-off). */
.motion-off #photo-subjects button {
  transition: none;
}
