/*
 * visual10 - strona startowa (widoki days / month / list / terms z ustawienia 100), lista wydarzeń (/bilety)
 * i strona wydarzenia (/bilety/<slug>). Ładowane po core.css z klas PortalHomePage, PortalEventsPage,
 * PortalEventPage. Klasy: p-home-* (wspólne elementy: pasek dni, karty wydarzeń, godziny, kalendarz),
 * p-events-* (lista wydarzeń), p-event-* (wydarzenie), p-home-tile* (kafle miejsc / kategorii), p-home-exh* (wystawy).
 * Opis wydarzenia (.p-rich) - rich.css. Kolory wyłącznie z tokenów core.css / marki.
 * Breakpointy: 768 px (telefon / desktop), 900 px (afisz z tytułami, kolumna boczna listy), 1100 px (panel dnia obok afisza).
 */

/* ---------------------------------------------------------------- wspólne */

.p-home-h1 { margin-bottom: 12px; }
/* tytuł „Repertuar” powtarza podświetloną pozycję menu (od 768 px w nagłówku, na telefonie w zakładkach na dole) -
   widać go tylko na komputerze bez menu; dla czytnika zostaje zawsze (nagłówek strony) */
@media (max-width: 767.98px) {
  .p-home-h1 { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 768px) {
  .p-nav-on .p-home-h1 { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.p-home-view[aria-busy="true"] { opacity: .55; transition: opacity .15s; }
.p-body .p-home-note { margin: 10px 0 0; font-size: 14px; line-height: 20px; color: var(--p-muted); }
.p-body .p-home-summary { margin: 0 0 12px; font-size: 14px; line-height: 20px; color: var(--p-ink-2); }

/* nagłówek dnia: „Dziś” + „czwartek, 8 października” */
.p-body .p-home-dayh {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 22px 0 2px;
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  scroll-margin-top: 16px;
}
.p-body .p-home-dayh:focus { outline: none; }
.p-body .p-home-dayh:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: var(--p-r-xs, 6px); }
.p-home-dayh-sub { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0; color: var(--p-muted); }
@media (min-width: 768px) {
  .p-body .p-home-dayh { font-size: 28px; line-height: 34px; font-weight: 800; margin-top: 28px; }
  .p-home-dayh-sub { font-size: 15px; }
}

/* ---------------------------------------------------------------- baner strony startowej (ustawienia 202-204) */

/* obrazek z zarezerwowaną proporcją (bez przesunięcia układu po wczytaniu), nazwa i hasło na pełnym tle w kolorze głównym -
   telefon: panel pod obrazkiem, zachodzi na jego dół; od 768 px panel na obrazku w lewym dolnym rogu */
.p-hero { margin: 0 0 18px; }
.p-hero-media {
  aspect-ratio: 16 / 9;
  border-radius: var(--p-radius);
  overflow: hidden;
  background: var(--brand-soft);
}
.p-hero-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.p-hero-panel {
  position: relative;
  padding: 14px 18px 16px;
  border-radius: var(--p-radius);
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: var(--p-shadow);
}
.p-hero.has-img .p-hero-panel { margin: -36px 12px 0; }
.p-body .p-hero-name { margin: 0; font-size: 24px; line-height: 28px; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.p-body .p-hero-tag { margin: 6px 0 0; font-size: 16px; line-height: 22px; font-weight: 500; overflow-wrap: anywhere; }
@media (min-width: 768px) {
  .p-hero { margin-bottom: 24px; }
  .p-hero-media { aspect-ratio: 5 / 2; }
  /* obrazek i panel w jednej komórce siatki: długie hasło powiększa baner zamiast wychodzić poza obrazek */
  .p-hero.has-img { display: grid; }
  .p-hero.has-img > * { grid-area: 1 / 1; }
  .p-hero.has-img .p-hero-panel { align-self: end; justify-self: start; max-width: min(560px, calc(100% - 48px)); margin: 24px; padding: 18px 24px 20px; }
  .p-body .p-hero-name { font-size: 34px; line-height: 40px; }
  .p-body .p-hero-tag { font-size: 18px; line-height: 26px; }
}
@media (forced-colors: active) {
  .p-hero-panel { border: 1px solid CanvasText; }
}

/* ---------------------------------------------------------------- pasek dni (days) */

.p-home-stripbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.p-home-strip {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.p-home-strip-list {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  position: relative;
}
/* telefon: ostatni widoczny kafel wygasa przy prawej krawędzi (obok przycisku kalendarza) zamiast być ucięty na ostro */
@media (max-width: 767.98px) {
  .p-home-strip-list {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
}
.p-home-strip-list::-webkit-scrollbar { display: none; }
.p-home-strip-list > li { flex: none; scroll-snap-align: start; scroll-margin-inline: 6px; }
.p-home-strip .p-day { min-height: 64px; }
.p-home-mon { display: none; font-size: 11px; }
.p-home-strip .p-day.is-newmonth .p-home-mon { display: block; }
.p-home-stripnav {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 100%;
  min-height: 64px;
  border-radius: var(--p-r-md, 14px);
  color: var(--p-ink) !important;
  text-decoration: none;
}
.p-home-stripnav:hover { background: var(--p-line); }
.p-home .p-home-calbtn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 56px;
  min-height: 64px;
  padding: 0;
  border: 0;
  border-radius: var(--p-r-md, 16px);
  background: var(--p-ink);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.p-home .p-home-calbtn:hover { background: #000; }
/* telefon: sama ikona, nazwa dla czytnika */
.p-home-calbtn-t {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (min-width: 768px) {
  .p-home-stripbar { align-items: flex-start; gap: 12px; }
  /* jeden rząd: 14 dni + strzałki „Wcześniejsze / Kolejne dni” (dzień spoza pierwszych 2 tygodni, filtr) bez zawijania;
     przy wąskim oknie rząd się przewija (strzałki klawiatury, wybrany dzień przewijany do widoku - home.js) */
  .p-home-strip-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(52px, 1fr);
    overflow-x: auto;
    padding: 6px;
    /* widoczny pasek przewijania, gdy rząd się nie mieści (mysz bez przewijania w bok) */
    scrollbar-width: thin;
  }
  .p-home-strip-list::-webkit-scrollbar { display: block; height: 6px; }
  .p-home-strip-list::-webkit-scrollbar-thumb { background: var(--p-line-2); border-radius: 3px; }
  .p-home-strip .p-day { width: 100%; min-height: 76px; }
  .p-home-mon { display: block; }
  .p-home-stripnav { width: 100%; min-height: 76px; }
  .p-home .p-home-calbtn { width: auto; min-height: 76px; padding: 0 20px; margin-top: 4px; }
  .p-home-calbtn-t { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}

/* okno „Kalendarz” (days) */
.p-home-caldlg .p-dialog-body { padding-top: 0; }
.p-home-caldlg .p-home-cal { max-width: 420px; margin: 0 auto; }

/* ---------------------------------------------------------------- filtry */

.p-home-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 4px 0 4px;
}
.p-home-chips {
  display: flex;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 5px;
  margin: -5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.p-home-chips::-webkit-scrollbar { display: none; }
.p-home-chips .p-chip { flex: none; }
.p-home-place { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.p-home-place .p-select { width: auto; min-width: 12rem; max-width: 100%; min-height: 44px; padding: 8px 12px; font-size: 15px; }
.p-home-place .p-label { font-size: 14px; }
@media (min-width: 768px) {
  .p-home-chips { flex-wrap: wrap; overflow: visible; }
}

/* ---------------------------------------------------------------- kafle miejsc / kategorii (ustawienie 160) */

/* telefon: rząd przewijany w bok (jak kategorie); od 768 px siatka. Kafel = link filtra, wybrany - aria-current. */
.p-home-tiles { margin: 0 0 12px; }
.p-body .p-home-tiles-h { margin: 0 0 8px; font-size: 15px; line-height: 20px; font-weight: 700; color: var(--p-ink-2); }
.p-home-tiles-list {
  display: flex;
  gap: 10px;
  margin: -5px;
  padding: 5px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.p-home-tiles-list::-webkit-scrollbar { display: none; }
.p-home-tiles-list > li { flex: 0 0 148px; scroll-snap-align: start; }
.p-home-tile {
  /* blok pozycjonowania dla .p-sr - inaczej tekst dla czytnika z kafli poza ekranem poszerza stronę */
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 44px;
  border-radius: var(--p-r-md, 16px);
  overflow: hidden;
  background: var(--p-surface);
  color: var(--p-ink) !important;
  text-decoration: none;
}
/* obwódka nad obrazkiem (warstwa ::after) - cień inset kafla przykrywał obrazek, więc zaznaczenie obejmowało tylko dół */
.p-home-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1.5px var(--p-line);
  pointer-events: none;
}
.p-home-tile:hover::after { box-shadow: inset 0 0 0 1.5px var(--p-field); }
.p-home-tile[aria-current]::after { box-shadow: inset 0 0 0 3px var(--brand-strong); }
.p-home-tile-img {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  background: var(--brand-soft);
  color: var(--brand-strong);
  overflow: hidden;
}
.p-home-tile-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.p-home-tile-img.is-text span { font-size: 34px; line-height: 1; font-weight: 800; }
.p-home-tile.is-t1 .p-home-tile-img.is-text { background: var(--p-ink); color: #fff; }
.p-home-tile.is-t2 .p-home-tile-img.is-text { background: var(--brand); color: var(--brand-ink); }
.p-home-tile.is-t3 .p-home-tile-img.is-text { background: var(--p-line); color: var(--p-ink); }
/* „Wszystkie…”: pole obrazka w kolorze marki (w kolorze tła strony kafel wyglądał na ucięty) */
.p-home-tile-img.is-all { background: var(--brand-soft); color: var(--brand-strong); }
.p-home-tile-body { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; min-width: 0; }
.p-home-tile-name { font-size: 15px; line-height: 20px; font-weight: 700; overflow-wrap: anywhere; }
.p-home-tile-meta { font-size: 13px; line-height: 18px; color: var(--p-muted); }
.p-home-tile-next { display: block; }
.p-home-tile[aria-current] .p-home-tile-name::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 6px 1px 0;
  border-radius: 50%;
  background: var(--brand-strong);
}
@media (min-width: 768px) {
  .p-home-tiles { margin-bottom: 16px; }
  .p-home-tiles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    overflow: visible;
  }
  .p-home-tiles-list > li { flex: none; }
  .p-home-tile-img { aspect-ratio: 2 / 1; }
  .p-home-tile-name { font-size: 16px; line-height: 22px; }
}

/* ---------------------------------------------------------------- wystawy (ustawienie 162) */

.p-home-exh { margin: 0 0 20px; }
.p-body .p-home-exh-h { margin: 0 0 10px; }
.p-home-exh-card .p-events-card-cta { margin-top: 6px; }
@media (min-width: 768px) {
  .p-home-exh { margin-bottom: 28px; }
}

/* ---------------------------------------------------------------- karty wydarzeń */

.p-home-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.p-home-ev {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  background: var(--p-surface);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  padding: 12px;
}
.p-home-ev .p-home-pills { grid-column: 1 / -1; }
.p-home-ev-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.p-body .p-home-ev-title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.p-body .p-home-ev-title a { color: var(--p-ink) !important; text-decoration: none; }
.p-body .p-home-ev-title a:hover { text-decoration: underline; }
.p-body .p-home-ev-sub { margin: 0; font-size: 14px; line-height: 20px; color: var(--p-ink-2); }
.p-body .p-home-ev-meta { margin: 0; font-size: 13px; line-height: 18px; color: var(--p-muted); }
.p-home-ev-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; }
.p-home-ev-price { margin-left: auto; font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; }

/* wiersze (list, panel dnia w month): mniejszy plakat, wspólna biała ramka z liniami */
.p-home-cards.is-rows {
  gap: 0;
  background: var(--p-surface);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  padding: 0 12px;
}
.p-home-cards.is-rows > li + li { border-top: 1px solid var(--p-line); }
.p-home-ev.is-row {
  grid-template-columns: 48px minmax(0, 1fr);
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 14px 0;
}
.p-home-ev.is-row .p-home-ev-title { font-size: 16px; line-height: 21px; font-weight: 650; }
.p-home-ev.is-row .p-home-pills { margin-top: 0; }

@media (min-width: 768px) {
  .p-home-ev {
    grid-template-columns: 108px minmax(220px, 300px) minmax(0, 1fr);
    gap: 16px 24px;
    padding: 16px;
    border-radius: var(--p-r-lg, 20px);
  }
  .p-home-ev .p-home-pills { grid-column: auto; margin-top: 2px; align-content: flex-start; }
  .p-body .p-home-ev-title { font-size: 22px; line-height: 28px; }
  .p-body .p-home-ev-meta { font-size: 14px; line-height: 20px; }
  .p-home-ev-price { margin-left: 0; font-size: 15px; }
  .p-home-ev-foot { margin-top: auto; padding-top: 6px; }
  .p-home-ev-body { align-self: stretch; }
  .p-home-cards.is-rows { padding: 0 18px; }
  .p-home-ev.is-row { grid-template-columns: 72px minmax(200px, 280px) minmax(0, 1fr); padding: 16px 0; }
  .p-home-ev.is-row .p-home-ev-title { font-size: 18px; line-height: 24px; font-weight: 700; }
}

/* panel dnia obok afisza (month): wąski - wiersze jak na telefonie */
.p-home-results.is-panel .p-home-ev.is-row { grid-template-columns: 56px minmax(0, 1fr); }
.p-home-results.is-panel .p-home-ev.is-row .p-home-pills { grid-column: 1 / -1; }

/* ---------------------------------------------------------------- plakaty */

.p-home-poster {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--p-r-sm, 12px);
  overflow: hidden;
  background: var(--p-bg);
  text-decoration: none;
}
.p-home-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.p-home-ev.is-row .p-home-poster { border-radius: var(--p-r-xs, 8px); }
/* zastępczy plakat typograficzny (brak pliku) - odcienie z tokenów */
.p-home-poster.is-text {
  display: flex;
  align-items: flex-end;
  padding: 10%;
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.p-home-poster.is-text span {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
  hyphens: auto;
}
.p-home-poster.is-text.is-t1 { background: var(--p-ink); color: #fff; }
.p-home-poster.is-text.is-t2 { background: var(--brand); color: var(--brand-ink); }
.p-home-poster.is-text.is-t3 { background: var(--p-line); color: var(--p-ink); }
.p-home-ev.is-row .p-home-poster.is-text span { font-size: 9px; -webkit-line-clamp: 3; }
@media (min-width: 768px) {
  .p-home-poster.is-text span { font-size: 16px; }
  .p-home-ev.is-row .p-home-poster.is-text span { font-size: 11px; }
}

/* ---------------------------------------------------------------- godziny (pigułki) */

.p-home-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.p-home-pills .p-pill small { white-space: nowrap; }
/* miejsce pod godziną (terminy w kilku miejscach): do dwóch linii, pełna nazwa także dla czytnika w nazwie pigułki */
.p-home-pills .p-pill .p-pill-place {
  max-width: 16ch;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  color: var(--p-ink-2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.p-home-pills.has-places .p-pill { padding-top: 6px; padding-bottom: 6px; border-radius: var(--p-radius); }
.p-home-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--p-r-pill, 999px);
  border: 1.5px dashed var(--p-field);
  background: var(--p-surface);
  color: var(--p-ink);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.p-home-more:hover { border-style: solid; border-color: var(--p-ink); }
@media (min-width: 768px) {
  .p-home-pills .p-pill { min-height: 52px; min-width: 84px; font-size: 16px; }
  .p-home-pills .p-pill small { font-size: 12px; }
}

/* ---------------------------------------------------------------- brak terminów */

.p-home-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 24px 20px; }
.p-home-empty p { margin: 0; color: var(--p-ink-2); }
.p-home-empty .p-h1 { margin: 0; }
.p-home-empty-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--p-r-md, 16px);
  background: var(--p-bg);
}
.p-home-empty-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; align-self: stretch; }
.p-body .p-home-dayempty { margin: 0; padding: 14px 16px; font-size: 14px; line-height: 20px; color: var(--p-ink-2); }
@media (max-width: 767.98px) {
  .p-home-empty-actions .p-btn { flex: 1 1 100%; }
}

/* ---------------------------------------------------------------- kalendarz miesiąca */

.p-home-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
}
.p-body .p-home-cal-title {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  text-align: center;
}
.p-body .p-home-cal-title:focus { outline: none; }
.p-body .p-home-cal-title:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: var(--p-r-xs, 6px); }
.p-home-cal-nav { border: 1.5px solid var(--p-line); background: var(--p-surface); color: var(--p-ink) !important; }
.p-home-cal-nav:hover { border-color: var(--p-field); }
/* motyw (195-198): strzałki stoją wprost na tle strony, ale mają tło i tekst karty - przy najechaniu tło karty z odcieniem
   (ogólne :hover przycisków-ikon odsłaniało tło strony i na ciemnej stronie ikona znikała) */
.p-th .p-iconbtn.p-home-cal-nav:hover:not(.is-off) { background: color-mix(in srgb, var(--p-ink) 8%, var(--p-surface)); }
.p-home-cal-nav.is-off { color: var(--p-field) !important; border-color: var(--p-line); cursor: default; }
.p-home-cal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
  margin: 0 -3px;
  width: calc(100% + 6px);
}
.p-home-cal-table th {
  padding: 2px 0 4px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--p-muted);
  text-align: center;
}
/* telefon: skróty dni widoczne, pełne nazwy dla czytnika */
.p-home-wd-l {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.p-home-cal-table td { padding: 0; vertical-align: top; }
.p-home-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 48px;
  border-radius: var(--p-r-sm, 12px);
  color: var(--p-ink) !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
a.p-home-cell:hover { background: var(--p-bg); }
.p-home-cell-top { display: flex; align-items: center; justify-content: center; gap: 6px; }
.p-home-cell-today, .p-home-cell-lines { display: none; }
.p-home-cell-dots { display: flex; gap: 3px; height: 5px; }
.p-home-cell-dots i { display: block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.is-today .p-home-cell { box-shadow: inset 0 0 0 1.5px var(--p-ink); }
.is-empty .p-home-cell { color: var(--p-muted) !important; font-weight: 500; }
.is-past .p-home-cell { color: var(--p-field) !important; font-weight: 500; }
.is-listed .p-home-cell { background: var(--brand-softer); }
.is-current .p-home-cell,
.is-current a.p-home-cell:hover {
  background: var(--p-ctl, var(--brand));
  color: var(--p-ctl-ink, var(--brand-ink)) !important;
  box-shadow: inset 0 0 0 1.5px var(--p-ctl-edge, var(--brand-strong));
}
.p-home-cal.is-mini .p-home-cell { min-height: 44px; font-size: 15px; }

/* afisz (month) od 900 px: tytuły i godziny w komórkach */
@media (min-width: 900px) {
  .p-home-cal.is-big .p-home-cal-table { border-spacing: 8px; margin: 0 -8px; width: calc(100% + 16px); }
  .p-home-cal.is-big .p-home-cal-table th { padding: 0 0 2px 10px; text-align: left; font-size: 13px; }
  .p-home-cal.is-big .p-home-wd-s { display: none; }
  .p-home-cal.is-big .p-home-wd-l { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
  .p-home-cal.is-big .p-home-cell {
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    min-height: 128px;
    padding: 8px 8px 10px;
    border-radius: var(--p-r-md, 16px);
    background: var(--p-surface);
    box-shadow: var(--p-shadow);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
  }
  .p-home-cal.is-big a.p-home-cell:hover { box-shadow: inset 0 0 0 1.5px var(--p-ink); }
  .p-home-cal.is-big .p-home-cell-top { justify-content: space-between; margin-bottom: 2px; }
  .p-home-cal.is-big .p-home-cell-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
    border-radius: var(--p-r-sm, 10px);
    font-size: 22px;
    font-weight: 800;
  }
  .p-home-cal.is-big .p-home-cell-today {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: var(--p-r-pill, 999px);
    background: var(--p-ink);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
  }
  .p-home-cal.is-big .p-home-cell-lines { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  /* godzina w swojej linii, tytuł w jednej linii z wielokropkiem (pełny w panelu dnia) - w wąskiej komórce
     długie słowo nie łamie się w środku */
  .p-home-cal.is-big .p-home-cell-ln { position: relative; display: block; min-width: 0; padding-left: 12px; }
  .p-home-cal.is-big .p-home-cell-ln > span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .p-home-cal.is-big .p-home-cell-ln::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--brand);
    box-shadow: inset 0 0 0 1px var(--brand-strong);
  }
  .p-home-cal.is-big .p-home-cell-ln b { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
  .p-home-cal.is-big .p-home-cell-more { padding-left: 12px; font-weight: 600; color: var(--p-ink-2); }
  .p-home-cal.is-big .p-home-cell-dots { display: none; }
  .p-home-cal.is-big .is-today .p-home-cell { box-shadow: var(--p-shadow); }
  .p-home-cal.is-big .is-today .p-home-cell-num { box-shadow: inset 0 0 0 1.5px var(--p-ink); }
  .p-home-cal.is-big .is-empty .p-home-cell { background: var(--p-bg); box-shadow: inset 0 0 0 1px var(--p-line); }
  .p-home-cal.is-big .is-past .p-home-cell { background: transparent; box-shadow: inset 0 0 0 1px var(--p-line); }
  .p-home-cal.is-big .is-current .p-home-cell,
  .p-home-cal.is-big .is-current a.p-home-cell:hover {
    background: var(--p-surface);
    color: var(--p-ink) !important;
    box-shadow: inset 0 0 0 3px var(--brand-strong);
  }
  .p-home-cal.is-big .is-current .p-home-cell-num { background: var(--p-ctl, var(--brand)); color: var(--p-ctl-ink, var(--brand-ink)); }
  .p-home-cal.is-big .p-home-cal-head { justify-content: flex-start; gap: 12px; margin-bottom: 12px; }
  .p-home-cal.is-big .p-home-cal-title { min-width: 12ch; font-size: 26px; line-height: 32px; font-weight: 800; }
}

/* ---------------------------------------------------------------- widok month */

.p-home-monthcal {
  background: var(--p-surface);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  padding: 10px 12px 12px;
  margin-top: 8px;
}
.p-home-results.is-panel { margin-top: 4px; }
@media (min-width: 900px) {
  .p-home-monthcal { background: none; box-shadow: none; padding: 0; margin-top: 16px; }
}
@media (min-width: 1100px) {
  .p-home-monthgrid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    gap: 24px;
    align-items: start;
  }
  .p-home-results.is-panel {
    position: sticky;
    top: 16px;
    margin-top: 16px;
    padding: 4px 20px 20px;
    background: var(--p-surface);
    border-radius: var(--p-r-lg, 24px);
    box-shadow: var(--p-shadow-panel, 0 12px 40px rgba(21, 22, 26, .12));
  }
  .p-home-results.is-panel .p-home-dayh { margin-top: 16px; font-size: 24px; line-height: 30px; }
  .p-home-results.is-panel .p-home-cards.is-rows { box-shadow: none; padding: 0; }
  .p-home-results.is-panel .p-home-empty { padding: 16px 0 0; box-shadow: none; }
}

/* ---------------------------------------------------------------- widok list */

.p-home-from { padding: 2px 12px 12px; margin-bottom: 12px; }
.p-home-from-sum {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  list-style: none;
  cursor: pointer;
  font-size: 15px;
}
.p-home-from-sum::-webkit-details-marker { display: none; }
.p-home-from-t { flex: 1; min-width: 0; }
.p-home-from-chev { transition: transform .15s; }
.p-home-from[open] .p-home-from-chev { transform: rotate(180deg); }
.p-home-from .p-home-cal { margin-top: 2px; }
.p-home-side .p-home-filters { flex-direction: column; align-items: stretch; margin-bottom: 4px; }
.p-home-side .p-home-place .p-select { flex: 1 1 12rem; }
.p-home-days { list-style: none; margin: 0; padding: 0; }
.p-home-daygroup .p-home-dayh { margin: 18px 0 10px; }
.p-home-daygroup:first-child .p-home-dayh { margin-top: 6px; }
.p-home-listmore { margin-top: 20px; }
.p-home-listmore .p-btn { background: var(--p-surface); }
@media (min-width: 900px) {
  .p-home-listgrid {
    display: grid;
    grid-template-columns: minmax(340px, 360px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }
  .p-home-side { position: sticky; top: 16px; }
  .p-home-from > summary { display: none; }
  .p-home-from { padding: 12px; }
  .p-home-side .p-home-chips { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------- widok terms: wiersz na termin */

/* biała ramka z liniami jak wiersze listy. Telefon: miniatura plakatu na wysokość wiersza, obok godzina i tytuł
   z „Kup bilet” po prawej, pod spodem miejsce, cena, stan, kategoria. Od 768 px: godzina, plakat, tytuł z linią
   szczegółów, kolumna ceny, przycisk. Plakat zawsze - dla wielu instytucji to główna informacja o wydarzeniu. */
.p-home-trows {
  list-style: none;
  margin: 0;
  padding: 0 12px;
  background: var(--p-surface);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
}
.p-home-trow {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  grid-template-areas:
    "poster time  act"
    "poster title act"
    "poster info  info";
  gap: 2px 12px;
  align-items: start;
  padding: 12px 0;
}
.p-home-trow + .p-home-trow { border-top: 1px solid var(--p-line); }
.p-home-trow-time {
  grid-area: time;
  font-size: 17px;
  line-height: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.p-home-trow .p-home-poster { grid-area: poster; border-radius: var(--p-r-xs, 6px); }
/* zastępcza miniatura: pierwsza litera tytułu */
.p-home-trow .p-home-poster.is-text { display: flex; align-items: center; justify-content: center; padding: 0; }
.p-home-trow .p-home-poster.is-text span { font-size: 18px; line-height: 1; }
.p-body .p-home-trow-title {
  grid-area: title;
  margin: 0;
  font-size: 16px;
  line-height: 21px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.p-body .p-home-trow-title a { padding: 4px 0; color: var(--p-ink) !important; text-decoration: none; }
.p-body .p-home-trow-title a:hover { text-decoration: underline; }
.p-home-trow-info { grid-area: info; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.p-body .p-home-trow-sub { margin: 0; font-size: 14px; line-height: 19px; color: var(--p-ink-2); }
.p-body .p-home-trow-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--p-muted);
}
.p-home-trow-meta .p-status, .p-home-trow-meta .p-tag { min-height: 22px; padding: 0 8px; font-size: 12px; }
.p-home-trow-mprice { font-weight: 600; color: var(--p-ink-2); white-space: nowrap; }
.p-body .p-home-trow-price { display: none; }
.p-home-trow-act { grid-area: act; align-self: center; display: flex; justify-content: flex-end; }
.p-home-trow-buy.p-btn { min-height: 44px; padding: 0 14px; font-size: 15px; white-space: nowrap; }
/* wejście „w godzinach otwarcia” (23:59): ikona zegara w kolumnie godziny, tekst w linii szczegółów */
.p-home-trow-time.is-open { display: inline-flex; align-self: center; color: var(--p-ink-2); }
.p-home-trow-open { font-weight: 600; color: var(--p-ink-2); }
/* wyprzedany termin: godzina wyciszona, w miejscu przycisku „Wyprzedane” (tekst, nie tylko kolor) */
.p-home-trow.is-out .p-home-trow-time { color: var(--p-muted); font-weight: 600; }
@media (min-width: 768px) {
  .p-home-trows { padding: 0 18px; }
  .p-home-trow {
    grid-template-columns: 4rem 56px minmax(0, 1fr) 7.5rem 8.5rem;
    grid-template-areas:
      "time poster title price act"
      "time poster info  price act";
    gap: 4px 16px;
    align-items: center;
    padding: 14px 0;
  }
  .p-home-trow-time { font-size: 22px; line-height: 28px; }
  .p-home-trow .p-home-poster.is-text span { font-size: 22px; }
  .p-body .p-home-trow-title { align-self: end; font-size: 18px; line-height: 24px; font-weight: 700; }
  .p-home-trow-info { align-self: start; }
  .p-body .p-home-trow-meta { font-size: 14px; line-height: 20px; }
  .p-home-trow-mprice { display: none; }
  .p-body .p-home-trow-price { display: block; grid-area: price; margin: 0; font-size: 15px; line-height: 20px; font-weight: 600; text-align: right; }
  .p-body .p-home-trow.is-out .p-home-trow-price { color: var(--p-muted); }
  .p-home-trow-buy.p-btn { width: 100%; font-size: 16px; }
  /* wiersz bez linii szczegółów: tytuł na środku wiersza */
  .p-home-trow:not(:has(.p-home-trow-info)) .p-home-trow-title { grid-row: 1 / 3; align-self: center; }
}

/* ---------------------------------------------------------------- lista wydarzeń (/bilety) */

.p-events-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-bottom: 14px; }
.p-events-head .p-h1 { margin: 0; }
.p-events-search { display: flex; gap: 8px; flex: 1 1 18rem; max-width: 26rem; }
.p-events-search .p-input { flex: 1; min-width: 0; }
.p-events-search .p-btn { min-height: 48px; padding: 0 16px; }
.p-events-chips { margin-bottom: 12px; }
.p-events-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.p-events-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  padding: 12px;
  background: var(--p-surface);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
}
.p-events-card-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.p-body .p-events-card-cat { margin: 0; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--p-muted); }
.p-body .p-events-card-title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.p-body .p-events-card-title a { color: var(--p-ink) !important; text-decoration: none; }
.p-body .p-events-card-title a:hover { text-decoration: underline; }
.p-body .p-events-card-next { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
.p-body .p-events-card-meta { margin: 0; font-size: 13px; line-height: 18px; color: var(--p-muted); }
.p-events-card-cta { align-self: flex-start; margin-top: auto; }
@media (min-width: 768px) {
  .p-events-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; }
  .p-events-card { grid-template-columns: 120px minmax(0, 1fr); gap: 18px; padding: 16px; border-radius: var(--p-r-lg, 20px); }
  .p-body .p-events-card-title { font-size: 20px; line-height: 26px; }
}

/* ---------------------------------------------------------------- wydarzenie (/bilety/<slug>) */

.p-event-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.p-event-head > .p-home-poster { max-width: 240px; border-radius: var(--p-r-md, 16px); box-shadow: var(--p-shadow); }
.p-event-head > .p-home-poster.is-text span { font-size: 26px; }
.p-body .p-event-title { margin-bottom: 6px; overflow-wrap: anywhere; }
.p-body .p-event-sub { margin: 0 0 12px; }
.p-event-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.p-event-facts li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--p-r-pill, 999px);
  background: var(--p-surface);
  box-shadow: inset 0 0 0 1px var(--p-line);
  font-size: 14px;
  font-weight: 500;
}
.p-event-desc { font-size: 16px; line-height: 24px; max-width: 70ch; }
/* długi opis zwinięty: klasa p-clamp z serwera (descriptionLong) albo po pomiarze wysokości w term.js, przycisk „Pokaż cały
   opis” - jak „O wydarzeniu” na stronie terminu (term.css); bez JS opis cały, bez przycisku */
.p-event .p-event-more { display: none; align-items: center; margin: 4px 0 0; padding: 0; min-height: 44px; border: 0; background: none; color: var(--link); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (scripting: enabled) {
  .p-event-desc.p-clamp:not(.is-open) { max-height: 12em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
  .p-event .p-event-more { display: inline-flex; }
}
.p-clamp-js .p-event-desc.p-clamp:not(.is-open) { max-height: 12em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.p-clamp-js .p-event .p-event-more { display: inline-flex; }
.p-event .p-event-more[hidden] { display: none !important; }
@media (forced-colors: active) {
  .p-event-desc.p-clamp:not(.is-open) { -webkit-mask-image: none; mask-image: none; }
}
.p-body .p-event-reg { margin: 12px 0 0; font-weight: 600; }
.p-body .p-event-reg a { display: inline-flex; align-items: center; min-height: 44px; }
.p-body .p-event-jump { margin: 16px 0 0; }
.p-event-terms { margin-top: 28px; }
.p-event-terms .p-h2:focus { outline: none; }
.p-event-days { list-style: none; margin: 0; padding: 0 16px; background: var(--p-surface); border-radius: var(--p-radius); box-shadow: var(--p-shadow); }
.p-event-day { padding: 14px 0 16px; }
.p-event-day + .p-event-day { border-top: 1px solid var(--p-line); }
.p-body .p-event-dayh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 10px; font-size: 17px; line-height: 24px; font-weight: 700; }
@media (min-width: 768px) {
  .p-event-head { grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 32px; align-items: start; }
  .p-event-head > .p-home-poster { max-width: none; }
  .p-body .p-event-jump { display: none; }
  .p-event-days { padding: 0 24px; }
  .p-event-day { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 16px; align-items: start; padding: 18px 0; }
  .p-body .p-event-dayh { margin: 12px 0 0; flex-direction: column; gap: 0; }
}

/* ---------------------------------------------------------------- wysoki kontrast */

@media (forced-colors: active) {
  .p-home-cell, .p-home-more, .p-home-calbtn, .p-home-stripnav, .p-events-card, .p-home-ev, .p-home-trows, .p-home-tile { border: 1px solid CanvasText; }
  .p-home-tile[aria-current] { outline: 3px solid Highlight; }
  .is-current .p-home-cell { outline: 3px solid Highlight; }
  .p-home-cal.is-big .p-home-cell-ln::before, .p-home-cell-dots i { background: CanvasText; }
}

/* ---------------------------------------------------------------- kolory strony instytucji (body.p-th, core.css)

   Kontekst kart dla elementów, które są kartą tylko na części ekranów; tekst na wypełnieniu w kolorze tekstu (--p-ink)
   w kolorze --p-on-ink (biały na ciemnym tekście, kolor tła na jasnym). */
@media (max-width: 899.98px) {
  .p-th :where(.p-home-monthcal) {
    --p-ink: var(--p-s-ink); --p-ink-2: var(--p-s-ink-2); --p-muted: var(--p-s-muted); --p-line: var(--p-s-line); --p-line-2: var(--p-s-line-2);
    --p-field: var(--p-s-field); --p-bg: var(--p-s-fill); --p-on-ink: var(--p-s-on-ink); --p-ink-hi: var(--p-s-ink-hi); --link: var(--p-s-link);
    --brand-strong: var(--p-s-brand-strong); --brand-soft: var(--p-s-brand-soft); --brand-softer: var(--p-s-brand-softer); --brand-line: var(--p-s-brand-line);
    --p-ok: var(--p-s-ok); --p-ok-bg: var(--p-s-ok-bg); --p-warn: var(--p-s-warn); --p-warn-bg: var(--p-s-warn-bg); --p-err: var(--p-s-err); --p-err-bg: var(--p-s-err-bg);
    color: var(--p-ink);
  }
}
@media (min-width: 900px) {
  /* afisz: komórka dnia jest kartą; minione dni bez tła leżą na tle strony */
  .p-th :where(.p-home-cal.is-big td:not(.is-past) > .p-home-cell) {
    --p-ink: var(--p-s-ink); --p-ink-2: var(--p-s-ink-2); --p-muted: var(--p-s-muted); --p-line: var(--p-s-line); --p-line-2: var(--p-s-line-2);
    --p-field: var(--p-s-field); --p-bg: var(--p-s-fill); --p-on-ink: var(--p-s-on-ink); --p-ink-hi: var(--p-s-ink-hi); --link: var(--p-s-link);
    --brand-strong: var(--p-s-brand-strong); --brand-soft: var(--p-s-brand-soft); --brand-softer: var(--p-s-brand-softer); --brand-line: var(--p-s-brand-line);
    color: var(--p-ink);
  }
}
@media (min-width: 1100px) {
  .p-th :where(.p-home-results.is-panel) {
    --p-ink: var(--p-s-ink); --p-ink-2: var(--p-s-ink-2); --p-muted: var(--p-s-muted); --p-line: var(--p-s-line); --p-line-2: var(--p-s-line-2);
    --p-field: var(--p-s-field); --p-bg: var(--p-s-fill); --p-on-ink: var(--p-s-on-ink); --p-ink-hi: var(--p-s-ink-hi); --link: var(--p-s-link);
    --brand-strong: var(--p-s-brand-strong); --brand-soft: var(--p-s-brand-soft); --brand-softer: var(--p-s-brand-softer); --brand-line: var(--p-s-brand-line);
    --p-ok: var(--p-s-ok); --p-ok-bg: var(--p-s-ok-bg); --p-warn: var(--p-s-warn); --p-warn-bg: var(--p-s-warn-bg); --p-err: var(--p-s-err); --p-err-bg: var(--p-s-err-bg);
    color: var(--p-ink);
  }
}
.p-th .p-home .p-home-calbtn { color: var(--p-on-ink); }
.p-th .p-home .p-home-calbtn:hover { background: var(--p-ink-hi); }
.p-th .p-home-tile.is-t1 .p-home-tile-img.is-text,
.p-th .p-home-poster.is-text.is-t1 { color: var(--p-on-ink); }
@media (min-width: 900px) {
  .p-th .p-home-cal.is-big .p-home-cell-today { color: var(--p-on-ink); }
}

