/*
 * hyd-reference-details.css
 *
 * Detail pass for the plum desktop (#home) and the player's information toolbar and
 * file-properties dialog: the video-shuffle object and folder art in the hero entry
 * (.visual-entry), the shared desktop window frame (#home .desktop-window: titlebar, menu bar,
 * recordings list, status bar, sky panel, contact strip and photo tools), #cinema
 * .pixel-toolbar, and the #recording-properties dialog. It is linked 16th in hyd-world.html
 * (after hyd-boot.css, before hyd-deck-details.css). Colours are literal values; the sheet uses
 * no custom properties.
 *
 * hyd-mac-windows.css (26th) and hyd-classic-desktop.css restyle many of the same #home
 * properties under html[data-theme] #world, so the plum values here show only where those later
 * rules do not reach.
 *
 * Dormant: no HTML or script references .kept-flight or .city-shuffle (checked 2026-10-06).
 *
 * !important appears in two kinds of place: the desktop titlebar gradient, and the transition:
 * none rules for reduced motion and the .motion-off switch. Each is explained where it occurs.
 *
 * Order: video shuffle, desktop window family, information toolbar, file-properties dialog,
 * then responsive, reduced-motion and touch-size rules.
 */

/* Existing plum desktop, with one clear video-shuffle action. */

/* --- Video shuffle and folder art (.visual-entry) ---
   The shuffle icon rises 4 px on hover and nudges down on :active, a dotted ring marks keyboard
   focus, and the area terminal's folder art tilts while the terminal has focus. */
.visual-entry .recording-shuffle {
  display: grid;
  place-items: center;
  width: 124px;
  height: 104px;
  flex-basis: 104px;
  position: relative;
}

.visual-entry .recording-shuffle svg {
  width: 124px;
  height: 104px;
  filter: drop-shadow(2px 5px 2px #07020e80);
  transition: translate 0.18s ease-out;
}

.visual-entry .shuffle-object {
  border-radius: 3px;
  transition: background 0.15s;
}

.visual-entry .shuffle-object:hover {
  background: #ceb4e10b;
}

.visual-entry .shuffle-object:hover .recording-shuffle svg {
  translate: 0 -4px;
}

.visual-entry .shuffle-object:focus-visible {
  outline: 2px dotted #f5cee9;
  outline-offset: -4px;
}

.visual-entry .shuffle-object b {
  font:
    bold calc(12 * var(--px)) Tahoma,
    sans-serif;
  color: #fcf0ff;
}

.visual-entry .shuffle-object:active .recording-shuffle svg {
  translate: 0 2px;
}

.visual-entry .shuffle-object:active .entry-play {
  box-shadow: inset 0 2px 3px #2d143f66;
  translate: 0 1px;
}

.visual-entry .area-terminal .folder-art {
  transition:
    translate 0.2s,
    rotate 0.2s;
}

.visual-entry .area-terminal:focus-within .folder-art {
  translate: 0 -3px;
  rotate: -4deg;
}

/* --- Desktop window family (#home .desktop-window) ---
   Frame, titlebar, window buttons, menu bar, recordings list, status bar, sky panel, contact
   strip and photo tools. */

/* One window family, derived from the existing purple Aqua entry window. */
#home .desktop-window {
  border: 1px solid;
  border-color: #e4d6ee #655271 #655271 #d4c3e0;
  background: #21172c;
  box-shadow:
    0 2px 2px #07020c99,
    0 12px 26px #08020c77,
    inset 0 0 0 1px #b49ac455;
  border-radius: 7px 7px 4px 4px;
}

/* !important: this plum gradient must beat the titlebar backgrounds that hyd-aqua.css also
   marks !important (its #desk-entry rule has equal specificity, so source order, later here,
   decides). hyd-mac-windows.css overrides it in turn with its own !important and a more
   specific selector. */
#home .desktop-window .desktop-titlebar {
  background: linear-gradient(
    #f0e5f5 0%,
    #d8c6e4 12%,
    #ad94be 47%,
    #c7b2d6 52%,
    #d6c4e0 100%
  ) !important;
  color: #33213f;
  border: 1px solid;
  border-color: #f6eafb #8d729f #8d729f #e7d8ed;
  border-radius: 5px 5px 0 0;
  box-shadow: inset 0 1px #fff7;
  min-height: 27px;
}

#home .desktop-window .window-grab {
  color: #30203d;
  font:
    11px/1.2 Tahoma,
    sans-serif;
  text-shadow: 0 1px #fff6;
}

#home .desktop-window .desktop-titlebar > div > button {
  box-shadow:
    inset 0 1px 2px #fff9,
    0 1px 1px #24172d80;
  border-color: #8b627e;
  background: radial-gradient(ellipse at 35% 25%, #fff8ff, #e1abc8 38%, #a2618e 80%);
}

#home .desktop-window .desktop-titlebar > div > button:first-child {
  background: radial-gradient(ellipse at 35% 25%, #fffaff, #d1c0e8 38%, #8e79ad 80%);
  border-color: #897399;
}

#home .desktop-window.is-front {
  box-shadow:
    0 3px 3px #07020caa,
    0 13px 27px #08020c88,
    inset 0 0 0 1px #d1b5e080;
}

/* Menu bar and its buttons. */
#home .desktop-menu {
  display: flex;
  gap: 3px;
  padding: 5px;
  background: #2c2037;
  border-bottom: 1px solid #725b80;
}

#home .desktop-menu button {
  display: flex;
  gap: 5px;
  align-items: center;
  color: #f7e8fa;
  background: linear-gradient(#4b385b, #32243d);
  border: 1px solid;
  border-color: #8b729c #1d1426 #1d1426 #8b729c;
  border-radius: 3px;
  font:
    calc(10 * var(--px)) Tahoma,
    sans-serif;
  padding: 4px 8px;
  min-height: 25px;
}

#home .desktop-menu button:hover {
  background: #594268;
}

#home .desktop-menu button:active {
  border-style: inset;
  background: #2f203d;
}

/* Recordings list: cover thumbnails with a small badge, then title and duration. */
#home .desk-recordings {
  padding: 6px;
  gap: 6px;
  background: #21172c;
}

#home .desk-recordings > button {
  border: 1px solid #7b638e;
  background: #2e203b;
  color: #faedf8;
  box-shadow: inset 0 1px #a18aad44;
  border-radius: 3px;
  padding: 0;
  text-align: left;
}

#home .desk-recordings .desk-video-cover {
  display: block;
  position: relative;
  padding: 0;
  overflow: hidden;
  margin: 3px;
  background: #130d1b;
  border: 1px solid #16101f;
}

#home .desk-video-cover img {
  height: 104px;
  width: 100%;
  object-fit: cover;
}

#home .desk-video-cover i {
  display: grid;
  place-items: center;
  position: absolute;
  bottom: 5px;
  left: 5px;
  width: 22px;
  height: 18px;
  border: 1px solid #dbc4e6;
  border-radius: 3px;
  background: #241831c9;
  color: #fff3ff;
  font: 10px/1 Tahoma;
  font-style: normal;
  box-shadow: 0 2px 5px #09020c77;
}

#home .desk-recordings .desk-video-label {
  display: block;
  padding: 5px 7px 7px;
  white-space: normal;
  font:
    calc(11 * var(--px))/1.35 Tahoma,
    sans-serif;
  color: #f9edf9;
  background: none;
}

#home .desk-recordings .desk-video-label small {
  display: block;
  font:
    calc(9 * var(--px))/1.4 Tahoma,
    sans-serif;
  color: #cbb5d8;
  margin-top: 4px;
}

#home .desk-recordings > button:hover {
  border-color: #ebc4e8;
  background: #3d2b49;
}

/* Status bar, sky panel, contact strip and photo tools. */
#home .desktop-status {
  background: #2b1f35;
  border-top: 1px solid #735983;
  color: #cdb6d9;
  font:
    calc(10 * var(--px)) Tahoma,
    sans-serif;
  padding: 6px 8px;
}

#home #desk-view .desktop-sky {
  display: block;
  width: 100%;
  padding: 5px;
  border: 0;
  background: #21172c;
  color: #f7eaf8;
}

#home #desk-view .desktop-sky img {
  width: 100%;
  object-fit: cover;
  border: 1px solid #887194;
  box-shadow: 0 0 0 1px #150d1f;
}

#home #desk-view .desktop-sky span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font:
    calc(11 * var(--px)) Tahoma,
    sans-serif;
  margin: 7px 3px 3px;
}

/* Bigger text: the caption wraps instead of ending in an ellipsis (see --px in hyd-platform.css). */
@container not style(--px: 1px) {
  #home #desk-view .desktop-sky span {
    white-space: normal;
  }
}

.desktop-contact-strip {
  display: flex;
  gap: 5px;
  background: #21172c;
  padding: 3px 7px 7px;
}

.desktop-contact-strip button {
  padding: 2px;
  background: #30233d;
  border: 1px solid #867093;
  border-radius: 2px;
  box-shadow: inset 0 1px #dac3e52b;
  cursor: pointer;
  width: 47px;
  min-width: 0;
}

.desktop-contact-strip img {
  width: 100%;
  height: 30px;
  object-fit: cover;
  display: block;
}

.desktop-contact-strip button[aria-pressed='true'] {
  border-color: #fad7f1;
  background: #b680aa;
  box-shadow: 0 0 0 1px #f0c0dd;
}

.desktop-photo-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 5px 7px;
  background: #2b1f35;
  border-top: 1px solid #735983;
  color: #d7c2e2;
  font:
    calc(10 * var(--px)) Tahoma,
    sans-serif;
}

.desktop-photo-tools > span {
  min-width: 0;
  white-space: nowrap;
}

.desktop-photo-tools > div {
  display: flex;
  gap: 4px;
}

.desktop-photo-tools button {
  width: 28px;
  height: 25px;
  padding: 0;
  border: 1px solid;
  border-color: #c6acd8 #291937 #291937 #c6acd8;
  border-radius: 3px;
  background: linear-gradient(#735d86, #493451);
  color: #f9e9fb;
  box-shadow: inset 0 1px #ddc6ec55;
  font: 14px Tahoma;
  cursor: pointer;
}

.desktop-photo-tools button:active {
  border-style: inset;
  background: #382542;
}

/* Keyboard focus ring for every button inside a desktop window. */
#home .desktop-window button:focus-visible {
  outline: 2px solid #f2aed8;
  outline-offset: 1px;
}

/* Up to 620 px wide: smaller shuffle art, contact strip and photo tools. */
@media (max-width: 620px) {
  .visual-entry .recording-shuffle,
  .visual-entry .recording-shuffle svg {
    width: 106px;
    height: 92px;
    flex-basis: 92px;
  }

  .desktop-contact-strip img {
    height: 25px;
  }

  .desktop-photo-tools {
    font-size: calc(9 * var(--px));
  }

  .desktop-photo-tools button {
    width: 25px;
    height: 27px;
  }

  #home .desk-video-cover img {
    height: 104px;
  }
}

/* !important (here and in the three transition rules below): reduced motion and the .motion-off
   switch must win over the shuffle and folder-art transitions declared earlier in this file
   whatever specificity those rules have. */
@media (prefers-reduced-motion: reduce) {
  .recording-shuffle svg,
  .visual-entry .area-terminal .folder-art {
    transition: none !important;
  }
}

/* Same !important reason, for the page's motion switch (.motion-off on body). */
.motion-off .recording-shuffle svg,
.motion-off .visual-entry .area-terminal .folder-art {
  transition: none !important;
}

/* --- Information toolbar (#cinema .pixel-toolbar) ---
   Compact buttons for a recording's metadata: day glyph or icon, a label and a value, with a
   pressed state that sinks 1 px. */

/* The information toolbar is the existing metadata, made compact and actionable. */
#cinema .pixel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 20px 0 0 75px;
  padding: 5px;
  background: linear-gradient(#302337, #21172c);
  border: 1px solid;
  border-color: #826c91 #100b17 #100b17 #826c91;
  border-radius: 3px;
  box-shadow: inset 0 1px #dbbee11c;
  width: fit-content;
  max-width: calc(100% - 75px);
}

.pixel-toolbar > button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 51px;
  padding: 7px 11px;
  background: linear-gradient(#4b3b58, #2c2035);
  border: 1px solid;
  border-color: #9f85ae #170f20 #170f20 #9f85ae;
  border-radius: 2px;
  box-shadow: inset 0 1px #f2dcff1c;
  color: #fcf0ff;
  text-align: left;
  font:
    calc(12 * var(--px)) Tahoma,
    sans-serif;
  cursor: pointer;
}

.pixel-toolbar > button > span:not(.folder-art):not(.day-glyph) {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pixel-toolbar small {
  font:
    calc(10 * var(--px)) Tahoma,
    sans-serif;
  color: #dccbdf;
}

.pixel-toolbar b {
  font:
    bold calc(11 * var(--px))/1.35 Tahoma,
    sans-serif;
  color: #fff2ff;
}

#cinema .pixel-toolbar svg,
#cinema .pixel-toolbar .day-glyph {
  width: 29px;
  height: 29px;
  flex: none;
  grid-row: auto;
  grid-column: auto;
}

#cinema .pixel-toolbar .day-glyph {
  font: 27px/1 Tahoma;
  color: #f0c1dc;
  text-align: center;
  display: grid;
  place-items: center;
}

.pixel-toolbar .folder-art {
  width: 28px;
  height: 20px;
  min-width: 28px;
  margin: 3px 0 0;
  transform: none;
  box-shadow: 1px 2px #0007;
}

.pixel-toolbar .folder-art:before {
  width: 13px;
  height: 5px;
  top: -4px;
}

.pixel-toolbar > button:hover {
  background: linear-gradient(#60496d, #38253f);
  border-color: #d1b4de;
}

.pixel-toolbar > button:active {
  border-style: inset;
  translate: 0 1px;
  background: #2c1e36;
  box-shadow: inset 1px 2px 3px #0007;
}

.pixel-toolbar > button:focus-visible {
  outline: 2px solid #f9c5e7;
  outline-offset: 2px;
}

/* --- File-properties dialog (#recording-properties) ---
   Modal dialog opened from hyd-world.js: titlebar, scrolling content, file summary, key/value
   list and the action row. .kept-flight is styled here but nothing creates it. */

/* A familiar file-properties window; no extra metadata is invented. */
#recording-properties {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 3px;
  width: 400px;
  max-width: calc(100vw - 28px);
  max-height: calc(100dvh - 28px);
  overflow: hidden;
  background: linear-gradient(110deg, #d3dce2, #a5b0ba);
  color: #162330;
  border: 2px solid;
  border-color: #f4f8fb #47515b #47515b #f4f8fb;
  border-radius: 5px;
  box-shadow:
    4px 6px 0 #06020c70,
    0 18px 75px #0009;
  font:
    12px/1.5 Tahoma,
    sans-serif;
  rotate: 0deg;
  transform: none;
}

#recording-properties[open] {
  display: flex;
  flex-direction: column;
}

#recording-properties::backdrop {
  background: #0c071aaa;
  backdrop-filter: blur(2px);
}

.properties-titlebar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 5px 6px;
  color: #19232d;
  background:
    repeating-linear-gradient(0deg, #ffffff25 0 1px, transparent 1px 3px),
    linear-gradient(#e5ebf0, #abb6c1);
  border-bottom: 1px solid #81909d;
  font:
    11px Tahoma,
    sans-serif;
}

.properties-titlebar > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.properties-titlebar svg {
  width: 21px;
  height: 21px;
}

#recording-properties .dialog-close {
  position: static;
  inset: auto;
  border: 1px solid;
  border-color: #fff #536474 #536474 #fff;
  border-radius: 3px;
  background: linear-gradient(#f1f5f9, #9aabb9);
  color: #182a38;
  font: 17px/1 Tahoma;
  padding: 0;
  min-width: 28px;
  min-height: 27px;
  box-shadow: inset 0 1px #fff9;
}

#recording-properties .dialog-close:active {
  background: #9aaab7;
  border-style: inset;
}

#recording-properties button:focus-visible {
  outline: 2px solid #664779;
  outline-offset: 2px;
}

.properties-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  margin: 9px 7px;
  padding: 13px;
  background: #e5e9ed;
  border: 1px solid;
  border-color: #8493a0 #eef3f7 #eef3f7 #8493a0;
  border-radius: 2px;
}

.properties-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 13px;
  border-bottom: 1px solid #a5b0ba;
}

.properties-file img {
  width: 78px;
  height: 63px;
  object-fit: cover;
  border: 1px solid #506478;
  padding: 2px;
  background: #fff;
  flex: none;
}

#recording-properties h2 {
  font:
    bold 16px/1.25 Tahoma,
    sans-serif;
  margin: 0 0 6px;
  color: #162330;
  letter-spacing: 0;
}

#properties-duration {
  font: 11px Tahoma;
  color: #4d5c67;
}

.properties-list {
  margin: 9px 0;
}

.properties-list > div {
  display: grid;
  grid-template-columns: 91px 1fr;
  gap: 8px;
  padding: 7px 6px;
  border-bottom: 1px solid #c3cbd3;
}

.properties-list dt {
  color: #4b5660;
}

.properties-list dd {
  color: #152735;
  font-weight: bold;
  margin: 0;
  overflow-wrap: anywhere;
}

.properties-list > div.is-highlighted {
  background: #e1d1e8;
  box-shadow: inset 3px 0 #805191;
}

#properties-note {
  font:
    11px/1.55 Tahoma,
    sans-serif;
  color: #485766;
  margin: 12px 4px 0;
}

.properties-actions {
  flex: none;
  padding: 0 8px 8px;
  display: flex;
  justify-content: flex-end;
}

#recording-properties .properties-actions button {
  min-width: 82px;
  min-height: 29px;
  font-size: 12px;
}

.kept-flight {
  position: fixed;
  object-fit: cover;
  width: 48px;
  height: 39px;
  border: 2px solid #e9cae5;
  border-radius: 2px;
  box-shadow: 1px 3px 8px #0008;
  pointer-events: none;
  z-index: 2000;
}

/* Up to 1000 px wide: the toolbar drops its left indent. */
@media (max-width: 1000px) {
  #cinema .pixel-toolbar {
    margin-left: 0;
    max-width: 100%;
  }
}

/* Up to 620 px wide: toolbar buttons flex to fill each row; the toolbar and dialog content
   tighten. */
@media (max-width: 620px) {
  .pixel-toolbar > button {
    padding: 7px 9px;
    flex: 1 1 130px;
    min-width: 0;
  }

  .pixel-toolbar > button b {
    overflow-wrap: anywhere;
  }

  .pixel-toolbar > button:last-child {
    flex-grow: 0;
  }

  #cinema .pixel-toolbar {
    width: 100%;
    margin-top: 16px;
    box-sizing: border-box;
  }

  .properties-content {
    padding: 10px;
  }

  .properties-list > div {
    grid-template-columns: 79px 1fr;
  }

  .properties-file img {
    width: 65px;
    height: 57px;
  }
}

/* Reduced motion, again. !important has the same reason as above; .kept-flight is hidden
   outright. */
@media (prefers-reduced-motion: reduce) {
  .visual-entry .area-terminal .folder-art {
    transition: none !important;
  }

  .kept-flight {
    display: none;
  }
}

/* Motion switch, same !important reason. .city-shuffle matches nothing in the current HTML or
   scripts. */
.motion-off .city-shuffle *,
.motion-off .visual-entry .area-terminal .folder-art {
  transition: none !important;
}

/* Touch sizing: the dialog close button and the action buttons reach 44 px on phones and coarse
   pointers. */
@media (max-width: 620px), (any-pointer: coarse) {
  #recording-properties .properties-titlebar .dialog-close {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
  }

  #recording-properties .properties-actions button {
    min-height: 44px;
  }
}
