* { box-sizing: border-box; }

:root{
  --k-black:#000;
  --k-gray:#727D84;
  --k-border:#e6e6e6;
  --k-bg:#fff;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #111;
  background: var(--k-bg);
}

/* ===== TEAM SECTION ===== */

.team {
  max-width: 1400px;              /* było 1200: optycznie większe */
  margin: 0 auto;
  padding: 56px 28px 80px;        /* więcej oddechu */
}

.team-head h2{
  font-size: 44px;                /* większy nagłówek */
  line-height: 1.12;
  margin: 0 0 12px;
  letter-spacing: -0.3px;
}

.team-lead{
  margin: 0 0 22px;
  max-width: 980px;
  color: #333;
  line-height: 1.55;
  font-size: 18px;
}

/* Sticky pasek działów */
.dept-nav{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--k-border);
  margin: 16px 0 30px;
}

.dept-nav-inner{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
}

/* Chipy w stylu "kafelków" jak na projekcie */
.dept-chip{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 22px;

  border: 1px solid #d6d6d6;
  border-radius: 7px;            /* było 999px */
  background: #f7f7f7;
  color: #111;

  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.1px;
  text-decoration: none;

  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.dept-chip:hover{
  background: #efefef;
  border-color: #cfcfcf;
}

.dept-chip.is-active{
  background: #3a3a3a;           /* ciemny aktywny */
  border-color: #3a3a3a;
  color: #fff;
}

.dept-chip:focus-visible{
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Sekcje działów */
.department{
  margin: 0 0 52px;
  scroll-margin-top: 92px; /* offset pod sticky nav */
}

.department-head{
  margin: 0 0 18px;
}

.department h3{
  font-size: 30px;              /* większy dział */
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--k-black);
  width: 100%;
}

/* Grid kart */
.team-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

/* Karta pracownika: foto lewo / content prawo */
.member{
  display: flex;
  gap: 21px;
  border: 1px solid var(--k-border);
  background: #fff;
  padding: 21px;
  border-radius: 12px;
  min-height: 175px;
}

.member-photo{
  width: 152px;              /* było 96: większe głowy */
  height: 152px;
  flex: 0 0 152px;
  border-radius: 12px;
  overflow: hidden;
  background: #f2f2f2;
}

.member-photo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member-photo-placeholder{
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f2f2f2 0%, #e9e9e9 100%);
}

.member-body{
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.member-name{
  font-weight: 750;
  font-size: 25px;
  line-height: 1.2;
  margin: 0 0 6px;
}

.member-role{
  font-size: 18px;
  color: #555;
  margin: 0 0 12px;
}

/* KLUCZ: e-mail pod telefonem */
.member-contact{
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 18px;
  line-height: 1.35;
}

.member-link{
  color: var(--k-black);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.member-link:hover{ border-bottom-color: var(--k-black); }

/* ===== RWD ===== */
@media (max-width: 1100px) {
  .team { max-width: 1200px; padding: 48px 20px 70px; }
  .team-head h2{ font-size: 38px; }
  .department h3{ font-size: 26px; }
  .member-photo{ width: 120px; height: 120px; flex-basis: 120px; }
}

@media (max-width: 900px) {

    /* MOBILE: chipy jako siatka (czytelnie jeden pod drugim, bez przycinania prawej kolumny) */
  .dept-nav-inner{
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* klucz: minmax(0,...) */
    gap: 10px;
    padding: 12px 12px 14px; /* bezpieczny padding po bokach */
    width: 100%;
    overflow: visible;
  }

  .dept-chip{
    width: 100%;
    min-width: 0;              /* pozwala się zawijać zamiast wypychać */
    justify-content: center;
    white-space: normal;
    text-align: center;

    height: auto;              /* zdejmujemy sztywną wysokość */
    min-height: 46px;          /* ale trzymamy spójny baseline */
    padding: 8px 12px;         /* padding góra/dół pod 2 linie */
    line-height: 1.15;
  }


  .dept-chip{
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .team-grid{ grid-template-columns: 1fr; }
  .dept-nav{ top: 0; }
  .department{ scroll-margin-top: 104px; }
}

@media (max-width: 520px) {
  .team-head h2{ font-size: 30px; }
  .team-lead{ font-size: 18px; }
  .member{ padding: 14px; gap: 14px; }
  .member-photo{ width: 104px; height: 104px; flex-basis: 104px; }
  .member-name{ font-size: 18px; }
  .member-role, .member-contact{ font-size: 18px; }
}

/* FORCE: mobile chip wrap fix (na końcu pliku, żeby na pewno wygrało) */
@media (max-width: 900px) {
  .dept-nav-inner .dept-chip{
    height: auto !important;
    min-height: 46px;
    padding: 10px 12px !important;
    line-height: 1.15;
    white-space: normal !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* FORCE: mobile chip compact (żeby nav nie zjadał ekranu) */
@media (max-width: 900px) {
  .dept-nav{ margin: 10px 0 18px; }
  .dept-nav-inner{
    gap: 8px !important;
    padding: 10px 10px 12px !important;
  }
  .dept-nav-inner .dept-chip{
    font-size: 13px !important;
    min-height: 36px !important;
    padding: 6px 10px !important;
    line-height: 1.12 !important;
  }
}

/* jeszcze ciaśniej na bardzo małych ekranach */
@media (max-width: 520px) {
  .dept-nav-inner{
    gap: 6px !important;
    padding: 8px 8px 10px !important;
  }
  .dept-nav-inner .dept-chip{
    font-size: 12px !important;
    min-height: 34px !important;
    padding: 6px 9px !important;
  }
}

/* FORCE: mobile — usuń zbędną dziurę między HERO a TEAM */
@media (max-width: 900px) {
  .team{
    padding-top: 18px !important;
  }
  .dept-nav{
    margin-top: 8px !important;
  }
}

/* FORCE: mobile — usuń pustkę nad "Nasz zespół" (to jest padding team, nie hero) */
@media (max-width: 900px) {
  .team{
    padding-top: 10px !important;
  }
  .team-head{
    margin-top: 0 !important;
  }
  .team-head h2{
    margin-top: 0 !important;
  }
}



/* MOBILE TUNING: spacing + chips */

@media (max-width: 900px) {

  /* pkt 1: odstęp między HERO a "Nasz zespół" — kontrolujemy to tu */
  .team { padding-top: 18px !important; }          /* lekko, nie 56px */
  .team-head { margin-top: 16px !important; }      /* taki sam "oddech" jak lead niżej */
  .team-head h2 { margin-top: 0 !important; }

  /* pkt 2: chipy mniejsze i równa szerokość */
  .dept-nav { margin: 12px 0 18px !important; }
  .dept-nav-inner{
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 10px 10px 12px !important;
    width: 100% !important;
  }

  .dept-nav-inner .dept-chip{
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 34px !important;
    padding: 6px 8px !important;

    font-size: 12px !important;
    font-weight: 650 !important;
    line-height: 1.1 !important;

    white-space: normal !important;
    text-align: center !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .team-grid { grid-template-columns: 1fr; }
  .department { scroll-margin-top: 104px; }
}

@media (max-width: 520px) {
  .dept-nav-inner{ gap: 6px !important; padding: 8px 8px 10px !important; }
  .dept-nav-inner .dept-chip{
    font-size: 11px !important;
    min-height: 32px !important;
    padding: 6px 7px !important;
  }
}


/* FORCE: mobile — team top tune (2) */
@media (max-width: 900px) {
  .team { padding-top: 14px !important; } /* było 10/18 – tutaj dociskamy */
  .team-head { margin-top: 0 !important; }
  .team-head h2 { margin-top: 0 !important; margin-bottom: 8px !important; }
}
