:root {
    --primary-hover-color: #839d2c;
}

/* Resetowanie domyślnych stylów */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Styl dla całego dokumentu */
body {
    font-family: "Montserrat", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
    padding: 25px;
}

/* Nagłówki */
h1, h2, h3 {
    font-weight: bold;
    margin-bottom: 10px;
}

/* Linki */
a {
    color: #333;
    text-decoration: none;
    -webkit-transition: all 0.5s ease-in-out;
    -moz-transition: all 0.5s ease-in-out;
    -o-transition: all 0.5s ease-in-out;
    transition: all 0.5s ease-in-out;
    /* Optymalizacja */
    will-change: transform;
}
a:hover { color: var(--primary-hover-color); }

.ow-pre-heder {
    display: flex;
    position: relative;
    width: 100%;
    min-height: 75px;
}
.ow-pre-heder .ow-logo { width: 35%; }
.ow-pre-heder .ow-logo .ow-box-logo {
    position: absolute;
    margin: 0px 40px 0 60px;
    padding: 20px 20px 15px 20px;
    background-color: #FFFFFF;
    z-index: 9999;
}
.ow-pre-heder .ow-logo .ow-box-logo img { width: 225px; }

.ow-pre-heder .ow-nav {
    display: flex;
    justify-content: flex-end;
    position: relative;
    margin: 0px 40px;
    width: 65%;
    line-height: 70px;
}
.ow-pre-heder .ow-nav ul { list-style: none; }
.ow-pre-heder .ow-nav ul li { display: inline; margin-right: 20px; }
.ow-pre-heder .ow-nav ul li a { font-weight: 600; }

.ow-nav__toggle { display: none; }

/* Główna sekcja */
main { text-decoration: none; }
main .box-h1 {
    position: absolute;
    display: inline-block;
    margin: -50px 40px 0 60px;
    padding: 20px 20px 15px 20px;
    background-color: #FFFFFF;
    z-index: 9999;
}
/* Article */
main .box {
    display: flex;
    gap: 16px;
    align-items: flex-start; /* albo center */
}
main .box .title{
    padding: 20px 10px 20px 0px;
    writing-mode: sideways-lr;     /* pionowo, od prawej do lewej */
    text-orientation: mixed;       /* łacińskie znaki czytelne */
    font-weight: 700;
    font-size: 38px;
    line-height: 1;
    white-space: nowrap;
    color: #839d2c;
}
main .box .content { font-size: 20px; }

/* Partners Logotypes */
.logotypes { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
.logotypes li { overflow: hidden; border-radius: 8px; }
.logotypes img { width: 100%; height: auto; display: block; border-radius: 8px; }

/* Responsywność */
@media (max-width: 1024px) {
  .logotypes { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .logotypes { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .logotypes { grid-template-columns: 1fr; }
}

/* Stopka */
footer { margin-top: 0; }
footer .main {
    display: flex;
    position: relative;
    padding: 25px;
    justify-content: flex-end;
    color: #FFFFFF;
    background-color: #333;
}
footer .main a { color: #FFF; }
footer .main a:hover { color: var(--primary-hover-color); }
footer .main .box-one {
    position: absolute;
    margin: -75px 40px 0 35px;
    padding: 20px 20px 15px 20px;
    color: #333;
    background-color: #FFFFFF;
    z-index: 9999;
}
footer .after {
    display: flex;
    position: relative;
    padding: 25px 25px 0 25px;
    margin: 25px 0;
}
footer .main ul { list-style: none; padding: 0; margin: 0; }
footer .main ul li { display: block; }
footer .main ul li a {
    display: block;
    text-decoration: none;
    color: white;
    padding: 1px 5px;
}
footer .main ul li a:hover { color: var(--primary-hover-color); }

/* DODATKI */
.slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 0 0 25px 0;
}
.slider { display: flex; transition: transform 0.5s ease-in-out; }
.slide { min-width: 100%; }
.slide img { width: 100%; display: block; }

/* Strzałki nawigacyjne */
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    width: 60px;
    line-height: 60px;
    cursor: pointer;
    border: none;
    font-size: 18px;
    transition: 0.3s;
    border-radius: 50%;
}
.prev { left: 25px; }
.next { right: 25px; }
.prev:hover, .next:hover { background-color: rgba(0, 0, 0, 0.8); }

/* Grid */
.gallery {
    display: grid;
    grid-template-columns: 4fr 5fr; /* Kolumny: 1 duża po lewej, 2 małe po prawej */
    grid-template-rows: auto auto;  /* Dwa wiersze dla prawej kolumny */
    gap: 10px;
    height: 100vh;
}
.gallery .item { position: relative; overflow: hidden; }
.gallery .item img { width: 100%; height: 100%; object-fit: cover; }
.gallery .item .text-overlay {
    position: absolute;
    bottom: 10px;
    left: 25px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 25px;
    width: calc(100% - 50px);
}
.gallery .item .text-overlay h2 {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0px;
}
.gallery .item .text-overlay p {
    font-size: 14px;
    line-height: 16px;
    margin-bottom: 5px;
}
.gallery .item .text-overlay a {
    color: #FFFFFF;
    text-decoration: none;
    text-transform: uppercase;
    -webkit-transition: all 0.5s ease-in-out;
    -moz-transition: all 0.5s ease-in-out;
    -o-transition: all 0.5s ease-in-out;
    transition: all 0.5s ease-in-out;
    /* Optymalizacja */
    will-change: transform;
}
.gallery .item .text-overlay a:hover { color: var(--primary-hover-color); }

/* Okno informacji */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;                 /* zawsze flex */
    justify-content: center;
    align-items: center;
    z-index: 100000;               /* ponad wszystko */
    opacity: 0;                    /* ukryte */
    pointer-events: none;          /* nie klikalne */
    transition: opacity .25s ease; /* płynne wejście */
}
.modal-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.modal-box {
    background: #fff;
    padding: 20px 30px;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease;
}
.modal-box h2 {
    margin-top: 0;
    font-size: 20px;
    color: #333;
}
.modal-box p {
    margin: 15px 0;
    font-size: 15px;
    color: #555;
}
.modal-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.modal-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}
.modal-btn.ok { background: #007bff; color: #fff; }
.modal-btn.ok:hover { background: #0056b3; }
.modal-btn.cancel { background: #e0e0e0; color: #333; }
.modal-btn.cancel:hover { background: #c6c6c6; }
@keyframes fadeIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===========================
   MOBILNE NADPISKI (<= 768px)
   =========================== */
@media (max-width: 768px) {
  body { padding: 16px; }

  /* Pre-header: logo nad nawigacją, bez absolutów */
  .ow-pre-heder { flex-direction: column; min-height: auto; }
  .ow-pre-heder .ow-logo { width: 100%; }
  .ow-pre-heder .ow-logo .ow-box-logo {
    position: static;
    margin: 0 0 12px 0;
    padding: 12px 14px;
  }
  .ow-pre-heder .ow-logo .ow-box-logo img { width: 160px; }

  .ow-pre-heder .ow-nav {
    width: 100%;
    margin: 0;
    line-height: 1.2;
    justify-content: flex-start;
  }
  .ow-pre-heder .ow-nav ul li {
    display: block;           /* linki w kolumnie */
    margin: 0 0 8px 0;
  }
  .ow-pre-heder .ow-nav ul li a {
    display: block;
    padding: 10px 0;          /* większy „tap area” */
  }

  /* H1-box nad treścią, bez absolute */
  main .box-h1 {
    position: static;
    display: block;
    margin: 0 0 16px 0;
    padding: 14px 16px;
  }

  /* Artykuł: pionowy układ, tytuł poziomo dla czytelności */
  main .box { flex-direction: column; gap: 12px; }
  main .box .title{
    padding: 0;
    writing-mode: horizontal-tb;  /* było sideways-lr */
    text-orientation: mixed;
    font-size: 26px;
    line-height: 1.2;
    white-space: normal;
  }
  main .box .content { font-size: 18px; }

  /* Logotypy – już masz 2 i 1 kol., tylko drobna kosmetyka */
  .logotypes { gap: 12px; }
  .logotypes img { border-radius: 6px; }

  /* Slider – mniejsze przyciski, ciaśniejsze krawędzie */
  .prev, .next {
    width: 44px;
    line-height: 44px;
    font-size: 16px;
  }
  .prev { left: 10px; }
  .next { right: 10px; }

  /* Gallery – na mobile wysokość nie na 100vh, 1 kolumna */
  .gallery {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
  }
  .gallery .item .text-overlay {
    left: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
    padding: 14px;
  }
  .gallery .item .text-overlay h2 { font-size: 16px; }
  .gallery .item .text-overlay p  { font-size: 13px; line-height: 1.3; }

  /* Stopka – pionowo, box-one w naturalnym przepływie */
  footer .main {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }
  footer .main .box-one {
    position: static;
    margin: 0 0 16px 0;
    padding: 14px 16px;
  }
  footer .after {
    padding: 16px 16px 0 16px;
    margin: 16px 0;
  }
  footer .main ul li a { padding: 6px 0; }

  /* ====== Mobile nav ====== */
  .ow-nav { display: flex; flex-direction: column; gap: 8px; }

  /* Przycisk hamburgera */
  .ow-nav__toggle {
    appearance: none;
    border: 1px solid #ddd;
    background: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }

  /* Domyślnie menu schowane */
  .ow-menu ul {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height .35s ease, opacity .25s ease, transform .25s ease;
  }

  /* Po otwarciu kontenera .is-open */
  .ow-nav.is-open .ow-menu ul {
    max-height: 500px;   /* wystarczająco duże, by pomieścić linki */
    opacity: 1;
    transform: translateY(0);
  }

  /* Linki w kolumnie, większy tap area */
  .ow-pre-heder .ow-nav ul li { display: block; margin: 0; }
  .ow-pre-heder .ow-nav ul li a { display: block; padding: 10px 0; border-bottom: 1px solid #eee; }
  .ow-pre-heder .ow-nav ul li:last-child a { border-bottom: 0; }

  /* Social pod menu */
  .ow-socialmedia ul { display: flex; align-items: center; gap: 8px; }

  /* Logo box: logo po lewej, hamburger po prawej (unikalne reguły) */
  .ow-pre-heder .ow-logo .ow-box-logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .ow-nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 22px;         /* sam „☰” */
    line-height: 1;
  }
}

/* ===========================
   DROBNE NADPISKI (<= 480px)
   =========================== */
@media (max-width: 480px) {
  .ow-pre-heder .ow-logo .ow-box-logo img { width: 140px; }
  main .box .title { font-size: 22px; }
  .prev, .next { width: 40px; line-height: 40px; font-size: 14px; }
  .logotypes { gap: 10px; }
}

/* Preferencje dostępności: mniej animacji */
@media (prefers-reduced-motion: reduce) {
  .ow-menu ul { transition: none; }
}

/* Dla pewności: na >768px menu bez ograniczeń */
@media (min-width: 769px) {
  .ow-menu ul {
    max-height: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}


/* ===========================
   FOOTER — WERSJA MOBILNA
   =========================== */
@media (max-width: 768px) {

  /* odstęp nad footerem niech będzie niższy */
  .box-break { line-height: 32px !important; }

  /* główna część stopki w kolumnie */
  footer .main {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
  }

  /* każda kolumna na 100% szerokości, bez pozycji absolutnych */
  footer .main > div {
    width: 100% !important;
    position: static !important;
    margin: 0;
  }

  /* biały box z tytułem na swoim miejscu */
  footer .main .box-one {
    position: static !important;
    margin: 0 0 12px 0;
    padding: 14px 16px;
  }

  /* blok KRS/NIP/REGON – był absolutny, tu normalny przepływ */
  footer .main > div:first-child > div:last-of-type {
    position: static !important;
    margin-top: 12px;
  }

  /* kolumna „Mapa strony” */
  footer .main > div:nth-child(2) ul {
    padding-left: 0;
  }
  footer .main > div:nth-child(2) li {
    display: block;
    margin: 0;
  }
  footer .main > div:nth-child(2) li a {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #444; /* subtelny separator w ciemnej stopce */
  }
  footer .main > div:nth-child(2) li:last-child a {
    border-bottom: 0;
  }

  /* „Social Media” – był absolutny, tu pod listą */
  footer .main > div:nth-child(2) > div {
    position: static !important;
    margin-top: 16px;
  }
  /* ikony w jednym rzędzie z odstępami */
  footer .main > div:nth-child(2) > div ul {
    display: flex !important;       /* nadpisuje inline */
    gap: 12px;
    padding-left: 0;
    align-items: center;
  }

  /* kolumna „Kontakt” – drobna czytelność */
  footer .main > div:nth-child(3) .content {
    padding-left: 0 !important;
  }

  /* dolny pasek ("after") w kolumnie, wyśrodkowany */
  footer .after {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 0 16px;
    margin: 16px 0;
    text-align: center;
  }
  footer .after .copyright,
  footer .after .design {
    width: 100% !important;
    justify-content: center !important;
  }
  footer .after .logo img {
    height: 22px !important; /* delikatnie mniejsze, żeby nie „pchały” linii */
  }
}
