:root {
  --brand-brown: #4C210C;
  --bg-cream: #F2F2F2;
  --card-bg: #F2F2F2;
  --text-main: #1A1A1A;
  --text-light: #F2F2F2;
  --accent-blue: #2B59C3;
  --muted: #7b7b7b;
  --radius: .5rem;
  --max-width: 1200px;
  --user-font-scale: 1; /* Zmienna do skalowania czcionki */
}
 *, *::before, *::after {
  box-sizing: border-box;
}
html, body {
  width: 100%;
  max-width: 100%;
  padding-top: 0 !important;
  margin: 0;
}
html {
  scroll-padding-top: 80px;
}
body {
  background: var(--bg-cream);
  color: var(--text-main);
}
 /* Hero */
    .hero{
      background: linear-gradient(180deg, rgba(255,255,255,0.0), rgba(255,255,255,0.0));
      padding: 3rem 0;
      position: relative;
    }
    .hero .hero-card{
      background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.96));
      border-radius: .75rem;
      box-shadow: 0 6px 30px rgba(16,24,32,0.06);
      padding: 2rem;
    }
    .hero .kicker{
      color: var(--brand-brown);
      font-weight:600;
      text-transform:uppercase;
      letter-spacing:.08em;
      font-size:.85rem;
    }
    .hero h1{
      font-family: "Montserrat", sans-serif;
      color: var(--brand-brown);
      font-size:1.9rem;
      margin-bottom: .5rem;
    }
    .hero p.lead{
      color: #444;
      margin-bottom:1rem;
    }
    .cta-primary{
      background: var(--brand-brown);
      color: #fff;
      border-radius: .5rem;
      padding: .6rem 1rem;
      border: none;
    }
    .cta-outline{
      background: transparent;
      color: var(--brand-brown);
      border: 1px solid rgba(107,62,38,0.12);
      padding: .6rem 1rem;
      border-radius: .5rem;
    }
    /* SVG menu */
    .svg-menu{
      max-width: 420px;
      margin: 1rem 0;
    }
    .svg-menu a{ text-decoration:none; color: inherit; }
        /* --- MINIMALISTYCZNA WYSZUKIWARKA --- */
.search-minimal .form-control {
    border-right: none;
    border-radius: 20px 0 0 20px;
    padding-left: 15px;
}
.search-minimal .btn {
    border-left: none;
    border-radius: 0 20px 20px 0;
    border-color: #dee2e6; /* kolor ramki inputa */
    background: #fff;
    color: var(--brand-brown);
    transition: all 0.3s;
}
.search-minimal .btn:hover {
    background: var(--brand-brown);
    color: #fff;
}
.search-minimal .form-control:focus + .btn {
    border-color: #86b7fe; /* bootstrap focus color */
    border-left: none;
}

.search-minimal {
    max-width: 200px;
}
@media (max-width: 576px) {
    .wcag-panel { margin-right: 0; margin-bottom: 10px; justify-content: center; width: 100%; }
    .search-minimal { max-width: 100%; width: 100%; }
}
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  background: var(--bg-cream);
  color: var(--text-main);
  font-family: "Poppins", "Montserrat", system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

/* Kluczowe dla skalowania czcionki */
html {
  font-size: calc(100% * var(--user-font-scale));
}

/* --- MINIMALISTYCZNA WYSZUKIWARKA (Przywrócona) --- */
.search-minimal .form-control {
    border-right: none;
    border-radius: 20px 0 0 20px;
    padding-left: 15px;
    border-color: #dee2e6;
}
.search-minimal .btn {
    border-left: none;
    border-radius: 0 20px 20px 0;
    border-color: #dee2e6;
    background: #fff;
    color: var(--brand-brown);
    transition: all 0.3s;
}
.search-minimal .btn:hover {
    background: var(--brand-brown);
    color: #fff;
    border-color: var(--brand-brown);
}
.search-minimal .form-control:focus {
    box-shadow: none;
    border-color: var(--accent-blue);
}
.search-minimal .form-control:focus + .btn {
    border-color: var(--accent-blue);
    border-left: none;
}
/* Responsywność wyszukiwarki */
.search-minimal {
    max-width: 220px;
}
@media (max-width: 991px) {
    .search-minimal { max-width: 100%; width: 100%; margin-top: 10px; }
}

/* Skalowanie czcionki */
html { font-size: calc(100% * var(--user-font-scale)); }

/* =========================================
   MOTYWY WCAG - AGRESYWNE NADPISYWANIE
   ========================================= */

/* 1. KONTRAST (Żółty na Czarnym) */
body.theme-contrast,
body.theme-contrast * {
    background-color: #000 !important;
    background-image: none !important; /* Usuwa tła dworku */
    color: #FF0 !important;
    border-color: #FF0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
}
body.theme-contrast a { 
    color: #0FF !important; 
    text-decoration: underline !important; 
}
body.theme-contrast .btn-wcag.active {
    background: #FF0 !important;
    color: #000 !important;
    border: 2px solid #FF0 !important;
}
/* Specjalna obsługa obrazków w kontraście (żeby były widoczne, ale w skali szarości) */
body.theme-contrast img, 
body.theme-contrast video,
body.theme-contrast iframe {
    filter: grayscale(100%) contrast(120%) !important;
    opacity: 0.8 !important;
    background: transparent !important;
}

/* =========================================
   2. ULEPSZONY TRYB CIEMNY (Dark Mode)
   ========================================= */
body.theme-dark {
    background-color: #121212 !important;
    background-image: url('resources/tlo-brazowe2-orzel.webp') !important;
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-blend-mode: multiply;
}

/* --- NOCNY KLIMAT DWORKU (Poprawiony) --- */

/* 1. Delikatniejsza winieta (cienie tylko po bokach/dole) */
body.theme-dark .dworek-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Środek (transparent) -> Boki (półprzezroczysty czarny) */
    background: radial-gradient(circle at 50% 55%, rgba(20, 30, 60, 0.0) 30%, rgba(0, 0, 0, 0.6) 90%);
    z-index: 25;
    pointer-events: none;
    mix-blend-mode: multiply;
}

/* 2. Lżejsze przyciemnienie samej grafiki (unikamy "podwójnego" mroku) */
body.theme-dark .dworek-static-img,
body.theme-dark .dworek-svg-layer {
    /* Zmieniono z 0.65 na 0.85 - obraz jest jaśniejszy, ale wciąż "wieczorny" */
    filter: brightness(0.85) contrast(1.1) !important;
    transition: filter 0.5s ease;
}

/* Orzeł - też lekko przyciemniony, by pasował do otoczenia */
body.theme-dark .dworek-eagle {
    filter: brightness(0.8) drop-shadow(0 -5px 10px rgba(0,0,0,0.5)) !important;
}

/* --- POZOSTAŁE STYLE DARK MODE --- */

/* Karty Projektów (Main Page) - Ciemne tło */
body.theme-dark .project-card {
    background-color: #1e1e1e !important;
    border: 1px solid #333 !important;
}
body.theme-dark .project-card:hover {
    background-color: #252525 !important;
}
body.theme-dark .project-title { color: #fff !important; }
body.theme-dark .project-meta, body.theme-dark .project-excerpt { color: #bbb !important; }

/* Reszta teł (Karty, Modale, Inputy) */
body.theme-dark .card, 
body.theme-dark .modal-content,
body.theme-dark .form-control,
body.theme-dark .list-group-item,
body.theme-dark .pub-box,
body.theme-dark .news-media, 
body.theme-dark .newsletter,
body.theme-dark #zarzad,
body.theme-dark .onas-card,
body.theme-dark .onas-section,
body.theme-dark .doc-item {
    background-color: rgba(30, 30, 30, 0.95) !important;
    background-image: none !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
    color: #e0e0e0 !important;
}

/* FIX DLA PASKÓW ADRESOWYCH (KONTAKT) */
body.theme-dark .map-header {
    background-color: rgba(30, 30, 30, 1) !important;
    border-bottom-color: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
}
body.theme-dark .map-title { color: #fff !important; }
body.theme-dark .map-text-primary { color: #e0e0e0 !important; }
body.theme-dark .map-text-secondary { color: #aaa !important; }

/* Navbar (Wymuszony ciemny na podstronach) */
body.theme-dark header.navbar,
body.theme-dark #mainNavbar {
    background-color: rgba(18, 18, 18, 0.98) !important;
    border-bottom: 1px solid #333 !important;
}
body.theme-dark .nav-link { color: #e0e0e0 !important; }
body.theme-dark .nav-link:hover, body.theme-dark .nav-link.active { color: #8ab4f8 !important; }
body.theme-dark .navbar-toggler-icon { filter: invert(1); }

/* Teksty */
body.theme-dark h1, body.theme-dark h2, body.theme-dark h3, 
body.theme-dark h4, body.theme-dark h5, body.theme-dark h6,
body.theme-dark .h1, body.theme-dark .h2, body.theme-dark .h3, 
body.theme-dark .h4, body.theme-dark .h5, body.theme-dark .h6 {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
body.theme-dark p, body.theme-dark .lead, body.theme-dark .text-muted,
body.theme-dark li, body.theme-dark small {
    color: #d0d0d0 !important;
}
body.theme-dark .pub-title, body.theme-dark .zarzad-info h5 {
    color: #f2f2f2 !important;
}

/* Przyciski */
body.theme-dark .btn-outline-primary { color: #fff !important; border-color: #fff !important; }
body.theme-dark .btn-outline-primary:hover { background-color: #fff !important; color: #000 !important; }

/* Reset tła sekcji */
body.theme-dark #aktualnosci, body.theme-dark #o-nas, 
body.theme-dark #projekty, body.theme-dark #galeria, 
body.theme-dark #kontakt { background: transparent !important; }

/* Zarząd */
body.theme-dark .zarzad-photo-wrap { background: linear-gradient(135deg, #2c3e50 0%, #000000 100%) !important; }
body.theme-dark .zarzad-card { background-color: #1e1e1e !important; }
/* Nagłówki podstron */
.page-header h1, .page-header h2, .hero-header h1 {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: -1;
    pointer-events: none;
}

/* Zarząd - tło zdjęć */
body.theme-dark .zarzad-photo-wrap {
    background: linear-gradient(135deg, #2c3e50 0%, #000000 100%) !important;
}
body.theme-dark .zarzad-card {
    background-color: #1e1e1e !important;
}

/* --- NAGŁÓWKI PODSTRON (FIX) --- */
/* To naprawia problem ciemnego tytułu na brązowym tle na podstronach */
.page-header h1, 
.page-header h2,
.hero-header h1 {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}
/* Jeśli podstrona ma jasne tło w sekcji header, wymuszamy ciemniejsze dla kontrastu */
.page-header {
    position: relative;
    z-index: 1;
}
/* Opcjonalnie: przyciemnienie tła nagłówka na podstronach */
.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3); /* Lekkie przyciemnienie zdjęcia w tle nagłówka */
    z-index: -1;
    pointer-events: none;
}

/* 3. SEPIA */
body.theme-sepia {
    background-color: #f4ecd8 !important;
    color: #5b4636 !important;
}
body.theme-sepia .navbar, 
body.theme-sepia .card,
body.theme-sepia .dworek-wrapper {
    background-color: #fdf6e3 !important;
    background-image: none !important;
    border-color: #d6c6ac !important;
    color: #5b4636 !important;
}
body.theme-sepia a { color: #8f5902 !important; }
body.theme-sepia img { filter: sepia(100%); }

/* --- RESZTA STYLÓW (NAVBAR, SEARCH, HERO...) --- */
.navbar {
  background: #fff;
  border-bottom: 1px solid rgba(107,62,38,0.06);
  backdrop-filter: blur(4px);
}
.brand-logo { height: 60px; width: auto; }
@media (max-width: 768px) {
  .brand-logo { height: 48px; }
  .navbar { padding: 0.5rem 0; }
}

/* Panel WCAG */
.wcag-panel {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    gap: 5px;
    align-items: center;
    margin-right: 15px;
}
.btn-wcag {
    width: 36px; height: 36px; min-width: 36px;
    border: 1px solid var(--brand-brown);
    background: transparent; color: var(--brand-brown);
    border-radius: 5px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; line-height: 1;
    transition: all 0.2s;
}
.btn-wcag:hover { background: var(--brand-brown); color: #fff; }
.btn-wcag.active { background: var(--brand-brown); color: #fff; box-shadow: inset 0 2px 4px rgba(0,0,0,0.3); }
          /* --- WYNIKI WYSZUKIWANIA (MODAL) --- */
.search-result-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
    text-align: left; /* Wymuszenie wyrównania do lewej */
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-item:hover {
    background-color: #f9f9f9;
}
.search-result-item a {
    text-decoration: none;
    display: block;
}
.search-result-title {
    color: var(--brand-brown);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
    display: block;
}
.search-result-url {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 8px;
    display: block;
}
.search-result-snippet {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    display: block;
}
/* Podświetlenie szukanej frazy */
.search-result-snippet mark {
    background-color: rgba(255, 240, 0, 0.4);
    color: #000;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}
/* Styl modala */
.modal-search-header {
    background: linear-gradient(135deg, var(--brand-brown) 0%, #2c1305 100%);
    color: white;
}
.modal-search-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
/* --- LIVE SEARCH (AUTOCOMPLETE) --- */
.search-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    max-height: 350px;
    overflow-y: auto;
    display: none; /* Domyślnie ukryte */
}

.autocomplete-list.active {
    display: block;
}

.autocomplete-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover, .autocomplete-item:focus {
    background-color: #f8f9fa;
    text-decoration: none;
    color: inherit;
}

.ac-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--brand-brown);
    margin-bottom: 2px;
}

.ac-snippet {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Spinner ładowania wewnątrz inputa */
.input-loading {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23ccc" d="M12,4V2A10,10 0 0 0 2,12h2a8,8 0 0 1 8-8Z"><animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}
/* Kontener głównego wideo */
.latest-video {
  background: #000;
  border: 1px solid #333;
  padding: 15px;
  /* Kluczowe dla stabilności: */
  height: 100%;             
  min-height: 380px;        /* Minimalna wysokość, żeby kontener nie skakał przy ładowaniu */
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Wypycha nawigację na sam dół */
}

/* Tytuł filmu - SZTYWNA WYSOKOŚĆ I UCINANIE */
.video-title {
  display: block;
  width: 100%;
  /* Ustawiamy wysokość na dokładnie 2 linie tekstu + margines */
  height: 3.4rem;           
  line-height: 1.4rem;      
  margin-top: 12px;
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  
  /* Logika ucinania tekstu (ellipsis) po 2 liniach */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;      /* Pozwala na zawijanie */
}

/* Nawigacja zawsze na dole */
.slider-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;         /* Dopycha do dołu kontenera flex */
  padding-top: 10px;
  border-top: 1px solid #222;
}

/* Reszta stylów wideo bez zmian... */
#sokialtv { background-image: url("/resources/tlo-czarne2-orzel.webp"); background-size: cover; width: 100%; overflow: hidden; color: white; }
.video-container { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; overflow: hidden; background: #000; }
.video-container iframe, .video-container .video-thumb-wrapper { position: absolute !important; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.slider-btn { background: #2b59c2; border: none; color: #fff; width: 40px; height: 40px; border-radius: 4px; cursor: pointer; font-size: 1.2rem; }
.slider-btn:hover { background: #1a45a0; }
.film-reel-container { width: 100%; overflow: hidden; background: #000; padding: 5px 0; }
.film-reel-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.film-block { width: 40px; height: 25px; background: #fff; margin: 0 15px; flex-shrink: 0; }
.other-videos-wrapper { overflow: hidden; background: #000; padding: 15px 0; position: relative; mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent); -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent); }
.other-videos-track { display: flex; gap: 20px; width: max-content; }
.animate-marquee { animation: marquee 60s linear infinite; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.other-videos-wrapper:hover .other-videos-track, .other-videos-wrapper:hover .film-reel-track { animation-play-state: paused; }
.video-item { width: 220px; flex-shrink: 0; transition: transform 0.2s; }
.video-item:hover { transform: scale(1.05); z-index: 2; }
.video-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; border: 1px solid #333; }
.video-item h6 { color: #ccc; font-size: 0.85rem; margin-top: 5px; }
.youtube-promo { display: flex; align-items: center; justify-content: center; background: #000; border: 2px solid #2b59c2; padding: 10px; margin: 10px; border-radius: 8px; color: #fff; text-decoration: none; transition: transform 0.2s; }
.youtube-promo:hover { transform: translateY(-3px); color: #fff; }
.youtube-promo i { font-size: 24px; color: red; margin-right: 10px; }

/* Responsywność */
@media (max-width: 991px) {
  .latest-video { margin-bottom: 20px; min-height: auto; }
  .wcag-panel { justify-content: center; margin-bottom: 10px; }
}
.py-5 {
    padding-top: 0rem !important;
    padding-bottom: 0rem !important;
}
    .news-media{
      padding: 2rem 0;
    }
    .news-card{
      border-radius: .5rem;
      background: var(--card-bg);
      box-shadow: 0 6px 18px rgba(16,24,32,0.04);
      padding: 1rem;
      margin-bottom: 1rem;
    }
    .media-feed{
      min-height: 200px;
    }
    :root{
--card-radius: 12px;
--glass-bg: rgba(255,255,255,0.9);
--muted:#6b7280;
--accent: linear-gradient(90deg,#5b3b2e,#2b6fb3);
}
.projekty-container{background-image:url('resources/tlo-biale1-mix.webp');background-size:cover;background-position:center;border-radius:0.75rem;padding:1.25rem}
.projekty-header{display:flex;flex-direction:column;gap:.5rem;padding:0 0 1rem 0}
.projekty-header h2{margin:0;color:#fff}
.projekty-accent{width:60px;height:4px;border-radius:2px;background:var(--accent)}


/* Swiper overrides */
.swiper{padding:1rem 0}
.swiper-slide{height:auto}


.project-card{border-radius:var(--card-radius);overflow:hidden;background:var(--glass-bg);border:1px solid rgba(16,24,32,0.04);display:flex;flex-direction:column;height:100%;transition:transform .18s ease,box-shadow .18s ease}
.project-card:hover{transform:translateY(-8px);box-shadow:0 16px 40px rgba(16,24,32,0.12)}
.project-thumb{width:100%;height:240px;object-fit:cover;display:block;background:#f3f4f6}
.project-body{padding:.75rem;display:flex;flex-direction:column;gap:.45rem;flex:1}
.project-meta{color:var(--muted);font-size:.82rem}
.project-title{font-size:.95rem;margin:0;color:#5b3b2e}
.project-excerpt{font-size:.88rem;color:#333;margin:0;flex:1;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}


/* Ensure equal height columns in grid fallback */
.projects-grid{display:grid;gap:1rem;grid-template-columns:repeat(2,1fr)}
@media(min-width:768px){.projects-grid{grid-template-columns:repeat(3,1fr)}}
@media(min-width:1200px){.projects-grid{grid-template-columns:repeat(4,1fr)}}
@media(min-width:1400px){.projects-grid{grid-template-columns:repeat(5,1fr)}}


/* Fade-up animation (initial state) */
.fade-up{opacity:0;transform:translateY(18px);transition:opacity .6s cubic-bezier(.22,.9,.28,1),transform .6s cubic-bezier(.22,.9,.28,1)}
.fade-up.inview{opacity:1;transform:none}


/* Controls styling */
.projekty-footer{display:flex;justify-content:space-between;align-items:center;padding-top:.75rem}
.cta-outline{border:1px solid rgba(255,255,255,0.15);padding:.45rem .75rem;border-radius:6px;color:#fff;text-decoration:none;background:transparent}


/* Accessibility focus */
.project-card a:focus{outline:3px solid rgba(59,130,246,0.25);outline-offset:2px}


/* Responsive tweaks for thumb on small screens */
@media(max-width:576px){.project-thumb{height:110px}}
    /* Documents/Downloads */
    .doc-list .doc-item{
      display:flex;
      gap: .75rem;
      align-items:center;
      padding: .6rem .5rem;
      border-radius: .5rem;
      background: #fff;
      margin-bottom: .5rem;
    }
    /* Newsletter */
    .newsletter{
      padding: 1.5rem;
      border-radius: .75rem;
      background: linear-gradient(90deg, rgba(213,154,42,0.06), rgba(80,97,69,0.03));
    }
    /* Accessibility helpers */
    a:focus, button:focus, input:focus, textarea:focus{
      outline: 3px solid rgba(216,154,42,0.18);
      outline-offset: 2px;
    }
    /* Responsive tweaks */
    @media(min-width:992px){
      .hero{
        padding: 4rem 0;
      }
      .hero h1{ font-size:2.6rem; }
      .svg-menu{ max-width: 520px; }
    }
    .latest-video {
      margin-bottom: 10px;
      padding: 20px;
      padding-bottom: 20px;
      background-color: #000;
      position: relative;
      z-index: 10;
      display: flex;
      flex-direction: column;
      /* Allow natural height on small screens and keep a comfortable max on desktop */
      height: auto;
      min-height: 280px;
    }
    .other-videos-container {
      overflow: hidden;
      width: 100%;
    }
    .other-videos{
      padding-top:15px;
      padding-bottom: 10px;
      cursor: pointer;
      display:flex;
      justify-content: space-between;
      overflow: hidden;
      position: relative;
      z-index: 1;
    }
    /* Desktop - 4 filmy */
    @media (min-width: 1400px) {
      .other-videos-container {
        width: calc(200px * 4 + 30px * 4);
      }
    }
    /* Tablet Large - 3 filmy */
    @media (min-width: 1024px) and (max-width: 1399px) {
      .other-videos-container {
        width: calc(200px * 3 + 30px * 3);
      }
    }
    /* Tablet - 2 filmy */
    @media (min-width: 768px) and (max-width: 1023px) {
      .other-videos-container {
        width: calc(200px * 2 + 30px * 2);
      }
    }
    .video-container {
      position: relative;
      width: 100%;
      /* keep 16:9 ratio so iframe scales nicely across devices */
      aspect-ratio: 16/9;
      overflow: hidden;
      transition: opacity 0.5s ease;
      flex-shrink: 0;
      max-height: 520px;
    }
    .video-container.slide-in {
      animation: slideInVideo 0.6s ease forwards;
    }
    .video-container.slide-out {
      animation: slideOutVideo 0.6s ease forwards;
    }
    @keyframes slideInVideo {
      from {
        opacity: 0;
        transform: translateX(100%);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }
    @keyframes slideOutVideo {
      from {
        opacity: 1;
        transform: translateX(0);
      }
      to {
        opacity: 0;
        transform: translateX(-100%);
      }
    }
    .video-container iframe {
      position: absolute;
      top: 0;
      left: 0;
      width: 100% !important;
      height: 100% !important;
      border: 0;
    }
    /* Thumbnail (used on mobile) - hidden by default, shown via media query */
    .video-thumbnail {
      display: none;
      width: 100%;
      height: auto;
      object-fit: cover;
      cursor: pointer;
      border-radius: 6px;
      box-shadow: 0 8px 20px rgba(0,0,0,0.35);
      position: relative;
      z-index: 2;
    }
    .thumbnail-play {
      display: none;
      position: absolute;
      z-index: 3;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      background: rgba(0,0,0,0.55);
      color: #fff;
      border: none;
      font-size: 28px;
      width: 64px;
      height: 64px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }
    .video-title{
      color: white;
      font-size: 16px;
      transition: opacity 0.5s ease;
      height: auto; /* Więcej miejsca na tytuł */
      display: flex;
      align-items: center;
      padding: 10px 0;
      overflow: hidden;
      flex-shrink: 0;
      line-height: 1.3;
    }
    .video-title.slide-in {
      animation: slideInText 0.6s ease 0.1s forwards;
    }
    .video-title.slide-out {
      animation: slideOutText 0.6s ease forwards;
    }
    @keyframes slideInText {
      from {
        opacity: 0;
        transform: translateX(50px);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }
    @keyframes slideOutText {
      from {
        opacity: 1;
        transform: translateX(0);
      }
      to {
        opacity: 0;
        transform: translateX(-50px);
      }
    }
    @media screen and (max-width: 800px) {
    .other-videos, .latest-video, .video-thumbnail {
      width: 100%;
    }
    }
    /* On small screens, hide the iframe and show the thumbnail + play button */
    @media (max-width: 767px) {
      .video-iframe { display: none !important; }
      .video-thumbnail { display: block !important; }
      .thumbnail-play { display: flex !important; }
      .video-container { position: relative; }
    }
    .video-thumbnail{
      margin-top: 10px;
      margin-left: 10px;
      width: 100%;
      height: auto;
      padding-top: 15px;
      padding-left: 15px;
    }
    .animation-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.7);
      display: none;
      z-index: 9999;
    }
    .animation-content {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      color: #fff;
      text-align: center;
    }
    @media (max-width: 767px) {
      .mobile{
        display:none;
      }
    }   
    #sokialtv{
      background-image: url("/resources/tlo-czarne2-orzel.webp");
      justify-content: center;
      align-items: center;
      width: 100%;
    }
    .video-title{
      color: white;
    }
    .email-container {
      display: flex;
      align-items: center;
    }
    .film-reel-container {
      width: 100%;
      height: auto;
      display: flex;
      overflow: hidden;
    }
    .film-reel {
      width: fit-content;
      display: flex;
      animation: scroll-film linear infinite;
      animation-duration: 200s;
    }
    .block {
      width: 60px;
      height: 40px;
      margin: 10px;
      background-color: white;
      flex-shrink: 0;
    }
    @keyframes scroll-film {
      0% {
        transform: translateX(0);
      }
      100% {
        transform: translateX(-100%);
      }
    }
    .image-container {
      position: relative;
      display: inline-block;
    }
    .slider-navigation {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: auto;
      gap: 10px;
      height: 40px; /* Stała wysokość dla nawigacji */
      padding: 8px 0;
      flex-shrink: 0;
    }
    .slider-btn {
      background-color: #2b59c2;
      border: none;
      color: #000;
      padding: 10px 15px;
      font-size: 18px;
      cursor: pointer;
      border-radius: 5px;
      transition: background-color 0.3s ease;
      font-weight: bold;
    }
    .slider-btn:hover {
      background-color: #1157f7;
    }
    .slider-btn:disabled {
      background-color: #666;
      cursor: not-allowed;
    }
    .slider-counter {
      color: white;
      font-size: 14px;
      min-width: 80px;
      text-align: center;
    }
    .video-card {
      flex: 0 0 auto;
      min-width: fit-content;
      transition: none;
    }
    @keyframes slideInCard {
      from {
        opacity: 0;
        transform: translateX(100%);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }
    /* -------------------- PUBLIKACJE – KARUZELA -------------------- */
.pub-carousel-container {
  position: relative;
  overflow: hidden;
}

.pub-carousel {
  display: flex;
  gap: 1rem;
  scroll-behavior: smooth;
  padding-bottom: .5rem;
  overflow-x: auto;
  scrollbar-width: none;  /* Firefox */
  -ms-overflow-style: none;  /* IE i Edge */
}

.pub-carousel::-webkit-scrollbar {
  display: none;
}.pub-carousel {
  display: flex;
  gap: 1rem;
  scroll-behavior: smooth;
  padding-bottom: .5rem;
  overflow-x: auto;
}

.pub-carousel::-webkit-scrollbar {
  height: 6px;
}
.pub-carousel::-webkit-scrollbar-thumb {
  background: #c8b8a2;
  border-radius: 4px;
}

.pub-box {
  min-width: calc(33.333% - 1rem);
  max-width: calc(33.333% - 1rem);
  background: #fff;
  border-radius: .5rem;
  padding: .5rem;
  border: 1px solid #e7e1da;
  transition: transform .25s ease;
}

.pub-box:hover {
  transform: translateY(-4px);
}

.pub-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: .35rem;
}

.pub-title {
  font-size: 1rem;
  color: var(--brand-brown);
  margin: .5rem 0 .25rem;
}

/* Mobilne – 2 kafelki */
@media (max-width: 768px) {
  .pub-box {
    min-width: calc(50% - 0.7rem);
    max-width: calc(50% - 0.7rem);
  }
}

/* Przyciski */
.pub-nav-btn {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  background: #fff;
  border: 1px solid #d0c5b9;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  color: var(--brand-brown);
  z-index: 2;
  transition: background .2s;
}
.pub-nav-btn:hover {
  background: #f3ece6;
}

.pub-prev { left: -10px; }
.pub-next { right: -10px; }

/* PUBLIKACJE SWIPER DESIGN (spójny z projektami) */
.pub-swiper-container {
  position: relative;
  overflow: visible;
}
.pub-swiper .swiper-wrapper {
  align-items: stretch;
}
.pub-swiper .swiper-slide {
  height: auto;
  display: flex;
  align-items: stretch;
}
.pub-swiper .pub-box {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: #fff;
  border-radius: .5rem;
  padding: .5rem;
  border: 1px solid #e7e1da;
  box-shadow: 0 2px 8px rgba(16,24,32,0.04);
  transition: transform .22s;
}
.pub-swiper .pub-box:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 24px rgba(43,89,195,0.08);
}
CSS

/* --- NAPRAWA MINIATUREK PUBLIKACJI --- */
.pub-swiper .pub-thumb,
.pub-box .pub-thumb {
    width: 100%;
    height: 180px; /* Nieco wyższa ramka, żeby lepiej eksponować zdjęcia */
    
    /* KLUCZOWA ZMIANA: 'contain' sprawia, że widać całe zdjęcie */
    object-fit: contain !important; 
    
    /* Wyśrodkowanie zdjęcia w ramce */
    object-position: center !important;
    
    /* Tło dla pustych przestrzeni (jeśli zdjęcie nie wypełni całej ramki) */
    background-color: #f8f9fa; 
    
    border-radius: .35rem;
    border: 1px solid #eee; /* Delikatna ramka wokół miejsca na zdjęcie */
}

/* W trybie ciemnym tło pod zdjęciem musi być ciemne */
body.theme-dark .pub-swiper .pub-thumb,
body.theme-dark .pub-box .pub-thumb {
    background-color: #2c2c2c !important;
    border-color: #444;
}
.pub-swiper .pub-title {
  font-size: 1rem;
  color: var(--brand-brown);
  margin: .5rem 0 .25rem;
}

/* Swiper arrows for publikacje */
.pub-swiper-prev, .pub-swiper-next {
  color: var(--accent-blue);
  background: rgba(43, 89, 195, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  outline: none;
}
.pub-swiper-prev { left: -18px; }
.pub-swiper-next { right: -18px; }
.pub-swiper-prev::after, .pub-swiper-next::after {
  font-size: 18px;
}
.pub-swiper-prev:hover, .pub-swiper-next:hover {
  background: rgba(43, 89, 195, 0.2);
  color: var(--brand-brown);
}
@media (max-width: 768px) {
  .pub-swiper-prev, .pub-swiper-next { width: 28px; height: 28px; left: -8px; right: -8px; }
}
      .gallery-thumbs {margin-bottom:2rem;}
      .gallery-thumb {position:relative; overflow:hidden; border-radius:0.75rem; aspect-ratio:1; box-shadow:0 4px 12px rgba(0,0,0,0.1); cursor:pointer;}
      .gallery-img {width:100%; height:100%; object-fit:cover;}
      .gallery-lightbox {display:none; position:fixed; top:0; left:0; width:100vw; height:100vh; background:rgba(30,32,34,0.96); z-index:99999; align-items:center; justify-content:center;}
      .gallery-lightbox.active {display:flex;}
      .gallery-img-wrap {max-width:90vw; max-height:80vh; display:flex; align-items:center; justify-content:center;}
      .gallery-lightbox img {max-width:100%; max-height:80vh; border-radius:1rem; box-shadow:0 8px 32px rgba(0,0,0,0.18);}
      .gallery-close, .gallery-prev, .gallery-next {background:rgba(255,255,255,0.85); border:none; border-radius:50%; width:48px; height:48px; font-size:2rem; color:#222; cursor:pointer; box-shadow:0 2px 12px rgba(0,0,0,0.12);}
      @media(max-width:600px){.gallery-img-wrap img{max-height:60vh;}.gallery-close,.gallery-prev,.gallery-next{width:38px;height:38px;font-size:1.5rem;top:16px;right:16px;left:16px;}}
      .search-results {margin:2rem 0;}
      .search-result {background:#fff;border-radius:8px;padding:1rem;margin-bottom:1rem;box-shadow:0 2px 8px rgba(0,0,0,0.04);}
      .search-result-file {font-size:.95rem;color:#2b6fb3;word-break:break-all;}
      .search-result-snippet {font-size:.98rem;color:#333;margin-top:.5rem;}
      mark {background: #ffe066; color: #222;}
       /* Fixed navbar styling (always visible) */
    header.navbar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 9999;
      transition: box-shadow 0.22s ease, background-color 0.22s ease, transform 0.18s ease;
      background-color: rgba(255,255,255,0.96);
      backdrop-filter: blur(6px);
    }
    header.navbar.navbar-scrolled { box-shadow: 0 6px 26px rgba(16,24,32,0.12); }
    .brand-logo { height: 44px; width: auto; display: inline-block; }
    @media(max-width: 768px){ .brand-logo{ height:38px } }
     /* Scoped styles for O nas modern layout */
        .onas-container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }
        .onas-intro { margin-bottom: 2.25rem; }
          .onas-logo { text-align: center; margin-bottom: 1rem; }
        .onas-logo img {
  width: min(60vw, 550px);
  /* 60% szerokości ekranu, ale nie więcej niż 550px */
  
  max-width: 100%;
  height: auto;

  display: block;
  margin-inline: auto;
}

@media (max-width: 480px) {
  .onas-logo img {
    width: 70vw;   /* Na małych ekranach logo proporcjonalnie większe */
  }
}
        
        /* Dworek SVG as decorative background element */
        .onas-dworek-bg {
          position: absolute;
          top: 0;
          right: -10%;
          width: 45%;
          height: 100%;
          opacity: 0.08;
          z-index: 0;
          pointer-events: none;
        }

        /* Main content z-index above background */
        .onas-content {
          position: relative;
          z-index: 1;
        }

        .onas-hero { display:grid; grid-template-columns: 1.1fr .9fr; gap: 1.25rem; align-items: stretch; }
        .onas-card {
          background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.76));
          border-radius: 1rem;
          padding: 1.25rem;
          box-shadow: 0 8px 30px rgba(16,24,32,0.06);
          animation: fadeUpStagger 0.7s ease forwards;
          opacity: 0;
          animation-delay: 0.1s;
        }
        
        .onas-quote {
          position: relative;
          display:flex;
          gap: 1rem;
          align-items: center;
          padding: 1.5rem;
          border-radius: 1rem;
          background: linear-gradient(135deg, rgba(76,33,12,0.08), rgba(43,89,195,0.06));
          min-height: 220px;
          border: 2px solid rgba(76,33,12,0.12);
          animation: fadeUpStagger 0.7s ease forwards;
          opacity: 0;
          animation-delay: 0.2s;
          backdrop-filter: blur(8px);
        }

        .jp2-photo {
          width: 96px;
          height: 96px;
          border-radius: 50%;
          object-fit: cover;
          border: 3px solid rgba(255,255,255,0.6);
          box-shadow: 0 6px 18px rgba(16,24,32,0.08);
          flex-shrink: 0;
        }
        
        .jn-quote {
          font-size: 1.15rem;
          font-weight: 600;
          color: var(--brand-brown);
          line-height: 1.4;
          font-style: italic;
        }
        
        .jn-author {
          margin-top: 0.75rem;
          font-size: .95rem;
          color: #444;
          font-weight:700;
        }
        
        .onas-split {
          display:grid;
          grid-template-columns: 1fr 1fr;
          gap: 1.25rem;
          margin-top: 1.5rem;
        }
        
        .onas-section {
          padding: 1.5rem;
          border-radius: .75rem;
          background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(250,250,250,0.95));
          box-shadow: 0 6px 22px rgba(16,24,32,0.04);
          border-left: 4px solid transparent;
          transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
          animation: fadeUpStagger 0.7s ease forwards;
          opacity: 0;
          animation-delay: 0.3s;
          position: relative;
          overflow: hidden;
        }
        
        .onas-section:nth-child(1) {
          border-left-color: var(--brand-brown);
          animation-delay: 0.35s;
        }
        
        .onas-section:nth-child(2) {
          border-left-color: var(--accent-blue);
          animation-delay: 0.45s;
        }
        
        .onas-section:hover {
          transform: translateY(-8px);
          box-shadow: 0 12px 40px rgba(16,24,32,0.1);
        }
        
        .onas-section h4 {
          color: var(--brand-brown);
          font-weight: 800;
          letter-spacing: .02em;
          margin-bottom: 0.75rem;
        }
        
        .onas-section:nth-child(2) h4 {
          color: var(--accent-blue);
        }
        
        /* Timeline slider */
        .timeline-swiper {
          margin-top: 1rem;
          position: relative;
          width: 100%;
          padding: 0 60px;
          margin-left: -60px;
          margin-right: -60px;
          width: calc(100% + 120px);
        }
        
        .swiper {
          position: relative;
          width: 100%;
          min-height: 140px;
        }
        
        .swiper-wrapper {
          display: flex;
          width: 100%;
        }
        
        .swiper-slide {
          width: 100%;
          flex-shrink: 0;
        }
        
        .timeline-item {
          padding: 0.75rem 1rem;
          background: linear-gradient(135deg, rgba(76,33,12,0.05), rgba(43,89,195,0.05));
          border-radius: 0.5rem;
          border-left: 3px solid var(--accent-blue);
          cursor: pointer;
          transition: all 0.3s ease;
        }
        
        .timeline-item:hover {
          transform: translateX(8px);
          background: linear-gradient(135deg, rgba(76,33,12,0.08), rgba(43,89,195,0.08));
        }
        
        .timeline-item time {
          display:block;
          font-weight:700;
          color: var(--brand-brown);
          font-size: 0.95rem;
        }
        
        .timeline-item div {
          color: #555;
          font-size: 0.9rem;
          margin-top: 0.25rem;
        }

        .timeline-slide-media { margin-top: .75rem; display:flex; align-items:center; gap:.75rem; }
        .timeline-slide-media img { width: 120px; height: 80px; object-fit: cover; border-radius: .5rem; box-shadow: 0 6px 18px rgba(16,24,32,0.06); }

        /* Pulse animation for decorative element */
        .onas-accent-pulse {
          display: inline-block;
          width: 12px;
          height: 12px;
          background: var(--accent-blue);
          border-radius: 50%;
          margin-right: 0.5rem;
          animation: pulse 2s ease-in-out infinite;
        }

        /* Fade-up stagger animation */
        @keyframes fadeUpStagger {
          from {
            opacity: 0;
            transform: translateY(24px);
          }
          to {
            opacity: 1;
            transform: translateY(0);
          }
        }

        @keyframes pulse {
          0%, 100% { box-shadow: 0 0 0 0 rgba(43, 89, 195, 0.7); }
          50% { box-shadow: 0 0 0 8px rgba(43, 89, 195, 0); }
        }

        @media(max-width: 900px){
          .onas-hero { grid-template-columns: 1fr; }
          .onas-split { grid-template-columns: 1fr; }
          .onas-dworek-bg { display: none; }
          .timeline-swiper {
            padding: 0 40px;
            margin-left: -40px;
            margin-right: -40px;
            width: calc(100% + 80px);
          }
          .swiper-button-next, .swiper-button-prev {
            width: 32px;
            height: 32px;
          }
          .swiper-button-prev {
            display: none;
          }
        }
    /* Header / navbar */
    .navbar{
      background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
      border-bottom: 1px solid rgba(107,62,38,0.06);
      backdrop-filter: blur(4px);
    }
    .brand-logo{
      height:60px;
      width:auto;
      filter: none;
    }
h1, h2, h3, h4 {
  color: var(--text-main);
}
.card,
.project-card,
.doc-item,
.newsletter {
  background: var(--card-bg);
  color: var(--text-main);
}
button,
.btn {
  background: var(--accent-blue);
  color: var(--text-light);
}
a {
  color: var(--accent-blue);
}
.hero,
.dark-section {
  background: var(--brand-brown);
  color: var(--text-light);
}
    .navbar{
      background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
      border-bottom: 1px solid rgba(107,62,38,0.06);
      backdrop-filter: blur(4px);
    }
    .brand-logo{
      height:60px;
      width:auto;
      filter: none;
    }
footer {
  background: #1A1A1A;
  color: var(--text-light);
}
ul{
  list-style: none;
}
.footer{
  background-image: url("./resources/tlo-czarne1.webp");
    padding: 70px 0;
}
.footer-col{
   flex: 1 1 25%;
   min-width: 220px;
   box-sizing: border-box;
   padding: 0 15px;
}
.footer-col h4{
  font-size: 18px;
  color: #ffffff;
  text-transform: capitalize;
  margin-bottom: 35px;
  font-weight: 500;
  position: relative;
}
.footer-col h3{
  color:white;
  padding-bottom: 10px;
}
.footer-col h4::before{
  content: '';
  position: absolute;
  left:0;
  bottom: -10px;
  background-color: #6fbbda;
  height: 2px;
  box-sizing: border-box;
  width: 50px;
}
.footer-col ul li:not(:last-child){
  margin-bottom: 10px;
}
.footer-col ul li a{
  font-size: 16px;
  text-transform: capitalize;
  color: #ffffff;
  text-decoration: none;
  font-weight: 300;
  display: block;
  transition: all 0.3s ease;
}
.footer-col ul li a:hover{
  color: #ffffff;
  padding-left: 8px;
}
.footer-col .social-links a{
  display: inline-block;
  height: 40px;
  width: 40px;
  background-color: rgba(255,255,255,0.2);
  margin:0 10px 10px 0;
  text-align: center;
  line-height: 40px;
  border-radius: 50%;
  color: #ffffff;
  transition: all 0.5s ease;
}
.footer-col .social-links a:hover{
  color: #24262b;
  background-color: #ffffff;
}
.footer .footer-row {
  display: flex;
  flex-wrap: wrap;      /* żeby ładnie łamało na mobile */
  justify-content: space-between;
}

.footer-col {
  flex: 1 1 25%;
  min-width: 220px;      /* zabezpieczenie przed ściskaniem */
  padding: 0 15px;
}

/* Naprawa social icons, aby nie wychodziły poza kontener */
.footer-col .social-links a {
  flex-shrink: 0;
}

/* Mobile – 2 kolumny */
@media (max-width: 767px) {
  .footer-col {
    flex: 1 1 50%;
  }
}

/* Extra small — 1 kolumna */
@media (max-width: 480px) {
  .footer-col {
    flex: 1 1 100%;
  }
}

.left-column {
  flex: 1;
  padding: 20px;
}
.right-column {
  flex: 1;
  padding: 20px;
}
.right-column label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: bold;
}
input[type="radio"] {
  margin-right: 10px;
}
/*responsive*/
@media(max-width: 767px){
  .footer-col{
    width: 50%;
    margin-bottom: 30px;
}
}
@media(max-width: 574px){
  .footer-col{
    width: 50%;
}
}

/* Appended styles moved from index.php <style> block */
/* Dark mode / accessibility styles and component overrides */
/* (moved here to central stylesheet to reduce index.php size) */
/* Dark mode */
body.dark-mode {
  background: #07101a !important;
  color: #dbeaf8 !important;
}
body.dark-mode .card,
body.dark-mode .onas-section,
body.dark-mode .project-card,
body.dark-mode .pub-box {
  background-color: #0f1724 !important;
  color: #e6f2ff !important;
  border-color: rgba(255,255,255,0.03) !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6) !important;
}
body.dark-mode a { color: #9fd1ff !important; }
/* Dark mode text colors - ALL text elements */
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 { color: #e6f2ff !important; }
body.dark-mode .kicker { color: #9fd1ff !important; }
body.dark-mode .hero-card { background: linear-gradient(180deg, rgba(15, 23, 36, 0.98), rgba(15, 23, 36, 0.96)) !important; }
body.dark-mode .hero p.lead { color: #bdd4f0 !important; }
body.dark-mode .project-meta { color: #9fd1ff !important; }
body.dark-mode .pub-lead { color: #bdd4f0 !important; }
body.dark-mode .pub-title { color: #e6f2ff !important; }
body.dark-mode .text-muted { color: #8aa8cc !important; }
body.dark-mode .navbar { background-color: rgba(7, 16, 26, 0.96) !important; color: #e6f2ff !important; }
body.dark-mode .nav-link { color: #bdd4f0 !important; }
body.dark-mode .nav-link.active { color: #9fd1ff !important; font-weight: 600; }
body.dark-mode .form-label { color: #e6f2ff !important; }
body.dark-mode .form-control, body.dark-mode .form-select { background-color: #1a2332 !important; color: #e6f2ff !important; border-color: #2a3d52 !important; }
body.dark-mode .form-control::placeholder { color: #7a94b0 !important; }
body.dark-mode .btn-outline-secondary { color: #bdd4f0 !important; border-color: #2a3d52 !important; }
body.dark-mode .btn-outline-secondary:hover { background: rgba(255,255,255,0.08) !important; color: #e6f2ff !important; }
body.dark-mode .form-check-label { color: #bdd4f0 !important; }
body.dark-mode .alert-info { background-color: rgba(43, 89, 195, 0.15) !important; color: #bdd4f0 !important; border-color: #2a5ab5 !important; }
body.dark-mode .alert-info strong { color: #9fd1ff !important; }

/* Accessibility panel positioning - FIXED so button stays in place */
.accessibility-panel { position: fixed; right: 12px; top: 8px; z-index: 99999; }
.accessibility-panel .accessibility-tools.open { display: flex; }
html, body{
  height: auto;
  width: 100%;
  max-width: 100%;
  font-family: "Poppins", "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg-cream);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
* {
  box-sizing: border-box;
}
/* Hero */
.hero{
  background: linear-gradient(180deg, rgba(255,255,255,0.0), rgba(255,255,255,0.0));
  padding: 3rem 0;
  position: relative;
}
body.dark-mode .hero { background: linear-gradient(180deg, rgba(15, 23, 36, 0.0), rgba(15, 23, 36, 0.0)); }
.hero .hero-card{
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.96));
  border-radius: .75rem;
  box-shadow: 0 6px 30px rgba(16,24,32,0.06);
  padding: 2rem;
}
.hero .kicker{
  color: var(--brand-brown);
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:.85rem;
}
.hero h1{
  font-family: "Montserrat", sans-serif;
  color: var(--brand-brown);
  font-size:1.9rem;
  margin-bottom: .5rem;
}
.hero p.lead{
  color: #444;
  margin-bottom:1rem;
}
.cta-primary{
  background: var(--brand-brown);
  color: #fff;
  border-radius: .5rem;
  padding: .6rem 1rem;
  border: none;
}
body.dark-mode .cta-primary { background: #2b59c3; color: #fff; }
body.high-contrast .cta-primary { background: #fff; color: #000; }
body.sepia .cta-primary { background: #5c3a1a; color: #fff; }
.cta-outline{
  background: transparent;
  color: var(--brand-brown);
  border: 1px solid rgba(107,62,38,0.12);
  padding: .6rem 1rem;
  border-radius: .5rem;
}
body.dark-mode .cta-outline { color: #9fd1ff; border-color: rgba(159, 209, 255, 0.2); }
body.high-contrast .cta-outline { color: #fff; border: 2px solid #fff; }
body.sepia .cta-outline { color: #3d2815; border-color: rgba(61, 40, 21, 0.2); }
/* SVG menu */
.svg-menu{
  max-width: 420px;
  margin: 1rem 0;
}
.svg-menu a{ text-decoration:none; color: inherit; }
/* Two-column news/media */
.news-media{
  padding: 2rem 0;
}
body.dark-mode .news-media { background-color: rgba(15, 23, 36, 0.4) !important; }
body.high-contrast .news-media { background-color: transparent !important; border: 2px solid #fff; }
body.sepia .news-media { background-color: rgba(250, 246, 241, 0.4) !important; }
.news-card{
  border-radius: .5rem;
  background: var(--card-bg);
  box-shadow: 0 6px 18px rgba(16,24,32,0.04);
  padding: 1rem;
  margin-bottom: 1rem;
}
.media-feed{
  min-height: 200px;
}
/* Projects */
.projects{
  padding: 2rem 0;
}
body.dark-mode .projects { background: transparent; }
body.high-contrast .projects { background: #000; }
body.sepia .projects { background: transparent; }
.project-card{
  border-radius: .5rem;
  overflow:hidden;
  background: #fff;
  transition: transform .18s ease, box-shadow .18s ease;
}
body.dark-mode .project-card { background: #0f1724; color: #e6f2ff; }
body.high-contrast .project-card { background: #000; border: 2px solid #fff; }
body.sepia .project-card { background: #faf6f1; color: #2b1f0f; }
.project-card:hover{ transform: translateY(-6px); box-shadow: 0 10px 30px rgba(16,24,32,0.08); }
.project-thumb{
  width:100%;
  height:160px;
  object-fit:cover;
  display:block;
}
.project-body{
  padding: .75rem;
}
.project-meta{ color:var(--muted); font-size:.85rem; }
.pub-box {
  background: #fff;
}
.pub-title {
  color: var(--brand-brown);
}
.pub-lead {
  color: #444;
}
/* Map section placeholder */
#projects-map{
  width:100%;
  height:360px;
  border-radius:.5rem;
  background: linear-gradient(180deg, #f6f9f6, #eef4ee);
  border:1px solid rgba(80,97,69,0.06);
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  margin-top:1rem;
}
/* Documents/Downloads */
.doc-list .doc-item{
  display:flex;
  gap: .75rem;
  align-items:center;
  padding: .6rem .5rem;
  border-radius: .5rem;
  background: #fff;
  margin-bottom: .5rem;
}
/* Newsletter */
.newsletter{
  padding: 1.5rem;
  border-radius: .75rem;
  background: linear-gradient(90deg, rgba(213,154,42,0.06), rgba(80,97,69,0.03));
}
body.dark-mode .newsletter { background: linear-gradient(90deg, rgba(43, 89, 195, 0.08), rgba(122, 148, 176, 0.04)); }
body.high-contrast .newsletter { background: #000; border: 2px solid #fff; }
body.sepia .newsletter { background: linear-gradient(90deg, rgba(107, 62, 38, 0.08), rgba(140, 111, 71, 0.04)); }
/* Accessibility helpers */
a:focus, button:focus, input:focus, textarea:focus{
  outline: 3px solid rgba(216,154,42,0.18);
  outline-offset: 2px;
}
@media(min-width:992px){
  .hero{
    padding: 4rem 0;
  }
  .hero h1{ font-size:2.6rem; }
  .svg-menu{ max-width: 520px; }
}

.accessibility-toggle {
  background: #2b59c3;
  color: #fff;
  border: 2px solid transparent;
  border-radius: 10px;
  width: 48px;
  height: 48px;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-weight: 700;
}
:root {
  --modal-heading-background: url('./resources/tlo-czarne1.webp');
  --modal-body-background: url('./resources/tlo-biale3.webp');
  --modal-footer-background: url('./resources/tlo-czarne1.webp');
}
  /* Apply CSS variables to modal elements */
  .modal-header {
    color: white;
  }
  .modal-body {
    background-image: var(--modal-body-background);
    font-size: 1rem;
    display: flex;
    flex-wrap: wrap;
  }
  .modal-footer {
    background-image: var(--modal-footer-background);
  }

  @media (max-width: 767px) {
    .col-mobile {
      flex-basis: 50%;
      max-width: 50%;
      padding: 0 10px; /* Dodatkowy padding po bokach dla odstępu między publikacjami */
    }
  }
  .text-reset {
    all: unset; /* Usuń wszystkie właściwości stylów */
}
.pt-2 {
  padding-top: 0.2rem!important;
}
.mt-4 {
  margin-top: 0.6rem!important;
}
.social-icon.social li a {
    color: #adb5bd;
    border-color: #adb5bd;
}
.social-icon li a {
    color: #35404e;
    border: 1px solid #35404e;
    display: inline-block;
    height: 32px;
    text-align: center;
    font-size: 15px;
    width: 32px;
    line-height: 30px;
    -webkit-transition: all 0.4s ease;
    transition: all 0.4s ease;
    overflow: hidden;
    position: relative;
}
.rounded {
    border-radius: 5px !important;
}
.para-desc {
    max-width: 600px;
}
.text-muted {
    color: #8492a6 !important;
}
.section-title .title {
    letter-spacing: 0.5px;
    font-size: 30px;
}
  .card-body{
    padding: 0px;
  }
     .latest-video {
      margin-bottom: 10px;
      padding: 20px;
      padding-bottom: 0px;
      background-color: #000;
      position: relative;
      z-index: 10;
    }
    .other-videos-container {
      overflow: hidden;
      width: 100%;
    }
    .other-videos{
      padding-top:15px;
      padding-bottom: 10px;
      cursor: pointer;
      display:flex;
      justify-content: space-between;
      overflow: hidden;
      position: relative;
      z-index: 1;
    }
    /* Desktop - 4 filmy */
    @media (min-width: 1400px) {
      .other-videos-container {
        width: calc(200px * 4 + 30px * 4);
      }
    }
    /* Tablet Large - 3 filmy */
    @media (min-width: 1024px) and (max-width: 1399px) {
      .other-videos-container {
        width: calc(200px * 3 + 30px * 3);
      }
    }
    /* Tablet - 2 filmy */
    @media (min-width: 768px) and (max-width: 1023px) {
      .other-videos-container {
        width: calc(200px * 2 + 30px * 2);
      }
    }
    .video-container {
      padding-bottom: 300px;
      position: relative;
      height: 0;
      overflow: hidden;
      transition: opacity 0.5s ease;
    }
    .video-container.slide-in {
      animation: slideInVideo 0.6s ease forwards;
    }
    .video-container.slide-out {
      animation: slideOutVideo 0.6s ease forwards;
    }
    @keyframes slideInVideo {
      from {
        opacity: 0;
        transform: translateX(100%);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }
    @keyframes slideOutVideo {
      from {
        opacity: 1;
        transform: translateX(0);
      }
      to {
        opacity: 0;
        transform: translateX(-100%);
      }
    }
    .video-container iframe {
      position: absolute;
      width: 300px;
      justify-content: space-between;
      height: auto;
    }
    .video-title{
      color: white;
      font-size: 18px;
      transition: opacity 0.5s ease;
    }
    .video-title.slide-in {
      animation: slideInText 0.6s ease 0.1s forwards;
    }
    .video-title.slide-out {
      animation: slideOutText 0.6s ease forwards;
    }
    @keyframes slideInText {
      from {
        opacity: 0;
        transform: translateX(50px);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }
    @keyframes slideOutText {
      from {
        opacity: 1;
        transform: translateX(0);
      }
      to {
        opacity: 0;
        transform: translateX(-50px);
      }
    }
    @media screen and (max-width: 800px) {
    .other-videos, .latest-video, .video-thumbnail {
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box;
    }
    #sokialtv .col-lg-4, #sokialtv .col-lg-8 {
      width: 100% !important;
      padding: 0 !important;
    }
    }
    .video-thumbnail{
      margin-top: 10px;
      margin-left: 10px;
      width: 100%;
      height: auto;
      padding-top: 15px;
      padding-left: 15px;
    }
    .animation-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.7);
      display: none;
      z-index: 9999;
    }
    .animation-content {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      color: #fff;
      text-align: center;
    }
    .outline{
      text-shadow: -1.35px -1.35px 0 #000, 1.35px -1.35px 0 #000, -1.35px 1.35px 0 #000, 1.35px 1.35px 0 #000;
    }
    .outline2{
      text-shadow: -1px -1px 10px #111, 1px -1px 10px #111, -1px 1px 10px #111, 1px 1px 10px #111;
    }
    .boxoutline{
      box-shadow: -1px -1px 10px #202020, 1px -1px 10px #202020, -1px 1px 10px #202020, 1px 1px 10px #202020;
    }
    .separator{
      margin: 25px 0;
      background-color: white;
      border: 0;
      height:2px;
    }
    @media (max-width: 767px) {
      .mobile{
        display:none;
      }
    }   
    #sokialtv{
      background-image: url("/resources/tlo-czarne-orzel.webp");
      justify-content: center;
      align-items: center;
      width: 100%;
      max-width: 100%;
      overflow-x: hidden !important;
      box-sizing: border-box;
    }
    #sokialtv .row {
      width: 100%;
      max-width: 100%;
      overflow-x: hidden !important;
      margin: 0 !important;
      padding: 0 !important;
    }
    
    #sokialtv .col-lg-4, #sokialtv .col-md-4, #sokialtv .col-sm-12 {
      box-sizing: border-box;
      padding: 0 !important;
    }
    
    #sokialtv .col-lg-8, #sokialtv .col-md-8 {
      box-sizing: border-box;
      padding: 0 !important;
      overflow-x: hidden;
    }
    
    .video-title{
      color: white;
    }
    .email-container {
      display: flex;
      align-items: center;
    }
    .film-reel-container {
      width: 100%;
      height: auto;
      display: flex;
      overflow: hidden !important;
      max-width: 100%;
      box-sizing: border-box;
    }
    .film-reel {
      display: flex;
      animation: scroll-film linear infinite;
      animation-duration: 200s;
  width: max-content; /* ważne: cala tasma ma rzeczywistą szerokość */
    }
    .block {
      width: 70px;
      height: 50px;
      margin: 10px;
      background-color: white;
      flex-shrink: 0;
    }
    @keyframes scroll-film {
      0% {
        transform: translateX(0);
      }
      100% {
        transform: translateX(-100%);
      }
    }
    .image-container {
      position: relative;
      display: inline-block;
    }
    .slider-navigation {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 15px;
      gap: 10px;
    }
    .slider-counter {
      color: white;
      font-size: 14px;
      min-width: 80px;
      text-align: center;
    }
    .video-card {
      flex: 0 0 auto;
      min-width: fit-content;
      transition: none;
    }
    .video-item {
      width: 200px;
      flex: 0 0 200px;
      min-width: 200px;
      margin-right: 30px;
    }
    .video-item img {
      width: 100%;
      display: block;
    }
    .video-item h6,
    .video-thumbnail .video-title {
      max-width: 100%;
      white-space: normal;
      overflow-wrap: break-word;
      word-wrap: break-word;
      text-align: center;
      display: block;
    }
 .youtube-promo-wrapper {
    display: flex;
    justify-content: flex-start; /* ustawia przy latest video */
    align-items: center;
    margin-top: 15px;
    max-height: 180px; /* dopasowane do wysokości latest video */
    overflow: hidden; /* żeby nie wyszło poza kontener */
}

.youtube-promo {
    display: flex;
    align-items: center;
    border: 2px solid #2b59c2;
    background-color: #000;    border-radius: 10px;
    padding: 10px 20px;
    max-width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.youtube-promo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(250, 166, 26, 0.4);
}

.youtube-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.youtube-link:hover .youtube-icon {
    transform: scale(1.2);
}
.youtube-text {
    color: #2b59c2;
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
}
  .youtube-promo .social-links{
  display: inline-block;
  height: 40px;
  width: 40px;
  background-color: rgba(255,255,255,0.2);
  margin:0 10px 0px 0;
  text-align: center;
  line-height: 40px;
  border-radius: 50%;
  color: #ffffff;
  transition: all 0.5s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* ---------- Animacje slidera publikacji ---------- */
.pub-item {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .35s ease, transform .35s ease;
}

.pub-item.active {
  opacity: 1;
  transform: translateX(0);
}

.pub-item.slide-out {
  opacity: 0;
  transform: translateX(-20px);
}

/* Social posty — fade-in */
.social-post {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity .35s ease, transform .35s ease;
}

.social-post.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Card hover effects */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
}

/* Form styling improvements */
.form-control, .form-select {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--brand-brown);
  box-shadow: 0 0 0 0.2rem rgba(76, 33, 12, 0.15);
}

/* Newsletter section styling */
.newsletter {
  background: linear-gradient(135deg, rgba(213, 154, 42, 0.12), rgba(80, 97, 69, 0.08));
  border-radius: 1rem;
  border-left: 4px solid var(--brand-brown);
}

/* Alert styling */
.alert {
  border-radius: 0.75rem;
  border-left: 4px solid currentColor;
}

.alert-info {
  background-color: rgba(43, 89, 195, 0.1);
  border-left-color: var(--accent-blue);
  color: #1a5490;
}

/* Button smooth transitions */
.btn {
  transition: all 0.3s ease;
}

.btn:hover, .btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

/* Responsive improvements for cards */
@media (max-width: 768px) {
  .card {
    margin-bottom: 1.5rem;
  }
  
  .form-control-lg, .form-select-lg {
    font-size: 1rem;
  }
}

#sokialtv,
#sokialtv * {
  box-sizing: border-box;
}

#sokialtv {
  overflow-x: hidden !important;
  width: 100%;
}
.film-reel-container {
  overflow: hidden !important;
}

.film-reel {
  will-change: transform;
}

/* Additional Mobile Optimizations */
@media (max-width: 768px) {
  .navbar {
    padding: 0.5rem 0;
  }
  
  .brand-logo {
    height: 48px;
  }
  
  .pub-carousel {
    gap: 0.5rem;
  }
  
  .pub-box {
    min-width: calc(50% - 0.25rem);
    max-width: calc(50% - 0.25rem);
  }
  
  .card-body {
    padding: 1rem !important;
  }
  
  .form-control-lg, .form-select-lg {
    font-size: 1rem;
  }
  
  h1, h2 {
    font-size: 1.75rem !important;
  }
  
  .h5 {
    font-size: 1rem;
  }
  
  .row {
    padding: 0 !important;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .hero .hero-card {
    padding: 1.5rem;
  }
  
  .btn-lg {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
}
/* --- SEKCJA GALERII (POPRAWIONE SKALOWANIE) --- */
.gallery-thumbs {
    margin-bottom: 2rem;
    margin-left: -8px; /* Korekta marginesów dla siatki */
    margin-right: -8px;
}

.gallery-thumbs > [class*='col-'] {
    padding-left: 8px;
    padding-right: 8px;
    padding-bottom: 16px;
}

/* Kafelki galerii - zawsze równe kwadraty */
.gallery-thumb {
    position: relative;
    display: block;
    width: 100%;
    /* WYMUSZENIE PROPORCJI 1:1 */
    aspect-ratio: 1 / 1; 
    overflow: hidden;
    border-radius: 0.75rem;
    background-color: #f0f0f0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-thumb:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 2;
}

/* Zdjęcie wewnątrz kafelka */
.gallery-img {
    width: 100%;
    height: 100%;
    /* CROP: Wypełnia cały kafelek, przycinając nadmiar, nie zniekształca */
    object-fit: cover; 
    object-position: center;
    transition: transform 0.6s ease;
    display: block;
}

.gallery-thumb:hover .gallery-img {
    transform: scale(1.1); /* Zoom zdjęcia przy najechaniu */
}

/* --- LIGHTBOX (PODGLĄD) - SKALOWANIE I RESPONSYWNOŚĆ --- */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Nieco lżejsze tło */
    z-index: 100000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    /* Zapobiega zaznaczaniu tekstu przy szybkim klikaniu */
    user-select: none;
    -webkit-user-select: none;
}

.gallery-lightbox.active {
    display: flex;
    opacity: 1;
}

/* Kontener na zdjęcie */
.gallery-img-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: none; /* Aby kliknięcia obok zdjęcia zamykały galerię */
}

/* SAMO ZDJĘCIE - LOGIKA ROZMIARÓW */
.gallery-lightbox img {
    pointer-events: auto; /* Przywracamy klikalność na samym zdjęciu (opcjonalne) */
    width: auto;
    height: auto;
    
    /* Domyślnie (Mobile/Tablet): Wykorzystaj dużą część ekranu */
    max-width: 95vw;
    max-height: 80vh;
    
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    
    /* Animacja zmiany zdjęcia */
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 1;
    transform: scale(1);
}

/* Klasa dodawana przez JS przy zmianie slajdu */
.gallery-lightbox img.fade-out {
    opacity: 0.5;
    transform: scale(0.98);
}

/* DESKTOP (Ekrany powyżej 1200px) - Zmniejszamy zdjęcie do ok. 600x400 */
@media (min-width: 1200px) {
    .gallery-lightbox img {
        /* Ograniczamy maksymalne wymiary, by na wielkim ekranie nie było "giganta" */
        max-width: 800px;  /* Pozwala na ok. 600-800px szerokości */
        max-height: 600px; /* Pozwala na ok. 400-600px wysokości */
    }
}

/* --- PRZYCISKI NAWIGACJI --- */
.gallery-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    /* Usunięto transform z transition */
    transition: background-color 0.2s ease, color 0.2s ease;
    z-index: 100001;
    pointer-events: auto;
}

.gallery-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    /* USUNIĘTO transform: scale(1.1) zgodnie z życzeniem */
}

/* Pozycjonowanie przycisków */
.gallery-close {
    top: 20px;
    right: 20px;
    background: transparent;
    font-size: 3rem;
    line-height: 1;
    padding-bottom: 10px;
}

.gallery-prev {
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-next {
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
}

/* --- RESPONSYWNOŚĆ STRZAŁEK NA TELEFONACH (POPRAWKA) --- */
@media (max-width: 768px) { 
    .gallery-btn { 
        width: 48px; /* Nieco większe dla wygody */
        height: 48px; 
        font-size: 1.5rem; 
        background: rgba(0,0,0,0.5); /* Ciemniejsze tło */
    } 
    
    .gallery-prev { 
        left: 10px; 
    } 
    
    .gallery-next { 
        right: 10px; 
        left: auto; /* FIX: Kluczowe dla uniknięcia nakładania */
    } 
    
    .gallery-close { 
        top: 15px; 
        right: 15px; 
        /* FIX: Centrowanie ikony */
        display: flex;
        align-items: center;
        justify-content: center;
        padding-bottom: 4px; /* Przesuwa krzyżyk wizualnie do góry */
    } 
    .latest-video { display: none !important; }
}
/* Links styling */
a {
  transition: color 0.3s ease;
}

a:hover {
  text-decoration: none;
}
/* --- FACEBOOK FEED STYLES --- */

/* Kontener listy postów */
#social-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.5s ease;
}
#social-list.loaded {
    opacity: 1;
}

/* Pojedynczy post */
.fb-post {
    background: #fff;
    border: 1px solid #e7e1da;
    border-radius: 8px;
    padding: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.fb-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #d1d9e6;
}

/* Nagłówek posta (ikona + data) */
.fb-post-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.fb-icon {
    color: #1877F2; /* Facebook Blue */
    font-size: 1.1rem;
    margin-right: 8px;
}

.fb-date {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Zdjęcie w poście */
.fb-media-wrapper {
    width: 100%;
    height: 160px;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 10px;
    background-color: #f3f4f6;
}

.fb-media-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.fb-post:hover .fb-media-wrapper img {
    transform: scale(1.05);
}

/* Treść */
.fb-content p {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.5;
    margin-bottom: 8px;
}

.fb-link {
    font-size: 0.85rem;
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.fb-link:hover {
    text-decoration: underline;
}

/* Scrollbar dla kontenera feedu (opcjonalnie, jeśli chcesz ograniczyć wysokość) */
.media-feed {
    max-height: 600px; /* Wysokość dopasowana do sekcji obok */
    overflow-y: auto;
    padding-right: 5px;
    /* Styl paska przewijania */
    scrollbar-width: thin;
    scrollbar-color: #d1d9e6 #f0f2f5;
}
.media-feed::-webkit-scrollbar {
    width: 6px;
}
.media-feed::-webkit-scrollbar-track {
    background: #f0f2f5;
    border-radius: 3px;
}
.media-feed::-webkit-scrollbar-thumb {
    background-color: #d1d9e6;
    border-radius: 3px;
}

/* TRYB CIEMNY (Kompatybilność) */
body.theme-dark .fb-post {
    background-color: #1a2332;
    border-color: #2a3d52;
}
body.theme-dark .fb-content p {
    color: #bdd4f0;
}
body.theme-dark .fb-date {
    color: #6c829d;
}
body.theme-dark .fb-post-header {
    border-bottom-color: #2a3d52;
}
/* =========================================
   POPRAWKA MODALI (Z-INDEX I PRZESUNIĘCIA)
   ========================================= */

/* 1. Wyciągnięcie modala na wierzch */
/* Menu ma z-index: 9999, Dworek: 10005. Modal musi być wyżej. */
.modal {
    z-index: 100050 !important; 
}
.modal-backdrop {
    z-index: 100040 !important; /* Tło przyciemniające */
}

/* 2. Zablokowanie przesuwania strony (skakania menu) */
/* Nadpisujemy zachowanie Bootstrapa, które ukrywa scrollbar i dodaje padding */
body.modal-open {
    overflow-y: scroll !important; /* Pasek przewijania zostaje widoczny */
    padding-right: 0 !important;   /* Nie dodajemy sztucznego odstępu z prawej */
}

/* Opcjonalnie: Upewnienie się, że navbar też nie dostaje marginesu od Bootstrapa */
body.modal-open .navbar,
body.modal-open .fixed-top,
body.modal-open .sticky-top {
    padding-right: 0 !important;
    margin-right: 0 !important;
}
/* =========================================
   1. TŁA STRONY (SOKIAL - ORZEŁ)
   ========================================= */

/* Domyślny tryb jasny */
body {
    background-color: var(--bg-cream);
    /* Upewnij się, że ścieżka jest poprawna */
    background-image: url('resources/tlo-biale2-orzel.webp'); 
    background-size: cover;
    background-attachment: fixed;
    background-position: center top;
    background-blend-mode: multiply;
}

/* Tryb Ciemny */
body.theme-dark {
    background-color: #121212 !important;
    background-image: url('resources/tlo-brazowe2-orzel.webp') !important;
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-blend-mode: multiply;
}

/* =========================================
   2. STYLE DLA SEKCJI MAP (Wygląd klocków)
   ========================================= */

/* Nagłówek karty (kontener) */
.map-header {
    background: #fff;
    padding: 1.25rem 1.5rem;
    color: #222;
    display: flex !important;       /* Wymuszenie Flexboxa */
    align-items: flex-start !important;
    gap: 1.25rem;
    border-bottom-width: 2px;
    border-bottom-style: solid;
    transition: background-color 0.3s, border-color 0.3s;
}

/* Kolorowy klocek z ikoną */
.map-icon-box {
    flex-shrink: 0;
    display: flex !important;       /* Wymuszenie Flexboxa */
    align-items: center !important;
    justify-content: center !important;
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    color: #fff !important;         /* Ikona zawsze biała */
    font-size: 1.6rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* Lekki cień dla klocka */
}

/* Teksty */
.map-info {
    display: flex;
    flex-direction: column;
}
.map-title {
    font-size: 1.08rem;
    font-weight: 800;
    margin-bottom: 2px;
    line-height: 1.2;
}
.map-address {
    font-size: 1.01rem;
    color: #222;
    font-weight: 600;
}
.map-zip {
    font-size: 0.98rem;
    color: #666;
}

/* --- WARIANTY KOLORYSTYCZNE --- */

/* Brązowy (Siedziba) */
.style-brown .map-header { border-bottom-color: var(--brand-brown); }
.style-brown .map-icon-box { background-color: var(--brand-brown); }
.style-brown .map-title { color: var(--brand-brown); }

/* Niebieski (Biuro) */
.style-blue .map-header { border-bottom-color: var(--accent-blue); }
.style-blue .map-icon-box { background-color: var(--accent-blue); }
.style-blue .map-title { color: var(--accent-blue); }


/* =========================================
   3. TRYB CIEMNY DLA MAP
   ========================================= */

body.theme-dark .map-header {
    background-color: #1e1e1e !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* Teksty na ciemnym */
body.theme-dark .map-title { color: #fff !important; }
body.theme-dark .map-address { color: #e0e0e0 !important; }
body.theme-dark .map-zip { color: #aaa !important; }

/* Klocki w trybie ciemnym (zachowujemy kolor, ale nieco ciemniejszy/stonowany) */
body.theme-dark .style-brown .map-icon-box { background-color: #5d4037 !important; } /* Ciemniejszy brąz */
body.theme-dark .style-blue .map-icon-box { background-color: #1a5490 !important; }  /* Ciemniejszy niebieski */

/* Kolory tytułów w trybie ciemnym (żeby pasowały do klocków) */
body.theme-dark .style-brown .map-title { color: #d4a373 !important; }
body.theme-dark .style-blue .map-title { color: #8ab4f8 !important; }
/* =========================================
   NOWA SEKCJA DANE KONTAKTOWE
   ========================================= */

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Odstęp między lokalizacjami */
}

.contact-item {
    display: flex;
    align-items: center; /* Wyśrodkowanie w pionie */
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.contact-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Teksty w lokalizacji */
.contact-info {
    flex: 1; /* Zajmuje pozostałe miejsce */
}

.contact-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-brown);
    margin-bottom: 0.2rem;
    display: block;
}

.contact-address {
    font-size: 1.05rem;
    color: #222;
    line-height: 1.4;
    font-weight: 500;
}

/* DUŻE ZDJĘCIE LOKALIZACJI */
.contact-img-wrap {
    flex-shrink: 0;
    width: 200px;  /* Znacznie szersze (było 120px) */
    height: 140px; /* Wyższe (było 90px) */
    border-radius: 0.8rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
}

.contact-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.contact-item:hover .contact-img {
    transform: scale(1.08); /* Efekt zoom przy najechaniu */
}

/* Responsywność: Na telefonach zdjęcie na górę i na całą szerokość */
@media (max-width: 576px) {
    .contact-item {
        flex-direction: column-reverse; /* Zdjęcie nad tekstem */
        align-items: flex-start;
        gap: 1rem;
    }
    .contact-img-wrap {
        width: 100%;
        height: 200px; /* Duże zdjęcie na mobilu */
    }
}

/* TRYB CIEMNY */
body.theme-dark .contact-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
body.theme-dark .contact-address {
    color: #ddd;
}
body.theme-dark .contact-label {
    color: #f2f2f2; /* Jasny tekst nagłówka w ciemnym trybie */
}
/* Poprawka dla labeli w ciemnym trybie (jeśli używasz klas brand-brown) */
body.theme-dark .text-brand { color: #fff !important; }
/* =========================================
   SEKCJA ZARZĄD - NAPRAWIONA
   ========================================= */

/* Kontener karty (Legitymacja) */
.zarzad-card {
    background: #fff;
    border: none;
    /* Cień: delikatny, niebieskawy */
    box-shadow: 0 4px 15px rgba(43, 89, 195, 0.08); 
    border-radius: 1rem;
    overflow: hidden;
    
    /* Układ: Zawsze poziomy (zdjęcie po lewej, tekst po prawej) */
    display: flex;
    flex-direction: row; 
    align-items: stretch;
    
    width: 100%;
    /* Stała wysokość dla spójności */
    height: 180px; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Efekt najechania (tylko na desktopach) */
@media (min-width: 992px) {
    .zarzad-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(43, 89, 195, 0.15);
    }
}

/* Kontener zdjęcia (Lewa strona) */
.zarzad-photo-wrap {
    /* Stała szerokość: 35% karty, ale nie mniej niż 100px */
    width: 35%;
    min-width: 110px; 
    flex-shrink: 0; /* Nie zgniataj zdjęcia */
    
    background: linear-gradient(135deg, #f7f5f2 0%, #e7e1da 100%);
    position: relative;
    overflow: hidden;
    
    /* Centrowanie awatara SVG */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Samo zdjęcie */
.zarzad-photo {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Wypełnij obszar, przytnij nadmiar */
    object-position: top center; /* Twarz jest zwykle na górze */
    display: block;
}

/* Ikona zastępcza (gdy brak zdjęcia) */
.zarzad-avatar-svg {
    width: 70%;
    height: auto;
    opacity: 0.5;
    mix-blend-mode: multiply;
}

/* Kontener tekstu (Prawa strona) */
.zarzad-info {
    flex: 1; /* Zajmij resztę miejsca */
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Wyśrodkuj tekst w pionie */
    overflow: hidden; /* Ucinaj zbyt długie teksty */
}

/* Typografia w karcie */
.zarzad-info h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-brown);
    margin-bottom: 0.4rem;
    line-height: 1.2;
}

.zarzad-info p {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

/* --- RESPONSYWNOŚĆ (Dostosowanie wysokości na mobilkach) --- */

/* Na tabletach i telefonach (poniżej 991px) */
@media (max-width: 991px) {
    .zarzad-card {
        height: 140px; /* Nieco niższa karta */
    }
    .zarzad-info {
        padding: 0.8rem;
    }
    .zarzad-info h5 {
        font-size: 1rem;
    }
    .zarzad-info p {
        font-size: 0.85rem;
    }
}

/* Na bardzo małych ekranach (poniżej 400px) */
@media (max-width: 400px) {
    .zarzad-photo-wrap {
        width: 30%; /* Węższe zdjęcie, więcej miejsca na tekst */
        min-width: 90px;
    }
}

