/* ==========================================================================
   Stopka – „Atlas oddziałów”
   Biała stopka. W tle ledwo widoczna kula ziemska z kropek rastra (półton,
   wyśrodkowana na Polsce). Na niej lupa drukarska z krzyżem pasowania, która
   „powiększa” Polskę: kropkowa mapa z oddziałami i trasami z Krakowa.
   Kontakt na pierwszym planie; lista oddziałów to prawdziwa nawigacja,
   mapa ją tylko powtarza (aria-hidden).
   Wymaga tokenów z style.css; JS (footer.js) dodaje tylko jedno wejście ruchu.
   ========================================================================== */

.site-footer {
  --ft-soft: #4d5d6e;   /* drugi plan: 4.9:1 nawet na najciemniejszej kropce globusa */
  --ft-globe: .13;      /* siła globusa: kropki maks. 13% granatu na bieli */
  --ft-gap: clamp(2.5rem, 6vw, 6rem);
  background: #fff;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 0; }
.site-footer strong { color: var(--navy-900); font-weight: 500; }
.site-footer a { color: var(--navy-900); text-decoration: none; }
.site-footer a:hover {
  color: var(--navy-900);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: .28em;
}
.site-footer .icon { width: 1em; height: 1em; }
.site-footer ::selection { background: var(--orange-100); color: var(--navy-900); }

/* Układ 5/7 ----------------------------------------------------------------- */

.footer__main {
  position: relative;
  isolation: isolate;          /* globus (z-index:-1) zostaje pod treścią stopki */
  overflow: hidden;
  padding-top: clamp(3.5rem, 6vw, 5.5rem);
}
.footer__layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 3rem var(--ft-gap);
  align-items: center;
}

.footer__logo { display: block; width: 200px; height: auto; margin: 0 0 2.25rem; }

.footer__label {
  font-family: var(--font-ui);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 0;
}

/* Kontakt: ten sam komponent co w nagłówku (.header-contact) --------------- */

.footer__lines {
  display: flex; flex-wrap: wrap; row-gap: 1.25rem;
  padding: 1.35rem 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}
.footer__contact {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto;
  column-gap: .9rem; row-gap: .1rem; align-items: center; align-content: center;
  padding: 0 1.75rem;
  font-family: var(--font-ui);
}
.footer__contact:first-child { padding-left: 0; }
.footer__contact + .footer__contact { border-left: 1px solid var(--line); }
.footer__icon {
  grid-row: 1 / 4; width: 40px; height: 40px; border-radius: 50%;
  background: var(--navy-50); color: var(--orange-600);
  display: grid; place-items: center;
}
.site-footer .footer__icon .icon { width: 1.125rem; height: 1.125rem; }
.footer__small {
  grid-column: 2; margin: 0;
  font-family: var(--font-ui); font-size: .6875rem; font-weight: 500; line-height: 1.2;
  text-transform: uppercase; letter-spacing: .09em;
  color: var(--ft-soft);
}
.site-footer .footer__phone {
  grid-column: 2;
  font-size: 1.0625rem; font-weight: 500; line-height: 1.15;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.site-footer .footer__mail { grid-column: 2; font-size: .8125rem; line-height: 1.3; color: var(--ft-soft); }
.site-footer .footer__phone:hover, .site-footer .footer__mail:hover { text-decoration-thickness: 1px; text-underline-offset: .2em; }

.footer__company {
  display: flex; flex-wrap: wrap; gap: 1rem 3rem;
  margin-top: 1.6rem;
  font-size: .9375rem; line-height: 1.65;
}
.footer__company address { font-style: normal; }
.footer__time { display: inline-flex; align-items: center; gap: .5em; }
.footer__time .icon { color: var(--orange-600); }

/* Oddziały: lupa nad globusem + lista ---------------------------------------- */

.footer__branches {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 1fr);
  gap: 2rem clamp(1.75rem, 3.5vw, 3.5rem);
  align-items: center;
}

.footer__lens {
  position: relative;          /* bez z-indexu: globus i tarcza należą do warstwy .footer__main */
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  justify-self: center;
}

/* Kula ziemska: półtonowe kropki, środek dokładnie pod środkiem lupy */
.footer__globe {
  position: absolute; left: 50%; top: 50%; z-index: -1;
  width: 330%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: var(--ft-globe);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 36%, rgba(0, 0, 0, .5) 66%, transparent 94%);
          mask-image: radial-gradient(closest-side, #000 36%, rgba(0, 0, 0, .5) 66%, transparent 94%);
}
.footer__globe img { display: block; width: 100%; height: 100%; }

/* Szkło lupy: biała tarcza z cieniem przesłania globus pod mapą Polski */
.footer__disc {
  position: absolute; inset: 0; z-index: -1;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 0 0 9px rgba(255, 255, 255, .85),
    0 0 0 10px var(--line),
    0 26px 50px -30px rgba(22, 42, 67, .4);
}

/* Krzyż pasowania na obrzeżu lupy */
.footer__reticle {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible; fill: none;
  stroke: var(--navy); stroke-width: 1; vector-effect: non-scaling-stroke;
  opacity: .5;
}
.footer__reticle path { vector-effect: non-scaling-stroke; }

/* Mapa Polski w lupie */
.footer__pl {
  position: absolute; left: 8%; top: 10.1%;
  width: 84%; aspect-ratio: 1000 / 950;
}
.footer__pl > img, .footer__routes { position: absolute; inset: 0; width: 100%; height: 100%; }
.footer__pl > img { transition: filter .9s var(--ease), opacity .9s var(--ease), transform 1.1s var(--ease); }
.footer__routes { overflow: visible; fill: none; }
.footer__routes path { stroke-linecap: round; }
.footer__routes .track path { stroke: var(--orange-100); stroke-width: 4; }
.footer__routes .draw path { stroke: var(--orange); stroke-width: 4.5; transition: opacity .3s; }
.footer__routes .leader { stroke: var(--navy); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .6; transition: opacity .3s, stroke .3s; }

.pin { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; transition: opacity .5s var(--ease) .9s; }
.pin i {
  position: absolute; left: -4.5px; top: -4.5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 0 0 2px #fff;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), background-color .2s;
}
.pin--hub i {
  left: -6.5px; top: -6.5px; width: 13px; height: 13px;
  background: var(--orange);
  box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(248, 120, 49, .2);
}
.pin__label {
  position: absolute; top: 0;
  transform: translateY(-50%);
  font-family: var(--font-ui);
  font-size: .75rem; font-weight: 500; line-height: 1;
  letter-spacing: .03em;
  color: var(--text);
  white-space: nowrap;
  text-shadow: 0 0 2px #fff, 0 0 4px #fff, 0 0 8px #fff;
  transition: color .2s;
}
.pin__label--right { left: 11px; }
.pin__label--left { right: 11px; }
.pin__label--below { right: 6px; top: 12px; transform: none; }

/* Jedno wejście: lupa „łapie ostrość”, potem z Krakowa rysują się trasy (footer.js) */
.site-footer.is-armed .footer__pl > img { filter: blur(6px); opacity: .35; transform: scale(1.05); }
.site-footer.is-armed .footer__routes .draw path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.site-footer.is-armed .pin { opacity: 0; }
.site-footer.is-drawn .footer__pl > img { filter: none; opacity: 1; transform: none; }
.site-footer.is-drawn .pin { opacity: 1; }
.site-footer.is-drawn .footer__routes .draw path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.6s var(--ease) calc(var(--d, 0s) + .55s), opacity .3s;
}

/* Lista */
.footer__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.625rem, 2.2vw, 2rem);
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--navy-900);
  margin: 0;
}
.footer__caption { margin-top: .35rem !important; font-size: .9375rem; color: var(--ft-soft); }
.footer__offices ul { list-style: none; margin: 1.25rem 0 0; padding: 0; border-top: 1px solid var(--line-strong); }
.footer__offices li { border-bottom: 1px solid var(--line); }
.site-footer .footer__offices a {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  column-gap: .75rem;
  padding: .6rem 0 .64rem;
}
.footer__offices a::before {
  content: ""; grid-row: 1 / span 2; justify-self: center; margin-top: .5em;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--navy);
  transition: transform .3s var(--ease), background-color .2s;
}
.footer__offices a[data-branch="krakow"]::before { width: 11px; height: 11px; margin-top: .42em; background: var(--orange); }
.footer__name { font-weight: 500; line-height: 1.35; color: var(--navy-900); }
.footer__role { font-size: .875rem; line-height: 1.4; color: var(--ft-soft); }
.site-footer .footer__offices a:hover { text-decoration: none; }
.footer__offices a:is(:hover, :focus-visible) .footer__name {
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: .25em;
}
.footer__offices a:is(:hover, :focus-visible)::before { transform: scale(1.3); background: var(--orange); }

/* Najechanie / fokus na oddziale zapala jego pinezkę i trasę na mapie */
.footer__branches:has(.footer__offices a:is(:hover, :focus-visible)) .pin i { background: var(--line-strong); box-shadow: 0 0 0 2px #fff; }
.footer__branches:has(.footer__offices a:is(:hover, :focus-visible)) .pin__label { color: var(--muted-2); }
.footer__branches:has(.footer__offices a:is(:hover, :focus-visible)) .footer__routes .draw path { opacity: .25; }

.footer__branches:has([data-branch="krakow"]:is(:hover, :focus-visible)) [data-pin="krakow"] i,
.footer__branches:has([data-branch="michalowice"]:is(:hover, :focus-visible)) [data-pin="michalowice"] i,
.footer__branches:has([data-branch="katowice"]:is(:hover, :focus-visible)) [data-pin="katowice"] i,
.footer__branches:has([data-branch="lodz"]:is(:hover, :focus-visible)) [data-pin="lodz"] i,
.footer__branches:has([data-branch="warszawa"]:is(:hover, :focus-visible)) [data-pin="warszawa"] i {
  background: var(--orange);
  transform: scale(1.45);
  box-shadow: 0 0 0 2px #fff, 0 0 0 6px rgba(248, 120, 49, .22);
}
.footer__branches:has([data-branch="krakow"]:is(:hover, :focus-visible)) [data-pin="krakow"] .pin__label,
.footer__branches:has([data-branch="michalowice"]:is(:hover, :focus-visible)) [data-pin="michalowice"] .pin__label,
.footer__branches:has([data-branch="katowice"]:is(:hover, :focus-visible)) [data-pin="katowice"] .pin__label,
.footer__branches:has([data-branch="lodz"]:is(:hover, :focus-visible)) [data-pin="lodz"] .pin__label,
.footer__branches:has([data-branch="warszawa"]:is(:hover, :focus-visible)) [data-pin="warszawa"] .pin__label { color: var(--navy-900); }
.footer__branches:has([data-branch="krakow"]:is(:hover, :focus-visible)) .footer__routes .draw path,
.footer__branches:has([data-branch="katowice"]:is(:hover, :focus-visible)) .r-katowice,
.footer__branches:has([data-branch="lodz"]:is(:hover, :focus-visible)) .r-lodz,
.footer__branches:has([data-branch="warszawa"]:is(:hover, :focus-visible)) .r-warszawa { opacity: 1; }
.footer__branches:has([data-branch="michalowice"]:is(:hover, :focus-visible)) .footer__routes .leader { opacity: 1; stroke: var(--orange-600); }

/* Na skróty: jeden wiersz na linii ----------------------------------------- */

.footer__quick {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: .75rem 2.5rem;
  margin-top: clamp(3rem, 5vw, 4.5rem);
  padding: 1.35rem 0 1.45rem;
  border-top: 1px solid var(--line-strong);
}
.footer__quick ul { display: flex; flex-wrap: wrap; gap: .4rem 2rem; list-style: none; margin: 0; padding: 0; }
.site-footer .footer__quick a { font-weight: 500; font-size: .9375rem; }
.site-footer .footer__order { display: inline-flex; align-items: center; gap: .4em; }
.footer__order .icon { color: var(--orange-600); }

/* Pasek prawny -------------------------------------------------------------- */

.footer__base { background: var(--paper-2); border-top: 1px solid var(--line); font-size: .8125rem; color: var(--muted); }
.footer__base-in {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem 2rem;
  padding: 1.1rem 0 1.2rem;
}
.footer__legal { display: flex; flex-wrap: wrap; gap: .4rem 1.75rem; list-style: none; margin: 0; padding: 0; }
.site-footer .footer__legal a { color: var(--text); }
.site-footer .footer__top { display: inline-flex; align-items: center; gap: .35em; font-weight: 500; color: var(--navy-900); }
.footer__top .icon { color: var(--orange-600); transition: transform .3s var(--ease); }
.footer__top:hover .icon { transform: translateY(-2px); }

/* Responsywność ------------------------------------------------------------ */

@media (max-width: 1100px) {
  .footer__layout { grid-template-columns: minmax(0, 1fr); gap: 3.5rem; }
  /* jak w nagłówku: logo po lewej, kontakty po prawej, dane firmy pod linią */
  .footer__lead { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 2rem; }
  .footer__logo { margin: 0; }
  .footer__lines { justify-self: end; padding: 0; border: 0; }
  .footer__company { grid-column: 1 / -1; margin-top: 1.6rem; padding-top: 1.5rem; border-top: 1px solid var(--line-strong); }
  .footer__branches { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer__lens { max-width: 400px; }
}

@media (max-width: 760px) {
  .footer__lead { display: block; }
  .footer__logo { margin-bottom: 1.75rem; }
  .footer__lines { justify-self: auto; padding: 1.35rem 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
  .footer__company { margin-top: 1.6rem; padding-top: 0; border-top: 0; }
}

@media (max-width: 640px) {
  .footer__logo { width: 176px; }
  .footer__lines { flex-direction: column; }
  .footer__contact { padding: 0; }
  .footer__contact + .footer__contact { border-left: 0; padding-top: 1.25rem; border-top: 1px solid var(--line); }
  .footer__company { gap: 1rem 2rem; }
  .footer__branches { grid-template-columns: minmax(0, 1fr); gap: 2.25rem; }
  .footer__offices { order: -1; }
  .footer__lens { max-width: 340px; width: calc(100% - 1.5rem); }
  .footer__globe { width: 290%; }
  .site-footer { --ft-globe: .1; }
  .footer__quick { flex-direction: column; gap: .9rem; }
  .footer__quick ul { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem 1.5rem; width: 100%; }
  .footer__base-in { flex-direction: column; align-items: flex-start; padding-bottom: 5.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .site-footer.is-armed .footer__pl > img { filter: none; opacity: 1; transform: none; }
  .site-footer.is-armed .footer__routes .draw path { stroke-dasharray: none; stroke-dashoffset: 0; }
  .site-footer.is-armed .pin { opacity: 1; }
  .site-footer *, .site-footer *::before { transition: none !important; }
}
