/* Ślad Ekologiczny - Sekcja */

.ecological-footprint {
  position: relative;
  padding: 96px 0;
  background-color: #e9ebef;
  overflow: hidden;
}

/* Blob tła */
.ecological-footprint-blob {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.ecological-footprint-blob-1 {
  border-radius: 1689px;
  background: rgba(82, 71, 231, 0.14);
  filter: blur(300px);
  width: 1689px;
  height: 1395.742px;
  bottom: -5%;
  right: -10%;
}

.ecological-footprint__header {
  text-align: left;
}

.ecological-footprint__title {
  font-family: "Inter", sans-serif;
  font-size: 2.125rem;
  font-weight: 700;
  color: #213361;

  letter-spacing: -1.8px;
}

.ecological-footprint__subtitle {
  font-family: "Inter", sans-serif;
  font-size: 20px;
  color: rgba(33, 51, 97, 0.5);
  margin: 0;
}

/* Biały zaokrąglony kontener */
.ecological-footprint__content {
  position: relative;
  z-index: 1;
  display: block;
  background-color: #ffffff;
  padding: 32px;
  border-radius: 24px;
  box-shadow: 0px 4px 12px 0px rgba(142, 152, 168, 0.06);
  max-width: 1456px;
  margin: 0 auto;
}

/* Obraz wewnątrz kontenera */
.ecological-footprint__chart {
  margin: 2rem auto;
  text-align: center;
  max-width: 50%;
}

.ecological-footprint__chart-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.ecological-footprint__chart-image {
  height: auto;
  max-width: 100%;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

.ecological-footprint__chart-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 8px;
}

.ecological-footprint__chart-source {
  color: white;
  text-decoration: none;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  border-radius: 4px;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ecological-footprint__chart-source:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.05);
  color: white;
}

.ecological-footprint__chart-container:hover
  .ecological-footprint__chart-overlay {
  opacity: 1;
}

.ecological-footprint__chart-container:hover
  .ecological-footprint__chart-image {
  transform: scale(1.02);
}

.ecological-footprint__preview-icon {
  width: 48px;
  height: 48px;
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Podpis pod obrazkiem */
.ecological-footprint__chart-caption {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-style: italic;
  color: #888888;
  margin-top: 12px;
  text-align: center;
  line-height: 1.4;
}

.ecological-footprint__info-title {
  font-family: "Inter", sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #213361;
  margin: 0 0 18px 0;
}

/* Układ dwóch kolumn */
.ecological-footprint__two-columns {
  display: flex;
  gap: 40px;
  margin: 24px 0;
}

.ecological-footprint__column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Prawa kolumna - przycisk na dole */
.ecological-footprint__column:last-child {
  display: flex;
  flex-direction: column;
}

.ecological-footprint__column:last-child .ecological-footprint__info-content {
  flex: 1;
}

.ecological-footprint__column:last-child .ecological-footprint__info-button {
  margin-top: 24px;
  align-self: flex-start;
}

/* Style dla obu układów */
.ecological-footprint__info--single {
  /* Standardowe style dla jednej kolumny */
}

.ecological-footprint__info--two_columns {
  /* Dodatkowe style dla dwóch kolumn */
}

.ecological-footprint__info-content {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #213361;
  margin: 0 0 1em 0;
}

/* Custom bullet points for lists in WYSIWYG content */
.ecological-footprint__info-content ul {
  list-style: none;
  padding-left: 0;
  margin-top: 18px;
}

.ecological-footprint__info-content ul li {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #213361;
  padding-left: 30px;
  position: relative;
  margin-bottom: 12px;
}

.ecological-footprint__info-content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 19px;
  height: 19px;
  background-color: #213361;
  border-radius: 50%;
}

/* Poprawki dla siatki postów w sekcji Ślad Ekologiczny */
.ecological-footprint__posts {
  padding-top: 50px; /* Odstęp od linii */
}

.ecological-footprint__posts-title {
  font-family: "Inter", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #213361;
  margin-bottom: 40px; /* Odstęp od siatki postów */
  text-align: left;
}

.ecological-footprint__divider {
  border: none;
  border-top: 1px solid #e9ebf8;
  margin: 50px 0 0;
}

.ecological-footprint__posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .ecological-footprint__two-columns {
    flex-direction: column;
    gap: 30px;
  }

  .ecological-footprint__column:last-child .ecological-footprint__info-button {
    margin-top: 24px;
  }

  .ecological-footprint__posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  /* Responsive blob scaling */
  .ecological-footprint-blob-1 {
    width: 800px;
    height: 660px;
    bottom: 5%;
    right: 0;
  }
}

@media (max-width: 767px) {
  .ecological-footprint {
    padding: 60px 0;
  }

  .ecological-footprint__header {
    margin-bottom: 40px;
  }

  .ecological-footprint__title {
    font-size: 32px;
  }

  .ecological-footprint__subtitle {
    font-size: 18px;
  }

  .ecological-footprint__chart {
    max-width: 100%;
  }

  .ecological-footprint__info-content {
    text-align: left;
  }

  .ecological-footprint__posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .ecological-footprint__posts-title {
    font-size: 22px;
  }

  /* Responsive blob scaling for mobile */
  .ecological-footprint-blob-1 {
    width: 500px;
    height: 413px;
    bottom: -20%;
    right: 0;
    opacity: 0.8;
  }
}

/* Fullscreen modal */
.ecological-footprint__modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ecological-footprint__modal--active {
  display: flex;
  opacity: 1;
}

.ecological-footprint__modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.ecological-footprint__modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-zoom 0.3s ease;
}

.ecological-footprint__image-wrapper {
  position: relative;
  overflow: auto; /* Allow native scrolling when zoomed */
  border-radius: 8px;
  width: 90vw;
  height: 90vh;
  transition: transform 0.3s ease;
  display: flex; /* Enables centering when zoomed out */
  scrollbar-width: none; /* Hide scrollbar for cleaner look */
  -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
}

.ecological-footprint__image-wrapper::-webkit-scrollbar {
  display: none;
}

.ecological-footprint__modal-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1); /* Smoother easing for zoom */
  transform-origin: top left;
  margin: auto; /* Required for centering within flex when smaller than container */
}

/* Zoom controls */
.ecological-footprint__zoom-controls {
  position: absolute;
  top: -20px;
  right: 60px;
  display: flex;
  gap: 8px;
  z-index: 10002;
}

.ecological-footprint__zoom-btn {
  width: 40px;
  height: 40px;
  background-color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  color: #213361;
}

.ecological-footprint__zoom-btn:hover {
  background-color: #f8f9fa;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ecological-footprint__zoom-btn:active {
  transform: scale(0.95);
}

.ecological-footprint__zoom-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ecological-footprint__zoom-btn svg {
  pointer-events: none;
}

/* Zoom states */
.ecological-footprint__modal--zoomed .ecological-footprint__image-wrapper {
  cursor: grab;
}

.ecological-footprint__modal--zoomed
  .ecological-footprint__image-wrapper:active {
  cursor: grabbing;
}

.ecological-footprint__modal-close {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 48px;
  height: 48px;
  background-color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 10001;
}

.ecological-footprint__modal-close:hover {
  background-color: #f8f9fa;
  transform: scale(1.1);
}

.ecological-footprint__modal-close svg {
  color: #213361;
}

@keyframes modal-zoom {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mobile responsive for modal */
@media (max-width: 767px) {
  .ecological-footprint__modal-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .ecological-footprint__modal-content {
    max-width: 95vw;
    max-height: 95vh;
  }

  .ecological-footprint__zoom-controls {
    top: 10px;
    right: 60px;
  }

  .ecological-footprint__zoom-btn {
    width: 36px;
    height: 36px;
  }

  .ecological-footprint__zoom-btn svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  .ecological-footprint__zoom-controls {
    right: 50px;
    gap: 6px;
  }

  .ecological-footprint__zoom-btn {
    width: 32px;
    height: 32px;
  }

  .ecological-footprint__zoom-btn svg {
    width: 16px;
    height: 16px;
  }
}
