/* library page (v7): "everything" on the left, the five kinds as columns on the right; the chosen one opens its
   sub-categories underneath. The find row (search, shuffle, random, grid, index) stays as in v6. */
.libbar7 { gap: 10px; padding-block: 14px 12px; }
.lib7__sentinel { display: block; height: 0; }
.lib7__cats { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: 32px; }
.lib7__five { display: grid; grid-template-columns: repeat(5, auto); justify-content: end; column-gap: clamp(22px, 3.6vw, 64px); }
.lib7__col { position: relative; display: grid; justify-items: start; align-content: start; }
.lib7__h { font-family: var(--f-display); font-size: 20px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--stone); padding-block: 4px; transition: color 0.2s; white-space: nowrap; }
.lib7__h:hover { color: var(--bone); }
.lib7__h[aria-pressed="true"] { color: var(--bone); text-shadow: -1px 0 var(--flower), 1px 0 var(--violet); }
.lib7__h sup, .lib7__subs sup { font-size: 11px; margin-left: 3px; color: var(--stone); opacity: 0.7; }
.lib7__subs { display: none; }
.lib7__col.open .lib7__subs { display: grid; justify-items: start; gap: 0; padding: 2px 0 2px 1px; animation: lib7in 0.28s ease-out; }
.lib7__subs button { font-family: var(--f-display); font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stone); padding-block: 3px; white-space: nowrap; transition: color 0.2s; }
.lib7__subs button:hover, .lib7__subs button[aria-pressed="true"] { color: var(--bone); }
.lib7__subs button[aria-pressed="true"] { text-shadow: -1px 0 var(--flower), 1px 0 var(--violet); }
@keyframes lib7in { from { opacity: 0; transform: translateY(-4px); } }

.lib7__find { justify-content: space-between; gap: 10px 24px; flex-wrap: nowrap; }
.lib7__find input { flex: 1 1 auto; width: auto; max-width: 460px; min-width: 0; border-bottom-color: rgba(236, 228, 212, 0.18); }
.lib7__find input:focus { outline: none; border-bottom-color: rgba(236, 228, 212, 0.5); }
.libtools__r { display: flex; gap: 6px 22px; align-items: baseline; flex-wrap: wrap; justify-content: flex-end; }
.libtools__r button { padding-block: 4px; }
.libtools__r [data-lview="grid"] { margin-left: 10px; }

/* scrolled down: the open column folds up so the bar stays slim; it opens again on hover or focus */
.libbar7.is-stuck .lib7__col.open .lib7__subs { display: none; }
@media (min-width: 761px) {
  .libbar7.is-stuck .lib7__col.open:hover .lib7__subs, .libbar7.is-stuck .lib7__col.open:focus-within .lib7__subs { display: grid; position: absolute; top: 100%; left: -14px; z-index: 2; padding: 6px 14px 10px; background: rgba(11, 10, 9, 0.94); }
}

/* between tablet and small laptop the five columns sit under "everything" */
@media (max-width: 1100px) and (min-width: 761px) {
  .lib7__cats { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
  .lib7__five { justify-content: space-between; }
}

/* phone: the kinds wrap over one or two lines, the open one's sub-categories follow on the next line */
@media (max-width: 760px) {
  .libbar7 { gap: 4px; padding-block: 8px; }
  .lib7__cats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 16px; }
  .lib7__five, .lib7__col { display: contents; }
  .lib7__h { order: 1; font-size: 17px; min-height: 36px; }
  .lib7__col.open .lib7__subs { order: 2; flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 0 16px; padding: 0 0 4px; }
  .lib7__subs button { font-size: 14px; min-height: 34px; }
  .lib7__find { flex-wrap: wrap; gap: 0 16px; }
  .lib7__find input { flex: 1 1 100%; max-width: none; font-size: 16px; min-height: 36px; }
  .libtools__r { justify-content: space-between; width: 100%; gap: 0 14px; }
  .libtools__r button { min-height: 36px; font-size: 14px; }
  .libtools__r [data-lview="grid"] { margin-left: auto; }
}
