/* ==========================================================================
   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; }
/* Header logo (wide version, readable at header size) */
.nav-inner { height: 84px; }
.nav-logo img.logo-header { height: 58px; width: auto; max-width: none; }

/* ── 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; }

/* ==========================================================================
   Laptop widths – fit logo + 9 menu items + CTA on one line
   ========================================================================== */
@media (min-width: 1200px) {
  .nav-links { gap: 24px; }
  .nav-inner { gap: 32px; }
  .nav-cta { padding: 11px 18px; }
}
@media (min-width: 1200px) and (max-width: 1365px) {
  .nav-links { gap: 18px; }
  .nav-inner { gap: 24px; }
  .nav-cta { padding: 10px 14px; font-size: 11px; }
  .nav-logo img.logo-header { height: 46px; }
}
@media (min-width: 1200px) { .nav-links > li > a { white-space: nowrap; } }
@media (min-width: 1366px) {
  .nav-links { gap: 22px; }
  .nav-inner { gap: 28px; }
  .nav-logo img.logo-header { height: 56px; }
}

/* ==========================================================================
   ≤1199px  – menu button (9 menu items don't fit beside a readable logo)
   ========================================================================== */
@media (max-width: 1199px) {
  /* NAV */
  nav#site-navigation { padding: 0 20px; }
  .nav-inner { height: 72px; gap: 16px; }
  .nav-logo img.logo-header { height: 54px; }

  .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: 72px; 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);
    z-index: 99;
  }
  .admin-bar .nav-menu-wrap { top: 118px; }
  .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;
  }

}

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

  /* 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 + 24px) 24px 48px;
    display: block;
  }
  .hero-vertical-text { display: none; }
  .hero-quote { max-width: 560px; }

  /* TRUST BAR – stacked: label, names in an even 2-column grid, languages below a divider */
  .trust-bar { padding: 36px 24px; }
  .trust-bar-inner { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
  .trust-label { white-space: normal; }
  .trust-logos {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px; align-items: center;
  }
  .trust-logo-item { font-size: 16px; line-height: 1.25; letter-spacing: 0.03em; }
  .trust-lang {
    margin-left: 0; justify-content: flex-start;
    padding-top: 20px; border-top: 1px solid var(--rule);
  }

  /* 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 + 20px) 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-header { height: 48px; }
}

/* 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); }
}


/* ── "Trusted by" bar: darker, more legible client names + aligned layout ── */
.trust-logo-item { color: var(--ink-mid); font-weight: 600; opacity: 0.85; }
.trust-label { color: var(--ink-mid); }
.trust-lang .lang-badge { color: var(--ink-mid); border-color: #BDB6A8; }
@media (min-width: 901px) {
  .trust-bar-inner { flex-wrap: nowrap; }
  .trust-logos { justify-content: space-between; gap: 24px 40px; }
  .trust-lang { flex-wrap: nowrap; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .trust-bar-inner { flex-wrap: wrap; }
  .trust-logos { flex: 1 1 60%; }
}


/* Menu panel animation only after the page is ready (prevents a brief flash of the menu on load) */
html.yf-nav-ready .nav-menu-wrap { transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s; }

/* ==========================================================================
   "Service" page (built in Elementor) – phone/tablet corrections.
   Its big headings use a line-height of 1.08px (should be 1.08), are sized for
   desktop (50–80px) and are indented 50–80px, so on phones they pile on top of
   each other. Elements are targeted by their Elementor IDs.
   ========================================================================== */
@media (max-width: 1024px) {
  .elementor h1.elementor-heading-title { line-height: 1.08 !important; }
}
@media (max-width: 767px) {
  /* remove desktop indents */
  .elementor-element-e0be8f0, .elementor-element-e80c6ab, .elementor-element-324a7e3,
  .elementor-element-bd91976, .elementor-element-89a70f3, .elementor-element-058879f,
  .elementor-element-94e8cae, .elementor-element-df08673 { padding-left: 0 !important; }
  .elementor-element-350f379, .elementor-element-ba76fd2 { padding-right: 0 !important; }

  /* hero heading: "Four commercial / problems. / One method." reads as one block */
  .elementor-element-324a7e3, .elementor-element-bd91976, .elementor-element-89a70f3 {
    margin-top: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important;
  }
  .elementor-element-324a7e3 { margin-top: 12px !important; }
  .elementor-element-89a70f3 { padding-bottom: 32px !important; }
  .elementor-element-324a7e3 .elementor-heading-title,
  .elementor-element-bd91976 .elementor-heading-title,
  .elementor-element-89a70f3 .elementor-heading-title { font-size: clamp(40px, 12vw, 52px) !important; }

  .elementor-element-94e8cae .elementor-heading-title { font-size: clamp(32px, 9.5vw, 40px) !important; }
  .elementor-element-94e8cae { margin-top: 0 !important; padding-bottom: 12px !important; }

  /* section headings 50–60px -> phone size */
  .elementor-element-04065f2 .elementor-heading-title, .elementor-element-df08673 .elementor-heading-title,
  .elementor-element-9fdd74c .elementor-heading-title, .elementor-element-6e2134b .elementor-heading-title,
  .elementor-element-0fef09f .elementor-heading-title, .elementor-element-d05b36a .elementor-heading-title {
    font-size: clamp(28px, 8.4vw, 36px) !important; line-height: 1.15 !important;
  }
  /* service names 38px -> 28px, big numbers 80px -> 56px */
  .elementor-element-7b5781e .elementor-heading-title, .elementor-element-3177761 .elementor-heading-title,
  .elementor-element-c5006b6 .elementor-heading-title, .elementor-element-45a5bca .elementor-heading-title,
  .elementor-element-fbb3f69 .elementor-heading-title, .elementor-element-d530f22 .elementor-heading-title,
  .elementor-element-48ec50a .elementor-heading-title { font-size: 28px !important; line-height: 1.15 !important; }
  .elementor-element-9bdde64 .elementor-heading-title, .elementor-element-b79b426 .elementor-heading-title,
  .elementor-element-e4a01ea .elementor-heading-title, .elementor-element-b35b2e0 .elementor-heading-title {
    font-size: 56px !important; line-height: 1 !important;
  }
}

/* "CONTENT REQUIRED FROM YOUFIRST" note boxes: visible only to logged-in users */
body:not(.logged-in) .placeholder { display: none !important; }
/* Founder background on About: shown as normal text, without the old note heading */
.founder-bio > h4:first-child { display: none; }
.founder-bio ul { margin: 12px 0 0 1.1em; padding: 0; }
.founder-bio li { margin: 4px 0; }

/* ==========================================================================
   Wider header logo (client request, Nov 2026) – overrides the sizes above.
   ========================================================================== */
.nav-logo img.logo-header { height: 72px; }
@media (min-width: 1200px) and (max-width: 1365px) {
  .nav-logo img.logo-header { height: 58px; }
}
@media (min-width: 1366px) {
  .nav-logo img.logo-header { height: 72px; }
}
@media (max-width: 1199px) {
  .nav-logo img.logo-header { height: 64px; }
}
@media (max-width: 420px) {
  .nav-logo img.logo-header { height: 62px; }
}
@media (max-width: 340px) {
  .nav-logo img.logo-header { height: 48px; }
}
