/* =====================================================================
   AUDYTEL — EBOOK CYBERBEZPIECZEŃSTWO 2026 — STYLES (v4)
   =====================================================================
   Plik: audytel-ebook.css
   Lokalizacja: /wp-content/themes/generatepress-child/css/audytel-ebook.css

   Brand color: #922221 (czerwień Audytel — --maincolor)
   Hover/active: #7A1C1B (ciemniejszy o ~12%)

   Komponenty:
   - Inline banner — wstrzykiwany w środek pola desc7 przez filter ACF
   - Hero card — tylko na samej /cyberbezpieczenstwo/
   - Floating sidebar — prawy bok, pionowo wycentrowany (vertical:50%)

   Scope: .audytel-ebook-* — nie nadpisuje GeneratePress, LiteSpeed, Rank Math.
   ===================================================================== */


/* ===== RESET LOKALNY ===== */
.audytel-ebook-sidebar,
.audytel-ebook-sidebar *,
.audytel-ebook-inline,
.audytel-ebook-inline *,
.audytel-ebook-hero,
.audytel-ebook-hero * {
  box-sizing: border-box;
}

.audytel-ebook-sidebar a,
.audytel-ebook-inline a,
.audytel-ebook-hero a {
  text-decoration: none !important;
  color: inherit !important;
  display: block;
}


/* =========================================================
   WARIANT A — FLOATING SIDEBAR (prawy bok, pionowy środek)
   =========================================================
   Strategia "delayed reveal":
   - Domyślnie sidebar ukryty (.is-hidden = display:none)
   - JS po 10 sekundach usuwa klasę is-hidden i dodaje is-revealed
   - is-revealed = opacity 0 → 1 z fade-in (CSS transition)
   - Po kliknięciu X znika trwale w tej sesji (sessionStorage)

   position: fixed — nie scrolluje się z treścią
   top: 50%, transform: translateY(-50%) — wycentrowany pionowo
   right: 24px — odsunięty od krawędzi
   ========================================================= */
.audytel-ebook-sidebar {
  position: fixed;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  width: 220px;
  z-index: 9990;
  font-family: inherit;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* Stan po 10 sekundach — JS dodaje klasę .is-revealed */
.audytel-ebook-sidebar.is-revealed {
  opacity: 1;
  pointer-events: auto;
}

/* Stan startowy i po zamknięciu — całkowicie ukryty */
.audytel-ebook-sidebar.is-hidden,
.audytel-ebook-sidebar.is-closed {
  display: none;
}

.audytel-ebook-sidebar__card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(146, 34, 33, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.audytel-ebook-sidebar:hover .audytel-ebook-sidebar__card {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(146, 34, 33, 0.28);
}

.audytel-ebook-sidebar__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #555;
  padding: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.audytel-ebook-sidebar__close:hover {
  background: #ffffff;
  color: #922221;
}

.audytel-ebook-sidebar__cover {
  background-image: url('../img/cyberbezpieczenstwo-2026-ebook.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  aspect-ratio: 3 / 4;
  width: 100%;
  display: block;
}

.audytel-ebook-sidebar__body {
  padding: 12px;
}

.audytel-ebook-sidebar__kicker {
  font-size: 10px;
  color: #922221;
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.audytel-ebook-sidebar__heading {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 10px;
  line-height: 1.3;
  color: #1a1a1a;
}

.audytel-ebook-sidebar__cta {
  background: #922221;
  color: #ffffff !important;
  padding: 9px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  text-align: center;
  display: block;
  transition: background 0.2s ease;
}

.audytel-ebook-sidebar:hover .audytel-ebook-sidebar__cta {
  background: #7A1C1B;
}

.audytel-ebook-sidebar__cta-arrow {
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.audytel-ebook-sidebar:hover .audytel-ebook-sidebar__cta-arrow {
  transform: translateX(3px);
}

.audytel-ebook-sidebar__meta {
  font-size: 10px;
  color: #888888;
  margin: 8px 0 0;
  text-align: center;
}

/* Stan zamknięty (po kliknięciu X) */
.audytel-ebook-sidebar.is-closed {
  display: none;
}

/* Mobile — sidebar ukryty (za mało miejsca) */
@media (max-width: 1024px) {
  .audytel-ebook-sidebar {
    display: none;
  }
}


/* =========================================================
   WARIANT B — INLINE BANNER (pełna szerokość treści, w desc7)
   ========================================================= */
.audytel-ebook-inline {
  margin: 32px 0;
  font-family: inherit;
}

.audytel-ebook-inline__card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 4px solid #922221;
  border-radius: 10px;
  padding: 24px;
  display: flex;
  gap: 24px;
  align-items: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.audytel-ebook-inline__card:hover {
  box-shadow: 0 6px 20px rgba(146, 34, 33, 0.15);
  transform: translateY(-1px);
}

.audytel-ebook-inline__cover {
  flex-shrink: 0;
  width: 120px;
  aspect-ratio: 3 / 4;
  background-image: url('../img/cyberbezpieczenstwo-2026-ebook.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.audytel-ebook-inline__content {
  flex: 1;
  min-width: 0;
}

.audytel-ebook-inline__kicker {
  font-size: 11px;
  color: #922221;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.audytel-ebook-inline__heading {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.3;
  color: #1a1a1a;
}

.audytel-ebook-inline__description {
  font-size: 14px;
  color: #555555;
  margin: 0 0 16px;
  line-height: 1.55;
}

.audytel-ebook-inline__cta {
  background: #922221;
  color: #ffffff !important;
  padding: 11px 22px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  display: inline-block;
  transition: background 0.2s ease;
}

.audytel-ebook-inline__card:hover .audytel-ebook-inline__cta {
  background: #7A1C1B;
}

.audytel-ebook-inline__cta-arrow {
  display: inline-block;
  margin-left: 6px;
  transition: transform 0.2s ease;
}

.audytel-ebook-inline__card:hover .audytel-ebook-inline__cta-arrow {
  transform: translateX(3px);
}

@media (max-width: 600px) {
  .audytel-ebook-inline__card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 16px;
  }
  .audytel-ebook-inline__cover {
    width: 100px;
  }
  .audytel-ebook-inline__heading {
    font-size: 17px;
  }
}


/* =========================================================
   WARIANT C — HERO CARD (tylko /cyberbezpieczenstwo/)
   ========================================================= */
.audytel-ebook-hero {
  margin: 40px 0;
  font-family: inherit;
}

.audytel-ebook-hero__card {
  background: linear-gradient(135deg, #922221 0%, #6B1817 100%);
  border-radius: 14px;
  padding: 36px;
  display: flex;
  gap: 32px;
  align-items: center;
  color: #ffffff;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.audytel-ebook-hero__card:hover {
  box-shadow: 0 12px 32px rgba(146, 34, 33, 0.4);
  transform: translateY(-2px);
}

.audytel-ebook-hero__cover {
  flex-shrink: 0;
  width: 160px;
  aspect-ratio: 3 / 4;
  background-image: url('../img/cyberbezpieczenstwo-2026-ebook.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.audytel-ebook-hero__content {
  flex: 1;
}

.audytel-ebook-hero__kicker {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.audytel-ebook-hero__heading {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.25;
  color: #ffffff;
}

.audytel-ebook-hero__description {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 20px;
  line-height: 1.55;
}

.audytel-ebook-hero__cta {
  background: #ffffff;
  color: #922221 !important;
  padding: 13px 26px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 15px;
  display: inline-block;
  transition: background 0.2s ease;
}

.audytel-ebook-hero__card:hover .audytel-ebook-hero__cta {
  background: #f5f5f5;
}

.audytel-ebook-hero__cta-arrow {
  display: inline-block;
  margin-left: 6px;
  transition: transform 0.2s ease;
}

.audytel-ebook-hero__card:hover .audytel-ebook-hero__cta-arrow {
  transform: translateX(3px);
}

@media (max-width: 768px) {
  .audytel-ebook-hero__card {
    flex-direction: column;
    text-align: center;
    padding: 28px 20px;
    gap: 20px;
  }
  .audytel-ebook-hero__cover {
    width: 130px;
  }
  .audytel-ebook-hero__heading {
    font-size: 20px;
  }
}
