/* festivals.css — the festivals page told in the afisha's own language (board: «Фестивали как афиша»).
   The home page steps by day, this page by month: the same sentence of choices, the same chips, a rail of
   months where the home page has a rail of days, a month big on the left and posters on the right. It reuses the
   site's own .say, .tok, .bar, .chip, .views, .day, .card, .poster, .meta, .title, .place; fv- adds only what a
   month needs that a day does not. catalog.js still folds the months (six cards, three months) and writes dates. */

.ct-folded { display: none !important; }

/* A genre that came in the address shows as a chosen chip; the rest wait unseen. */
.fv-genre { display: none; align-items: center; gap: 6px; cursor: pointer; }
.fv-genre input { position: absolute; opacity: 0; pointer-events: none; }
.fv-genre:has(input:checked) { display: inline-flex; background: var(--acc); border-color: var(--acc); color: #FFFFFF; }
.fv-genre small { display: none; }

/* The rail of months — the home page's rail of days, one step coarser. catalog.js turns it to start at this month. */
.fv-months { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
.fv-months::-webkit-scrollbar { display: none; }
.fv-month { flex: 0 0 auto; width: 64px; padding: 12px 0 10px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.fv-month:hover { background: var(--s1); color: var(--txt); }
.fv-month b { font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.fv-month small { font: 500 11px var(--mono); letter-spacing: .06em; color: var(--mut); }
.fv-month small:empty::before { content: "0"; }
.fv-month .dots { display: flex; gap: 3px; height: 4px; }
.fv-month .dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--acc); }
.fv-month.is-now { background: var(--s1); }
.fv-month.is-now small { color: var(--acc); }
.fv-months:has(.is-chosen) .fv-month.is-now { background: none; }
.fv-months:has(.is-chosen) .fv-month.is-now small { color: var(--mut); }
.fv-month.is-chosen { background: var(--s1); box-shadow: inset 0 -2px 0 var(--acc); }
.fv-month.is-chosen small { color: var(--acc); }
.fv-narrow .fv-hl, .fv-narrow .fv-kinds { display: none; }
/* Under a search or a choice the rail keeps only the months with something found (festivals.html, syncRail). */
.fv-month[hidden], .fv-months .fx-cal-y[hidden] { display: none; }
.fv-month[data-gally-none], .fv-month.is-empty { opacity: .4; }
.fv-months .fx-cal-y { flex: 0 0 auto; align-self: stretch; margin: 0 8px; padding: 12px 0 0 12px; border-left: 1px solid rgba(var(--ink), .12); font: 500 11px var(--mono); letter-spacing: .08em; color: var(--mut); }

/* «Главное этой осенью» — three posters, the home page's «Главное на неделе». */
.fv-hl { padding-top: 28px; }
.fv-hl .poster { aspect-ratio: 4 / 3; }
.fv-hl-row { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; scroll-snap-type: x mandatory; scroll-padding-inline: 18px; }
.fv-hl-row::-webkit-scrollbar { display: none; }
.fv-hl-row > .card { flex: 0 0 min(300px, 82vw); scroll-snap-align: start; }
.fv-soon { color: var(--txt); background: rgba(var(--accr), .12); padding: 1px 6px; border-radius: 4px; }
.fv-soon:empty { display: none; }

/* Eight kinds: small square photos, the name under each. */
.fv-kinds { padding: 0 0 40px; }
.fv-kinds-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; margin-bottom: 16px; }
.fv-kinds-note { display: none; font-size: 15px; color: var(--mut); }
.fv-kinds-row { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
.fv-kinds-row::-webkit-scrollbar { display: none; }
.fv-kind { flex: 0 0 104px; display: flex; flex-direction: column; gap: 8px; }
.fv-kind:hover { color: var(--txt); }
.fv-ph { display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--s2); }
.fv-ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.fv-kind:hover .fv-ph img { transform: scale(1.04); }
.fv-kind-t { display: flex; flex-direction: column; gap: 2px; }
.fv-kind b { font-size: 14px; font-weight: 500; line-height: 1.2; letter-spacing: -.01em; }
.fv-kind small { font: 500 11px var(--mono); color: var(--mut); }
.fv-kind:hover small { color: var(--acc); }

/* A month: the home page's day, with the month's first three letters in place of the date. */
.fv-group .day-num { min-width: 2.4ch; }
.fv-group .fx-when { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.fv-group .fx-when b { font-size: 18px; font-weight: 400; letter-spacing: -.02em; color: var(--txt); }
.fv-group .fx-when small { font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mut); }
.fv-group .fx-fold { display: flex; justify-content: center; align-items: center; gap: 8px; height: 48px; padding: 0 20px; font-size: 15px; font-weight: 500; color: var(--acc); border: 1px solid rgba(var(--accr), .35); border-radius: 24px; transition: border-color .2s; }
.fv-group .fx-fold:hover { border-color: var(--acc); }
.fv-group .fx-fold[hidden] { display: none; }
.fv-group .fx-fold svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fv-tags { display: flex; gap: 10px; font-size: 13px; color: var(--mut); }
.fv-tags span:empty { display: none; }
.card-foot .price:empty { display: none; }
.ct-now { color: var(--acc); }
.fe :is([data-ct-more], .gally-more) { display: flex; width: fit-content; margin: 8px auto 0; height: 48px; padding: 0 24px; align-items: center; justify-content: center; border: 0; border-radius: 24px; background: var(--txt); color: var(--bg); font-size: 15px; font-weight: 500; text-decoration: none; }
.fe :is([data-ct-more], .gally-more)[hidden] { display: none; }
.fe :is([data-ct-more], .gally-more):hover { color: var(--bg); background: var(--acc); }
.fv-count { margin: 12px 0 32px; text-align: center; font: 500 12px var(--mono); color: var(--mut); }
.fv-count:empty { display: none; }

/* Lists in «Список» view: a row per festival. */
.fv-list[data-gally-view="list"] .cards { grid-template-columns: 1fr; gap: 0; }
.fv-list[data-gally-view="list"] .card { display: grid; grid-template-columns: 96px 1fr; gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid rgba(var(--ink), .1); }
.fv-list[data-gally-view="list"] .poster { grid-row: span 2; aspect-ratio: 1; }
.fv-list[data-gally-view="list"] .heart { display: none; }
.fv-list[data-gally-view="list"] .card-foot { border: 0; padding: 0; }

/* The rest of the year — light lines, the big names dark. The months the list above already shows are left out. */
.fv-year { padding: 36px 0 40px; border-top: 1px solid rgba(var(--ink), .12); }
.fv-year h2 { margin: 12px 0 20px; font-size: 28px; font-weight: 400; letter-spacing: -.03em; line-height: 1.12; }
.fv-lines { margin: 0; padding: 0; border-top: 1px solid rgba(var(--ink), .1); }
.fv-line { display: grid; grid-template-columns: 44px 1fr auto; align-items: baseline; gap: 12px; padding: 14px 0; border-bottom: 1px solid rgba(var(--ink), .1); }
.fv-line:hover { color: var(--txt); }
.fv-line:hover .fv-names b, .fv-line:hover .fv-n { color: var(--acc); }
.fv-lines > a.fv-line:nth-of-type(-n+3), .fv-lines > .fx-cal-y, .fv-line[hidden], .fv-year[hidden] { display: none; }
.fv-lines:has(> a.fv-line:not([hidden])) > a.fv-line:nth-of-type(-n+3):not([hidden]) { display: grid; }
.fv-names > span:nth-child(n+3) { display: none; }
.fv-mo { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.fv-names { font-size: 17px; font-weight: 300; letter-spacing: -.015em; line-height: 1.3; color: var(--mut); }
.fv-names > span + span::before { content: " · "; color: var(--faint); }
.fv-names b { font-weight: 400; color: var(--txt); }
.fv-names em { font-style: normal; }
.fv-names .fv-minor { display: none; }
.fv-n { font: 500 11px var(--mono); color: var(--mut); }

/* «Без билета» and «Прошедшие» — one quiet card and one dashed frame. */
.fv-end { display: grid; gap: 12px; padding: 0 0 48px; }
.fv-free, .fv-past { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border-radius: 8px; transition: box-shadow .2s, border-color .2s; }
.fv-free { background: var(--s1); }
.fv-free:hover { color: var(--txt); box-shadow: 0 12px 28px rgba(var(--ink), .08); }
.fv-past { border: 1px dashed rgba(var(--ink), .22); }
.fv-past:hover { color: var(--txt); border-color: rgba(var(--ink), .45); }
.fv-free-num { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 6px; background: var(--bg); display: grid; place-items: center; font-size: 36px; font-weight: 300; letter-spacing: -.05em; color: var(--acc); }
.fv-free-words { display: flex; flex-direction: column; gap: 6px; max-width: 46ch; }
.fv-free-words b { font-size: 19px; font-weight: 400; letter-spacing: -.02em; }
.fv-free-words > span { font-size: 15px; line-height: 1.45; color: var(--mut); }
.fv-free-names > span + span::before { content: ", "; }
.fv-year h2 b { font-weight: 500; color: var(--acc); }
.fv-free-words em { font-style: normal; font-size: 15px; font-weight: 500; color: var(--acc); }

/* The festivals that are no longer held — their pages stay; here they wait under «Прошедшие». */
.fv-gone { padding: 8px 0 56px; }
.fv-gone[hidden] { display: none; }
.fv-gone h2 { margin: 12px 0 20px; font-size: 28px; font-weight: 400; letter-spacing: -.03em; }
.fv-gone ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 32px; }
.fv-gone li a { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(var(--ink), .1); }
.fv-gone img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; filter: grayscale(1); opacity: .8; }
.fv-gone li b { display: block; font-weight: 400; }
.fv-gone li span span { font-size: 13px; color: var(--mut); }
.fv-miss { margin: 0; padding: 0 0 48px; font-size: 14px; color: var(--mut); }
.fv-miss a { color: var(--acc); }

.calendar-wrap { display: none; padding: 16px 0 48px; }
body:has(.views button[data-gally-view="calendar"][aria-pressed="true"]) .calendar-wrap { display: block; }
body:has(.views button[data-gally-view="calendar"][aria-pressed="true"]) :is(.fv-list, .fv-hl, .fv-kinds, .fv-year, .fv-months, [data-ct-more], .fe .gally-more, .fv-count) { display: none; }

@media (min-width: 900px) {
  .fv-months { margin: 0 -40px; padding: 0 40px; }
  .fv-month { width: 84px; }
  .fv-month b { font-size: 22px; }
  .fv-hl { padding-top: 40px; }
  .fv-hl-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; overflow: visible; margin: 0; padding: 0; }
  .fv-hl-row > .card { flex: none; }
  .fv-kinds { padding-bottom: 64px; }
  .fv-kinds-note { display: inline; }
  .fv-kinds-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 16px; overflow: visible; margin: 0; padding: 0; }
  .fv-kind { flex: none; }
  .fv-kind-t { flex-direction: row; justify-content: space-between; align-items: baseline; }
  .fv-kind b { font-size: 15px; }
  .fv-group .fx-fold { grid-column: 2; justify-self: start; }
  .fe :is([data-ct-more], .gally-more) { margin-left: 268px; }
  .fv-count { text-align: left; margin-left: 268px; }
  .fv-year { display: grid; grid-template-columns: 220px 1fr; gap: 20px 48px; padding: 56px 0 64px; }
  .fv-year h2 { font-size: 32px; margin-bottom: 0; }
  .fv-lines { border-top: 1px solid rgba(var(--ink), .1); }
  .fv-line { grid-template-columns: 72px 1fr auto; gap: 24px; padding: 18px 0; }
  .fv-names { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fv-names > span:nth-child(n+3) { display: inline; }
  .fv-end { grid-template-columns: 1fr 1fr; gap: 20px; padding-bottom: 72px; }
  .fv-free, .fv-past { gap: 28px; padding: 28px; }
  .fv-free-num { width: 104px; height: 104px; font-size: 56px; }
  .fv-free-words b { font-size: 22px; }
  .fv-gone ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fv-gone h2 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .fv-ph img, .poster img { transition: none; }
  .fv-kind:hover .fv-ph img, .card:hover .poster img { transform: none; }
}
