/* ==========================================================================
   YouFirst – responsive layer
   Loaded last (from footer.php) so it overrides the page-level <style> blocks.
   Breakpoints:  ≤1100 small laptop/tablet landscape
                 ≤900  tablet / mobile menu
                 ≤600  phones
                 ≤380  small phones
   ========================================================================== */

/* ── Global safety ─────────────────────────────────────────────────────── */
html, body { max-width: 100%; }
body { overflow-x: clip; }              /* clip (not hidden) keeps sticky nav working */
img, svg, video, iframe { max-width: 100%; height: auto; }
/* long words / emails / URLs never push the page wider */
p, li, h1, h2, h3, h4, blockquote, a, span, td, th { overflow-wrap: break-word; }

/* Underscores leftovers that had no CSS: hide the duplicate site title + skip link */
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute !important; word-wrap: normal !important;
}
.screen-reader-text:focus {
  background: #fff; clip: auto !important; clip-path: none; color: #1A3A5C;
  display: block; height: auto; width: auto; left: 8px; top: 8px; padding: 12px 20px;
  z-index: 100000; font-size: 14px; text-decoration: none;
}
.site-header .site-branding { display: none; }

/* ── Header / nav (desktop keeps original layout) ──────────────────────── */
.nav-menu-wrap { display: contents; }
.nav-toggle { display: none; }
.nav-logo img.logo { display: block; }

/* ── Home hero banner ──────────────────────────────────────────────────── */
.hero-right {
  background-color: #214D91;
  background-image: var(--hero-bg);
  /* fit to width: the banner's edges are flat blue, so the panel colour simply
     continues above/below – the photo is never over-zoomed or cropped */
  background-size: 100% auto;
  background-position: center 18%;
  background-repeat: no-repeat;
}
.hero-quote, .hero-quote-attr { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35); }

/* grid children may shrink instead of overflowing */
.hero > *, .problem-inner > *, .about-inner > *, .services-header > *,
.services-grid > *, .process-steps > *, .outcomes-header > *, .outcomes-grid > *,
.case-study > *, .testimonials-grid > *, .faq-inner > *, .footer-top > * { min-width: 0; }

/* ==========================================================================
   ≤1100px  – tighten the desktop nav so links + CTA fit
   ========================================================================== */
@media (max-width: 1100px) {
  .nav-inner { gap: 24px; }
  .nav-links { gap: 22px; }
  .nav-cta { padding: 10px 16px; font-size: 12px; }
}

/* ==========================================================================
   ≤900px  – mobile menu + stacked layouts
   ========================================================================== */
@media (max-width: 900px) {

  /* NAV */
  nav#site-navigation { padding: 0 20px; }
  .nav-inner { height: 64px; gap: 16px; }
  .nav-logo img.logo { max-height: 52px !important; max-width: 120px !important; }

  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center;
    gap: 5px; width: 44px; height: 44px; margin-right: -8px; padding: 0;
    background: transparent; border: 0; cursor: pointer; color: var(--ink);
    -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle-bar {
    display: block; width: 24px; height: 2px; background: currentColor; border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
  }
  .is-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-menu-wrap {
    display: block;
    position: fixed; left: 0; right: 0; top: 64px; bottom: 0;
    background: var(--ground);
    border-top: 1px solid var(--rule);
    padding: 8px 24px 32px;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 99;
  }
  .admin-bar .nav-menu-wrap { top: 110px; }
  .is-open .nav-menu-wrap { opacity: 1; visibility: visible; transform: none; }
  html.yf-menu-open, html.yf-menu-open body { overflow: hidden; }

  /* override the old "display:none" + page-level rules */
  .nav-menu-wrap .nav-links {
    display: flex !important; position: static !important;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0 !important; border: 0 !important; background: transparent !important;
  }
  .nav-menu-wrap .nav-links > li { border-bottom: 1px solid var(--rule); border-top: 0 !important; }
  .nav-menu-wrap .nav-links > li > a {
    display: flex !important; align-items: center; justify-content: space-between;
    height: auto !important; padding: 16px 0 !important;
    font-size: 17px !important; color: var(--ink);
  }
  .nav-menu-wrap .nav-links .sub-menu {
    position: static; display: none; min-width: 0;
    opacity: 1; visibility: visible; transform: none;
    border: 0; box-shadow: none; background: transparent;
    padding: 0 0 12px 14px; margin: 0;
  }
  .nav-menu-wrap .nav-links li.open > .sub-menu { display: block; }
  .nav-menu-wrap .nav-links .sub-menu a {
    padding: 10px 0; font-size: 15px; white-space: normal; color: var(--ink-mid);
  }
  .nav-menu-wrap .nav-links .sub-menu a:hover { padding-left: 4px; background: none; }
  .nav-menu-wrap .nav-links .menu-item-has-children > a::after { width: 7px; height: 7px; }

  .nav-menu-wrap .nav-cta {
    display: block; text-align: center; margin-top: 24px;
    padding: 16px 20px; font-size: 13px;
  }

  /* HOME HERO */
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-left { max-width: 100%; justify-self: stretch; padding: 48px 24px 40px; }
  .hero-sub { max-width: none; margin-bottom: 36px; }
  .cta-group { margin-bottom: 44px; }
  .hero-proof { flex-wrap: wrap; gap: 24px 32px; }
  .proof-label { max-width: 140px; }

  .hero-right {
    min-height: 0; height: auto;
    background-image: var(--hero-bg-mobile, var(--hero-bg));
    background-size: 100% auto;
    background-position: center top;
    /* the photo is 1000×652 → keep the quote below it, never on top of the face */
    padding: calc(65.2vw + 8px) 24px 48px;
    display: block;
  }
  .hero-vertical-text { display: none; }
  .hero-quote { max-width: 560px; }

  /* TRUST BAR */
  .trust-bar { padding: 28px 24px; }
  .trust-bar-inner { gap: 20px 32px; }
  .trust-label { white-space: normal; }
  .trust-logos { gap: 16px 32px; flex: 1 1 100%; }
  .trust-lang { margin-left: 0; }

  /* SECTIONS */
  .problem, .about, .services, .process, .outcomes, .testimonials, .faq, .final-cta {
    padding-left: 24px; padding-right: 24px;
  }
  .about-image-frame { max-height: none; aspect-ratio: 4 / 5; max-width: 480px; }
  .about-image { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
  .about-image-col { max-width: 480px; }
  .about-caption { right: 0; bottom: -20px; }
  .about-content { padding-top: 12px; }
  .outcomes-grid { grid-template-columns: 1fr 1fr; }
  .case-study { padding: 32px 28px; }
  .case-link { white-space: normal; }
  .testimonial-card, .outcome-card { padding: 36px 28px; }
  .service-card { padding: 36px 28px; }

  /* FOOTER */
  footer { padding: 56px 24px 32px; }
  .footer-legal { flex-wrap: wrap; gap: 12px 20px; list-style: none; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  /* INNER PAGES – shared patterns */
  .page-hero { padding-left: 24px; padding-right: 24px; }
  .page-hero-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  [style*="grid-template-columns:1fr 2fr"],
  [style*="grid-template-columns: 1fr 2fr"] { grid-template-columns: 1fr !important; gap: 40px !important; }
}

/* ==========================================================================
   ≤600px  – phones
   ========================================================================== */
@media (max-width: 600px) {
  body { font-size: 16px; }

  .hero-left { padding: 40px 20px 36px; }
  .hero-headline { font-size: clamp(36px, 10.5vw, 46px); margin-bottom: 22px; }
  .hero-sub { font-size: 16px; }
  .cta-group { flex-direction: column; align-items: stretch; gap: 18px; }
  .cta-group .btn-primary { text-align: center; padding: 16px 20px; }
  .cta-group .btn-secondary { justify-content: center; }
  .proof-number { font-size: 30px; }
  .hero-proof { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-label { max-width: none; }

  .hero-right { padding: calc(65.2vw + 4px) 20px 40px; }
  .hero-quote { font-size: 26px; }

  .problem, .about, .services, .process, .outcomes, .testimonials, .faq, .final-cta {
    padding: 64px 20px;
  }
  .problem-label, .about-headline, .services-headline, .process-headline,
  .outcomes-headline, .testimonials-headline { font-size: clamp(30px, 8.6vw, 38px); }
  .faq-headline { font-size: clamp(30px, 8.6vw, 36px); }
  .final-cta-headline { font-size: clamp(34px, 9.5vw, 44px); }
  .problem-list li { padding: 22px 0; gap: 14px; grid-template-columns: 14px 1fr; }
  .problem-text { font-size: 19px; }
  .problem-close { margin-top: 40px; padding-top: 32px; font-size: 26px; }

  .about-inner { gap: 56px; }
  .about-caption { right: 12px; bottom: -24px; width: 160px; padding: 18px 20px; }
  .about-caption-num { font-size: 34px; }

  .services-header { margin-bottom: 40px; }
  .service-card, .testimonial-card, .outcome-card { padding: 30px 22px; }
  .outcomes-grid { grid-template-columns: 1fr; margin-bottom: 48px; }
  .outcomes-header, .process-header { margin-bottom: 44px; }
  .case-study { padding: 28px 22px; }
  .process-steps { gap: 40px; }

  .faq-q { padding: 22px 0; }
  .faq-q-text { font-size: 18px; }

  .final-cta-group { flex-direction: column; align-items: stretch; }
  .final-cta-group a { width: 100%; text-align: center; padding-left: 20px; padding-right: 20px; }
  .final-cta-sub { font-size: 16px; margin-bottom: 36px; }

  footer { padding: 48px 20px 28px; }

  /* inner pages */
  .page-hero { padding-left: 20px; padding-right: 20px; }
  .page-title { font-size: clamp(34px, 10vw, 44px) !important; }
}

@media (max-width: 380px) {
  .hero-proof { grid-template-columns: 1fr; }
  .hero-headline { font-size: 34px; }
  .nav-logo img.logo { max-width: 104px !important; }
}

/* Sticky header: the <nav> was sticky inside a header of the same height, so it never stuck */
#masthead.site-header { position: sticky; top: 0; z-index: 100; }
.admin-bar #masthead.site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar #masthead.site-header { top: 46px; } }

/* Legal pages (privacy / cookies / terms) + results logo wall */
.legal-layout > *, .logo-wall > *, .grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr !important; gap: 36px !important; }
  .legal-rail { position: static !important; }
}
@media (max-width: 600px) {
  /* wide tables scroll sideways inside their own box instead of stretching the page */
  .legal-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .legal-table th, .legal-table td { min-width: 120px; }
  .logo-slot { padding: 12px; }
}

/* "What this engagement includes" lists (service pages).
   The <li> was a 2-column grid, so the bold label and the following text became
   separate cells and the text fell into the 16px bullet column. Fixed for all sizes. */
.deliv-list li { display: block !important; position: relative; padding-left: 50px !important; }
.deliv-list li::before { position: absolute; left: 28px; top: 16px; margin-top: 10px !important; }
@media (max-width: 600px) {
  .deliv-list li { padding: 14px 18px 14px 38px !important; }
  .deliv-list li::before { left: 18px; top: 14px; }
  .deliv-head { padding: 16px 18px !important; }
}

/* Inline-styled 2-column grids on service + contact pages must stack on mobile */
@media (max-width: 900px) {
  .sec-inner[style*="grid-template-columns:4fr 6fr"],
  .sec-inner[style*="grid-template-columns:1fr 2fr"] {
    grid-template-columns: 1fr !important; gap: 36px !important;
  }
  .sec-inner > * { min-width: 0; }
}

/* Before / After comparison (service pages): when stacked, label every cell */
@media (max-width: 700px) {
  .shift .shift-head { display: none; }
  .shift .shift-cell::before {
    content: 'Before'; display: block; margin-bottom: 6px;
    font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--ink-soft);
  }
  .shift .shift-cell.after::before { content: 'After'; color: var(--accent-warm); }
  .shift .shift-cell:not(.after) { margin-top: 10px; }
  .shift .shift-cell:first-of-type { margin-top: 0; }
}

/* Hero text column was wider than its grid cell between ~900–1250px and got cut off on the left */
.hero-left { width: 100%; box-sizing: border-box; }
@media (min-width: 901px) and (max-width: 1200px) {
  .hero-left { padding-left: 40px; padding-right: 40px; }
  .hero-headline { font-size: clamp(42px, 5vw, 60px); }
}
