/**
 * AndrewDesign — Mobile & Typografia v1.0
 * Warstwa uzupełniająca. Bez zmiany kolorów marki, grafik Hero i istniejących fontów lokalnych.
 */

/* Lepsze łamanie polskich nagłówków i zdań: bez ręcznych <br>. */
.home-funnel h1,
.home-funnel h2,
.home-funnel h3 {
  text-wrap: balance;
  overflow-wrap: normal;
  hyphens: manual;
}

.home-funnel p,
.home-funnel li,
.home-funnel dt,
.home-funnel dd,
.home-funnel .card-link,
.home-funnel .button,
.home-funnel .text-link {
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.home-funnel .site-container,
.home-funnel .services-grid,
.home-funnel .project-case__copy,
.home-funnel .service-card,
.home-funnel .benefits__intro,
.home-funnel .about__copy,
.home-funnel .contact__intro {
  min-width: 0;
}

/* Interaktywna nawigacja i kotwice poprawnie odsunięte pod przyklejonym headerem. */
html {
  scroll-padding-top: calc(var(--header-height, 4.25rem) + 1rem);
}

.home-funnel [id] {
  scroll-margin-top: calc(var(--header-height, 4.25rem) + 1rem);
}

@media (min-width: 600px) {
  .admin-bar .site-header {
    top: var(--wp-admin--admin-bar--height, 32px);
  }

  .admin-bar .primary-nav:not(.is-open) {
    scroll-margin-top: calc(var(--header-height, 4.75rem) + var(--wp-admin--admin-bar--height, 32px));
  }
}

/* Przyciski pozostają łatwe do kliknięcia na ekranach dotykowych. */
@media (hover: none) {
  .home-funnel .button,
  .home-funnel .card-link,
  .home-funnel .text-link,
  .home-funnel .header-cta {
    min-height: 44px;
  }
}

/* Tablet: zrównoważona odległość kart, bez sztywnego ujednolicania wysokości na mobile. */
@media (min-width: 48rem) and (max-width: 74.999rem) {
  .home-funnel .services-grid {
    gap: clamp(1rem, 2vw, 1.5rem);
    align-items: stretch;
  }

  .home-funnel .services-grid .service-card:last-child {
    min-height: 0;
  }
}

@media (max-width: 47.999rem) {
  :root {
    --header-height: 3.875rem;
    --section-space: clamp(3.25rem, 10vw, 4.25rem);
    --section-space-compact: clamp(3rem, 9vw, 4rem);
    --page-gutter: clamp(1rem, 5.2vw, 1.25rem);
    --grid-gap: 1rem;
  }

  html {
    scroll-padding-top: calc(var(--header-height) + 0.75rem);
  }

  .home-funnel [id] {
    scroll-margin-top: calc(var(--header-height) + 0.75rem);
  }

  .site-header .site-header__inner {
    min-height: var(--header-height);
  }

  .site-header .site-brand img {
    max-height: 2.5rem;
    max-width: 2.5rem;
  }

  .site-header .menu-toggle {
    min-height: 2.75rem;
    min-width: 2.75rem;
  }

  .home-funnel .section-heading {
    margin-bottom: clamp(1.5rem, 6vw, 2rem);
  }

  .home-funnel .section-heading h2,
  .home-funnel .benefits__intro h2,
  .home-funnel .about__copy h2 {
    line-height: 1.14;
  }

  .home-funnel .services-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
  }

  .home-funnel .service-card {
    min-height: 0;
    height: auto;
    padding: clamp(1.125rem, 5.2vw, 1.375rem);
    border-radius: clamp(0.875rem, 4vw, 1.125rem);
    transition: border-color 190ms ease, box-shadow 190ms ease;
  }

  .home-funnel .service-card__number {
    margin-bottom: 0.625rem;
    letter-spacing: 0.08em;
  }

  .home-funnel .service-card h3 {
    margin-bottom: 0.875rem;
    font-size: clamp(1.25rem, 5.9vw, 1.5rem);
    line-height: 1.24;
  }

  .home-funnel .service-card > p:not(.service-card__number) {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.57;
  }

  .home-funnel .service-card ul {
    gap: 0.5rem;
    margin: 0 0 1.25rem;
    line-height: 1.48;
  }

  .home-funnel .service-card li {
    padding-left: 1rem;
  }

  .home-funnel .service-card .card-link {
    align-self: flex-start;
    margin-top: 0;
    line-height: 1.35;
  }

  .home-funnel .benefits-list article {
    padding-block: 1.125rem;
  }

  .home-funnel .benefits-list h3 {
    margin-bottom: 0.5rem;
  }

  .home-funnel .project-case__copy {
    padding: 1.25rem;
  }

  .home-funnel .project-case__visual--compact {
    min-height: 8rem;
  }

  .home-funnel .process-list {
    gap: 0.5rem;
  }

  .home-funnel .process-list li {
    padding-bottom: 1.5rem;
  }

  .home-funnel .process-list li > span {
    transition: background-color 320ms ease, border-color 320ms ease, color 320ms ease, box-shadow 320ms ease;
  }

  .home-funnel .process-list li.ad-process-active > span {
    border-color: #e6b75d;
    background: rgba(230, 183, 93, 0.13);
    box-shadow: 0 0 0 5px rgba(230, 183, 93, 0.075);
    color: #f2c975;
  }

  .home-funnel .process-list li.ad-process-active:not(:last-child)::after {
    background: linear-gradient(180deg, #e6b75d, rgba(230, 183, 93, 0.32));
  }

  .home-funnel .faq-list summary {
    min-height: 3.75rem;
    gap: 0.75rem;
    padding-block: 0.875rem;
  }

  .home-funnel .faq-list details p {
    padding-right: 0.5rem;
  }

  .home-funnel .contact-form {
    padding: 1.25rem;
    gap: 1rem;
  }

  /* Mniej tekstowych „martwych stref” między końcem sekcji i CTA. */
  .home-funnel .section-action {
    margin-top: clamp(1.5rem, 6vw, 2.25rem);
  }
}

/* Animacje inicjowane dopiero po włączeniu JS — statyczna strona pozostaje czytelna. */
@media (max-width: 47.999rem) and (prefers-reduced-motion: no-preference) {
  .ad-mobile-motion .home-funnel .ad-reveal-pending {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    transition: opacity 460ms ease-out, transform 520ms cubic-bezier(.2,.75,.23,1);
  }

  .ad-mobile-motion .home-funnel .ad-reveal-pending.ad-reveal-visible {
    opacity: 1;
    transform: translateZ(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-funnel .ad-reveal-pending {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .home-funnel .process-list li > span {
    transition: none !important;
  }
}
