/* Reset + bazowe style */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #222;
  scroll-behavior: smooth;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

header .logo {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 15px;
  text-decoration: none;
}

header .logo img {
  max-height: 50px;
  height: auto;
  width: auto;
  object-fit: contain;
  display: block;
}

header .logo .brand-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
}

/* Nawigacja */
nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
}

nav a {
  text-decoration: none;
  color: #222;
  font-weight: 500;
  transition: color 0.3s;
}

nav a:hover {
  color: #777;
}

/* Hamburger (mobile) */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: #222;
  transition: 0.3s;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -250px;
  width: 250px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
  transition: right 0.3s ease;
  padding: 70px 20px;
  z-index: 999;
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-menu a {
  color: #222;
  text-decoration: none;
  font-size: 18px;
}

/* Sekcje */
section {
  min-height: 100vh;
  /* Fallback */
  min-height: 100dvh;
  /* Modern mobile fix */
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Restored vertical centering */
  align-items: center;
  text-align: center;
  padding: 100px 20px 40px 20px;
  /* Added top padding for header */
  color: #fff;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Overlay dla lepszej czytelności */
section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  /* Półprzezroczysta czarna warstwa */
  z-index: 1;
}

section.has-video::before {
  display: none;
  /* Hide overlay for video sections to verify visibility */
}

section h1,
section p,
section form {
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  /* Dodatkowy cień */
}

section h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeInUp 1s forwards 0.3s;
}

section p {
  max-width: 600px;
  line-height: 1.6;
  font-size: 1.2rem;
  opacity: 0;
  animation: fadeInUp 1s forwards 0.6s;
  white-space: pre-wrap;
}

/* Animacje */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Layout with Images */
/* Section Layout with Images */
.container-width {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  /* Increased gap for better rhythm */
  position: relative;
  z-index: 2;
  margin: auto;
}

.content-row {
  display: flex;
  flex-direction: row;
  gap: 40px;
  /* Consistent gap */
  align-items: center;
  /* Center vertically relative to images */
  justify-content: center;
  width: 100%;
}

.text-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 300px;
  gap: 20px;
  /* Spacing between text elements */
}

.side-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.modules-group {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: center;
}

.modules-left,
.modules-right {
  flex-direction: column;
  max-width: 300px;
}

.modules-bottom {
  margin-top: 20px;
  width: 100%;
}

.pos-text-top {
  margin-bottom: 30px;
  width: 100%;
}

.section-image {
  object-fit: cover;
  border-radius: 8px;
  /* box-shadow replaced with drop-shadow to support transparent PNGs */
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s;
}

.section-image:hover {
  transform: scale(1.02);
}

/* CTA Buttons */
.btn-cta {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin: 5px;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: #e67e22;
  /* Orange accent */
  color: white;
  border: 2px solid #e67e22;
}

.btn-primary:hover {
  background: #d35400;
  border-color: #d35400;
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-secondary:hover {
  background: white;
  color: #222;
}

/* Sizes */
.size-small {
  width: 150px;
  height: auto;
}

.size-medium {
  width: 300px;
  height: auto;
}

.size-large {
  width: 500px;
  max-width: 100%;
  height: auto;
}

/* Responsive */
@media(max-width: 900px) {
  .content-row {
    flex-direction: column;
    align-items: center;
  }

  .pos-left,
  .pos-right {
    flex-direction: row;
    max-width: 100%;
    order: -1;
    /* Images on top on mobile? Or let them stay?
                  Usually text first is better, but maybe images.
                  Let's keep DOM order: Left -> Text -> Right.
                  In column: Left (top) -> Text -> Right (bottom).
               */
  }
}

/* Formularz kontaktowy */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 400px;
  margin-top: 20px;
  opacity: 0;
  animation: fadeInUp 1s forwards 0.9s;
}

.contact-form input,
.contact-form textarea {
  padding: 12px;
  border: none;
  border-radius: 5px;
  font-family: inherit;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
}

.contact-form button {
  padding: 12px;
  border: none;
  border-radius: 5px;
  background: #fff;
  color: #222;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.contact-form button:hover {
  background: #eee;
}

/* Footer */
footer {
  background: #111;
  color: #aaa;
  padding: 40px 20px;
  text-align: center;
  font-size: 0.9rem;
}

footer p {
  margin-bottom: 10px;
}

footer a {
  color: #fff;
  text-decoration: none;
}

footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Social media (floating) */
.social {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  gap: 15px;
  z-index: 1100;
}

.social a {
  width: 35px;
  height: 35px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease, opacity 0.3s;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  padding: 7px;
  backdrop-filter: blur(5px);
}

.social a:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.2);
}

.social a.hidden {
  display: none;
}

.social svg {
  width: 100%;
  height: 100%;
  fill: #fff;
}

/* RWD */
@media(max-width: 768px) {
  nav ul {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  header .logo .brand-name {
    font-size: 1.2rem;
  }

  section h1 {
    font-size: 2rem;
  }
}

@media(max-width: 480px) {
  header .logo .brand-name {
    font-size: 1rem;
  }

  section h1 {
    font-size: 1.8rem;
  }

  section p {
    font-size: 1rem;
  }
}

/* Video Background */
.section-background-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  /* Sit at the bottom of the stack, but not negative */
  pointer-events: none;
}

.content-section {
  position: relative;
  overflow: hidden;
  /* No z-index needed on section if we manage children */
}

.content-section>*:not(.section-background-video) {
  position: relative;
  z-index: 1;
  /* Ensure content sits above video */
}

footer {
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* Admin Rich Text Editor */
.rich-text-editor {
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  margin-bottom: 10px;
}

.rte-toolbar {
  display: flex;
  gap: 5px;
  padding: 5px;
  border-bottom: 1px solid #eee;
  background: #f5f5f5;
  flex-wrap: wrap;
}

.rte-btn {
  padding: 5px 10px;
  cursor: pointer;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 3px;
  font-size: 14px;
}

.rte-btn:hover {
  background: #e9e9e9;
}

.rte-content {
  min-height: 100px;
  padding: 10px;
  outline: none;
  overflow-y: auto;
  color: #000;
  /* Ensure text is black in editor */
}

/* Frontend Text Module */
.module-text {
  padding: 20px;
  border-radius: 8px;
  margin: 10px 0;
  width: 100%;
}