/* Раздел «Мероприятия» (src/cases.mjs, поведение — cases.js): список с календарём-фильтром, страница мероприятия, лайтбокс.
   Цвета — токены site.css (светлая и тёмная темы сами), заголовки — Nunito. */
.cs h1,.cs h2,.cs-y,.cs-m,.cs-chip,.cs-go,.cs-bc a,.cs-stats b,.cs-lead2,.cs-codes li{font-family:var(--font-d)}
html[lang=zh] .cs :is(h1,h2,.cs-lead,.cs-lead2,.cs-sum){word-break:keep-all;overflow-wrap:anywhere}

/* ── шапка списка ── */
.cs-hd{padding:clamp(32px,5vw,64px) 0 clamp(18px,2.4vw,28px)}
.cs-hd h1{font-size:clamp(38px,6vw,68px);font-weight:800;letter-spacing:-.035em;line-height:1}
.cs-lead{margin-top:14px;max-width:44ch;font-size:clamp(16px,1.6vw,19px);line-height:1.45;color:var(--label-2);text-wrap:pretty}

/* ── календарь: годы и 12 месяцев; у месяца с мероприятиями — зелёная точка с числом ── */
.cs-cal{display:flex;flex-direction:column;gap:12px;padding-bottom:clamp(20px,3vw,32px)}
.cs-years{display:flex;flex-wrap:wrap;gap:8px}
.cs-years:empty{display:none}
.cs-y{height:36px;padding:0 16px;border-radius:999px;background:var(--fill);color:var(--label-2);font-size:14.5px;font-weight:800;transition:background .2s,color .2s}
.cs-y:hover{color:var(--label);background:var(--fill-2)}
.cs-y[aria-pressed=true]{background:var(--ink);color:var(--paper)}
.cs-months{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:4px;padding:5px;border-radius:20px;background:var(--surface);box-shadow:0 0 0 1px var(--sep)}
/* подпись месяца — строчные без выносных (окт, ноя): над буквами в строке пусто, и на глаз всё сидело ниже центра —
   padding-bottom поднимает подпись и кружок, чтобы поля над буквами и под кружком были равны (замер по пикселям) */
.cs-m{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:60px;padding-bottom:7px;border-radius:15px;color:var(--label);font-size:14px;font-weight:700;transition:background .2s,color .2s}
.cs-m span{white-space:nowrap}
.cs-m:disabled{color:var(--label-3);cursor:default}
.cs-m:not(:disabled):hover{background:var(--fill)}
.cs-m[aria-pressed=true],.cs-m[aria-pressed=true]:hover{background:var(--ink);color:var(--paper)}
.cs-dot{display:block;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--green);color:#fff;font:800 11.5px/20px var(--font-d);font-style:normal;text-align:center;transition:transform .25s cubic-bezier(.2,.8,.2,1)}
.cs-dot:empty{min-width:0;width:5px;height:5px;margin:7.5px 0;padding:0;background:var(--fill-2)}
.cs-m[aria-pressed=true] .cs-dot{transform:scale(1.08)}
.cs-y:focus-visible,.cs-m:focus-visible,.cs-card-a:focus-visible,.cs-bc a:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
@media(max-width:719px){.cs-months{grid-template-columns:repeat(6,minmax(0,1fr));border-radius:18px}.cs-m{height:54px;border-radius:13px;font-size:13.5px;padding-bottom:8px}}

/* ── карточки ── */
.cs-list{display:flex;flex-direction:column;gap:clamp(16px,2.4vw,28px);padding-bottom:clamp(56px,8vw,104px)}
.cs-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,330px),1fr));gap:clamp(16px,2.4vw,28px)}
.cs-card[hidden]{display:none}
.cs-card.cs-in{animation:csIn .45s cubic-bezier(.2,.8,.2,1) both}
@keyframes csIn{from{opacity:0;transform:translateY(12px)}}
.cs-card-a{display:flex;flex-direction:column;height:100%;border-radius:24px;overflow:hidden;background:var(--surface);box-shadow:0 0 0 1px var(--sep);transition:transform .3s cubic-bezier(.2,.8,.2,1),box-shadow .3s}
@media(hover:hover){.cs-card-a:hover{transform:translateY(-3px);box-shadow:0 0 0 1px var(--sep),0 26px 50px -30px rgb(20 19 15/.5)}.cs-card-a:hover .cs-cv img{transform:scale(1.035)}}
.cs-cv{aspect-ratio:3/2;overflow:hidden;background:var(--dc,var(--cream))}
.cs-cv picture,.cs-gal-g picture,.cs-hero picture{display:contents}
.cs-cv img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .7s cubic-bezier(.2,.8,.2,1)}
.cs-card-b{display:flex;flex:1;flex-direction:column;gap:8px;padding:18px 20px 20px}
.cs-meta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;font-size:14px;color:var(--label-2)}
.cs-card .cs-meta span::before{content:"·";margin-right:10px;color:var(--label-3)}
.cs-card-t{font-size:20px;font-weight:800;line-height:1.2;letter-spacing:-.015em;text-wrap:balance}
.cs-sum{font-size:16px;line-height:1.5;color:var(--label-2);text-wrap:pretty}
.cs-card-f{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;margin-top:auto;padding-top:8px}
.cs-chip{display:inline-flex;align-items:center;height:26px;padding:0 11px;border-radius:999px;background:var(--cream);color:var(--label);font-size:12.5px;font-weight:800;white-space:nowrap}
.cs-st{display:inline-flex;align-items:center;gap:5px;font-size:14px;color:var(--label-3)}
.cs-st b{color:var(--label);font-weight:700}
.cs-go{display:inline-flex;align-items:center;gap:6px;margin-left:auto;font-weight:800;font-size:15px}
.cs-go svg{transition:transform .25s cubic-bezier(.2,.8,.2,1)}
@media(hover:hover){.cs-card-a:hover .cs-go svg{transform:translateX(3px)}}
/* главное мероприятие — крупно: на широком экране обложка слева */
.cs-feat .cs-card-t{font-size:clamp(24px,3vw,38px);line-height:1.1;letter-spacing:-.025em}
.cs-feat .cs-card-f{margin-top:auto;padding-top:14px}
@media(min-width:880px){
  .cs-feat .cs-card-a{flex-direction:row;border-radius:28px}
  .cs-feat .cs-cv{flex:0 0 58%;aspect-ratio:auto;min-height:420px}
  .cs-feat .cs-card-b{gap:12px;padding:clamp(28px,3.4vw,44px)}
}
.cs-empty{display:flex;align-items:center;justify-content:center;gap:10px;padding:40px 0 clamp(64px,9vw,112px);color:var(--label-2);font-size:17px;text-align:center}
.cs-empty svg{color:var(--green)}

/* ── полоса «Хотите так же?» ── три точки знака над заголовком ── */
/* финал страницы: точки знака, вопрос и кнопка — прямо на фоне страницы, без отдельной полосы (решение владельца) */
.cs-band{padding:clamp(24px,4vw,48px) 0 clamp(64px,9vw,112px);text-align:center}
.cs-band .w::before{content:"";display:block;width:44px;height:10px;margin:0 auto 20px;
  background:radial-gradient(circle,#FF3B30 4.5px,transparent 5px) 0 50%/10px 10px no-repeat,radial-gradient(circle,#22C55E 4.5px,transparent 5px) 17px 50%/10px 10px no-repeat,radial-gradient(circle,#0A84FF 4.5px,transparent 5px) 34px 50%/10px 10px no-repeat}
.cs-band h2{max-width:20ch;margin:0 auto 26px;font-size:clamp(28px,4.4vw,52px);font-weight:800;line-height:1.08;letter-spacing:-.03em;text-wrap:balance}

/* ── страница мероприятия ── */
.cs-bc{padding-top:clamp(16px,2.4vw,28px)}
.cs-bc a{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px 0 10px;border-radius:999px;background:var(--fill);color:var(--label-2);font-size:14px;font-weight:800;transition:background .2s,color .2s}
.cs-bc a:hover{background:var(--fill-2);color:var(--label)}
@media(pointer:coarse){.cs-bc a{height:44px}}
.cs-ph{padding:clamp(18px,2.6vw,30px) 0 clamp(20px,3vw,34px)}
.cs-ph .cs-meta{gap:8px 12px}
.cs-ph h1{max-width:22ch;margin-top:14px;font-size:clamp(32px,5.4vw,64px);font-weight:800;line-height:1.04;letter-spacing:-.033em;text-wrap:balance}
.cs-where{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin-top:16px;color:var(--label-2);font-size:16.5px}
.cs-where svg{color:var(--red)}
.cs-where i{font-style:normal;color:var(--label-3)}
.cs-hero{margin-bottom:clamp(28px,4.4vw,56px);border-radius:clamp(18px,2.6vw,32px);overflow:hidden;background:var(--dc);box-shadow:0 0 0 1px var(--sep)}
.cs-hero img{display:block;width:100%;height:auto;max-height:min(74vh,760px);object-fit:cover}
.cs-cols{display:grid;grid-template-columns:minmax(0,1fr) 340px;align-items:start;gap:clamp(28px,5vw,80px);padding-bottom:clamp(44px,6.4vw,80px)}
.cs-lead2{margin-bottom:22px;font-size:clamp(19px,2.1vw,24px);font-weight:700;line-height:1.38;letter-spacing:-.012em;text-wrap:pretty}
.cs-body{max-width:66ch;font-size:17px;line-height:1.68}
.cs-body p+p{margin-top:1em}
.cs-body b{font-weight:700}
.cs-body a,.cs-dl a{text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:3px}
.cs-facts{position:sticky;top:84px;display:flex;flex-direction:column;gap:20px;padding:20px;border-radius:24px;background:var(--surface);box-shadow:0 0 0 1px var(--sep)}
.cs-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:0;list-style:none}
.cs-stats li{position:relative;display:flex;flex-direction:column;gap:4px;padding:14px 14px 13px;border-radius:16px;background:var(--bg)}
.cs-stats li::before{content:"";position:absolute;top:14px;right:14px;width:7px;height:7px;border-radius:50%;background:var(--blue)}
.cs-stats li:nth-child(2)::before{background:var(--green)}
.cs-stats li:nth-child(3)::before{background:var(--red)}
.cs-stats li:nth-child(4)::before{background:var(--label-3)}
.cs-stats b{font-size:clamp(26px,2.6vw,32px);font-weight:800;line-height:1;letter-spacing:-.025em}
.cs-stats span{font-size:13px;color:var(--label-2)}
.cs-dl{display:flex;flex-direction:column;gap:14px}
.cs-dl dt{font-size:12.5px;font-weight:600;color:var(--label-3)}
.cs-dl dd{margin:3px 0 0;font-weight:600;line-height:1.35}
.cs-dl a{display:inline-flex;align-items:center;gap:5px}
/* несколько организаторов — каждый своей строкой со своей ссылкой */
.cs-orgs{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}
.cs-dl a svg{color:var(--label-3)}
.cs-codes{display:flex;flex-wrap:wrap;gap:6px;margin-top:7px;padding:0;list-style:none}
.cs-codes li{height:26px;padding:0 9px;border-radius:8px;background:var(--fill);font-size:12.5px;font-weight:800;line-height:26px;letter-spacing:.04em}
.cs-prod li{background:var(--ink);color:var(--paper);letter-spacing:0}
@media(max-width:899px){
  .cs-cols{grid-template-columns:minmax(0,1fr)}
  .cs-facts{position:static;order:-1;padding:16px}
}
@media(min-width:520px) and (max-width:899px){.cs-stats{grid-template-columns:repeat(4,1fr)}.cs-dl{flex-flow:row wrap;gap:14px 28px}}

/* ── галерея: первая — крупно; нажатие — лайтбокс (cases.js) ── */
.cs-gal,.cs-vids{padding-bottom:clamp(44px,6.4vw,80px)}
.cs-gal h2,.cs-vids h2{display:flex;align-items:baseline;gap:10px;margin-bottom:18px;font-size:clamp(24px,3vw,34px);font-weight:800;letter-spacing:-.02em}
.cs-n{font-size:15px;font-weight:800;color:var(--label-3)}
/* три колонки: первая 2×2, справа две, дальше по три; последняя в неполном ряду растягивается — без «сирот» */
.cs-gal-g{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(8px,1vw,14px);padding:0;list-style:none}
.cs-gal-g li:first-child{grid-column:span 2;grid-row:span 2}
.cs-gal-g li:first-child:last-child{grid-column:1/-1;grid-row:auto}
.cs-gal-g li:first-child:last-child a{aspect-ratio:16/9}
.cs-gal-g li:nth-child(2):last-child{grid-row:span 2}
.cs-gal-g li:nth-child(2):last-child a{aspect-ratio:auto}
.cs-gal-g li:nth-child(3n+4):last-child{grid-column:1/-1}
.cs-gal-g li:nth-child(3n+4):last-child a{aspect-ratio:3/1}
.cs-gal-g li:nth-child(3n+5):last-child{grid-column:span 2}
.cs-gal-g li:nth-child(3n+5):last-child a{aspect-ratio:auto}
.cs-gal-g a{position:relative;display:block;height:100%;aspect-ratio:4/3;border-radius:clamp(12px,1.4vw,18px);overflow:hidden;background:var(--dc,var(--cream));cursor:zoom-in}
/* картинка только заполняет плитку (высоту задаёт сетка, а не размер фото — иначе вертикальный кадр растягивал ряд) */
.cs-gal-g picture,.cs-gal-g img{position:absolute;inset:0}
.cs-gal-g img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .6s cubic-bezier(.2,.8,.2,1)}
@media(hover:hover){.cs-gal-g a:hover img{transform:scale(1.04)}}
.cs-gal-g a:focus-visible{outline:3px solid var(--blue);outline-offset:3px}
@media(max-width:719px){
  .cs-gal-g{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cs-gal-g li:first-child{grid-column:1/-1;grid-row:auto}
  .cs-gal-g li:nth-child(n):last-child{grid-column:auto;grid-row:auto}
  .cs-gal-g li:nth-child(n):last-child a{aspect-ratio:4/3}
  .cs-gal-g li:first-child:last-child,.cs-gal-g li:nth-child(2n+2):last-child{grid-column:1/-1}
  .cs-gal-g li:first-child a,.cs-gal-g li:nth-child(2n+2):last-child a{aspect-ratio:16/10}
}
.cs-vids .film-v{max-width:none;margin:0 0 clamp(16px,2vw,24px)}

/* ── лайтбокс ── */
/* на body, не на html: иначе body (overflow-x:hidden) становится своим контейнером прокрутки и шапка .top перестаёт липнуть */
html.cs-lb-open body{overflow:hidden}
.cs-lb{position:fixed;inset:0;z-index:200;display:grid;grid-template-rows:minmax(0,1fr) auto;background:#0c0b0a;color:#fff;opacity:0;transition:opacity .25s ease}
.cs-lb.on{opacity:1}
/* уже закрывается — нажатия проходят к странице (открывающееся окно нажатия держит: второй щелчок двойного остаётся в нём) */
.cs-lb.out{pointer-events:none}
/* фото вписывается в область целиком: размеры — от самой области (container query), проценты тут не работали — вертикальное фото обрезалось */
.cs-lb-f{container-type:size;display:grid;place-items:center;min-height:0;margin:0;padding:64px 84px 8px;overflow:hidden;touch-action:pinch-zoom}
.cs-lb-f picture{display:contents}
.cs-lb-f img{max-width:100cqw;max-height:100cqh;width:auto;height:auto;border-radius:10px;object-fit:contain;user-select:none;-webkit-user-drag:none;transition:transform .32s cubic-bezier(.2,.8,.2,1),opacity .2s}
.cs-lb-f img.drag{transition:none}
.cs-lb button{position:absolute;display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:rgb(255 255 255/.12);color:#fff;transition:background .2s}
.cs-lb button:hover{background:rgb(255 255 255/.24)}
.cs-lb button:focus-visible{outline:2px solid #fff;outline-offset:2px}
.cs-lb button:disabled{opacity:.3;cursor:default}
.cs-lb-x{top:max(12px,env(safe-area-inset-top));right:12px}
.cs-lb-p,.cs-lb-n{top:50%;transform:translateY(-50%)}
.cs-lb-p{left:16px}.cs-lb-n{right:16px}
.cs-lb-c{padding:14px 16px calc(18px + env(safe-area-inset-bottom));font:700 14px/20px var(--font-d);color:rgb(255 255 255/.72);text-align:center;font-variant-numeric:tabular-nums}
.cs-lb-c span{display:block;margin-top:2px;font:400 14px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;color:rgb(255 255 255/.6)}
@media(max-width:719px){
  .cs-lb-f{padding:64px 0 0}
  .cs-lb-f img{border-radius:0}
  .cs-lb-p,.cs-lb-n{top:auto;bottom:calc(10px + env(safe-area-inset-bottom));transform:none}
  .cs-lb-c{min-height:68px;padding:24px 72px calc(14px + env(safe-area-inset-bottom))}
}
@media(prefers-reduced-motion:reduce){.cs-card.cs-in{animation:none}.cs-lb,.cs-lb-f img,.cs-cv img,.cs-gal-g img,.cs-card-a{transition:none}}
/* три цифры — третья во всю ширину, без пустой клетки */
.cs-stats li:nth-child(3):last-child{grid-column:1/-1}
@media(min-width:520px) and (max-width:899px){.cs-stats li:nth-child(3):last-child{grid-column:auto}}
.cs-lb:focus{outline:none}
@media(max-width:959px){.cs-facts{top:128px}}
