/* ═══════════════════════════════════════════════════════════════════════════
   WCP AESTHETIC POLISH OVERRIDES
   Emitted from a late-priority wp_head hook (see functions.php) so the <link>
   lands AFTER Bricks' inline design-system CSS (bricks-frontend-inline-inline-css,
   which Bricks prints via its own late hook, not an enqueueable handle). Loading
   last means equal-specificity rules here win by source order; more-specific rules
   (e.g. .wcp-cta-band .wcp-body-lg) still correctly override us. Targets the
   semantic wcp-* helper classes.

   Maps to the cross-cutting findings from the gemma4 vision review (23 pages).
   These are design-system-level fixes that cascade globally. Per-page structural
   fixes (footer column balance, CTA repetition, section rhythm) are intentionally
   NOT touched here — they need Bricks-level edits and carry breakage risk.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Card grids: equal-height cards ──────────────────────────────────────
   Original: align-items:start → jagged bottom edges when card text lengths differ.
   Fix:     stretch so all cards in a row share the same height.              */
.brxe-container.wcp-grid-2,
.brxe-container.wcp-grid-3,
.brxe-container.wcp-grid-4 {
  align-items: stretch;
}

/* ── 2. Pin "Dowiedz się więcej →" links to the card bottom ───────────────────
   Cards are flex columns (.wcp-stack); margin-top:auto on the last link pushes
   it to the bottom so links baseline-align across a row of cards.           */
.wcp-card .wcp-more:last-child {
  margin-top: auto;
}

/* ── 3. Prose readability: cap line length ~68 chars ──────────────────────────
   Vision: intro & legal paragraphs stretch too wide (>75 chars/line).
   Bricks sets .brxe-container .wcp-body-lg { max-width:100% } (0,2,0), so a bare
   .wcp-body-lg rule (0,1,0) loses. Match the offender's specificity and load last
   to win. .wcp-cta-band keeps its own 46ch (re-stated below, also 0,2,0, later in
   this file so it wins for cta-band contexts). Narrow cards are unaffected
   (card width < 68ch).                                                          */
.brxe-container .wcp-body-lg {
  max-width: 68ch;
}
.wcp-center-text .wcp-body-lg {
  margin-inline: auto;
}
.wcp-cta-band .wcp-body-lg {
  max-width: 46ch;
}

/* ── 4. Heading line-height: breathing room for display weights ─────────────
   Original H1 line-height 1.04 / H2 1.1 → descenders crowd ascenders.
   Loosen to 1.15 / 1.18. (H1 also reads as more dominant → clearer hierarchy.)  */
.wcp-h1 { line-height: 1.15; }
.wcp-h2 { line-height: 1.18; }

/* ── 5. Secondary / ghost buttons: visible 2px border ────────────────────────
   Vision: outline buttons "disappear" / look weak on the cream #FAF6EF bg.
   Force a 2px border so the secondary CTA reads as a real affordance.        */
.wcp-btn-secondary { border: 2px solid var(--wcp-clay-500); }
.wcp-btn-ghost     { border: 2px solid var(--wcp-border); }

/* ── 6. Phone link: stronger contrast vs cream background ───────────────────
   Original color:var(--wcp-muted) (#6E746E) reads as washed-out. Deepen to
   sage-deep (#435247). Hover state (clay-600) is untouched.                   */
.wcp-phone-link { color: var(--wcp-sage-deep); }

/* ── 7. Mobile: edge padding 16px → 24px + ≥44px touch targets ────────────── */
@media (max-width: 768px) {
  /* Containers: leave ~24px each side (was 92vw ≈ 15px on a 390px screen). */
  .wcp-container,
  .wcp-container-sm {
    width: calc(100vw - 48px) !important;
  }
  /* "Dowiedz się więcej" links: meet 44px touch target. */
  .wcp-more {
    min-height: 44px;
  }
  /* Phone link: 44px touch target + separation from the CTA button above. */
  .wcp-phone-link {
    min-height: 44px;
    margin-top: 0.5rem;
  }
}

/* Booknetic Theme 2: force WCP price color even when cached plugin CSS lingers. */
#booknetic_theme_2.booknetic_appointment .booknetic_appointment_container .booknetic_service_card_price {
  color: #a24f3a !important;
  border-color: #a24f3a !important;
}

/* ── 8. Mobile audit fixes (2026-07-20) ───────────────────────────────────── */

/* 8a. Anchor targets were landing under the fixed header (113px desktop /
   140px mobile) — scroll-padding-top was `auto` and targets had
   scroll-margin-top:0, so e.g. /kontakt/#kontakt-form hid its own first
   ~140px behind the header. */
html {
  scroll-padding-top: 150px;
}
html, body { overflow-x: clip !important; }  /* was overflow-x:hidden (header tmpl) — hidden forces overflow-y:auto on body, which breaks position:sticky (e.g. #z1-detail). clip still prevents horizontal scroll but does not create a scroll container, so sticky works. */

/* 8b. Headings hyphenated mid-word ("Najpierw spokojna roz-mowa") because the
   global block sets hyphens:auto on h1–h6. Breaks are valid Polish but read
   as sloppy at heading sizes. Body copy keeps hyphens:auto.
   !important: the global rule is an inline <style> in the body, so it wins
   on source order over this stylesheet. */
h1, h2, h3, h4, h5, h6,
.wcp-h1, .wcp-h2, .wcp-h3 {
  -webkit-hyphens: none !important;
  hyphens: none !important;
}

/* 8c. Checklist rows wrapped: the icon sat on its own line above the text.
   The row is display:flex/wrap, but the text child's flex-basis is auto →
   max-content → wider than the row, forcing a wrap. Give it a zero basis so
   it shrinks beside the 20px icon. Scoped to .wcp-gap3 so the header's
   .wcp-gap2 / .wcp-gap4 rows (phone chip, CTA) are untouched. */
.wcp-row.wcp-gap3 > .material-symbols-outlined + .brxe-text-basic {
  flex: 1 1 0%;
  min-width: 0;
}

/* 8d. CTA band rotator headline was clipped on every page at mobile widths.
   Its inline font-size is clamp(3.15rem,6.6vw,5.625rem) — below ~800px the
   3.15rem MINIMUM wins, pinning the type at 50.4px, so the longest headline
   ("Pierwszy krok nie musi być idealny.") measured 505px inside a 390px
   viewport and bled 58px past both edges. The items' text-overflow:ellipsis
   never engaged because their max-width:100% resolves against that oversized
   h2. Step the size down and constrain the h2 so the ellipsis is a real
   fallback. !important: the sizes are inline style attributes. */
@media (max-width: 640px) {
  .wcp-cta-rot-h {
    font-size: clamp(1.75rem, 7.4vw, 2.6rem) !important;
    max-width: 100% !important;
  }
  .wcp-cta-rot-clip,
  .wcp-cta-rot-list,
  .wcp-cta-rot-h-item {
    max-width: 100% !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. MOBILE/TABLET USABILITY AUDIT FIXES (2026-07-24)
   Source: Vision + computed-CSS audit at 375px (iPhone SE) and 768px (iPad).
   See ~/Desktop/wcp-css-backup-20260724-131633/ for pre-change backup.

   Findings from the audit:
   - Sticky header: already responsive (width:100% !important in wcp-nav.css) ✓
   - Location cards (.wcp-grid-3): 3→2→1 col responsive grid already handled ✓
   - Staff section (.z1-body): 2-col→1-col at 919px already handled ✓
   - Service cards (.hb-grid): auto-fit grid already responsive ✓

   Issues fixed below:
   9a. FAQ accordion container (.ac2/.ac2-wrap) fixed at 920px — overflows mobile
   9b. Hero CTA buttons only get width:100% at 640px — broken 641–940px (tablet)
   9c. Footer links 22px touch height — below 44px WCAG minimum
   9d. .hb-wrap / .hb-head fixed at 1169px — constrain to viewport at tablet
   ═══════════════════════════════════════════════════════════════════════════ */

/* 9a. FAQ accordion: container is fixed at 920px with no responsive override.
   Internal elements (font sizes, padding) have @media(max-width:600px) rules,
   but the container itself never shrinks. This causes 545px horizontal overflow
   at 375px and 152px overflow at 768px. Constrain at the tablet breakpoint. */
@media (max-width: 940px) {
  .ac2,
  .ac2-wrap,
  .ac2-intro,
  #ac2-root {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* 9b. Hero CTA buttons: inline CSS sets no width; the only responsive rule is
   @media(max-width:640px) { width:100% }. This leaves 641–940px (tablet portrait
   and large phone landscape) with buttons at their natural width (~590px from
   the 1180px container minus padding). At 768px that overflows by ~80px.
   Extend the full-width rule to the tablet breakpoint. */
@media (max-width: 940px) {
  #hv3-root .hv3-cta {
    width: 100% !important;
    max-width: 100% !important;
  }
  #hv3-root .wcp-hv3-btn,
  #hv3-root .wcp-hv3-ghost {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center !important;
  }
}

/* 9c. Footer links: display:block with 0 padding and 21.75px line-height =
   22px touch target. WCAG 2.2 Success Criterion 2.5.5 and Apple HIG require
   minimum 44px. Add vertical padding so each link is tappable without
   mis-hitting the adjacent link. Scoped to the footer area only.
   NOTE: the substring selector must be prefixed with `body ` so it can never
   match <html>/<body>. The footer signup placement script adds
   `wcp-footer-signup-relocated` to <html>; unprefixed, this rule then hit
   every link on the page (cards lost padding, sticky bar broke). Nov 2026. */
@media (max-width: 940px) {
  .brxe-footer a,
  body [class*="wcp-footer"] a,
  #brxe-footer a,
  footer a {
    display: block;
    padding: 8px 0 !important;
    min-height: 44px !important;
    line-height: 1.4 !important;
  }
}

/* 9d. Service bento wrapper: .hb-wrap is max-width:1440px, .hb-head is 1169px.
   The grid inside (.hb-grid) IS responsive (auto-fit, minmax(300px, 1fr)), but
   the wrapper containers don't constrain at tablet. This causes the section
   heading row (.hb-head with the "Cała oferta" link) to overflow at 768px.
   Constrain the wrappers at the tablet breakpoint. */
@media (max-width: 940px) {
  .hb-wrap,
  .hb-head {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* 9e. Staff section (.z1-wrap) — too narrow at mobile.
   The inline CSS sets padding: clamp(36px, 5vw, 56px) clamp(18px, 4vw, 48px).
   At 375px that resolves to 36px top/bottom, 18px left/right → only 339px content.
   The therapist card qualifications (.z1-rmeta i) use nowrap + ellipsis, so long
   strings like "Psycholożka · Psychoterapeutka CBT (w trakcie certyfikacji)…"
   truncate at ~249px. Fix: tighten padding at mobile and let qualifications wrap. */
@media (max-width: 940px) {
  /* Reduce z1-wrap padding — the parent Bricks container (#brxe-pqfreh)
     already adds 16px side padding, so z1-wrap's own 18px is double-padding.
     Set to 20px top/bottom, 0px sides (parent provides the 16px gutter). */
  #wcp-zsp-v1-root .z1-wrap {
    padding: 20px 0 !important;
    max-width: 100% !important;
  }
  /* With the wrap's side padding removed, the panel heading block (eyebrow, h3,
     intro) sat flush against the card border. Inset it to line up with the text
     inside the quiz card below: .zsp-quiz padding clamp(18px,3vw,28px) + 1px border.
     Nov 2026. */
  #wcp-zsp-v1-root .zsp-head {
    padding-inline: calc(clamp(18px, 3vw, 28px) + 1px);
  }
  /* Allow qualification text to wrap instead of truncating with ellipsis */
  #wcp-zsp-v1-root .z1-rmeta i {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  /* Reduce the gap between therapist cards to fit more content */
  #wcp-zsp-v1-root .z1-list {
    gap: 10px !important;
  }
  /* Tighten filter panel padding at mobile */
  #wcp-zsp-v1-root .zsp-panel {
    padding: 14px 14px !important;
  }
  /* Also reduce the Bricks container side padding from 16px to 12px for
     a bit more usable width on small screens */
  #brxe-pqfreh {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* At very small screens (≤425px) further reduce padding for maximum content width */
@media (max-width: 425px) {
  #brxe-pqfreh {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  #wcp-zsp-v1-root .z1-row {
    padding: 8px 10px !important;
  }
}

/* 9f. Partner ribbon (.par-*) — too narrow at mobile/tablet.
   .par-inner has max-width:1180px + padding:0 24px → header constrained.
   .par-track-wrap gradient overlays are clamp(50px,10vw,130px) each → eat ~75px
   at 375px, leaving only ~300px for logos. .par-logo min width is 156px → only
   ~2 logos visible. Fix: full-width inner, smaller gradient overlays, smaller
   logo min-width at mobile. */
@media (max-width: 940px) {
  /* Remove max-width constraint on the header container */
  .par-inner {
    max-width: 100% !important;
    padding: 0 16px !important;
  }
  /* Reduce gradient overlay width so more logos are visible */
  .par-track-wrap::before,
  .par-track-wrap::after {
    width: 32px !important;
  }
  /* Smaller logo cards at mobile so more fit in view */
  .par-logo {
    width: clamp(130px, 32vw, 180px) !important;
    height: 72px !important;
  }
  .par-logo a {
    padding: 12px 14px !important;
  }
  .par-logo img {
    max-height: 44px !important;
  }
}


/* ── 10. Staff-intro cards (Ewelina & Nina): equal paragraph size + one-line gap
   On /nasz-zespol/ the coordinator cards' first paragraph carries .wcp-body-lg
   (17px / 1.65), while the follow-on <p> inherit the 15px body size, so they read
   smaller. Match every paragraph in the card body to the first paragraph's 17px /
   1.65, and put exactly one line between consecutive paragraphs. The card body is
   a flex column with a uniform .6rem gap; drop that gap and rebuild the original
   rhythm with sibling margins so the paragraph gap is precise (one line-height =
   1.65em). Scoped to .wcp-staff-intro so nothing else is affected; non-paragraph
   spacing keeps the original .6rem (the CTA keeps its original .85rem). */
.wcp-staff-intro .wcp-staff-card__body { gap: 0; }
.wcp-staff-intro .wcp-staff-card__body .wcp-eyebrow { margin-bottom: .6rem; }
.wcp-staff-intro .wcp-staff-card__body h3 { margin: 0 0 .6rem; }
.wcp-staff-intro .wcp-staff-card__body p { margin: 0; font-size: 17px; line-height: 1.65; }
.wcp-staff-intro .wcp-staff-card__body p + p { margin-top: 1.65em; }
.wcp-staff-intro .wcp-staff-card__body .wcp-staff-card__cta { margin-top: .85rem; }
/* 9f. /terapia-online/ "Online czy stacjonarnie?" comparison card (#wcp-p38-v2 .wcp-cmp)
   at phone width. The 3-column table needed ~346px inside a ~293px scroll box, so the
   "Stacjonarnie" column was cut off. Slightly smaller text, tighter padding and fixed
   column widths make the whole card fit (verified at 390px: table 305px in 305px).
   !important because the page's own 14px mobile size loses to a 16px rule. Nov 2026. */
@media (max-width: 520px) {
  #wcp-p38-v2 .wcp-cmp { padding: 22px 14px 18px !important; }
  #wcp-p38-v2 .wcp-cmp__table { table-layout: fixed !important; font-size: 13.5px !important; }
  #wcp-p38-v2 .wcp-cmp__corner { width: 26% !important; }
  #wcp-p38-v2 .wcp-cmp__col { width: 37% !important; padding: 0 0 12px !important; }
  #wcp-p38-v2 .wcp-cmp__chip { padding: 7px !important; gap: 4px !important; max-width: 100%; box-sizing: border-box; }
  #wcp-p38-v2 .wcp-cmp__chip .ms { font-size: 14px !important; }
  #wcp-p38-v2 .wcp-cmp__cname { font-size: 12.5px !important; }
  #wcp-p38-v2 .wcp-cmp__row .wcp-cmp__label { font-size: 13.5px !important; padding: 9px 6px 9px 0 !important; overflow-wrap: anywhere; }
  #wcp-p38-v2 .wcp-cmp__row .wcp-cmp__cell { font-size: 13.5px !important; padding: 9px 5px !important; overflow-wrap: anywhere; }
  #wcp-p38-v2 .wcp-cmp__val { gap: 4px !important; font-size: 13.5px !important; }
  #wcp-p38-v2 .wcp-cmp__val .ms { font-size: 15px !important; }
}
