/* Zmienne w podobnym duchu jak w opisie, lecz z własnymi nazwami */
:root {
  /* Kolory */
  --color-primary: #00CAFF;
  --color-secondary: #2E4252;
  --color-text: #858B94;
  --color-accent: #445F7D;
  --color-blue-1: #0077ED;
  --color-blue-2: #00CAFF;
  --color-purple-1: #350391;
  --color-purple-2: #3C039B;
  --color-purple-3: #1E0274;
  --color-red: #FF4242;
  --color-bg-1: #FAFAFA;
  --color-bg-2: #EDEDED;
  --color-muted: #B3BBCA;
  --color-dark: #212A3A;
  --color-white: #FFFFFF;
  --color-green: #00F09A;
  --color-orange: #FA5450;

  /* Typografia / spacing */
  --font-sans: "Lato", system-ui, Arial, sans-serif;
  --fs-12: 12px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-20: 20px;
  --fs-32: 32px;
  --fs-40: 40px;
  --fs-60: 60px;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 700;
  --lh-tight: 1.25;
  --lh-normal: 1.5;
  --lh-loose: 1.7;
  --radius-6: 6px;
  --radius-8: 8px;
  --shadow-md: 0 8px 24px rgba(0,0,0,.08);

  --color-czlowieka-i-spoleczenstwa: #5947a6;
  --color-dziedzictwa-kultury-wartosc: #988381;
  --color-sztuki-kreacji: #f6871c;
  --color-nauki-techniki-inzynierii: #308879;
  --color-natury-zrownowazonego-rozwoju: #7fcc29;
  --color-nauki-eksperymentalnej-scislej: #a63da5;
  --color-zdrowia-aktywnosci: #db1e27;
  --color-biznesu-innowacji-makretingu: #4777c5;
  --color-charytatywna: #353395;

  --color-czlowieka-i-spoleczenstwa-obramowanie:#6652ae;
  --color-obramowanie-sztuka-kreacja: #f7922c;
  --color-obramowanie-biznes: #5780ca;
  --color-obramowanie-nauki-techniki: #439181;
  --color-obramowanie-natury: #8cd13a;
  --color-obramowanie-nauki-eksperymentalnej: #b55db6;
  --color-obramowanie-zdrowia: #e13a35;
  --color-obramowanie-dziedzictwa: #a18e8b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--color-dark);
  background: var(--color-white-bg-1);
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: var(--lh-normal);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--color-white);
  /*border-bottom: 1px solid var(--color-bg-2);*/
}

.logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.hamburger {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-dark);
  border-radius: 2px;
}

.nav { display: none; }
/* Mobile overlay menu (pokazujemy jako nowe okienko) */
@media (max-width: 767px) {
  .nav.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    padding: 20px;
  }

  /* panel wewnątrz overlay'a */
  .nav.open .menu {
    flex-direction: column;
    gap: 6px;
    background: var(--color-white);
    border-radius: var(--radius-8);
    padding: 12px;
    max-width: 520px;
    margin: 40px auto;
    box-shadow: var(--shadow-md);
  }
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--color-dark);
  border-radius: var(--radius-6);
}
.menu a:hover { background: var(--color-bg-2); }

.has-submenu { position: relative; }
.submenu {
  list-style: none;
  margin: 0;
  padding: 4px 0 8px 12px;
  display: none;
}
.submenu.open { display: block; }

@media (min-width: 768px) {
  .hamburger { display: none; }
  .nav { display: block; }

  .menu {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .has-submenu { position: relative; }
  .has-submenu > .submenu {
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 320px;
    background: var(--color-white);
    border: 1px solid var(--color-bg-2);
    border-radius: var(--radius-8);
    padding: 8px;
    display: none;
    box-shadow: var(--shadow-md);
  }
  .has-submenu:hover > .submenu { display: block; }
  .submenu li a { white-space: nowrap; }
}

.content { padding: 16px; }

h1 { margin: 0 0 .5rem; font-size: var(--fs-20); }
pre { background: #f6f6f6; padding: .75rem; border-radius: 8px; }

/* Lock scroll gdy overlay otwarty */
body.modal-open { overflow: hidden; }

/* Obraz planu na stronie głównej */
.hero-plan {
  display: block;
  width: 80vw;          /* 80% szerokości ekranu */
  max-width: 100%;
  height: auto;
  margin: 0 auto 16px;  /* wyśrodkowanie i odstęp na dole */
}

/* --- Sekcja Patronat honorowy --- */
.section { padding: 24px 16px; }
.section-title {
  font-size: var(--fs-40);
  font-weight: var(--fw-bold);
  margin: 0 0 12px 0;
  text-align: center;
}
.section-note {
  margin: 0 0 16px 0;
  color: var(--color-text);
  font-size: var(--fs-14);
}
.patronage .section-title {
  color: var(--color-dark);
  font-family: var(--font-sans);
  font-size: var(--fs-40);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  /* separator między nagłówkiem a listą */
  border-bottom: 1px solid var(--color-secondary);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.section.patronage::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--color-bg-2);
  margin-top: 16px;
}
.patronage-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.patronage-item {
  background: var(--color-white);
  border: 1px solid var(--color-bg-2);
  border-radius: var(--radius-8);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.patronage-item img {
  width: auto;
  height: 140px;
  object-fit: contain;
}
.patronage-item.is-large img {
  width: auto;
  height: 140px;
}
.patronage-item.is-large { justify-content: center; }
.patronage-item span {
  font-size: var(--fs-16);
}

/* Na telefonach ustaw jedną kolumnę (jeden pod drugim) */
@media (max-width: 767px) {
  .patronage-grid { grid-template-columns: 1fr; }
}

/* Desktop: układ 2,3,3... (pierwsze dwie pozycje w jednym rzędzie,
   kolejne po 3 w rzędzie). Osiągamy to siatką 6-kolumnową i spanami. */
@media (min-width: 768px) {
  .patronage-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  /* Domyślnie każdy element zajmuje 2 kolumny => 3 w rzędzie */
  .patronage-item { grid-column: span 2; }
  /* Pierwsze dwa elementy zajmują po 3 kolumny => 2 w pierwszym rzędzie */
  .patronage-item:nth-child(-n+2) { grid-column: span 3; }
}
.patronage-item {
  background: var(--color-white);
  border: 1px solid var(--color-bg-2);
  border-radius: var(--radius-8);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.patronage-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.patronage-item span {
  font-size: var(--fs-16);
}

/* Patronage layout overrides per TODO */
.section.patronage { 
    width: 90%; 
    margin: 0 auto; 
}
.patronage-grid { 
    width: 90%; 
    margin: 0 auto; 
}
.patronage-item { 
    border: none; 
    box-shadow: none; 
    justify-content: center; 
    height: var(--cell-h, 280px); 
}
.patronage-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}
/* Wymuś pełne wypełnienie także dla .is-large (wyższa specyficzność nad wcześniejszymi regułami) */
.patronage-item.is-large img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}
@media (max-width: 767px) {
  .patronage-grid { grid-template-columns: 1fr; }
  .patronage-item { height: var(--cell-h-mobile, 240px); }
  .patronage-item img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
}
@media (min-width: 768px) { .patronage-grid { grid-template-columns: repeat(6, 1fr); } .patronage-item { grid-column: span 2; } .patronage-item:nth-child(-n+2) { grid-column: span 3; } }

/* JPG/JPEG również dopasowują się do rozmiaru kafelka */

/* --- Sekcja Patronat medialny (karuzela) --- */
.section.media { width: 90%; margin: 0 auto; }
.section.media .section-title { border: 0; margin-bottom: 12px; }
.media-carousel { overflow: hidden; position: relative; }
.media-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.media-track::-webkit-scrollbar { 
    display: none; 
}

.media-track, .media-item, .media-item img { 
    backface-visibility: hidden; 
    -webkit-backface-visibility: hidden; 
}

.media-item img { 
    display: block; 
}

.media-item { 
    flex: 0 0 calc((100% - 3*12px)/4); 
    height: var(--media-h, 180px); 
    border-radius: var(--radius-8); 
    background: var(--color-white); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    scroll-snap-align: start; 
}

.media-item img { 
    /* Nie przycinaj logo – zawsze mieszczą się w kafelku */
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: center;
    border-radius: var(--radius-8);
}


.media-dots { 
    display: flex; 
    justify-content: center; 
    gap: 8px; 
    margin-top: 10px; 
}

.media-dot { 
    width: 2px; 
    height: 10px; 
    border-radius: 75%; 
    background: var(--color-muted); 
    border: 0; 
    cursor: pointer; 
}

.media-dot.active { 
    background: var(--color-secondary); 
}
@media (max-width: 767px) {
  .media-item { 
    flex-basis: 100%; 
    height: var(--media-h-mobile, 220px); }
}

/* --- Fix: usuń cienką linię między sekcjami (border pod tytułem patronatu) --- */
.patronage .section-title { border-bottom: 0 !important; }

/* --- Sekcja ORGANIZATORZY --- */
.section.organizers {
  width: 100%;
  margin: 0 auto;
  padding-top: 0; /* bez odstępu nad nagłówkiem */
  padding-bottom: 24px;
}

.organizers-header { 
  text-align: center;
  height: 150px;
  background-color: var(--color-bg-2);
  display: flex;               /* centrowanie pion/poziom */
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.organizers-header h2 { 
  margin: 0; 
  font-size: var(--fs-32); 
  letter-spacing: 1px; 
  color: var(--color-purple-1)
}

.organizers-header p {
  color: var(--color-primary);
  margin: 0; /* bez odstępu pod h2 */
  color: var(--color-text); 
  font-size: var(--fs-16); 
}

/* Pasek przejścia kolorów między nagłówkiem a sliderem */
.organizers-separator {
  height: 8px;
  border-radius: 999px;
  margin: 0; /* sklejone z headerem i karuzelą */
  width: 100%;
  max-width: none;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 50%, var(--color-secondary) 100%);
}

/* Karuzela organizatorów: 6 elementów na desktopie, 1 na mobile */
.organizers-carousel { overflow: hidden; position: relative; margin-top: 0; }
.organizers-track {
  background-color: var(--color-purple-1);
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.organizers-track::-webkit-scrollbar { display: none; }
.organizers-item { 
  flex: 0 0 calc((100% - 5*12px)/6); 
  height: var(--org-h, 120px); 
  border-radius: var(--radius-8); 
  background: var(--color-purple-1); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  scroll-snap-align: start; 
}
.organizers-item img {
  max-width: 80%;
  max-height: 80%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-8);
  display: block;
}
.organizers-dots { 
  display: flex; 
  justify-content: center; 
  gap: 8px; 
}

.organizers-dot { 
  width: 8px; 
  height: 8px; 
  border-radius: 50%; 
  background: var(--color-bg-2); 
  border: 0; 
  cursor: pointer; 
}

.organizers-dot.active { 
  background: var(--color-secondary);
 }

@media (max-width: 767px) {
  .organizers-item { 
    flex-basis: 100%; 
    height: var(--org-h-mobile, 160px); }
}

/* Pasek postępu karuzeli Organizatorzy */
.organizers-progress { 
  width: 100%; 
  height: 8px; 
  background: var(--color-bg-2); 
  overflow: hidden; 
}
.organizers-progress__bar { 
  width: 0%; 
  height: 100%; 
  background: linear-gradient(90deg, var(--color-purple-1) 0%,  var(--color-purple-1) 100%);
  transition: width .35s ease; 
}

/* --- Sekcja informacyjna 4-kolumnowa --- */
.section.info { background: #d8d8d8; padding: 24px 16px; margin-top: 24px; }
.info-grid { display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 1200px; margin: 0 auto; }
.info-col h3 { margin: 0 0 8px 0; font-size: var(--fs-18); }
.info-col ul { list-style: none; padding: 0; margin: 0; }
.info-col li { margin: 6px 0; }
.info-col a { color: var(--color-dark); text-decoration: none; }
.info-col a:hover { text-decoration: underline; }
.info-col--emblem { display: flex; align-items: center; justify-content: flex-end; }
.info-col--emblem img { max-width: 160px; height: auto; display: block; }
@media (min-width: 768px) { .info-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 767px) { .info-col--emblem { justify-content: center; } }

/* --- Spacer + znak w kolorze + sekcja 3 kolumny --- */
.spacer-24 { height: 24px; }
.spacer-12 { height: 12px; }
.brand-banner { display: flex; justify-content: center; }
.brand-banner img { width: 70%; max-width: 270px; height: auto; display: block; }
.section.brand-info { padding: 24px 16px; }
.brand-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: center; max-width: 1200px; margin: 0 auto; }
@media (min-width: 768px) { .brand-grid { grid-template-columns: 1fr 1.35fr 1fr; } }
.brand-col--center { display: flex; justify-content: center; align-items: center; }
.brand-note { color: var(--color-text); margin: 0; }
.brand-col--right { display: flex; justify-content: flex-start; }
.brand-logos { display: flex; gap: 12px; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
.brand-logos img { height: 60px; width: auto; display: block; }
@media (max-width: 767px) { .brand-col--right, .brand-logos { justify-content: center; } }

/* --- Szary blok stopki --- */
.footer-box { background: var(--color-bg-2); height: 150px; }
.footer-box__inner { max-width: 1200px; margin: 0 auto; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 8px; }
.footer-copy { margin: 0; color: var(--color-dark); font-size: var(--fs-14); }
.footer-credit { margin: 0; color: var(--color-text); font-size: var(--fs-12); }

/* --- Hotspoty na obrazie planu (overlay) --- */
.hero-plan { width: 100% !important; height: auto; }
.strefa-hero { width: 80%; max-width: 1200px; height: auto; display: block; margin: 0 auto; }
.plan-map { position: relative; width: 100%; max-width: 1200px; margin: 0 auto; }
.plan-map > img.hero-plan { display: block; width: 100%; height: auto; margin: 0; position: relative; z-index: 1; }
.plan-map .hotspot { position: absolute; left: var(--l); top: var(--t); width: var(--w); height: var(--h); display: block; outline: none; border-radius: 6px; z-index: 2; cursor: pointer; }
.plan-map .hotspot::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0); transition: background .15s ease, box-shadow .15s ease; border-radius: inherit; }
.plan-map .hotspot:hover::after, .plan-map .hotspot:focus-visible::after { background: rgba(0,0,0,.08); box-shadow: 0 0 0 2px rgba(0,0,0,.2) inset; }

/* Tooltip najechania dla hotspotów */
.hotspot-tooltip { position: absolute; z-index: 3; background: rgba(0,0,0,.85); color: #fff; border-radius: 8px; padding: 12px 14px; max-width: 320px; backdrop-filter: blur(2px); pointer-events: none; }
.hotspot-tooltip h1 { margin: 0 0 6px 0; font-size: 18px; line-height: 1.2; }
.hotspot-tooltip .tip-opis { margin: 0 0 6px 0; color: #eee; font-size: 14px; }
.hotspot-tooltip .tip-link { color: var(--color-primary); text-decoration: underline; font-size: 14px; }

/* Tooltip dla wierszy tabeli */
.row-tooltip { position: absolute; z-index: 1002; background: rgba(0,0,0,.88); color: #fff; border-radius: 8px; padding: 10px 12px; max-width: min(520px, 90vw); box-shadow: 0 8px 24px rgba(0,0,0,.25); pointer-events: none; }
.row-tooltip h1 { margin: 0 0 6px 0; font-size: 16px; line-height: 1.25; }
.row-tooltip .row-desc { margin: 0; font-size: 13px; color: #eee; }

/* Modal body formatting: H1, OPIS, link */
.modal-title { margin: 0 0 16px 0; font-size: clamp(28px, 4vw, 56px); line-height: 1.1; }
.modal-body {
  color: #EEE;
  font-size: clamp(16px, 2vw, 22px);
  white-space: pre-line;
  margin-bottom: 16px;
  /* przewijanie tylko treści, zarówno desktop jak i mobile */
  flex: 1 1 auto;
  max-height: calc(100vh - 200px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* Modal pełnoekranowy */
.modal-overlay[hidden] { display: none; }
.modal-overlay { position: fixed; inset: 0; z-index: 1000; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.modal-dialog { position: relative; z-index: 1001; width: 100vw; height: 100vh; max-width: none; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(18,18,18,.92); color: #fff; border-radius: 0; padding: clamp(16px, 4vw, 48px); text-align: center; overflow: hidden; }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.modal-go { display: inline-block; padding: 10px 16px; background: var(--color-primary); color: #000; border-radius: 10px; text-decoration: none; font-weight: var(--fw-bold); }
.modal-go:hover { filter: brightness(1.05); }
.modal-close { position: absolute; top: 16px; right: 16px; border: 0; background: transparent; color: #fff; font-size: 28px; cursor: pointer; }

/* Mobile: przewijanie tylko treści w modalu */
@media (max-width: 767px) {
  .modal-dialog {
    justify-content: flex-start;
    padding-top: 48px;
    padding-bottom: 96px; /* rezerwa na pasek przycisku u dołu */
  }
  .modal-title { margin-bottom: 12px; }
  .modal-body {
    max-height: calc(100vh - 220px); /* tytuł + stały pasek przycisku */
    padding-right: 6px; /* miejsce na scrollbar */
    text-align: left;
    margin-left: auto; margin-right: auto; max-width: 90vw;
  }
  /* Pasek przycisku przyklejony do dołu ekranu (tylko mobile) */
  .modal-actions {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(12px + env(safe-area-inset-bottom));
    padding: 12px 16px 0;
    background: rgba(18,18,18,.92);
    box-shadow: 0 -8px 24px rgba(0,0,0,.35);
    margin: 0; /* nadpisz margin-top */
  }
}

/* --- Fix marginesów w sekcji ORGANIZATORZY --- */
.section.organizers { padding: 0 !important; margin: 0 !important; }
.organizers-track { list-style: none; margin: 0; padding: 0; }
/* Tabela dla strefy  */
.strefa-table { 
  width: 90%; 
  margin: 16px auto; 
  border-collapse: collapse; 
  color: #fff; 
  font-size: var(--fs-16);
}

.strefa-table td, .strefa-table th { 
  padding: 10px 12px; 
  text-align: center; 
}
.obramowanie-czlowiek td, .obramowanie-czlowiek th{
  border: 2px solid var(--color-czlowieka-i-spoleczenstwa-obramowanie);
}
.obramowanie-dziedzictwa td, .obramowanie-dziedzictwa th{
  border: 2px solid var(--color-obramowanie-dziedzictwa);
}
.obramowanie-sztuka td, .obramowanie-sztuka th{
  border: 2px solid var(--color-obramowanie-sztuka-kreacja);
}
.obramowanie-nauki-techniki td, .obramowanie-nauki-techniki th{
  border: 2px solid var(--color-obramowanie-nauki-techniki);
}
.obramowanie-natura td, .obramowanie-natura th{
  border: 2px solid var(--color-obramowanie-natury);
}
.obramowanie-nauki-eksperymentalnej td, .obramowanie-nauki-eksperymentalnej th{
  border: 2px solid var(--color-obramowanie-nauki-eksperymentalnej);
}
.obramowanie-zdrowie td, .obramowanie-zdrowie th{
  border: 2px solid var(--color-obramowanie-zdrowia);
}
.obramowanie-biznes td, .obramowanie-biznes th{
  border: 2px solid var(--color-obramowanie-biznes);
}
.strefa-table.strefa-czlowiek { background: transparent; }
@media (max-width: 767px) { .strefa-table { width: 96%; font-size: var(--fs-14); } }
/* Uk�ad kolumn tabeli w strefie Cz�owieka i Spo�ecze�stwa */
.strefa-table.strefa-czlowiek { table-layout: auto; }
.strefa-table.strefa-czlowiek caption { caption-side: top; color: #fff; margin: 6px 0 10px; font-weight: var(--fw-bold); }
.strefa-table.strefa-czlowiek col.col-narrow { width: 1%; }
.strefa-table.strefa-czlowiek col.col-wide { width: 99%; }
.strefa-table.strefa-czlowiek td:nth-child(1),
.strefa-table.strefa-czlowiek th:nth-child(1),
.strefa-table.strefa-czlowiek td:nth-child(2),
.strefa-table.strefa-czlowiek th:nth-child(2) { white-space: nowrap; }

.strefa-table-finished { opacity: .95; margin-top: 20px; }

.opis-charytatywny {
  text-align: center;
  color: white;
  font-size: var(--fs-20);
}
.opis-charytatywny a {
  color: white;
  font-weight: bold;
  text-decoration: none; /* opcjonalnie - usuwa podkreślenie */
}
