/*
 * fs-footer.css – rzędy linków w stopce.
 *
 * ZASADA: każdy rząd to osobny obszar widgetów (Wygląd -> Widgety). Liczba kolumn w rzędzie = liczba widgetów
 * w tym obszarze. Dwa widgety = dwie równe kolumny, cztery widgety = cztery równe kolumny. Nic nie ustawiasz.
 *   Rząd 1: "Footer - items with links"  (dotychczasowy obszar)
 *   Rząd 2: "Footer - links row 2"
 *   Rząd 3: "Footer - links row 3"  (opcjonalny)
 * Komputer: kolumny obok siebie. Tablet (do 991 px): po dwie. Telefon (do 575 px): jedna pod drugą.
 * Wygląd tytułów i tekstu widgetów zostaje taki, jak w motywie. Zmieniamy tylko układ.
 */
:root {
  --fs-footer-col-gap: 32px;     /* odstęp między kolumnami */
  --fs-footer-row-gap: 28px;     /* odstęp między widgetami, gdy się zawijają (tablet, telefon) */
  --fs-footer-rows-gap: 40px;    /* odstęp między rzędami */
}

/* Rząd: kolumny dzielą szerokość po równo, ile widgetów, tyle kolumn */
.site-footer .footer-links-col > .fs-footer-row {
  display: grid !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--fs-footer-row-gap) var(--fs-footer-col-gap);
  box-sizing: border-box;
  width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; grid-column: 1 / -1;
  margin: 0;
}
.site-footer .footer-links-col > .fs-footer-row + .fs-footer-row { margin-top: var(--fs-footer-rows-gap); }

/* Widget w rzędzie: reguły motywu z szerokością kolumny (np. 25 %) przestają obowiązywać */
.site-footer .footer-links-col > .fs-footer-row > .widget {
  width: auto !important; max-width: none !important; min-width: 0;
  flex: none !important; float: none !important; margin: 0 !important;
  overflow-wrap: anywhere;
}

/* Tablet: po dwie kolumny */
@media (max-width: 991px) {
  .site-footer .footer-links-col > .fs-footer-row {
    grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Telefon: jedna kolumna */
@media (max-width: 575px) {
  .site-footer .footer-links-col > .fs-footer-row { grid-template-columns: minmax(0, 1fr); }
  .site-footer .footer-links-col > .fs-footer-row + .fs-footer-row { margin-top: var(--fs-footer-row-gap); }
}

/* =========================================================
   STOPKA BLOKOWA – Gutenberg
   ========================================================= */

.fs-footer-blocks {
  width: 100%;
}

.fs-footer-blocks__row {
  width: 100%;
  margin: 0 !important;
  gap: 32px !important;
  align-items: flex-start !important;
}

.fs-footer-blocks__row + .fs-footer-blocks__row {
  margin-top: 42px !important;
}

.fs-footer-blocks .wp-block-column {
  min-width: 0;
}

.fs-footer-blocks h3 {
  margin: 0 0 16px !important;
  color: #FFFFFF !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

.fs-footer-blocks p,
.fs-footer-blocks li {
  margin: 0 0 7px !important;
  color: #FFFFFF !important;
  font-size: 0.92rem !important;
  line-height: 1.55 !important;
}

.fs-footer-blocks ul {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.fs-footer-blocks a {
  color: #FFFFFF !important;
  text-decoration: none !important;
}

.fs-footer-blocks a:hover,
.fs-footer-blocks a:focus {
  color: #FFFFFF !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* drugi rząd delikatnie oddzielony */
.fs-footer-blocks__row--2 {
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,.22);
}

/* Tablet */
@media (max-width: 991px) {

  .fs-footer-blocks__row {
    flex-wrap: wrap !important;
  }

  .fs-footer-blocks__row > .wp-block-column {
    flex: 1 1 calc(50% - 16px) !important;
  }

}

/* Telefon */
@media (max-width: 575px) {

  .fs-footer-blocks__row {
    gap: 24px !important;
  }

  .fs-footer-blocks__row + .fs-footer-blocks__row {
    margin-top: 32px !important;
  }

  .fs-footer-blocks__row > .wp-block-column {
    flex: 1 1 100% !important;
  }

}


/* =========================================================
   STOPKA BLOKOWA – Gutenberg
   ========================================================= */

.fs-footer-blocks {
  width: 100%;
}

.fs-footer-blocks__row {
  width: 100%;
  margin: 0 !important;
  gap: 32px !important;
  align-items: flex-start !important;
}

.fs-footer-blocks__row + .fs-footer-blocks__row {
  margin-top: 42px !important;
}

.fs-footer-blocks .wp-block-column {
  min-width: 0;
}

.fs-footer-blocks h3 {
  margin: 0 0 16px !important;
  color: #FFFFFF !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

.fs-footer-blocks p,
.fs-footer-blocks li {
  margin: 0 0 7px !important;
  color: #FFFFFF !important;
  font-size: 0.92rem !important;
  line-height: 1.55 !important;
}

.fs-footer-blocks ul {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.fs-footer-blocks a {
  color: #FFFFFF !important;
  text-decoration: none !important;
}

.fs-footer-blocks a:hover,
.fs-footer-blocks a:focus {
  color: #FFFFFF !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* drugi rząd delikatnie oddzielony */
.fs-footer-blocks__row--2 {
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,.22);
}

/* Tablet */
@media (max-width: 991px) {

  .fs-footer-blocks__row {
    flex-wrap: wrap !important;
  }

  .fs-footer-blocks__row > .wp-block-column {
    flex: 1 1 calc(50% - 16px) !important;
  }

}

/* Telefon */
@media (max-width: 575px) {

  .fs-footer-blocks__row {
    gap: 24px !important;
  }

  .fs-footer-blocks__row + .fs-footer-blocks__row {
    margin-top: 32px !important;
  }

  .fs-footer-blocks__row > .wp-block-column {
    flex: 1 1 100% !important;
  }

}

