/* =========================
   SUBPAGES (work/realizacje)
   Treść + galeria + back btn
   Bez header/footer
   ========================= */

/* Żeby treść nie wchodziła pod fixed header */
:root {
  --content-top: 90px;     /* odstęp od góry pod fixed header */
  --sep-gap-top: 12px;     /* odstęp h2 -> separator */
  --sep-gap-bottom: 28px;  /* odstęp separator -> tekst */
}

main.page-content {
  padding-top: var(--content-top);
}

/* ===== TEXT SECTION ===== */
.text-section {
  max-width: 1200px;
  margin-left: 12%;
  margin-top: 40px;
  margin-bottom: 60px;
}

.text-section h2 {
  text-align: left;
  font-size: 2rem;
  margin: 0;          /* KLUCZ: żadnych % */
  padding: 0;
}

.text-section p {
  text-align: left;
  max-width: 700px;
  color: #000;
  font-size: 1.5rem;
  line-height: 1.6;
}

.text-section .highlight {
  font-weight: bold;
}

/* jeśli chcesz inne odstępy dla ostatniej sekcji – daj w px, nie w % */
.text-section:last-of-type {
  margin-top: 60px;
  margin-bottom: 120px;
}

/* separator */
.text-section .separator {
  width: 250px;
  height: 8px;
  background-color: #f0bb1c;
  margin-top: var(--sep-gap-top);
  margin-bottom: var(--sep-gap-bottom);
  transform: scaleX(0);
  transform-origin: left;
  animation: drawLine 9s ease-in-out infinite;
}

@keyframes drawLine {
  0%   { transform: scaleX(0); }
  25%  { transform: scaleX(1); }
  75%  { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

/* ===== VIDEO SECTION (zamiast inline style) ===== */
.video-section {
  text-align: center;
  padding: 40px 0;
  background: #fff;
}

.video-wrap {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.video-frame {
  width: 100%;
  height: 100%;
  border-radius: 27px;
  border: 0;
}

/* ===== GALLERY SECTION ===== */
.gallery-section {
  max-width: 2500px;
  margin: auto;
  padding: 0 20px;
  margin-bottom: 8%;
}

.gallery-section h2 {
  text-align: center;
  font-size: 2rem;
  margin: 0 0 10px 0;
}

.gallery-section p {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 20px auto;
  color: #000;
  font-size: 1.1rem;
  line-height: 1.6;
}

.gallery-section .highlight {
  font-weight: bold;
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

/* karta */
.gallery-item {
  width: 600px;
  height: 550px;
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid #000;
  text-align: center;
  transition: transform 0.4s ease;
}

.gallery-item:hover {
  transform: scale(1.01);
}

.gallery-media {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* obraz + video */
.gallery-media img,
.gallery-media video {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.3s ease-in-out;
}

/* video na hover (desktop) */
.gallery-media video {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}

.gallery-item:hover .gallery-media img {
  opacity: 0;
}

.gallery-item:hover .gallery-media video {
  opacity: 1;
}

/* jeśli masz obraz poza .gallery-media */
.gallery-item > img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

/* ===== BACK BUTTON ===== */
.back-button {
  display: block;
  width: fit-content;
  margin: 50px auto;
  padding: 12px 25px;
  color: #000;
  font-weight: bold;
  text-decoration: none;
  border-radius: 38px;
  transition: all 0.3s ease;
}

.back-button:hover {
  background-color: #f0bb1c;
  color: #000;
  transform: scale(1.05);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root {
    --content-top: 70px;
    --sep-gap-top: 10px;
    --sep-gap-bottom: 22px;
  }

  .text-section {
    margin-left: 13%;
    margin-right: 10%;
    margin-top: 30px;
    margin-bottom: 50px;
  }

  .text-section h2 {
    font-size: 1.7rem;
    margin: 0;
  }

  .text-section p {
    font-size: 1.4rem;
  }

  .text-section:last-of-type {
    margin-top: 50px;
    margin-bottom: 90px;
  }

  .gallery-section {
    margin-top: 10%;
    margin-bottom: 20%;
  }

  /* mobile: nie bawimy się w cover na hover */
  .gallery-item .gallery-media img {
    display: none;
  }

  .gallery-item .gallery-media video {
    position: static;
    opacity: 1 !important;
    pointer-events: auto;
  }
}

/* Tablet – bez % marginesów */
@media (min-width: 768px) and (max-width: 1024px) {
  .text-section {
    margin-left: 15%;
    margin-top: 40px;
    margin-right: 7%;
    margin-bottom: 60px;
  }
}

/* Laptopy 1366 – bez % marginesów separatora */
@media (min-width: 768px) and (max-width: 1366px) {
  .text-section {
    margin-top: 40px;
    margin-bottom: 60px;
  }
}

/* Bardzo duże ekrany – bez dziwnych % */
@media (min-width: 2560px) {
  .text-section {
    margin-left: 35%;
    margin-top: 40px;
    margin-right: 7%;
    margin-bottom: 60px;
  }
}