/* Copyright Ayers Electronics Inc. All rights reserved. */
/* Arrange My Rows: the panel drawn beside the On Demand rows (js/settings-arrange.js). While it is
   open the card widens by a third column so the rows and the panel read at once. Spacing inside the
   panel is margins, never flex gap, which the television WebViews' floor drops. */
.settings-card.arranging {
  max-width: 1180px;
}
.settings-card.arranging .settings-split {
  grid-template-columns: 220px minmax(0, 1fr) minmax(240px, 300px);
}
.settings-arrange {
  align-self: start;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel);
}
.settings-arrange-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 2px 4px;
}
.settings-arrange-title {
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.settings-arrange-close {
  margin-left: 12px;
  padding: 2px 4px;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--type-micro);
  color: var(--muted);
  cursor: pointer;
}
.settings-arrange-rows {
  display: flex;
  flex-direction: column;
}
.settings-arrange > * + *,
.settings-arrange-rows > * + * {
  margin-top: 6px;
}
/* One rail: the grip and the name are the pick-up control, the switch sits at the right. */
.settings-arrange-row {
  display: flex;
  align-items: center;
  min-height: var(--control-min-height);
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--elevated);
  color: var(--text);
}
.settings-arrange-pick {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  padding: 6px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: var(--type-label);
  text-align: left;
  cursor: pointer;
}
.settings-arrange-pick .pl-grip {
  flex: 0 0 12px;
  margin-right: 10px;
}
/* The row the ring is on wears the accent, the ring (base.css) white against it; a held row lifts on the
   accent edge instead, the gap under it showing where it will drop. */
.settings-arrange-row:focus-within:not(.held) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.settings-arrange-row:focus-within:not(.held) .pl-grip i {
  background: var(--on-accent);
}
.settings-arrange-row.held {
  border-color: var(--accent);
}
.settings-arrange-row.fixed .settings-arrange-pick {
  cursor: default;
}
/* The switch: a pill with its knob at the right while the rail shows, at the left while it is
   turned off. */
.settings-arrange-switch {
  position: relative;
  flex: 0 0 auto;
  margin-left: 8px;
  width: 30px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--track);
  cursor: pointer;
}
.settings-arrange-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-round);
  background: var(--muted);
}
.settings-arrange-switch.on {
  border-color: var(--accent);
  background: var(--accent);
}
.settings-arrange-switch.on::after {
  left: auto;
  right: 2px;
  background: var(--on-accent);
}
.settings-arrange-row:focus-within:not(.held) .settings-arrange-switch {
  border-color: var(--on-accent);
}
.settings-arrange-switch:disabled {
  cursor: default;
}
.settings-arrange-hint {
  margin: 4px 2px 0;
  font-size: var(--type-micro);
  line-height: 1.35;
  color: var(--muted);
}
/* The Genres row's Pick stop, between its name and its switch: a small outlined word. */
.settings-arrange-list {
  flex: 0 0 auto;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: none;
  color: inherit;
  font: inherit;
  font-size: var(--type-micro);
  cursor: pointer;
}
.settings-arrange-row:focus-within:not(.held) .settings-arrange-list {
  border-color: var(--on-accent);
}
/* A genre in the genre list: its name, then its switch at the right. */
.settings-arrange-name {
  flex: 1 1 auto;
  padding: 6px 0;
  overflow: hidden;
  font-size: var(--type-label);
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Opened from On Demand's Arrange tile: the panel stands over the page at its right, under the page
   tabs, above the rails, and its rows scroll inside it when they outgrow the screen. */
.settings-arrange.over-page {
  position: fixed;
  top: 64px;
  right: 24px;
  bottom: 24px;
  z-index: 3;
  width: 300px;
}
.settings-arrange.over-page .settings-arrange-rows {
  flex: 1 1 auto;
  overflow-y: auto;
}
/* A phone's width: the panel stands under the rows rather than beside them. */
@media (max-width: 767px) {
  .settings-card.arranging .settings-split {
    grid-template-columns: minmax(0, 1fr);
  }
}
