/* Tenner Browse: a large title, a capsule of collections, filters in grouped panels (a sheet on phones),
   and a poster grid where every poster is shown whole. Built on the tokens and shell in styles.css. */

.bwrap { max-width: 1240px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }

/* ---------- header ---------- */
.b-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 8px; }
.b-head .large-title { margin: 10px 0 6px; font-size: clamp(30px, 3.6vw, 40px); }
/* Shows | Films uses the shared segmented control in styles.css */

/* ---------- collections (the same frosted bar and gliding tile as the service bar) ---------- */
.coll {
  position: relative; margin-top: 18px; padding: 3px; border-radius: var(--r-ctl); overflow: hidden; display: flex; max-width: 100%; width: max-content;
  background: var(--frost); -webkit-backdrop-filter: var(--frost-blur); backdrop-filter: var(--frost-blur); box-shadow: var(--frost-line);
}
.coll-track { --fl: 28px; --fr: 28px; position: relative; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-radius: var(--r-in); min-width: 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent); transition: --fl .35s ease, --fr .35s ease; }
.coll.at-start .coll-track { --fl: 0px; }
.coll.at-end .coll-track { --fr: 0px; }
.coll-track::-webkit-scrollbar { display: none; }
.coll-ind { position: absolute; z-index: 0; left: 0; top: 0; bottom: 0; width: 0; border-radius: var(--r-in); pointer-events: none;
  background: var(--frost-on); box-shadow: inset 0 0 0 .5px var(--frost-edge); }
.coll-b {
  position: relative; z-index: 1; flex: none; height: 30px; padding: 0 13px; border: 0; border-radius: var(--r-in); background: none; cursor: pointer;
  font: 600 14px/1 var(--font); letter-spacing: -.01em; color: var(--label2); white-space: nowrap;
  transition: color .25s ease, transform .4s var(--ease-spring);
}
.coll-b[aria-checked="true"] { color: var(--label); }
@media (hover: hover) { .coll-b[aria-checked="false"]:hover { color: var(--label); } }
.coll-b:active { transform: scale(.95); }
.coll-b:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- body: filters + results ---------- */
.b-body { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 28px; margin-top: 24px; align-items: start; }
.filters { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 76px); display: grid; gap: 12px; max-height: calc(100dvh - 96px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 8px; }
.filters::-webkit-scrollbar { display: none; }
.sheet-head { display: none; }
.panel { border-radius: 20px; padding: 14px 14px 16px;   /* frosted glass, like the switch and the service bar */
  background: var(--frost); box-shadow: var(--frost-line); -webkit-backdrop-filter: var(--frost-blur); backdrop-filter: var(--frost-blur); }
.panel h3 { display: flex; justify-content: space-between; align-items: baseline; margin: 2px 4px 10px; font: 600 13px/1.2 var(--font); color: var(--label2); letter-spacing: -.01em; }
.panel h3 output { color: var(--label); font-weight: 600; font-variant-numeric: tabular-nums; }

/* where to watch: app icons that light up when chosen */
.where { display: grid; gap: 4px; }
.w-b {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 6px 8px; border: 0; border-radius: 12px; background: none; cursor: pointer;
  color: var(--label); font: 500 15px/1.2 var(--font); text-align: left; transition: background-color .2s ease;
}
.w-b::after { content: ""; margin-left: auto; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--label3); transition: box-shadow .25s var(--ease-spring); }
.w-b[aria-pressed="true"]::after { box-shadow: inset 0 0 0 6px var(--accent); }
@media (hover: hover) { .w-b:hover { background: var(--fill); } }
.w-ic { width: 30px; height: 30px; flex: none; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--fill-strong); font-weight: 700; box-shadow: 0 0 0 .5px var(--sep); }
.w-ic img { width: 100%; height: 100%; object-fit: cover; }

/* sort: a Settings-style list with a tick */
.sort { display: grid; }
.s-b {
  display: flex; align-items: center; justify-content: space-between; width: 100%; height: 40px; padding: 0 8px; border: 0; border-radius: 10px; background: none;
  color: var(--label); font: 500 15px/1 var(--font); cursor: pointer; text-align: left;
}
.s-b i { width: 14px; height: 8px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg) scale(.6); opacity: 0; transition: opacity .2s ease, transform .35s var(--ease-spring); margin-top: -4px; }
.s-b[aria-checked="true"] { color: var(--accent); font-weight: 600; }
.s-b[aria-checked="true"] i { opacity: 1; transform: rotate(-45deg) scale(1); }
@media (hover: hover) { .s-b:hover { background: var(--fill); } }

/* genres: pills */
.genres { display: flex; flex-wrap: wrap; gap: 6px; }
.g-b {
  height: 30px; padding: 0 11px; border: 0; border-radius: 8px; cursor: pointer; color: var(--label);
  background: var(--frost); box-shadow: var(--frost-line);
  font: 500 14px/1 var(--font); transition: background-color .2s ease, color .2s ease, transform .35s var(--ease-spring);
}
.g-b[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: none; }
.g-b:active { transform: scale(.94); }

/* rating: a slider with a rainbow track up to the thumb */
#rating { --fill: 0%; width: 100%; height: 28px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
#rating::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #ff375f, #ff9f0a, #ffd60a, #30d158) 0 0 / var(--fill) 100% no-repeat, var(--fill-strong); }
#rating::-moz-range-track { height: 6px; border-radius: 3px; background: var(--fill-strong); }
#rating::-moz-range-progress { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #ff375f, #ff9f0a, #ffd60a, #30d158); }
#rating::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .3), 0 0 0 .5px rgba(0, 0, 0, .06); }
#rating::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
#rating:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.scale { display: flex; justify-content: space-between; margin: 4px 2px 0; font-size: 12px; letter-spacing: -.01em; color: var(--label3); font-variant-numeric: tabular-nums; }
.clear { width: 100%; height: 44px; }
.clear:disabled { opacity: .45; pointer-events: none; }

/* ---------- results ---------- */
.r-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 16px; min-height: 36px; }
.count { margin: 0; font: 600 17px/1.2 var(--font); color: var(--label2); font-variant-numeric: tabular-nums; }
.f-btn { display: none; }
.r-bar:has(.count:empty) { min-height: 0; margin-bottom: 0; }   /* no count until there's a search to count */
.b-ctl { display: flex; align-items: center; gap: 10px; }   /* Shows | Films | Both, and Filters beside it on phones */
.f-btn svg { width: 18px; height: 18px; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 26px 18px; }
.tile { animation: tileIn .6s var(--ease-out) both; animation-delay: calc(min(var(--d), 16) * 22ms); }
@keyframes tileIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.tile a { display: grid; gap: 4px; color: inherit; text-decoration: none; }
.art { position: relative; display: block; border-radius: 12px; overflow: hidden; background: var(--fill);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .1), 0 6px 18px -8px rgba(0, 0, 0, .3); transition: translate .35s var(--ease-out); }
:root[data-theme="dark"] .art { box-shadow: 0 0 0 .5px rgba(255, 255, 255, .12), 0 6px 18px -8px rgba(0, 0, 0, .55); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .art { box-shadow: 0 0 0 .5px rgba(255, 255, 255, .12), 0 6px 18px -8px rgba(0, 0, 0, .55); } }
.art img, .art .ph { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: contain; }
.art .ph { display: grid; align-content: end; padding: 14px; color: #fff; font: 700 18px/1.08 var(--font-display); letter-spacing: -.02em; text-wrap: balance; }
@media (hover: hover) { .tile a:hover .art { translate: 0 -3px; } .tile a:hover .t { color: var(--accent); } }   /* the poster lifts a touch, nothing more */
.tile a:focus-visible { outline: none; }
.tile a:focus-visible .art { outline: 3px solid var(--accent); outline-offset: 3px; }
/* the score: a small glass disc on the poster's corner */
.score {
  position: absolute; right: 8px; top: 8px; display: grid; place-items: center; min-width: 38px; height: 24px; padding: 0 7px; border-radius: 8px;
  background: rgba(20, 20, 24, .62); -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .22); color: #fff; font: 700 13px/1 var(--font); font-variant-numeric: tabular-nums; grid-auto-flow: column;
}
.score::before { content: "★"; margin-right: 3px; color: #ffd60a; font-size: 11px; }
.t { margin-top: 8px; font: 600 16px/1.25 var(--font); letter-spacing: -.022em; color: var(--label); transition: color .2s ease;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--label2); font-size: 14px; letter-spacing: -.01em; white-space: nowrap; }
.on { display: inline-flex; flex: none; }
.on img { width: 20px; height: 20px; border-radius: 5px; box-shadow: 0 0 0 1.5px var(--bg); }
.on img + img { margin-left: -5px; }
.buy { flex: none; font-size: 12px; font-weight: 600; color: var(--accent); }
.none { grid-column: 1 / -1; text-align: center; padding: 56px 20px; border-radius: 24px; background: var(--bg2); }
.sheet-head h2 { margin: 0; font: 700 24px/1.15 var(--font-display); letter-spacing: .004em; }
.none h2 { margin: 0 0 6px; font: 700 24px/1.15 var(--font-display); letter-spacing: .004em; }
.none p { margin: 0 0 16px; color: var(--label2); }
.more { height: 1px; }
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .4); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- tablets: filters in a narrower column ---------- */
@media (max-width: 1040px) { .b-body { grid-template-columns: 236px minmax(0, 1fr); gap: 22px; } }

/* ---------- phones and small tablets: filters become a sheet from the bottom ---------- */
@media (max-width: 820px) {
  .b-body { grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
  .f-btn { display: inline-flex; height: 36px; }
  .filters {
    position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; top: auto; max-height: min(82dvh, 720px); overflow-y: auto;
    padding: 8px max(16px, env(safe-area-inset-left, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px));
    border-radius: 28px 28px 0 0;
    /* the sheet itself is the glass (the page shows through it, blurred); its cards are a lighter frost on top */
    background: var(--sheet-bg); -webkit-backdrop-filter: var(--sheet-blur); backdrop-filter: var(--sheet-blur);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, .35), inset 0 .5px 0 var(--frost-edge);
    transform: translateY(105%); visibility: hidden;
    transition: transform .5s var(--ease-spring), visibility 0s linear .5s;
  }
  .filters.open { transform: none; visibility: visible; transition: transform .5s var(--ease-spring), visibility 0s; }
  .filters::before { content: ""; display: block; width: 38px; height: 5px; margin: 2px auto 6px; border-radius: 3px; background: var(--label3); }
  .filters .panel { -webkit-backdrop-filter: none; backdrop-filter: none; }   /* the sheet already blurs */
  .sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 4px; }
  .sheet-head .btn { color: var(--accent); }
  .sheet-open .tabbar { opacity: 0; pointer-events: none; transform: translateY(16px); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 22px 14px; }
  .coll { margin-top: 18px; width: auto; }
  .b-ctl { width: 100%; justify-content: space-between; }
  .b-ctl .f-btn { height: 36px; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-head { align-items: flex-start; }
  .t { font-size: 15px; }
  .m { font-size: 13px; }
}
.b-head .lede { font-size: 16px; }

/* ---------- search ---------- */
.search { position: relative; display: flex; align-items: center; max-width: 560px; margin-top: 20px; }
.search input {
  width: 100%; height: 42px; padding: 0 40px 0 42px; border: 0; border-radius: var(--r-ctl); background: var(--fill);
  color: var(--label); font: 400 16px/1 var(--font); letter-spacing: -.01em; -webkit-appearance: none; appearance: none;
  transition: background-color .2s ease, box-shadow .25s ease;
}
.search input::placeholder { color: var(--label2); }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: none; background: var(--bg2); box-shadow: 0 0 0 2px var(--accent); }
.s-ic { position: absolute; left: 13px; width: 19px; height: 19px; color: var(--label2); pointer-events: none; }
.s-key { position: absolute; right: 12px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font: 600 12px/1 var(--font); color: var(--label2); box-shadow: inset 0 0 0 1px var(--sep); pointer-events: none; }
.search input:focus ~ .s-key, .search input:not(:placeholder-shown) ~ .s-key { display: none; }
@media (hover: none) { .s-key { display: none; } }
.s-clear { position: absolute; right: 8px; width: 28px; height: 28px; padding: 5px; border: 0; background: none; color: var(--label3); cursor: pointer; border-radius: 50%; }
.s-clear svg { width: 18px; height: 18px; }
.s-clear:hover { color: var(--label2); }
/* while searching, the collections and Shows | Films step back, and each result says what it is */
.kind-l { display: none; font-size: 12px; font-weight: 600; color: var(--accent); margin-top: -2px; }
.mixed .kind-l { display: block; }   /* searching, or Both: each tile says whether it's a show or a film */
.searching .coll, .searching .b-head .segmented { opacity: .4; pointer-events: none; filter: saturate(.5); }
.coll, .b-head .segmented { transition: opacity .25s ease, filter .25s ease; }
@media (max-width: 820px) { .search { max-width: none; margin-top: 16px; } }

/* Apple's tracking for small control text, and the page's place beside the sidebar on computers */
.coll-b, .g-b, .s-b, .w-b, .count { letter-spacing: -.016em; }
@media (min-width: 1000px) {
  .bwrap { padding-top: 22px; }
  .browse .filters { top: 24px; max-height: calc(100dvh - 48px); }
}

/* with a mouse or trackpad: the macOS way (see styles.css) — shade, not size */
@media (hover: hover) and (pointer: fine) {
  .coll-b:active, .g-b:active { transform: none; }
  .coll-b[aria-checked="false"]:hover { background: var(--fill); }
  .coll-b[aria-checked="false"]:active, .w-b:active, .s-b:active { background: var(--fill-strong); }
  .g-b:active { filter: var(--press); }
  .coll-b, .g-b, .w-b, .s-b { transition-duration: .1s; }
}

/* ---------- hover preview (computers): a popover beside the poster with the title's details ---------- */
.pv {
  position: fixed; z-index: 70; width: 340px; border-radius: 14px; overflow: hidden; pointer-events: none;
  background: color-mix(in srgb, var(--card) 92%, transparent); -webkit-backdrop-filter: blur(30px) saturate(190%); backdrop-filter: blur(30px) saturate(190%);
  box-shadow: inset 0 0 0 .5px var(--frost-edge), 0 24px 60px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .12);
  opacity: 0; scale: .96; transition: opacity .16s ease, scale .2s var(--ease-out);
}
.pv.in { opacity: 1; scale: 1; }
:root[data-theme="dark"] .pv { background: rgba(36, 36, 40, .9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pv { background: rgba(36, 36, 40, .9); } }
.pv-art { position: relative; aspect-ratio: 16 / 9; background: var(--fill); overflow: hidden; }
.pv-art img, .pv-art .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-art img.soft { filter: blur(18px) saturate(1.3); scale: 1.25; }   /* no wide artwork: the poster, softened, as a backdrop */
.pv-art::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, color-mix(in srgb, var(--card) 35%, transparent)); }
.pv-body { padding: 14px 16px 14px; }
.pv h3 { margin: 0; font: 700 19px/1.2 var(--font-display); letter-spacing: -.01em; text-wrap: balance; }
.pv-meta { margin: 4px 0 0; font-size: 13px; color: var(--label2); font-variant-numeric: tabular-nums; }
.pv-genres { margin: 2px 0 0; font-size: 13px; color: var(--label2); }
.pv-ov { margin: 10px 0 0; font-size: 14px; line-height: 1.45; color: var(--label); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.pv-wait { display: block; height: 10px; margin: 6px 0; border-radius: 5px; background: var(--fill); }
.pv-wait.short { width: 60%; }
.pv-where { margin-top: 12px; padding-top: 10px; border-top: .5px solid var(--sep); }
.pv-l { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--label2); }
.pv-where > div { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-svc { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 4px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  background: var(--frost); box-shadow: var(--frost-line); }
.pv-svc img { width: 18px; height: 18px; border-radius: 5px; }
.pv-svc.buy { padding-left: 9px; color: var(--accent); }
.pv-hint { margin: 10px 0 0; font-size: 12px; color: var(--label3); }
@media (prefers-reduced-transparency: reduce) { .pv { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--card); } }

/* searching everything: TMDB's results under this hour's catalogue */
.web { margin-top: 40px; }
.web-hd { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; padding-top: 22px; border-top: .5px solid var(--sep); }
.web-hd h2 { margin: 0; font: 700 22px/1.2 var(--font-display); letter-spacing: .004em; }
.web-hd .count { margin: 0; }
.web.solo { margin-top: 0; }
.web.solo .web-hd { border-top: 0; padding-top: 0; }
/* "My services": choose the ones you pay for (they become Browse's starting filter) */
.mine-link { border: 0; padding: 6px 4px; margin: -6px -4px; background: none; color: var(--accent); font: 500 13px/1.2 var(--font); letter-spacing: -.01em; cursor: pointer; }
@media (hover: hover) { .mine-link:hover { text-decoration: underline; } }
.b-people { color: var(--accent); font-weight: 500; text-decoration: none; white-space: nowrap; }
.b-people::after { content: " ›"; }
@media (hover: hover) { .b-people:hover { text-decoration: underline; } }
