.stuff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 35px;
  margin: 25px;
  justify-content: center;
}

.stuff-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 30px;
  overflow: hidden;
  padding-bottom: 20px;
  text-align: center;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.stuff-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.stuff-img-box img {
  transition: transform 0.35s ease;
}

.stuff-card:hover .stuff-img-box img {
  transform: scale(1.05);
}

.stuff-name {
  font-size: 22px;
  font-weight: 700;
  color: #0d6bb2;
  margin: 18px 20px 5px;
}

.stuff-role {
  font-size: 16px;
  font-weight: 500;
  color: #393939;
  margin: 0 20px 12px;
}

.more-btn {
  margin-top: 10px;
  padding: 6px 12px;
  background: #0d6bb2;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.modal {
  display: block;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-body {
  font-size: 1.2em;
  line-height: 1.8;
}

.modal-content {
  background: white;
  margin: 3% auto;
  padding: 20px;
  width: 75%;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 12px;

  transform: scale(0.85);
  opacity: 0;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.modal.show .modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal-flex {
  display: flex;
  gap: 20px;
}

.modal-img-box img {
  width: 260px;
  height: 260px;
  object-fit: cover;
  border-radius: 12px;
}

.modal-text {
  flex: 1;
}

.close {
  float: right;
  font-size: 28px;
  cursor: pointer;
}

/* RESPONSYWNOSC */

@media (max-width: 768px) {
  .stuff-grid {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 0 15px;
  }

  .stuff-card {
    border-radius: 20px;
    padding-bottom: 15px;
  }

  .modal-content {
    width: 92%;
    margin: 10% auto;
    padding: 15px;
  }

  .modal-flex {
    flex-direction: column;
    align-items: center;
  }

  .modal-img-box img {
    width: 80%;
    height: auto;
    max-width: 260px;
    margin-bottom: 15px;
  }

  .stuff-name {
    font-size: 20px;
  }

  .stuff-role {
    font-size: 15px;
  }

  .more-btn {
    width: 70%;
    font-size: 15px;
  }

  .stuff-card:hover {
    transform: none;
    box-shadow: none;
  }

  .stuff-card:hover .stuff-img-box img {
    transform: none;
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: 95%;
    margin: 15% auto;
  }

  .modal-img-box img {
    width: 100%;
  }

  .more-btn {
    width: 90%;
  }
}

.opis .stuff-grid .stuff-img-box img {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
  transition: transform 0.35s ease;
}

.opis .stuff-grid .stuff-name {
  font-size: 22px;
  font-weight: 700;
  color: #0d6bb2;
  margin: 18px 20px 5px;
  border: 0;
  text-transform: none;
}

.opis .stuff-grid .stuff-role {
  font-size: 16px;
  font-weight: 500;
  color: #393939;
  margin: 0 20px 12px;
  border: 0;
  text-transform: none;
}

@media (max-width: 768px) {
  .opis .stuff-grid .stuff-img-box img {
    height: 240px !important;
  }
  .opis .stuff-grid .stuff-name {
    font-size: 20px;
  }
  .opis .stuff-grid .stuff-role {
    font-size: 15px;
  }
}
@media (max-width: 480px) {
  .opis .stuff-grid .stuff-img-box img {
    height: 200px !important;
  }
}

.stuff-pagination {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin: 20px 0 10px;
  flex-wrap: wrap;
}

.stuff-pagination button {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f0f6fb;
  color: #0d6bb2;
  border: 1px solid #cfe6f7;
  cursor: pointer;
  font-weight: 600;
}

.stuff-pagination button:hover {
  background: #e6f1fa;
}
.stuff-pagination button[disabled] {
  opacity: 0.5;
  cursor: default;
}

.stuff-pagination .is-active {
  background: #0d6bb2;
  color: #fff;
  border-color: #0d6bb2;
}

/* === KADRA: stabilna wysokość miniatur bez !important ==================== */
/* Kontener obrazu ma stałą wysokość — to on „ustawia” 300px */
.opis .stuff-grid .stuff-img-box {
  height: 300px; /* docelowa wysokość kafelka */
  overflow: hidden; /* odetnij nadmiar przy cover */
  position: relative; /* baza pod przyszłe rozszerzenia (np. badge) */
}

/* Sam <img> może mieć height:auto (global), ale wypełni kontener przez min-height */

/* RWD — kontener zmienia wysokość, a img dalej wypełnia przez min-height */
@media (max-width: 768px) {
  .opis .stuff-grid .stuff-img-box {
    height: 240px;
  }
}
@media (max-width: 480px) {
  .opis .stuff-grid .stuff-img-box {
    height: 200px;
  }
}

/* === KADRA: wygrana nad .middle .wrap .left h2/h3 bez !important ========= */
/* Podnosimy specyficzność: dodajemy cały łańcuch rodziców + klasę na samym elemencie */
.middle .wrap .left .stuff-grid h2.stuff-name {
  font-size: 22px;
  font-weight: 700;
  color: #0d6bb2;
  margin: 18px 20px 5px;
  border: 0;
  text-transform: none;
  float: none;
  width: auto;
  display: block;
  line-height: normal;
}

.middle .wrap .left .stuff-grid h3.stuff-role {
  font-size: 16px;
  font-weight: 500;
  color: #393939;
  margin: 0 20px 12px;
  border: 0;
  text-transform: none;
  float: none;
  width: auto;
  display: block;
  line-height: normal;
}

@media (max-width: 768px) {
  .middle .wrap .left .stuff-grid h2.stuff-name {
    font-size: 20px;
  }
  .middle .wrap .left .stuff-grid h3.stuff-role {
    font-size: 15px;
  }
}
