/* Zmienne i ustawienia bazowe */
:root {
  --bg: #edf4f7;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --line: rgba(17, 84, 109, 0.12);
  --text: #183847;
  --muted: #6d8794;
  --primary: #11546d;
  --primary-strong: #0b4054;
  --accent: #4ca6be;
  --soft: #dfeef3;
  --shadow: 0 24px 60px rgba(18, 62, 82, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(76, 166, 190, 0.16), transparent 30%),
    linear-gradient(180deg, #eef5f8 0%, #f8fbfc 46%, #edf4f7 100%);
}

body.modal-open {
  overflow: hidden;
}

/* Główny układ strony */
.page {
  width: min(1680px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 44px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(11, 64, 84, 0.98), rgba(20, 98, 126, 0.94));
  box-shadow: var(--shadow);
  color: #fff;
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 68%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 18px 0 14px;
  max-width: 860px;
  font-size: clamp(2.2rem, 4vw, 4.1rem);
  line-height: 1.04;
}

.hero p {
  margin: 0;
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.84);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
  max-width: 980px;
}

.hero-stat {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
}

.hero-stat strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.5rem;
}

.overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
  justify-content: center;
  align-items: stretch;
  gap: 20px;
  margin: 26px 0 42px;
}

.overview-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(16, 66, 87, 0.08);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.overview-card:hover,
.overview-card.active {
  transform: translateY(-4px);
  border-color: rgba(76, 166, 190, 0.4);
  box-shadow: 0 22px 42px rgba(16, 66, 87, 0.14);
}

.overview-card span {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(76, 166, 190, 0.12);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.overview-card h2 {
  margin: 14px 0 12px;
  font-size: 1rem;
  line-height: 1.35;
}

.overview-image {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 290px;
  aspect-ratio: auto;
  margin-top: 15px;
  overflow: hidden;
  border: 1px solid rgba(17, 84, 109, 0.08);
  border-radius: 16px;
  background: linear-gradient(135deg, #e5f1f5, #f8fbfc);
}

.overview-image::after {
  content: "Kliknij, aby zobaczyć szczegóły";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 48, 64, 0.72);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.overview-card:hover .overview-image::after,
.overview-card:focus-visible .overview-image::after {
  opacity: 1;
  transform: scale(1);
}

.overview-card:focus-visible {
  outline: 3px solid rgba(76, 166, 190, 0.45);
  outline-offset: 4px;
}

.overview-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.overview-card p,
.operation-intro p,
.subsection-header p,
.media-body p,
.footer-note {
  color: var(--muted);
  line-height: 1.7;
}

.overview-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 6px;
  color: var(--primary-strong);
  font-size: 0.93rem;
  font-weight: 600;
}

.operation {
  margin-bottom: 30px;
  padding: 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.operation-header {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  margin-bottom: 26px;
  cursor: pointer;
  border-radius: 18px;
  transition: background 0.2s ease, margin 0.2s ease;
}

.operation-header:hover {
  background: rgba(76, 166, 190, 0.07);
}

.operation-header:focus-visible {
  outline: 3px solid rgba(76, 166, 190, 0.4);
  outline-offset: 8px;
}

.operation.collapsed .operation-header {
  margin-bottom: 0;
}

.operation.collapsed .operation-details {
  display: none;
}

.operation-header h3 {
  margin: 0;
  color: #123f53;
  font-size: clamp(1.08rem, 1.35vw, 1.4rem);
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.operation-header > div:first-child {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 12px 8px 20px;
}

.operation-header > div:first-child::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
}

.operation-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(76, 166, 190, 0.16), rgba(17, 84, 109, 0.12));
  color: var(--primary-strong);
  font-weight: 600;
  text-align: left;
}

.operation-template-table {
  border-collapse: collapse;
  font-size: 0.78rem;
  line-height: 1.25;
}

.operation-template-table th,
.operation-template-table td {
  padding: 5px 10px;
  border-right: 1px solid rgba(17, 84, 109, 0.12);
  white-space: nowrap;
}

.operation-template-table th:last-child,
.operation-template-table td:last-child {
  border-right: 0;
}

.operation-template-table thead th {
  padding-top: 2px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.operation-template-table tbody tr + tr {
  border-top: 1px solid rgba(17, 84, 109, 0.1);
}

.operation-template-table tbody th {
  color: var(--primary-strong);
  font-weight: 700;
}

.operation-template-table tbody td:nth-child(2) {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
}

.operation-template-table th:nth-child(3),
.operation-template-table td:nth-child(3) {
  text-align: center;
}

.complexity-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.complexity-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.complexity-bars i {
  display: block;
  width: 5px;
  border-radius: 4px;
  background: rgba(17, 84, 109, 0.18);
}

.complexity-bars i:nth-child(1) {
  height: 7px;
}

.complexity-bars i:nth-child(2) {
  height: 11px;
}

.complexity-bars i:nth-child(3) {
  height: 16px;
}

.complexity-bars i.active {
  background: linear-gradient(180deg, var(--accent), var(--primary));
}

.complexity-level strong {
  min-width: 24px;
  font-size: 0.76rem;
}

.operation-toggle-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 7px 16px rgba(17, 84, 109, 0.24);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.operation-toggle-icon::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-top: 2.5px solid #fff;
  border-left: 2.5px solid #fff;
  transform: rotate(45deg);
}

.operation-header:hover .operation-toggle-icon {
  box-shadow: 0 9px 20px rgba(17, 84, 109, 0.34);
  transform: translateY(-2px);
}

.operation.collapsed .operation-toggle-icon {
  transform: rotate(180deg);
}

.operation.collapsed .operation-header:hover .operation-toggle-icon {
  transform: rotate(180deg) translateY(2px);
}

.operation-intro {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  margin-bottom: 24px;
}

.intro-card,
.structure-card,
.zone-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid rgba(17, 84, 109, 0.09);
}

.zone-card {
  position: relative;
  overflow: hidden;
  border-left-width: 5px;
}

.zone-card-reconstruction {
  border-left-color: #168aa2;
  background: linear-gradient(135deg, rgba(22, 138, 162, 0.07), #fff 28%);
}

.zone-card-szczeka {
  border-left-color: #4d67b1;
  background: linear-gradient(135deg, rgba(77, 103, 177, 0.07), #fff 28%);
}

.zone-card-biodro {
  border-left-color: #c7842f;
  background: linear-gradient(135deg, rgba(199, 132, 47, 0.08), #fff 28%);
}

.zone-card-reconstruction .zone-label {
  background: rgba(22, 138, 162, 0.14);
  color: #096478;
}

.zone-card-szczeka .zone-label {
  background: rgba(77, 103, 177, 0.14);
  color: #344b91;
}

.zone-card-biodro .zone-label {
  background: rgba(199, 132, 47, 0.16);
  color: #8b5617;
}

.zone-note {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.zone-label span {
  margin-left: 4px;
  opacity: 0.72;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
}

.intro-card h4,
.structure-card h4,
.zone-header h4,
.subsection-header h5 {
  margin: 0 0 10px;
}

.structure-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.structure-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--primary-strong);
  font-weight: 600;
}

.zones {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 22px;
}

.zone-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.zone-label {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(76, 166, 190, 0.12);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.subsections {
  display: grid;
  gap: 18px;
}

.subsection {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
  border: 1px solid rgba(17, 84, 109, 0.08);
}

.subsection-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.subsection-count {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Galerie materiałów */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

  .gallery:not(.gallery-two):not(.gallery-three):not(.gallery-four) {
    grid-template-columns: minmax(0, 1000px);
    justify-content: center;
  }

  .gallery:not(.gallery-two):not(.gallery-three):not(.gallery-four) .media-preview {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .gallery.gallery-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .gallery.gallery-four .media-card {
    display: grid;
    grid-template-rows: 400px auto;
    min-width: 0;
  }

  .gallery.gallery-four .media-preview {
    aspect-ratio: auto;
    min-height: 0;
    height: 400px;
  }

  .gallery.gallery-four .media-preview iframe {
    width: 100%;
    height: 100%;
  }

  .gallery.gallery-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .gallery.gallery-two .media-card {
    display: grid;
    grid-template-rows: 420px auto;
    min-width: 0;
  }

  .gallery.gallery-two .media-preview {
    aspect-ratio: auto;
    min-height: 0;
    height: 420px;
  }

  .gallery.gallery-two .media-preview iframe {
    width: 100%;
    height: 100%;
  }

.gallery.gallery-three {
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
  grid-template-rows: repeat(2, 350px);
  align-items: stretch;
}

  .gallery.gallery-three .media-card {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
  }

  .gallery.gallery-three .media-card:first-child {
    grid-row: 1 / span 2;
  }

  .gallery.gallery-three .media-preview {
    aspect-ratio: auto;
    min-height: 0;
    height: 100%;
  }

  .gallery.gallery-three .media-preview iframe {
    width: 100%;
    height: 100%;
  }

.media-card {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(17, 84, 109, 0.08);
  background: #fff;
  box-shadow: 0 12px 24px rgba(12, 55, 72, 0.08);
}

.media-preview {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 280px;
  overflow: hidden;
  background: linear-gradient(135deg, #deedf3, #f8fbfc);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

.media-preview.video::after,
.media-preview.html::after {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(8, 45, 59, 0.74);
  color: #fff;
  font-size: 1rem;
}

.media-preview.video::after {
  content: "▶";
}

  .media-preview.html::after {
    content: "360°";
    width: auto;
    min-width: 42px;
    padding: 0 10px;
    font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}

.media-body {
  padding: 14px 16px 16px;
}

.media-body h6 {
  margin: 0 0 8px;
  font-size: 0.98rem;
  line-height: 1.45;
}

.media-body p {
  margin: 0 0 10px;
  font-size: 0.92rem;
}

.media-body a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.media-note {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.92rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 23, 31, 0.84);
  z-index: 1000;
}

.lightbox.open {
  display: flex;
}

.lightbox-panel {
  width: min(1180px, 100%);
  max-height: 100%;
  overflow: hidden;
  border-radius: 24px;
  background: #081b24;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.36);
}

.lightbox-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 22px;
  color: #eff7fb;
  background: rgba(255,255,255,0.05);
}

.lightbox-top h6 {
  margin: 0;
  font-size: 1rem;
}

.lightbox-top button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.lightbox-content {
  display: grid;
  place-items: center;
  min-height: 68vh;
  background: #071821;
}

/* Pełnoekranowy podgląd materiałów */
.lightbox-content img,
.lightbox-content video {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  background: #071821;
}

.footer-note {
  padding-top: 8px;
  text-align: center;
  font-size: 0.94rem;
}

/* Widoki responsywne */
@media (max-width: 1120px) {
  .hero-stats,
  .zones,
  .operation-intro {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 18px, 1680px);
    padding-top: 10px;
  }

  .hero,
  .operation {
    padding: 24px;
  }

  .operation-header,
  .subsection-header {
    flex-direction: column;
  }

  .operation-badge {
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
    text-align: left;
  }

    .gallery {
      grid-template-columns: 1fr;
    }

    .media-preview {
      min-height: 240px;
    }

    .gallery.gallery-four .media-card,
    .gallery.gallery-two .media-card,
    .gallery.gallery-three .media-card {
      grid-template-rows: 320px auto;
    }

    .gallery.gallery-four .media-preview,
    .gallery.gallery-two .media-preview,
    .gallery.gallery-three .media-preview {
      min-height: 320px;
      height: 320px;
    }

    .gallery.gallery-three {
      grid-template-columns: 1fr;
      grid-template-rows: none;
    }

    .gallery.gallery-three .media-card:first-child {
      grid-row: auto;
    }
  }
