/* Reference (PL) page specific styles
   Zredukowano duplikaty (usunięto *, body, h2.to-do, footer .container itd.)
   Globalne style zapewnia css/style.css
*/

header.header2 {
  position: relative;
  height: 50vh;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
    url(../img/ref.jpg);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* Sekcja referencji */
.ref .ref-custom-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  margin: 0;
}

.ref .ref-item,
.ref .ref-item-full {
  display: flex;
  justify-content: center;
  align-items: center;
}

.ref .ref-item {
  flex: 0 1 clamp(140px, 16%, 220px);
  position: relative;
}

.ref .ref-item a {
  display: inline-block;
  width: 100%;
}

.ref .ref-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform .3s ease, box-shadow .3s ease;
}

.ref .ref-item img:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

.ref .ref-item-full {
  flex: 1 1 100%;
  margin-top: 2rem;
  text-align: center;
}

.ref .ref-item-full img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: inline-block;
}

/* Drobne dostosowania typografii tytułu sekcji (wykorzystuje h2.to-do z globalnego) */
.ref h2.to-do {
  letter-spacing: 1px;
}

/* Scroll optymalizacja przy bardzo dużej liczbie elementów */
@supports (overflow: clip) {
  .ref .ref-custom-row {
    overflow: clip;
  }
}

/* Responsive */
@media (max-width: 992px) {
  .ref .ref-item {
    flex: 0 1 clamp(140px, 22%, 220px);
  }
}

@media (max-width: 768px) {
  .ref .ref-custom-row {
    gap: 1rem;
  }
  .ref .ref-item {
    flex: 0 1 clamp(140px, 30%, 220px);
  }
}

@media (max-width: 560px) {
  .ref .ref-item {
    flex: 0 1 45%;
  }
}

@media (max-width: 400px) {
  .ref .ref-item {
    flex: 0 1 100%;
  }
  .ref .ref-item img {
    max-width: 280px;
    margin: 0 auto;
  }
}

/* Dark mode (jeśli kiedyś dodane preferencje) */
@media (prefers-color-scheme: dark) {
  .ref .ref-item img {
    background: #1e1e1e;
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  }
}

/* Accessibility focus */
.ref .ref-item a:focus-visible img {
  outline: 3px solid #467de3;
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(70,125,227,0.35);
  transform: translateY(-4px);
}
