/**
 * Site-wide mobile polish: readability, padding, touch feedback, heroes.
 */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hyphens: manual;
}

body {
  overflow-x: clip;
  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
}

/* Wrap at spaces only — never hyphenate or split words like "mar-keting" */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
li,
blockquote,
.section-title,
.section-kicker,
.hero-title,
.hero-lede,
.services-title,
.contact-title,
.why-work-title,
.home-case-studies-title,
.what-i-do-title,
.what-i-do-step-headline,
.what-i-do-step-text,
.step-title,
.step-text,
.diagnostic-title,
.quiz-headline,
.quiz-sub,
.cs-title,
.tagline,
.footer-tagline,
.who-industry-label {
  hyphens: none;
  -webkit-hyphens: none;
  -ms-hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
}

/* Who we help — match Why Galfer card title size on mobile (16px at ≤768px) */
@media (max-width: 768px) {
  .who-industry-label {
    font-size: 16px;
    line-height: 1.35;
  }
}

/* Industries — two columns on mobile/tablet (desktop stays 5-up) */
@media (max-width: 960px) {
  .who-industries-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Only break unbreakable strings (URLs, long emails) */
a[href^="http"],
a[href^="mailto:"],
.break-all {
  overflow-wrap: anywhere;
  word-break: break-all;
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

.page,
.page main {
  max-width: 100%;
}

/* Match nav side rails — more breathing room than 1.5rem on phones */
@media (max-width: 768px) {
  .page .container,
  .what-i-do > .container,
  .hero .container {
    padding-left: clamp(1.35rem, 5.5vw, 1.85rem);
    padding-right: clamp(1.35rem, 5.5vw, 1.85rem);
  }
  .why-work-title {
    white-space: normal;
  }

  .hero-title-line--cycle {
    max-width: 100%;
  }

  .hero-cycling-wrap {
    min-width: 0;
    max-width: 100%;
    display: block;
  }

  .hero-cycling-text {
    white-space: normal;
    overflow-wrap: normal;
  }

  .hero-lede {
    font-size: clamp(1.05rem, 4.2vw, 1.2rem);
    line-height: 1.65;
    max-width: 100%;
  }

  .hero-actions {
    flex-wrap: wrap;
    gap: 0.85rem 1rem;
  }

  .hero-text-cta {
    font-size: 0.95rem;
  }

  /* Inner-page heroes — keep nav clearance on mobile (match Services) */
  .services-hero,
  .about-hero,
  .contact-hero,
  .cs-hero {
    min-height: auto;
    padding-top: clamp(4.75rem, 12vw, 6.2rem);
    padding-bottom: clamp(2.25rem, 5vw, 3.5rem);
  }

  .page.page--case-study .hero {
    padding-top: clamp(4.75rem, 12vw, 6.2rem);
  }

  .case-study-fold .hero {
    padding-left: clamp(1.35rem, 5.5vw, 1.85rem);
    padding-right: clamp(1.35rem, 5.5vw, 1.85rem);
    padding-bottom: 0.65rem;
  }

  .services-text,
  .contact-subtitle {
    font-size: 1rem;
    line-height: 1.7;
  }

  .what-i-do-pills {
    justify-content: center;
  }

  .what-i-do-pill {
    font-size: 0.8rem;
  }

  .diagnostic-card {
    padding: 1.25rem 0.5rem;
  }

  .diagnostic-card #quiz-container {
    padding: 0.5rem 0 1rem;
  }

  .quiz-actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.65rem;
  }

  .quiz-actions-right {
    width: 100%;
    flex-direction: column;
    gap: 0.55rem;
  }

  .quiz-actions .btn,
  .quiz-actions button {
    width: 100%;
    justify-content: center;
  }

  .quiz-actions-spacer {
    display: none;
  }

  .quiz-problem {
    padding: 0.9rem 0.85rem;
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .cs-filters {
    justify-content: center;
    gap: 0.5rem;
  }

  .chip {
    font-size: 0.75rem;
    padding: 0.45rem 0.75rem;
    line-height: 1.35;
  }

  .page--case-study .hero-sub,
  .case-study-fold .hero .hero-sub {
    max-width: none;
  }

  .stats-bar .stats-inner {
    gap: 0.75rem 1rem;
  }

  .page--case-study .stats-bar {
    margin-top: 0.55rem !important;
    padding: 0.85rem 0 !important;
  }

  .page--case-study .stats-strip-inner {
    padding: 0 0.65rem !important;
  }

  /* Top bar: 4 columns — label on top, value below (per column) */
  .page--case-study .stats-bar .stats-inner {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.4rem 0.3rem !important;
    padding: 0.55rem 0 0.7rem !important;
    margin: 0 !important;
  }

  .page--case-study .stats-bar .stat {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.2rem !important;
    min-width: 0 !important;
    text-align: center !important;
  }

  .page--case-study .stats-bar .stat-label {
    order: 1 !important;
    min-height: 2.4em !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    width: 100% !important;
    text-align: center !important;
    margin: 0 !important;
    font-size: 0.58rem !important;
    line-height: 1.3 !important;
    letter-spacing: 0.08em !important;
  }

  .page--case-study .stats-bar .stat-num {
    order: 2 !important;
    text-align: center !important;
    margin: 0 !important;
    font-size: clamp(1.05rem, 4.2vw, 1.45rem) !important;
    line-height: 1.1 !important;
  }

  .page--case-study .stats-bar .stat-change {
    order: 3 !important;
    margin: 0 !important;
    font-size: 0.58rem !important;
    line-height: 1.25 !important;
  }

  /* Bottom bar: 5 columns — purple label on top, white value below */
  .page--case-study .meta-row {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 0.4rem 0.3rem !important;
    align-items: start !important;
    padding: 0.7rem 0 0.55rem !important;
    margin-top: 0 !important;
  }

  .page--case-study .meta-row:has(.meta-item:nth-child(4):last-child) {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .page--case-study .meta-row:has(.meta-item:nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .page--case-study .meta-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.25rem !important;
    min-width: 0 !important;
    text-align: center !important;
  }

  .page--case-study .meta-label {
    order: 1 !important;
    min-height: 2.75em !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    width: 100% !important;
    text-align: center !important;
    font-size: 0.52rem !important;
    letter-spacing: 0.1em !important;
    line-height: 1.25 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 0.1rem !important;
  }

  .page--case-study .meta-val {
    order: 2 !important;
    width: 100% !important;
    text-align: center !important;
    font-size: 0.68rem !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 0.1rem !important;
  }

  .stat-num {
    font-size: clamp(1.35rem, 5vw, 1.85rem);
  }

  .home-case-card--featured {
    padding: 1.5rem 1.25rem;
  }

  .home-case-card--restaurant,
  .home-case-card--chiro,
  .home-case-card--web {
    padding: 1.25rem;
  }

  .home-case-studies-all {
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .page:not(.page--case-study) {
    padding-top: 76px;
  }

  .gc-shared-logo-img {
    height: 42px;
  }

  .gc-shared-mobile-menu .gc-shared-cta {
    white-space: normal !important;
    line-height: 1.35 !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.8rem !important;
  }

}
