/* Find a programme page. Loads after styles.css and uses its tokens. */

/* Search panel: the page's main element */
.pf-hero { padding-block: clamp(14px, 2.5vw, 28px) 0; }
.pf-panel { padding: clamp(22px, 5vw, 56px) clamp(16px, 4.5vw, 52px); background: var(--ink); color: #fff; border-radius: var(--r-sheet); }
.pf-panel h1 { margin-bottom: 10px; font-size: clamp(2rem, 4.6vw, 3.5rem); }
.pf-lead { margin: 0 0 clamp(20px, 3vw, 32px); color: var(--band-muted); font-size: 1.1rem; max-width: 40em; }
.pf-panel :focus-visible { outline-color: var(--hi); }

.pf-search { position: relative; color: var(--ink); }
.pf-search svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pf-search > svg { position: absolute; left: 22px; top: 50%; translate: 0 -50%; pointer-events: none; }
.pf-search input { width: 100%; height: 68px; padding: 0 60px 0 60px; border: 0; border-radius: 999px; background: var(--sheet); font-size: 1.25rem; font-weight: 500; text-overflow: ellipsis; transition: box-shadow .15s; appearance: none; }
.pf-search input::placeholder { color: var(--muted); }
.pf-search input::-webkit-search-cancel-button { display: none; }
.pf-search input:focus { outline: none; box-shadow: 0 0 0 4px var(--hi); }
.pf-clear { position: absolute; right: 12px; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--sunk); cursor: pointer; }
.pf-clear[hidden] { display: none; }
.pf-clear svg { width: 18px; height: 18px; }
.pf-search .pf-clear:focus-visible { outline-color: var(--pen); }

.pf-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 18px; }
.pf-filters .chips { gap: 8px; }
.pf-filters .chip { justify-content: center; padding: 0 18px; border: 1px solid rgba(255, 255, 255, .34); color: #fff; }
.pf-filters .chip::before, .prog-empty .chip::before { content: none; }
.pf-filters .chip:hover { background: rgba(255, 255, 255, .12); }
.pf-filters .chip[aria-pressed="true"] { background: var(--hi); border-color: var(--hi); color: var(--ink); }
.pf-city select { min-height: 44px; min-width: 190px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .34); background: var(--ink); color: #fff; font-weight: 600; font-size: .95rem; cursor: pointer; }

/* Results */
.pf { padding-bottom: var(--section); }
.pf-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 24px; margin: 14px 0; }
[data-count] { margin: 0 auto 0 0; font-weight: 700; font-size: 1.1rem; }
.pf-sort { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: .95rem; }
.pf-sort[hidden] { display: none; }
.pf-sort select { min-height: 44px; padding: 0 14px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--sheet); font-size: .95rem; cursor: pointer; }
.pf-help summary { min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; font-weight: 650; color: var(--pen); }
.pf-help[open] { flex-basis: 100%; }
.pf-help p { max-width: 62em; margin: 0 0 .7em; color: var(--muted); font-size: .95rem; }
.pf-help b { color: var(--ink); }

.prog-list { display: grid; gap: 14px; }
.prog { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "photo" "who" "main" "more"; gap: 16px 28px; padding: 16px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-sheet); }
.prog__photo { grid-area: photo; align-self: start; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); background: var(--sunk); }
.prog__who { grid-area: who; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.prog h3 { margin-bottom: 4px; font-size: 1.3rem; }
.prog__sub { margin: 0; font-weight: 600; font-size: .95rem; line-height: 1.4; }
.prog__len { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.prog__book { margin-top: auto; }
.prog__who > p:last-of-type { margin-bottom: 14px; }
.prog__main { grid-area: main; min-width: 0; align-self: center; }

.metrics { display: grid; margin: 0; }
.metric { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--rule); }
.metric dt { color: var(--muted); font-weight: 650; font-size: .88rem; line-height: 1.3; }
.metric dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.metric__pair { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; column-gap: 7px; }
.metric__was, .metric__to { color: var(--muted); font-size: 1rem; }
.metric b { font: 800 1.9rem/1.1 var(--font); font-stretch: 75%; }
.metric b .np { font-stretch: 100%; }
.metric__diff { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.np { font: 400 .82rem/1.3 var(--font); color: var(--muted); }

.degree p { margin: 0; }
.degree__head { color: var(--muted); font-weight: 650; font-size: .88rem; }
.degree ul { margin: 4px 0 10px; padding: 0; list-style: none; font-weight: 600; line-height: 1.45; }
.degree__np { padding-top: 10px; border-top: 1px solid var(--rule); color: var(--muted); font-size: .88rem; }
.degree__np b { color: var(--ink); font-weight: 650; }

.prog__more { grid-area: more; border-top: 1px solid var(--rule); margin-bottom: -8px; }
.prog__more summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding-top: 6px; cursor: pointer; font-weight: 650; color: var(--pen); list-style: none; }
.prog__more summary::-webkit-details-marker { display: none; }
.prog__more summary::after { content: ""; flex-shrink: 0; width: 8px; height: 8px; margin-right: 6px; border: solid currentColor; border-width: 0 2px 2px 0; rotate: 45deg; }
.prog__more[open] summary::after { rotate: -135deg; }
.facts { display: grid; gap: 14px; margin: 16px 0 20px; }
.facts dt { font-weight: 700; font-size: .92rem; }
.facts dd { margin: 2px 0 0; color: var(--muted); max-width: 44em; }

/* styles.css restyles every table (and stacks them on phones), so this one resets all of it */
.prog table.nums { display: table; width: 100%; max-width: 640px; margin-top: 8px; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.prog .nums thead { display: table-header-group; position: static; width: auto; height: auto; overflow: visible; clip: auto; }
.prog .nums tbody { display: table-row-group; }
.prog .nums tbody tr { display: table-row; padding: 0; border: 0; background: none; }
.prog .nums tr > th, .prog .nums tr > td { display: table-cell; padding: 8px 0 8px 6px; text-align: right; vertical-align: baseline; background: none; border: 0; border-bottom: 1px solid var(--rule); font-stretch: 100%; font-size: .95rem; }
.prog .nums tr > td::before { content: none; }
.prog .nums tr > th:first-child { width: 48%; padding-left: 0; padding-right: 8px; text-align: left; }
.prog .nums thead th { color: var(--muted); border-bottom-color: var(--rule-strong); }
.prog .nums tbody th { font-weight: 600; color: var(--ink); }

.prog__srchead { margin: 0 0 4px; font-weight: 700; font-size: .92rem; }
.prog__src, .pf-sources ul { margin: 0 0 12px; padding-left: 18px; font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }
.prog__src li, .pf-sources li { margin-bottom: 4px; }
.prog__official { margin: 0; font-size: .85rem; }
.prog__official a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }

.prog-empty { padding: clamp(28px, 5vw, 56px) 20px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-sheet); text-align: center; }
.prog-empty h2 { margin-bottom: 8px; font-size: 1.5rem; overflow-wrap: anywhere; }
.prog-empty p { color: var(--muted); }
.prog-empty__try { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 22px; }
.prog-empty .chip { padding: 0 16px; border: 1px solid var(--rule-strong); }
.prog-empty .chip:hover { background: var(--pen-wash); }
.prog-empty .btn-row { justify-content: center; }

.pf-sources { margin-top: 32px; }
.pf-sources summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 650; }

@media (min-width: 640px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric { display: block; padding: 2px 14px; border-top: 0; border-left: 1px solid var(--rule); }
  .metric:first-child { padding-left: 0; border-left: 0; }
  .metric dd { text-align: left; }
  .metric__pair { justify-content: flex-start; margin: 4px 0 2px; }
}
@media (min-width: 768px) {
  .prog { grid-template-columns: 240px minmax(0, 1fr); grid-template-areas: "photo who" "main main" "more more"; }
  .prog__photo { width: 240px; height: 180px; }
  .facts { grid-template-columns: 1fr 1fr; column-gap: 32px; }
}
@media (min-width: 1100px) {
  .prog { grid-template-columns: 240px minmax(0, 1fr) minmax(0, 1.9fr); grid-template-areas: "photo who main" "more more more"; }
}
@media (max-width: 639px) {
  .pf-filters .chips { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .pf-filters .chip { padding: 0 4px; font-size: .86rem; white-space: nowrap; }
  .pf-city, .pf-city select { width: 100%; }
  [data-count] { width: 100%; margin-bottom: 8px; }
  .pf-sort { width: 100%; }
  .pf-sort select { flex: 1; min-width: 0; }
  .pf-search input { height: 60px; padding: 0 56px 0 50px; font-size: 1rem; }
  .pf-search > svg { left: 18px; width: 20px; }
}
