/**
 * ============================================================
 *  HA Campaign Types — arkusz stylów
 * ============================================================
 *
 *  Plik ładowany TYLKO na stronach z shortcode [ha_campaign_types].
 *  Nie obciąża reszty serwisu.
 *
 *  WAŻNE DLA WYDAJNOŚCI:
 *  Animujemy WYŁĄCZNIE opacity + transform.
 *  To jedyne właściwości, które przeglądarka przetwarza na warstwie
 *  GPU (compositor). Animowanie width/height/margin/top/left
 *  wymusza "layout reflow" — przeglądarka musi PRZELICZAĆ pozycje
 *  WSZYSTKICH elementów na stronie. Efekt: jankowanie, spadek fps.
 *
 *  PREFIKSY:
 *  Nie potrzebujesz -webkit-transform/-moz-transform w 2025+.
 *  Przeglądarki wspierają transform/transition bez prefiksów od lat.
 *  Dodawanie ich to martwy kod, który tylko zwiększa plik CSS.
 */

/* ─── Zmienne kolorów ─── */
:root {
  --ha-orange: #E8751A;
  --ha-orange-glow: #FF8C2B;
  --ha-bg-section: #EDF0F4;
  --ha-text-dark: #1A1A2E;
  --ha-text-muted: #6B7280;
}

/* ─── Kontener sekcji ─── */
.ha-campaign-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px 100px;
}

/* ─── Nagłówek ─── */
.ha-campaign-section__title {
  text-align: center;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 56px;
  letter-spacing: -0.02em;
  color: var(--ha-text-dark);
}
.ha-campaign-section__title span {
  color: var(--ha-orange);
}

/* ─── Grid ─── */
.ha-campaign-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
}

/* ─── Karta ─── */
.ha-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: default;
  position: relative; /* kotwica dla absolutnych dekoracji */
}

/* ─── Obszar ilustracji ─── */
.ha-card__visual {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  overflow: visible; /* dekoracje MUSZĄ wystawać poza box */
}

/* ─── Ilustracja (<img>) ─── */
.ha-card__img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 2;
}
.ha-card:hover .ha-card__img {
  transform: scale(1.06);
}

/* ─── Placeholder (gdy brak obrazka) ─── */
.ha-card__img-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ha-text-muted);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 2;
}
.ha-card:hover .ha-card__img-placeholder {
  transform: scale(1.06);
}

/* ─── Nazwa kampanii ─── */
.ha-card__label {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ha-text-dark);
  letter-spacing: -0.01em;
}


/* ═══════════════════════════════════════════════
 *  DEKORACJE HOVER
 * ═══════════════════════════════════════════════
 *
 *  Domyślnie: opacity: 0 + transform (przesunięcie/skalowanie)
 *  Na :hover karty: opacity: 1 + transform resetowany
 *  Każdy kształt ma inny transition-delay → efekt kaskady
 */

.ha-deco {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.ha-card:hover .ha-deco {
  opacity: 1;
}

/* --- Kółko (ring) --- */
.ha-deco--circle {
  width: 44px;
  height: 44px;
  border: 2.5px solid var(--ha-orange);
  border-radius: 50%;
  transform: translate(-8px, 8px) scale(0.7);
  transition-delay: 0s;
}
.ha-card:hover .ha-deco--circle {
  transform: translate(0, 0) scale(1);
}

/* --- Wypełniona kropka --- */
.ha-deco--dot {
  width: 10px;
  height: 10px;
  background: var(--ha-orange);
  border-radius: 50%;
  transform: translate(5px, -5px) scale(0);
  transition-delay: 0.08s;
}
.ha-card:hover .ha-deco--dot {
  transform: translate(0, 0) scale(1);
}

/* --- Kwadrat (obraca się w romb na hover) --- */
.ha-deco--square {
  width: 16px;
  height: 16px;
  border: 2px solid var(--ha-orange);
  border-radius: 2px;
  transform: translate(6px, -6px) rotate(0deg) scale(0.5);
  transition-delay: 0.06s;
}
.ha-card:hover .ha-deco--square {
  transform: translate(0, 0) rotate(45deg) scale(1);
}

/* --- Plus (+) zbudowany z pseudo-elementów --- */
.ha-deco--plus {
  width: 14px;
  height: 14px;
  transform: translate(-4px, 4px) scale(0.5) rotate(-90deg);
  transition-delay: 0.12s;
}
.ha-deco--plus::before,
.ha-deco--plus::after {
  content: '';
  position: absolute;
  background: var(--ha-orange);
  border-radius: 1px;
}
.ha-deco--plus::before {
  width: 2px;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
}
.ha-deco--plus::after {
  height: 2px;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
}
.ha-card:hover .ha-deco--plus {
  transform: translate(0, 0) scale(1) rotate(0deg);
}

/* --- Linia pozioma --- */
.ha-deco--line {
  width: 28px;
  height: 2.5px;
  background: var(--ha-orange);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition-delay: 0.1s;
}
.ha-card:hover .ha-deco--line {
  transform: scaleX(1);
}

/* --- Linia pionowa --- */
.ha-deco--line-v {
  width: 2.5px;
  height: 28px;
  background: var(--ha-orange);
  border-radius: 2px;
  transform: scaleY(0);
  transform-origin: center top;
  transition-delay: 0.14s;
}
.ha-card:hover .ha-deco--line-v {
  transform: scaleY(1);
}


/* ═══════════════════════════════════════════════
 *  POZYCJE KSZTAŁTÓW — unikalne dla każdej karty
 * ═══════════════════════════════════════════════ */

/* Karta 1: Performance Max */
[data-card="1"] .ha-deco--circle { top: -8px;   left: -14px; }
[data-card="1"] .ha-deco--square { bottom: 20px; right: -6px; }
[data-card="1"] .ha-deco--dot    { top: 30px;   right: 2px; }
[data-card="1"] .ha-deco--plus   { bottom: -2px; left: 20px; }
[data-card="1"] .ha-deco--line   { top: 50%;    left: -20px; }

/* Karta 2: Produktowa */
[data-card="2"] .ha-deco--circle { bottom: 10px; right: -16px; }
[data-card="2"] .ha-deco--square { top: 0;       left: -4px; }
[data-card="2"] .ha-deco--dot    { top: 10px;    right: 10px; }
[data-card="2"] .ha-deco--plus   { bottom: -4px; right: 30px; }
[data-card="2"] .ha-deco--line-v { top: 4px;     right: -10px; }

/* Karta 3: Sieć wyszukiwania */
[data-card="3"] .ha-deco--circle { top: 10px;    right: -18px; }
[data-card="3"] .ha-deco--square { bottom: 5px;  left: 0; }
[data-card="3"] .ha-deco--dot    { bottom: 30px; right: 4px; }
[data-card="3"] .ha-deco--plus   { top: -4px;    left: 30px; }
[data-card="3"] .ha-deco--line   { bottom: 12px; right: -16px; }

/* Karta 4: Sieć reklamowa */
[data-card="4"] .ha-deco--circle { bottom: -6px; left: -10px; }
[data-card="4"] .ha-deco--square { top: 8px;     right: 0; }
[data-card="4"] .ha-deco--dot    { top: -4px;    left: 30px; }
[data-card="4"] .ha-deco--plus   { bottom: 20px; right: -8px; }
[data-card="4"] .ha-deco--line-v { top: 10px;    left: -12px; }

/* Karta 5: Demand Gen */
[data-card="5"] .ha-deco--circle { top: -10px;   right: -10px; }
[data-card="5"] .ha-deco--square { bottom: 14px; left: -8px; }
[data-card="5"] .ha-deco--dot    { bottom: 0;    right: 20px; }
[data-card="5"] .ha-deco--plus   { top: 20px;    left: -6px; }
[data-card="5"] .ha-deco--line   { top: 6px;     left: 10px; }

/* Karta 6: Wideo */
[data-card="6"] .ha-deco--circle { bottom: 16px; right: -12px; }
[data-card="6"] .ha-deco--square { top: -2px;    left: 10px; }
[data-card="6"] .ha-deco--dot    { top: 20px;    left: -6px; }
[data-card="6"] .ha-deco--plus   { bottom: -6px; right: 24px; }
[data-card="6"] .ha-deco--line-v { bottom: 10px; left: -14px; }


/* ═══════════════════════════════════════════════
 *  RESPONSYWNOŚĆ
 * ═══════════════════════════════════════════════ */

@media (max-width: 860px) {
  .ha-campaign-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 24px;
  }
}

@media (max-width: 520px) {
  .ha-campaign-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    max-width: 320px;
    margin: 0 auto;
  }

  .ha-campaign-section {
    padding: 48px 16px 60px;
  }

  .ha-campaign-section__title {
    margin-bottom: 36px;
  }
}


/* ═══════════════════════════════════════════════
 *  DOSTĘPNOŚĆ — prefers-reduced-motion
 * ═══════════════════════════════════════════════
 *
 *  Ludzie z epilepsją, zaburzeniami przedsionkowymi (vestibular),
 *  migreną — mogą mieć tę opcję włączoną w systemie operacyjnym.
 *  Wyłączamy animacje, ale nadal pokazujemy kształty (przyciszone).
 */
@media (prefers-reduced-motion: reduce) {
  .ha-deco {
    transition: none;
    opacity: 0.4;
    transform: none !important;
  }
  .ha-card:hover .ha-deco {
    opacity: 0.7;
  }
  .ha-card__img,
  .ha-card__img-placeholder {
    transition: none;
  }
}
