/* Plakaty w kalendarzu wydarzeń (paczka L, 6.11.2026).
   Miniatura plakatu przy wydarzeniu + powiększenie w okienku (plakaty-kalendarza.js). */

/* ---------- Miniatura: wspólne ---------- */
.wydarzenie-plakat,
.event-plakat {
  display: block;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid #dfe6ee;
  border-radius: 4px;
  background: #f3f6f9;
  cursor: zoom-in;
  line-height: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wydarzenie-plakat img,
.event-plakat img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.wydarzenie-plakat:hover,
.event-plakat:hover {
  border-color: #9bbcd9;
  box-shadow: 0 4px 14px rgba(20, 38, 58, .14);
}
.wydarzenie-plakat:focus-visible,
.event-plakat:focus-visible {
  outline: 3px solid var(--main-color-dark, #2F6FA8);
  outline-offset: 2px;
}

/* ---------- /aktualnosci/kalendarz/ – plakat po prawej stronie karty ---------- */
.wydarzenie--plakat {
  align-items: center;
}
.wydarzenie--plakat .wydarzenie-opis {
  flex: 1 1 auto;
}
.wydarzenie-plakat {
  width: 92px;
  height: 130px;
  margin-left: auto;
}

/* ---------- Strona główna – plakat na początku wiersza ---------- */
.upcoming .event-item--plakat {
  align-items: center;
}
.event-plakat {
  width: 52px;
  height: 74px;
}

@media (max-width: 767px) {
  /* Telefon: plakat z lewej, obok data, tytuł i „Szczegóły” jeden pod drugim. */
  .upcoming .event-item--plakat {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 4px;
    align-items: start;
    justify-items: start;
  }
  .upcoming .event-item--plakat .event-plakat {
    grid-row: 1 / span 3;
    width: 60px;
    height: 85px;
  }
  .upcoming .event-item--plakat .event-date { margin: 0; }
  .upcoming .event-item--plakat .event-opis { width: 100%; }
  .upcoming .event-item--plakat .event-title { white-space: normal; }
}

@media (max-width: 480px) {
  .wydarzenie-plakat {
    width: 68px;
    height: 96px;
  }
  .wydarzenie--plakat {
    gap: 12px;
  }
}

/* ---------- Okienko powiększenia ---------- */
.plakat-okno {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 24px 16px;
  border: 0;
  background: transparent;
  overflow: auto;
}
.plakat-okno[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.plakat-okno::backdrop {
  background: rgba(12, 22, 36, .84);
}
html.plakat-okno-otwarte {
  overflow: hidden;
}

.plakat-okno__karta {
  position: relative;
  display: flex;
  flex-direction: column;
  width: fit-content;
  min-width: min(320px, 100%);
  max-width: min(760px, 100%);
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.plakat-okno__obraz {
  background: #0f1b2a;
  line-height: 0;
  text-align: center;
}
.plakat-okno__obraz img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 200px);
  max-height: calc(100dvh - 200px);
  width: auto;
  height: auto;
  margin: 0 auto;
}
.plakat-okno__opis {
  /* Opis nie poszerza karty – karta ma szerokość plakatu. */
  width: 0;
  min-width: 100%;
  box-sizing: border-box;
  padding: 14px 18px 16px;
  border-top: 1px solid #e6ebf1;
}
.plakat-okno__tytul {
  margin: 0;
  color: #1d2b3a;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}
.plakat-okno__kiedy {
  margin: 4px 0 0;
  color: #555;
  font-size: .875rem;
  line-height: 1.45;
}
.plakat-okno__akcje {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.plakat-okno__link {
  color: var(--main-color-dark, #2F6FA8);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.plakat-okno__link:hover,
.plakat-okno__link:focus-visible {
  color: #1d4f7c;
}
.plakat-okno__nawigacja {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.plakat-okno__nawigacja button {
  width: 38px;
  height: 34px;
  border: 1px solid #cfd9e3;
  border-radius: 4px;
  background: #fff;
  color: #1d2b3a;
  font-size: 1rem;
  cursor: pointer;
}
.plakat-okno__nawigacja button:hover { background: #f1f5f9; }
.plakat-okno__nawigacja button[hidden] { display: none; }

.plakat-okno__zamknij {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, .94);
  color: #1d2b3a;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.plakat-okno__zamknij:hover { background: #fff; }
.plakat-okno button:focus-visible,
.plakat-okno__link:focus-visible {
  outline: 3px solid var(--main-color-dark, #2F6FA8);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .plakat-okno[open] .plakat-okno__karta { animation: plakat-okno-wejscie .18s ease-out; }
  @keyframes plakat-okno-wejscie { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
}

/* Wysoki kontrast (ułatwienia dostępu). */
html.high-contrast .wydarzenie-plakat,
html.high-contrast .event-plakat { border: 2px solid #000; }
