/* Browse screens: Home, Library, Search and a person's page. Sizes and
   words: docs/designs/lyra-web-screens.md, sections 3.3 to 3.5. The shared
   pieces (posters, rows, chips, menus) are in lyra.css. */

/* --- grounds --- */
/* Canvas with glow: the glow starts at the window's top, behind the tabs
   when they float there. */
.browse-glow { min-height: calc(100vh - var(--bar) - env(safe-area-inset-bottom)); }
@media (min-width: 600px) { .browse-glow { min-height: 100vh; margin-top: -68px; padding-top: 68px; } }
/* Plain canvas: what scrolls up fades out under the floating tabs. */
.top-fade { display: none; }
@media (min-width: 600px) { .top-fade { display: block; position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: 68px; background: linear-gradient(180deg, var(--canvas) 70%, rgba(17,12,21,0)); pointer-events: none; } }

/* --- Home --- */
.home > .page-inner { display: flex; flex-direction: column; gap: var(--home-gap); padding-bottom: 24px; }
.home-head { display: flex; align-items: center; gap: 12px; padding: 8px var(--margin) 0; }
.home-word { font-size: 26px; font-weight: 600; letter-spacing: -.4px; line-height: 34px; }
.home-blocks { display: flex; flex-direction: column; gap: var(--home-gap); }
.home-pad { padding: 0 var(--margin); }

/* a row's arrows: only under a mouse, only while it can go that way */
.shelf-track { position: relative; }
.row-arrow { display: none; position: absolute; z-index: 2; top: calc(4px + var(--poster-w, 124px) * .75); width: 40px; height: 40px; margin-top: -20px; place-items: center; border-radius: 50%; background: rgba(32,24,38,.92); border: 1px solid var(--line); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.4); opacity: 0; transition: opacity .15s ease-out, background .12s ease-out; }
.row-arrow.prev { left: 12px; } .row-arrow.next { right: 12px; }
.row-arrow:hover { background: rgba(52,41,60,.96); }
@media (hover: hover) and (pointer: fine) {
  .row-arrow.can { display: grid; }
  .shelf-track:hover .row-arrow.can { opacity: 1; }
}

/* Today's pick */
.pick-card { position: relative; height: 200px; border-radius: var(--r-card-xl); border: 1px solid var(--line); background: var(--plum-gradient); overflow: hidden; isolation: isolate; }
.pick-card .pic { position: absolute; inset: 0; }
.pick-card .pic.from-poster { inset: 0 0 auto 0; height: auto; margin-top: -28%; }
.pick-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(17,12,21,.94), rgba(17,12,21,.62) 45%, rgba(17,12,21,0) 80%); }
.pick-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.pick-link:focus-visible { outline-offset: -3px; border-radius: var(--r-card-xl); }
.pick-text { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; height: 100%; max-width: 266px; padding: 24px 18px 20px; pointer-events: none; }
.pick-name { font-size: 27px; font-weight: 600; letter-spacing: -.5px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-facts { max-width: 100%; font-size: 13px; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-play { display: inline-flex; align-items: center; gap: 7px; height: 40px; margin-top: auto; padding: 0 18px 0 15px; border-radius: 999px; background: #fff; color: #000; font-size: 15px; font-weight: 600; pointer-events: auto; transition: transform .12s ease-out, opacity .12s ease-out; }
.pick-play:active { transform: scale(.98); opacity: .85; }
@media (min-width: 600px) {
  .pick-card { height: 300px; max-width: 900px; }
  .pick-name { font-size: 34px; }
  .pick-text { max-width: 456px; }
}

/* without a connection */
.offline-home, .offline-body { display: flex; flex-direction: column; gap: 18px; }
.offline-banner { display: flex; align-items: center; gap: 12px; margin: 0 var(--margin); padding: 14px; border-radius: var(--r-card-lg); background: var(--field); border: 1px solid var(--line); }
.offline-banner > .icon { color: var(--accent); stroke-width: 2.1; }
.offline-words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.offline-words strong { font-size: 15px; font-weight: 600; }
.offline-words span { font-size: 13px; color: var(--secondary); }
.btn.offline-retry { flex: none; width: auto; min-width: 88px; min-height: 34px; padding: 0 8px; font-size: 13px; font-weight: 600; }
.offline-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); justify-items: center; gap: 20px 14px; padding: 0 var(--margin); --poster-w: 104px; }
/* "49% on this browser" is longer than the phone's words: it may take a second line */
.offline-grid .poster-sub { white-space: normal; }
.library .offline-home { margin: 0 calc(-1 * var(--margin)); }

/* --- Library --- */
.library { display: flex; flex-direction: column; gap: 16px; padding: 8px var(--margin) 24px; }
.lib-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.lib-body { display: flex; flex-direction: column; gap: 16px; }
.filter-btn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.10); color: #fff; transition: background .12s ease-out, color .15s ease-out; }
.filter-btn:hover { background: rgba(255,255,255,.16); }
.filter-btn .icon { stroke-width: 2.2; }
.filter-btn.on { color: var(--accent); }
@media (min-width: 600px) { .lib-picker { max-width: 400px; } }
.lib-note:empty { display: none; }
/* the count's "Clear" has a full-size press area that must not push the posters down */
.lib-count { display: flex; align-items: center; justify-content: space-between; height: 20px; font-size: 13px; font-weight: 500; color: var(--secondary); }
.lib-count button { min-width: 44px; min-height: 44px; text-align: right; color: var(--text); font-weight: 500; }
.lib-count button:hover, .lib-nomatch button:hover { text-decoration: underline; }
.lib-nomatch { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 40px; font-size: 15px; font-weight: 600; }
.lib-nomatch button { min-height: 44px; font-weight: 600; }

/* the letters down the right edge */
.letter-index-wrap { position: fixed; z-index: 40; top: 12px; bottom: calc(var(--bar) + env(safe-area-inset-bottom) + 12px); right: max(0px, calc((100vw - var(--content)) / 2)); width: 26px; display: flex; flex-direction: column; justify-content: center; pointer-events: none; }
@media (min-width: 600px) { .letter-index-wrap { top: 80px; bottom: 12px; } }
.letter-index { position: relative; display: flex; flex-direction: column; max-height: 100%; font-size: 11px; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.letter-index:focus-visible { outline-offset: -1px; }
.letter-index span { flex: 0 1 16px; min-height: 0; display: grid; place-items: center; font-weight: 700; line-height: 1; color: var(--secondary); }
.letter-index span.on { color: var(--accent); }
.letter-bubble { position: absolute; right: 40px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-gradient); color: var(--on-accent); font-size: 26px; font-weight: 700; box-shadow: 0 4px 10px rgba(0,0,0,.35); pointer-events: none; }

/* --- Search --- */
.search { padding: 8px 0 24px; }
.search-head { display: flex; flex-direction: column; gap: 12px; padding: 0 var(--margin); }
.search-field { display: flex; align-items: center; height: 44px; border-radius: var(--r-field); background: var(--field); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s ease-out; }
.search-field:focus-within { box-shadow: inset 0 0 0 1.5px rgba(255,176,138,.85), 0 0 0 4px rgba(255,176,138,.10); }
.search-field > .icon { margin-left: 13px; color: var(--tertiary); }
.search-input { flex: 1; min-width: 0; height: 100%; padding: 0 10px; border: 0; background: none; font-size: 16px; -webkit-appearance: none; appearance: none; }
.search-input:focus, .search-input:focus-visible { outline: none; }
.search-input::placeholder { color: var(--tertiary); }
.search-input::-webkit-search-cancel-button, .search-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.search-clear { display: grid; place-items: center; width: 42px; height: 100%; color: var(--tertiary); }
.search-clear:hover { color: var(--secondary); }
.search-body { padding-top: 14px; }
.search-browse { padding: 8px 0; }
.search-label { padding: 0 var(--margin); }
.search-pad { padding: 8px var(--margin); }

.recent-clear { font-size: 15px; font-weight: 500; color: var(--accent); }
.recent-clear:hover { text-decoration: underline; }
.recent-list { padding: 6px 8px 18px var(--margin); }
.recent-row { display: flex; align-items: center; }
.recent-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 6px 0; border-radius: 8px; }
.recent-x { display: grid; place-items: center; flex: none; width: 44px; height: 44px; color: var(--tertiary); }
.recent-x .icon { stroke-width: 2.2; }
.recent-x:hover { color: var(--text); }

.search-shelf { padding-bottom: 26px; --poster-w: 104px; }
.search-shelf .h-scroll { gap: 10px; }
.search-chips { padding: 8px var(--margin) 0; }
.search-rows { display: flex; flex-direction: column; gap: 10px; padding: 8px var(--margin); }
.search-rows.genre { padding: 14px var(--margin) 0; }
.search-rows .search-label { padding: 0; }
.search-rows .search-label.first { margin-top: 4px; }
.search-rows .search-label.second { margin-top: 16px; }
.search-none { padding-top: 24px; font-size: 14px; color: var(--secondary); text-align: center; }
.search-row { display: flex; align-items: center; gap: 14px; }
.search-row.card { padding: 10px; transition: background .12s ease-out; }
.search-row.card:hover { background: var(--field-hover); }
.search-row.found { padding: 6px 10px 6px 0; border-radius: 10px; }
.search-row.found .row-name { color: rgba(255,255,255,.864); }
.search-row > .icon { color: var(--tertiary); stroke-width: 2.2; }
.search-row .status-line { margin-top: 3px; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.row-name { max-width: 100%; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--secondary); min-height: 18px; }
/* a small poster in a list: the plum ground and the mark when there is no picture */
.thumb { position: relative; display: grid; place-items: center; flex: none; overflow: hidden; background: var(--plum-gradient); }
.thumb.s34 { width: 34px; height: 51px; border-radius: 5px; }
.thumb.s44 { width: 44px; height: 66px; border-radius: var(--r-thumb); }
.thumb .pic { position: absolute; inset: 0; }
.thumb .mark { opacity: .2; filter: grayscale(1) brightness(3); }
/* wide: the field and the rows keep to a readable width; the shelf and chips use the page */
@media (min-width: 600px) {
  .search-head .search-field, .search-rows, .recent-list, .search-label.label-row { max-width: calc(900px + 2 * var(--margin)); }
  .search-head .search-field { max-width: 900px; }
}

/* --- a person's page --- */
.person-body { display: flex; flex-direction: column; gap: 22px; padding: 0 var(--margin) 30px; }
.person-head { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 8px; text-align: center; }
.person-photo { position: relative; display: grid; place-items: center; width: 116px; height: 116px; border-radius: 50%; overflow: hidden; background: var(--plum-gradient); border: 1px solid var(--line); color: var(--accent); font-size: 39px; font-weight: 600; }
.person-photo .pic { position: absolute; inset: 0; }
.person-name { font-size: 24px; font-weight: 700; line-height: 1.2; }
.person-count { font-size: 14px; color: var(--secondary); }
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); justify-items: center; gap: 18px 14px; --poster-w: 104px; }
.person-wait { display: grid; place-items: center; padding-top: 38px; }
/* inside a title's card on a narrow window: the tabs are covered */
@media (max-width: 599px) { body.cover-person .tabs { display: none; } body.cover-person .page { padding-bottom: 0; } body.cover-person .browse-glow { min-height: 100vh; } }
