/*
Стылі агульнага пошуку /find/ (page-find.php + template-parts/unified-catalog.php,
CONTRACT-unified-search-2026-10-31). Старт — mock-src/uf.css з зацверджанага макета v1.
Грузіцца ТОЛЬКІ на is_page('find') (inc/enqueue.php), таму старых старонак не кранае;
усё, што не мае ўласнага прэфікса uf-, дадаткова прывязана да абгорткі .uf-page.
Токены — з style.css; новы адзін: --uf-line (3.1:1 да белага) — межы палёў, чыпаў і
пункцір груп. Лагічныя ўласцівасці (inline-start/end) — каб ar/ur/he працавалі без rtl.css.
*/
.uf-page{--uf-line:#8b939e;--uf-ease:cubic-bezier(.2,.7,.2,1)}
.uf-head{padding:1.25rem 0 .5rem}
.uf-head h1,.uf-head h2{margin-bottom:.4rem;text-wrap:balance}
.uf-lead{color:var(--text-2);max-width:60ch;text-wrap:pretty;font-size:clamp(1rem,.96rem + .3vw,1.1rem);line-height:1.5}
.uf-main{min-width:0;outline:0}
/* [hidden] супраць аўтарскага display (flex/grid/inline-flex на ўласных класах): адно правіла на ўсю старонку. */
.uf-page [hidden]{display:none!important}

/* Карткі: толькі на /find/ — content-visibility, каб ~210 картак не рэндэрыліся разам. Памер «па
   чаканні» — вымераная медыяна высоты (1280 і 390 px: курс/рэсурс ≈ 420, клуб ≈ 450); `auto` кладзе
   ў памяць рэальны памер пасля першага рэндэру, таму скачкоў пры скролле няма. */
.uf-page .course-card,.uf-page .resource-card,.uf-page .club-card{content-visibility:auto;contain-intrinsic-size:auto 420px}
.uf-page .club-card{contain-intrinsic-size:auto 450px}

/* Deep-link з фільтрамі: спіс чакае першага прымянення JS (data-uf-pending здымае скрыпт);
   калі JS не выканаўся, анімацыя паказвае ўсё праз 1,5 с — пустой старонкі не бывае (кантракт §9.3). */
.uf-secs[data-uf-pending]{opacity:0;animation:uf-reveal .01s linear 1.5s forwards}
@keyframes uf-reveal{to{opacity:1}}

/* Без JS панэль фільтраў — мёртвыя кантролы: хаваем, пакуль скрыпт не дадаў .uf-js (канец unified-search.js).
   visibility, а не display: месца ў сетцы лішаецца, і з'яўленне панэлі не зрушвае верстку (CLS);
   хаваныя так кантролы не атрымліваюць фокус і не чытаюцца. */
.uf-page:not(.uf-js) .uf-filters{visibility:hidden}
/* Тое ж для кнопкі «Фільтры (N)»: пры збоі скрыпта (JS ёсць, але .uf-js не з'явіўся) яна была б мёртвай;
   <noscript> хавае яе толькі калі JS выключаны. Тры класы (.uf-page + :not(.uf-js) + .uf-open) перабіваюць .uf-led{display:flex}. */
.uf-page:not(.uf-js) .uf-open{display:none}

/* Ledger: sticky summary + jump anchors; on phones the filter button is its first cell */
.uf-ledger{position:sticky;top:63px;z-index:90;display:flex;gap:.25rem;margin:0 calc(-1 * var(--pad)) .75rem;padding:.4rem var(--pad);background:rgba(255,255,255,.96);backdrop-filter:saturate(150%) blur(8px);border-bottom:1px solid var(--border)}
.uf-led{flex:1 1 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:52px;min-width:0;padding:.3rem .45rem;border-radius:var(--radius-sm);color:var(--text);text-decoration:none;text-align:center;font:inherit;background:none;border:1px solid transparent;cursor:pointer}
.uf-led:hover{background:var(--bg-soft-2);opacity:1}
.uf-led-n{order:-1;font-size:1.2rem;font-weight:800;line-height:1.15;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.uf-led-l{font-size:.75rem;font-weight:600;line-height:1.2;color:var(--text-2);letter-spacing:.01em;overflow-wrap:anywhere}
.uf-led--zero .uf-led-n{color:var(--text-3);font-weight:700}
.uf-open{flex:0 0 auto;border-color:var(--uf-line);background:#fff;color:var(--text)}
.uf-open:hover{background:var(--bg-soft-2)}
.uf-open-ico{position:relative;display:block;line-height:0;margin-bottom:1px}
.uf-open-n{position:absolute;top:-6px;inset-inline-end:-12px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--green);color:#fff;font-size:.7rem;font-weight:700;line-height:18px;text-align:center}
.uf-open .uf-led-l{color:var(--text)}
/* Кнопка «Фільтры» вышэй за стужку кнопак: адмоўны вонкавы адступ стужкі (гл. ніжэй) заходзіць на яе на 2 px — клік мусіць трапляць у кнопку. */
.uf-open{position:relative;z-index:1}

/* Кнопкі віду «Усе разам · Курсы · Самастойна · Клубы» (.uf-kpill): адзін выбар, націснутая — зялёная з градыентам сайта.
   Тэлефон: стужка побач з кнопкай «Фільтры», пракручваецца ўбок, калі не ўмяшчаюцца (без паласы пракруткі). Кнопка не звужаецца
   менш за свой змест і запаўняе радок, калі месца хапае. Падпіс не ламаецца пасярод слова (.uf-led-l мае overflow-wrap:anywhere).
   Кольца фокусу (3 px + зазор 2 px + белы арэол 5 px, style.css) не мусіць абразацца скролерам: унутраны адступ 6 px,
   а адмоўны вонкавы вяртае ledger ранейшую вышыню і шырыню. */
.uf-kindbar{display:flex;flex:1 1 auto;min-width:0;gap:.25rem;padding:6px;margin:-6px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:none}
.uf-kindbar::-webkit-scrollbar{display:none}
/* Бакавы адступ вузейшы за .uf-led (.45rem): чатыры кнопкі па-беларуску ўмяшчаюцца ў 390 px без пракруткі; на дэсктопе — .uf-led ніжэй. */
.uf-kpill{flex:1 0 auto;padding-inline:.35rem}
.uf-kpill .uf-led-l{white-space:nowrap;overflow-wrap:normal}
/* Націснутая — градыент .btn--primary (style.css: тыя ж колеры і кут, hover, белы тэкст), але светлы канец (#04955f) вынесены
   за край (150 %): на поўным градыенце белы тэкст дробных падпісаў каля светлага вугла даваў 4,0–4,2:1, так ва ўсёй кнопцы ≥ 4,5:1
   (WCAG AA, замер па пікселях). Прэфікс .uf-led.uf-kpill + [aria-pressed] перабівае .uf-led, .uf-led:hover, .uf-led-l,
   .uf-led--zero .uf-led-n і дэсктопныя .uf-led{background:#fff}/.uf-led-l{color}. */
.uf-led.uf-kpill[aria-pressed=true]{background:linear-gradient(135deg,var(--green),#04955f 150%);border-color:var(--green);color:#fff}
.uf-led.uf-kpill[aria-pressed=true]:hover{background:linear-gradient(135deg,var(--green-dark),#04955f 150%);border-color:var(--green-dark)}
.uf-kpill[aria-pressed=true] .uf-led-l,.uf-kpill[aria-pressed=true] .uf-led-n{color:#fff}
/* Да .uf-js (скрыпт яшчэ не выканаўся ці зламаўся) у ledger няма нічога жывога: кнопкі віду і «Фільтры» працуюць толькі
   з JS. Хаваем увесь ledger, каб пад шапкай не ехала пустая sticky-паласа. Ён ляжыць далёка ніжэй першага экрана, а якар
   з адраса (#uf-self і пад.) JS пасля першага apply ставіць на месца. */
.uf-page:not(.uf-js) .uf-ledger{display:none}

/* Kind sections. scroll-margin-top — з прэфіксам .uf-page і тэгам: інакш яго перабівае
   section[id]{scroll-margin-top:76px} са style.css, і якар сэкцыі ляжыць пад sticky-ledger.
   Тое ж для хвастоў (<details class="uf-tail">, у т.л. «Удакладніце…»): на іх «яшчэ N — …» вядзе якар,
   а без поля summary прыляпляўся б пад ledger. Вышыня ledger не сталая (кнопкі віду могуць перанесціся ў другі радок),
   таму адступ задае JS праз --uf-anchor-top (шапка + ledger); лічба — запас без JS. */
.uf-sec{padding:.5rem 0 2rem}
.uf-page section.uf-sec,.uf-page details.uf-tail{scroll-margin-top:var(--uf-anchor-top,136px)}
.uf-sec:not([hidden])~.uf-sec:not([hidden]){border-top:1px solid var(--border);padding-top:1.25rem}
.uf-sec-head{margin-bottom:1rem}
.uf-sec-head h2{margin-bottom:.2rem}
.uf-sub{color:var(--text-2);font-size:.95rem;margin:0;font-variant-numeric:tabular-nums}
.uf-sub a{font-weight:600;text-decoration:underline;text-underline-offset:.15em}
.uf-na{display:flex;align-items:flex-start;gap:.45rem;color:var(--text-3);font-size:.9rem;line-height:1.45;margin:0 0 1rem}
.uf-na svg{flex:none;margin-top:.15rem}
.uf-more{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.5rem 1.25rem;margin-top:1.25rem}
.uf-more .btn{min-width:min(100%,260px)}
.uf-maplink{display:inline-flex;align-items:center;min-height:44px;font-weight:600}

/* Format badge on course/club cards (/find/ only) */
.uf-fmt{display:inline-flex;align-items:center;min-height:22px;padding:.1rem .55rem;border-radius:999px;border:1px solid var(--border);background:var(--bg-soft-2);color:var(--text-2);font-size:.75rem;font-weight:700;letter-spacing:.01em;line-height:1.2}
.uf-page .club-venue .uf-fmt{margin-inline-start:.35rem;vertical-align:1px}

/* Клуб на /find/: загаловак h3 (на галоўнай h4 — clubs.css) */
.uf-page .club-card-head h3{font-size:1.02rem;min-width:0;overflow-wrap:break-word}

/* Чыпы моў тлумачэнняў на карце курса (.res-badge — як у рэсурсаў, стылі ў style.css):
   на /find/ над імі бачны подпіс — асобны элемент з aria-hidden (група сама мае aria-label;
   падпіс праз ::before/content:attr() чытаўся б чытальнікам экрана другі раз), на старых старонках — толькі чыпы. */
.uf-page .course-langs{margin-top:-.25rem}
.uf-page .course-langs-label{flex:0 0 100%;font-size:.8rem;font-weight:600;color:var(--text-2)}

/* Club card on /find/: price row */
.uf-page .club-price{display:flex;align-items:center;gap:.4rem;color:var(--text-2);font-size:.9rem;margin:0 0 .6rem}
.uf-page .club-price b{color:var(--green-dark);font-weight:700}
.uf-page .club-card .tkl-levels{margin-bottom:.8rem}

/* Honest groups: UNKNOWN tail + CHECK-CITY + «не падыходзяць» — outside the headline, collapsed, dashed */
.uf-tail{margin-top:1.25rem;border:1px dashed var(--uf-line);border-radius:var(--radius);background:#fff}
.uf-tail>summary{display:flex;align-items:center;gap:.55rem;min-height:52px;padding:.65rem .9rem;cursor:pointer;list-style:none;font-weight:700;color:var(--text);border-radius:var(--radius)}
.uf-tail-main{flex:1 1 auto;min-width:0;display:flex;flex-wrap:wrap;align-items:center;gap:.35rem .55rem}
.uf-tail[open]{background:var(--bg-soft-2)}
.uf-tail>summary::-webkit-details-marker{display:none}
.uf-tail>summary:hover{background:var(--bg-soft)}
.uf-tail>summary>svg{flex:none;color:var(--text-2)}
.uf-tail-t{min-width:0}
.uf-tail-t .elig-group-count{font-weight:600}
.uf-tail-chips{display:contents}
.uf-tail-chev{flex:none;margin-inline-start:auto;display:inline-flex;color:var(--text-2);transition:transform .16s var(--uf-ease)}
.uf-tail[open]>summary .uf-tail-chev,.uf-elig[open]>summary .uf-tail-chev{transform:rotate(180deg)}
.uf-q{display:inline-flex;align-items:center;min-height:24px;padding:.1rem .55rem;border-radius:999px;border:1px dashed var(--uf-line);color:var(--text-2);font-size:.78rem;font-weight:600}
.uf-tail-body{padding:.25rem .9rem 1rem}
.uf-tail-why{color:var(--text-2);font-size:.9rem;margin:0 0 .9rem;max-width:62ch}

/* Status picker (course only): existing .elig-picker inside a one-line disclosure */
.uf-elig{margin:0 0 1rem;border:1px solid #bfe0cc;border-radius:var(--radius);background:var(--green-tint)}
.uf-elig>summary{display:flex;align-items:center;gap:.5rem;min-height:48px;padding:.55rem .9rem;font-weight:700;color:var(--green-dark);cursor:pointer;list-style:none;border-radius:var(--radius)}
.uf-elig>summary::-webkit-details-marker{display:none}
.uf-elig>summary svg{flex:none}
.uf-elig .uf-tail-chev{color:var(--green-dark)}
.uf-elig .elig-picker{border:0;background:none;margin:0;padding:0 .9rem 1rem}
.uf-elig .filter-group select{width:100%;min-height:44px;padding:.55rem .7rem;border:1px solid var(--uf-line);border-radius:var(--radius-sm);background:#fff;font-size:1rem}
.uf-elig-groups:not([hidden]){display:flex;flex-direction:column;gap:1.5rem;margin-bottom:1.5rem}
.uf-elig-empty{border:1px solid var(--border);background:var(--bg-soft);border-radius:var(--radius);margin:0 0 1rem}

/* All-zero banner */
.uf-empty{border:1px solid var(--border);background:var(--bg-soft);border-radius:var(--radius);padding:1rem 1.1rem;margin:0 0 1rem}
.uf-empty strong{font-size:1.05rem;color:var(--text)}
.uf-empty p{color:var(--text-2);margin:0 0 .35rem}
.uf-empty-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.75rem!important}

/* Filters block: one DOM — full-height sheet on phones, plain left column on desktop (no sticky, no inner scroll: the page scrolls as one; «Фільтры (N)» in the ledger jumps back to it) */
.uf-filters{display:none}
.uf-filters.is-open{display:flex;flex-direction:column;position:fixed;inset:0;z-index:2100;background:#fff;animation:uf-in .18s var(--uf-ease)}
@keyframes uf-in{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
body.uf-lock{overflow:hidden}
.uf-sheet-head{display:flex;align-items:center;gap:.5rem;min-height:60px;padding-block:.4rem;padding-inline:var(--pad) .4rem;border-bottom:1px solid var(--border)}
.uf-sheet-head h2{font-size:1.25rem;margin-inline-end:auto;outline:0}
.uf-reset-top{display:none}
.uf-x{display:grid;place-items:center;min-width:48px;min-height:48px;border:0;background:none;border-radius:var(--radius-sm);color:var(--text);cursor:pointer}
.uf-x:hover{background:var(--bg-soft-2)}
.uf-sheet-body{flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain;padding:1rem var(--pad) 1.5rem}
.uf-sheet-foot{display:flex;gap:.6rem;padding:.75rem var(--pad) calc(.75rem + env(safe-area-inset-bottom));border-top:1px solid var(--border);background:#fff}
.uf-sheet-foot .btn--primary{flex:1 1 auto}
.uf-group{border:0;margin:0 0 1.35rem;padding:0;min-width:0}
.uf-group>legend,.uf-label,.uf-field>label{display:block;padding:0;margin:0 0 .5rem;font-size:.92rem;font-weight:700;color:var(--text)}
.uf-label{margin-top:.25rem}
.uf-chips+.uf-label,.uf-chips+#uf-rprice-wrap{margin-top:1rem}
.uf-check{display:flex;align-items:center;gap:.65rem;min-height:44px;cursor:pointer;font-size:1rem;line-height:1.35}
.uf-check input{flex:none;width:20px;height:20px;margin:0;accent-color:var(--green)}
.uf-check input:disabled+span{color:var(--text-2)}
.uf-check input:disabled{cursor:not-allowed}
.uf-check--sm{font-size:.9rem;color:var(--text-2)}
.uf-hint{margin:.1rem 0 0;padding-inline-start:calc(20px + .65rem);font-size:.85rem;color:var(--text-2);line-height:1.4}
.uf-hint--field{padding-inline-start:0;margin-top:.4rem}
.uf-chips{display:flex;flex-wrap:wrap;gap:.4rem}
.uf-chip{display:inline-flex;align-items:center;justify-content:center;gap:.3rem;min-height:44px;min-width:44px;padding:.4rem .85rem;border-radius:999px;border:1px solid var(--uf-line);background:#fff;color:var(--text-2);font-size:.9rem;font-weight:600;cursor:pointer;transition:background-color .16s var(--uf-ease),border-color .16s var(--uf-ease)}
.uf-chip:hover{background:var(--bg-soft-2);color:var(--text)}
.uf-chip[aria-pressed=true]{background:var(--green-tint);border-color:var(--green);color:var(--green-dark);font-weight:700}
.uf-chip[aria-pressed=true]::before{content:"✓";font-size:.85em}
.uf-chip.lev-y[aria-pressed=true]{background:var(--yellow-tint);border-color:#c98d00;color:#7a5300}
.uf-chip.lev-r[aria-pressed=true]{background:var(--red-tint);border-color:var(--red);color:#9b1c1f}
.uf-chip:disabled{opacity:.5;cursor:not-allowed}
.uf-field{margin:0 0 1.35rem}
.uf-field select,.uf-field input[type=search]{width:100%;min-height:44px;padding:.55rem .7rem;border:1px solid var(--uf-line);border-radius:var(--radius-sm);background:#fff;font-size:1rem}
.uf-field input[type=search]::placeholder{color:var(--text-2);opacity:1}
.uf-kindspec>legend{float:inline-start;width:100%;padding:1.1rem 0 0;margin-bottom:.75rem;border-top:1px solid var(--border);font-size:.75rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--text-2)}
.uf-kindspec>legend+*{clear:both}
.uf-kindspec .cost-head{margin-bottom:.6rem}
.uf-kindspec .cost-slider{margin:.4rem 0 .5rem}

@media(min-width:992px){
  .uf-head{padding:1.75rem 0 .75rem}
  .uf-layout{display:grid;grid-template-columns:296px minmax(0,1fr);gap:2rem;align-items:start}
  .uf-filters,.uf-filters.is-open{display:block;position:static;inset:auto;z-index:auto;border:1px solid var(--border);border-radius:var(--radius);background:#fff;animation:none}
  .uf-sheet-head{min-height:0;padding:.85rem 1rem .25rem;border-bottom:0}
  .uf-sheet-head h2{font-size:1.1rem}
  .uf-reset-top{display:inline-flex;align-items:center;min-height:44px;padding:0 .5rem;border:0;background:none;color:var(--green);font-weight:600;font-size:.9rem;cursor:pointer;border-radius:var(--radius-sm)}
  .uf-reset-top:hover{background:var(--bg-soft-2)}
  .uf-x,.uf-sheet-foot{display:none}
  .uf-sheet-body{padding:.5rem 1rem 1rem;overflow:visible}
  /* align-items:flex-start — калі кнопкі віду пераносяцца ў другі радок, «Фільтры» застаецца сваёй вышыні, а не расцягваецца ў авал. */
  .uf-ledger{flex-wrap:wrap;align-items:flex-start;margin:0 0 .5rem;padding:.6rem 0;gap:.5rem;row-gap:.4rem;background:rgba(255,255,255,.96);border-bottom:1px solid var(--border)}
  .uf-led{flex:0 0 auto;flex-direction:row;gap:.45rem;min-height:44px;padding:.35rem .9rem;border:1px solid var(--border);border-radius:999px;background:#fff}
  .uf-led-n{order:0;font-size:1rem}
  .uf-open{gap:.9rem}
  .uf-led-l{font-size:.9rem;color:var(--text-2);white-space:nowrap}
  /* Кнопкі: група побач з кнопкай «Фільтры» ў адзін радок, калі ўмяшчаюцца; інакш пераносяцца ўсярэдзіне групы — гарызантальнай пракруткі няма. */
  .uf-kindbar{flex:1 1 0;min-width:0;display:flex;flex-wrap:wrap;gap:.5rem;row-gap:.4rem;overflow:visible;padding:0;margin:0}
  .uf-page section.uf-sec,.uf-page details.uf-tail{scroll-margin-top:var(--uf-anchor-top,132px)}
  .uf-sec .courses-grid,.uf-sec .resources-grid,.uf-sec .clubs-grid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr))}
}
@media(prefers-reduced-motion:reduce){
  .uf-filters.is-open{animation:uf-fade .12s linear}
  @keyframes uf-fade{from{opacity:0}to{opacity:1}}
  .uf-tail-chev,.uf-chip{transition:none}
}

/* Навіны тэставай галоўнай (template-parts/home-news.php з reveal; секцыі стаяць ПАЗА .uf-page, таму
   прэфікс не .uf-page, а клас сеткі `.news-grid--reveal` — у рэальнай галоўнай і ў архіве навін яго няма).
   ≥992px: карткі 1–3 бачныя, `.tkl-nr-x` (4-я і далей) схаваныя, кнопка схавана — як і было.
   ≤991px: бачная толькі 1-я карта; `.tkl-nr` адкрывае JS (`.is-shown`, unified-search.js), кнопка пад сеткай. */
.news-grid--reveal .tkl-nr-x{display:none}
/* Фокус-кальцо загалоўка (на яго JS пераносіць фокус пасля «Паказаць яшчэ»): .news-card h3 мае overflow:hidden
   (line-clamp, style.css), і знешняе кальцо абразалася — малюем яго ўнутры спасылкі. */
.news-grid--reveal .news-card h3 a:focus-visible{outline-offset:-3px;box-shadow:none}
.tkl-nr-more{display:none}
@media(max-width:991px){
  /* Планшэт (600–991px): style.css дае .news-grid дзве калонкі — адна першая картка займала б паўшырыні. */
  .news-grid--reveal{grid-template-columns:1fr}
  .news-grid--reveal .tkl-nr{display:none}
  .news-grid--reveal .tkl-nr.is-shown{display:flex}
  .tkl-nr-more{display:block;margin-top:1rem;text-align:center}
  .tkl-nr-more .btn{width:100%;max-width:340px}
}
