/* =====================================================================
   AUDYTEL — KALKULATOR ŚLADU WĘGLOWEGO — STYLES
   =====================================================================
   Plik: audytel-esg.css
   Lokalizacja: /wp-content/themes/generatepress-child/css/audytel-esg.css

   Brand color: #922221 (Audytel, spójność z modułem cyber)
   Hover/active: #7A1C1B

   Komponent:
   - Floating expanding pill w prawym dolnym rogu
   - bottom: 80px (żeby nie kolidować z LinkedIn icon w stopce)
   - Stan spoczynku: kółko 64×64 z ikonką liścia
   - Hover/focus: rozwija się w pigułkę z tekstem (transition na width)

   Scope: .audytel-esg-* — nie nadpisuje innych elementów strony.
   ===================================================================== */


/* ===== RESET LOKALNY ===== */
.audytel-esg-pill,
.audytel-esg-pill * {
  box-sizing: border-box;
}

.audytel-esg-pill a {
  text-decoration: none !important;
  color: inherit !important;
}


/* =========================================================
   KONTENER GŁÓWNY — floating, prawy bok, pionowy środek
   ========================================================= */
.audytel-esg-pill {
  position: fixed;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  z-index: 9990;
  font-family: inherit;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* Stan po 10 sekundach — JS dodaje .is-revealed */
.audytel-esg-pill.is-revealed {
  opacity: 1;
  pointer-events: auto;
}

/* Stan startowy / po zamknięciu */
.audytel-esg-pill.is-hidden,
.audytel-esg-pill.is-closed {
  display: none;
}


/* =========================================================
   LINK GŁÓWNY — flex container kółka i tekstu
   ========================================================= */
.audytel-esg-pill__link {
  display: flex;
  align-items: center;
  background: #922221;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(146, 34, 33, 0.4);
  width: 64px;
  height: 64px;
  overflow: hidden;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

/* Rozszerzenie na hover / focus / aktywny stan */
.audytel-esg-pill:hover .audytel-esg-pill__link,
.audytel-esg-pill:focus-within .audytel-esg-pill__link {
  width: 280px;
  background: #7A1C1B;
  box-shadow: 0 8px 24px rgba(146, 34, 33, 0.55);
}


/* =========================================================
   KÓŁKO Z NAPISEM "oblicz" + "CO₂"
   ========================================================= */
.audytel-esg-pill__circle {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.audytel-esg-pill__badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  transition: transform 0.3s ease;
}

.audytel-esg-pill__badge-small {
  font-size: 8px;
  opacity: 0.85;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
  font-weight: 400;
}

.audytel-esg-pill__badge-big {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.audytel-esg-pill__badge-big sub {
  font-size: 10px;
  vertical-align: -1px;
}

.audytel-esg-pill:hover .audytel-esg-pill__badge {
  transform: scale(1.05);
}


/* =========================================================
   TEKST W PIGUŁCE — ukryty domyślnie, fade-in przy rozszerzaniu
   ========================================================= */
.audytel-esg-pill__text {
  display: flex;
  flex-direction: column;
  padding: 0 18px 0 4px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.25s ease 0.1s, transform 0.25s ease 0.1s;
  color: #ffffff;
}

.audytel-esg-pill:hover .audytel-esg-pill__text,
.audytel-esg-pill:focus-within .audytel-esg-pill__text {
  opacity: 1;
  transform: translateX(0);
}

.audytel-esg-pill__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.audytel-esg-pill__subtitle {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.9;
  margin-top: 2px;
}


/* =========================================================
   PRZYCISK ZAMKNIĘCIA (×) — pojawia się tylko na hover
   ========================================================= */
.audytel-esg-pill__close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: #555;
  padding: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
}

.audytel-esg-pill:hover .audytel-esg-pill__close,
.audytel-esg-pill:focus-within .audytel-esg-pill__close {
  opacity: 1;
  transform: scale(1);
}

.audytel-esg-pill__close:hover {
  background: #f5f5f5;
  color: #922221;
}


/* =========================================================
   MOBILE — kółko na prawym boku, tap rozwija pigułkę
   ========================================================= */
@media (max-width: 768px) {
  .audytel-esg-pill {
    right: 16px;
  }

  /* Domyślnie samo kółko */
  .audytel-esg-pill__link {
    width: 64px;
  }

  /* Po tapie JS dodaje .is-expanded — wtedy pigułka się rozwija.
     Alternatywnie :focus-within łapie również keyboard/screen reader. */
  .audytel-esg-pill.is-expanded .audytel-esg-pill__link,
  .audytel-esg-pill:focus-within .audytel-esg-pill__link {
    width: 240px;
  }

  /* Tekst pokazuje się dopiero przy rozwinięciu */
  .audytel-esg-pill__text {
    opacity: 0;
    transform: translateX(-8px);
  }
  .audytel-esg-pill.is-expanded .audytel-esg-pill__text,
  .audytel-esg-pill:focus-within .audytel-esg-pill__text {
    opacity: 1;
    transform: translateX(0);
  }

  /* X widoczny dopiero przy rozwinięciu */
  .audytel-esg-pill__close {
    opacity: 0;
    transform: scale(0.7);
  }
  .audytel-esg-pill.is-expanded .audytel-esg-pill__close,
  .audytel-esg-pill:focus-within .audytel-esg-pill__close {
    opacity: 1;
    transform: scale(1);
  }

  .audytel-esg-pill__title {
    font-size: 13px;
  }
}

/* Bardzo małe ekrany — zwiń do samego kółka, tekst tylko na tap */
@media (max-width: 380px) {
  .audytel-esg-pill__link {
    width: 56px;
    height: 56px;
  }

  .audytel-esg-pill__circle {
    width: 56px;
    height: 56px;
  }

  .audytel-esg-pill__text {
    display: none;
  }
}
