/* Responsive fixes for phones and tablets. Loaded last on every page so it overrides the page stylesheets.
   Main cause fixed here: grid/flex children kept their content width ("1fr" = minmax(auto, 1fr), nowrap labels)
   and pushed sections wider than the screen, where they were clipped or made the page scroll sideways. */

/* ---------- global safety nets ---------- */
img, video, iframe, svg, canvas { max-width: 100%; }
table { max-width: 100%; }

/* ---------- home: franchise network block (map + text were clipped below ~375px) ---------- */
.franchise > *, .franchise .tx > *, .franchise .map > * { min-width: 0; }
.franchise .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mapbox { max-width: 100%; }

/* ---------- support: tab list was 441px wide on every phone ---------- */
.tabs-layout > * { min-width: 0; }
.tab-list > * { min-width: 0; }
.tab-list button { white-space: normal; overflow-wrap: anywhere; }

/* ---------- stats strip (about, franchise, life at trackon) clipped at 320px ---------- */
.fr-stat-row > *, .fr-stat > * { min-width: 0; }

/* ---------- locate us: panel + map clipped at 320-344px ---------- */
.loc > *, .loc-side > * { min-width: 0; }

/* ---------- common grids: never let a column grow past the screen ---------- */
.split > *, .card-grid > *, .sub-grid > *, .timeline > *, .vm-row > *, .net-in > *, .lead-box > *,
.help-grid > *, .contact-strip > *, .doc-grid > *, .xb-top > *, .xb-caps > *, .xb-outs > *, .ld-grid > *, .ld-ceo > * { min-width: 0; }

/* ---------- image + text "split" sections: stack on tablets and phones ----------
   pages.css has a later, un-scoped `.split { grid-template-columns: minmax(0,1fr) minmax(0,1fr) }` that cancelled
   its own <=1100px one-column rule, so every split section stayed two-column and squeezed its text on phones. */
@media (max-width: 1100px) {
  .split, .split.rev { grid-template-columns: minmax(0, 1fr); }
  .split.rev > :first-child { order: 0; }
  .lt-collage { max-width: 640px; }
}

/* ---------- inner-page heroes: pages.css sets `.pg-hero > .wrap { width: 100% }`, which removed the side
   margin below 961px, so hero headlines and buttons touched the screen edge on tablets and phones ---------- */
@media (max-width: 960px) {
  .pg-hero > .wrap { width: min(var(--wrap), 100% - 48px); }
}
@media (max-width: 600px) {
  .pg-hero > .wrap { width: calc(100% - 32px); }
}

/* ---------- tables: scroll sideways on phones instead of cutting off columns ---------- */
@media (max-width: 700px) {
  main table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---------- tablet portrait: leadership section used phone sizing (huge photos) ---------- */
@media (min-width: 601px) and (max-width: 820px) {
  .ld-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ld-ceo { grid-template-columns: minmax(0, 270px) minmax(0, 1fr); }
  .ld-ceo-img { aspect-ratio: 4 / 4.8; }
}

/* ---------- tablet landscape: 4 sub-service cards were squeezed to 230px ---------- */
@media (min-width: 1001px) and (max-width: 1180px) {
  .sub-grid.sub-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- phones ---------- */
@media (max-width: 600px) {
  /* buttons: long labels wrap instead of running off screen (life at trackon hero) */
  .pg-actions .btn, .cta-band .btn, .loc-hero-act .btn { max-width: 100%; white-space: normal; text-align: center; justify-content: center; }
  .pg-hero .pg-actions .btn { flex: 1 1 auto; }

  /* stats strip: two even columns, labels may wrap */
  .fr-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fr-stat small { white-space: normal; }
  .fr-stat b { font-size: 20px; }

  /* home franchise stats: keep three columns, let labels wrap */
  .franchise .stat-row { gap: 8px; }
  .franchise .stat-row > * { padding-left: 10px; padding-right: 10px; }
  .franchise .stat-row small, .franchise .stat-row span { white-space: normal; overflow-wrap: anywhere; }

  /* readability: nothing below 11.5px */
  .jc-steps li { font-size: 11px; }
  .jc-tag, .post-tag, .ph .tag, .ld-role { font-size: 12px; }
  .mapbox .hub, .hub { font-size: 11px; }

  /* tap targets: slider dots get a larger invisible hit area */
  .dots button { position: relative; }
  .dots button::after { content: ""; position: absolute; inset: -12px -6px; }
  .loc-prompt-x { min-width: 40px; min-height: 40px; }
}

/* ---------- phones: buttons never wider than the screen ---------- */
@media (max-width: 600px) {
  main .btn { max-width: 100%; white-space: normal; text-align: center; }
  .side-tabs > * { min-width: 0; }
}

/* ---------- very small phones (320-360px) ---------- */
@media (max-width: 360px) {
  .side-tabs button { font-size: 13px; padding-left: 4px; padding-right: 4px; white-space: normal; line-height: 1.2; }
  .fr-stat { column-gap: 8px; padding-left: 8px; padding-right: 2px; }
  .fr-stat-ic { width: 32px; height: 32px; }
  .franchise .stat-row { grid-template-columns: 1fr; }
}

/* ---------- About: Trackon x XpressBees merge card was too big (logos 360px wide, 84px year badge) ---------- */
.xb-merge .xb-node { width: min(400px, 100%); padding: 32px 44px; }
.xb-merge .xb-logo, .xb-merge .xb-b .xb-logo { width: 100%; max-width: 230px; }
.xb-merge .xb-join span { width: 64px; height: 64px; font-size: 17px; }
.xb-merge .xb-join { margin: 10px 0; }
@media (max-width: 600px) {
  .xb-merge .xb-node { padding: 24px 30px; }
  .xb-merge .xb-logo, .xb-merge .xb-b .xb-logo { max-width: 190px; }
  .xb-merge .xb-join span { width: 56px; height: 56px; font-size: 15px; }
}

/* ---------- readable small labels on phones and tablets (audit 17 Oct: 11px and 10px text) ---------- */
@media (max-width: 1100px) { .jc-steps li { font-size: 12px; } }
@media (max-width: 600px) {
  .net-map .hub { font-size: 11.5px; }
  .svc-panel .ph .tag { font-size: 12px; }
}

/* ---------- All photo heroes use the Prime Track shade: maroon behind the text, photo left natural on the right ---------- */
.banner::before, .pg-hero.has-photo::before, .hhero-shade {
  background: linear-gradient(90deg, rgba(122, 20, 24, .92) 0%, rgba(122, 20, 24, .8) 30%, rgba(122, 20, 24, .4) 48%, rgba(122, 20, 24, .08) 62%, rgba(122, 20, 24, 0) 70%);
}
.banner h1, .banner .lede, .pg-hero.has-photo h1, .pg-hero.has-photo p, .hhero-copy h1, .hhero-copy p { text-shadow: 0 2px 12px rgba(74, 12, 14, .5); }
@media (max-width: 1100px) {
  .banner::before, .pg-hero.has-photo::before, .hhero-shade {
    background: linear-gradient(90deg, rgba(122, 20, 24, .93) 0%, rgba(122, 20, 24, .82) 45%, rgba(122, 20, 24, .5) 70%, rgba(122, 20, 24, .3) 100%);
  }
}
@media (max-width: 600px) {
  .banner::before, .pg-hero.has-photo::before, .hhero-shade {
    background: linear-gradient(180deg, rgba(122, 20, 24, .45) 0%, rgba(122, 20, 24, .78) 55%, rgba(122, 20, 24, .9) 100%);
  }
}
/* wider headlines (About, Careers, Contact... and the home slider): same shade, fade starts later so the text stays on maroon */
@media (min-width: 1101px) {
  .pg-hero.has-photo::before, .hhero-shade {
    background: linear-gradient(90deg, rgba(122, 20, 24, .92) 0%, rgba(122, 20, 24, .82) 44%, rgba(122, 20, 24, .45) 62%, rgba(122, 20, 24, .1) 76%, rgba(122, 20, 24, 0) 84%);
  }
}

/* ---------- About: XpressBees story = three paragraphs of equal weight (no lead size, no icon box) ---------- */
.xb-copy p { font-size: 17px; line-height: 1.75; font-weight: 400; color: rgba(255, 255, 255, .86); margin: 0 0 16px; }
.xb-copy p:last-child { margin-bottom: 0; }
.xb-copy p b, .xb-copy p b.k { color: #fff; font-weight: 600; background: none; padding: 0; }
@media (max-width: 600px) { .xb-copy p { font-size: 16px; line-height: 1.7; } }
.xb-top .xb-copy p { margin: 0 0 18px; }
.xb-top .xb-copy p:last-child { margin-bottom: 0; }
.xb-top .xb-copy mark { background: none; color: #FFB36B; font-weight: 700; padding: 0; }
/* About band: no divider line above the audience chips; paragraph spacing beats xb-group.css */
.xb-sec .xb-for { border-top: 0; padding-top: 0; margin-top: 22px; }
.xb-sec .xb-top .xb-copy > p { margin: 0 0 18px; }
.xb-sec .xb-top .xb-copy > p:last-child { margin-bottom: 0; }
/* About band: no gradient strip on the left edge */
.xb-band::before { content: none; }

/* ---------- Hero photos never crop heads: anchor every hero photo to its TOP edge, so when the hero box is
   wider/shorter than the photo the extra is trimmed from the bottom (floor, boxes) only. Horizontal framing unchanged. ---------- */
.banner-bg, .pg-hero .pg-bg { background-position-y: top !important; animation: none !important; transform: none !important; }
.hhero .slide:not(.fest) img { object-position: 70% top !important; }
@media (max-width: 1100px) { .hhero .slide:not(.fest) img { object-position: 75% top !important; } }
@media (max-width: 767px) { .hhero .slide:not(.fest) img { object-position: 72% top !important; } }

/* ---------- Life at Trackon hero: group photo, phone crop centred on the group ---------- */
@media (max-width: 600px) {
  .pg-hero .pg-bg.lt-hero-bg { background-image: url('/assets/img/pages/life-at-trackon-hero-mobile.webp?v=1') !important; background-position: center !important; }
}

/* ---------- Life at Trackon hero: photo-first. heading only; maroon fade on the left behind it, group in natural colour ---------- */
.pg-hero.has-photo.lt-hero::before { background: linear-gradient(90deg, rgba(122, 20, 24, .82) 0%, rgba(122, 20, 24, .6) 22%, rgba(122, 20, 24, .22) 40%, rgba(122, 20, 24, 0) 55%) !important; }
@media (max-width: 600px) { .pg-hero.has-photo.lt-hero::before { background: linear-gradient(180deg, rgba(122, 20, 24, .25) 0%, rgba(122, 20, 24, .55) 50%, rgba(122, 20, 24, .25) 100%) !important; } }
.pg-hero.lt-hero::after { content: none; }
.pg-hero.lt-hero h1 { text-shadow: 0 2px 16px rgba(74, 12, 14, .55); }

/* ---------- Life at Trackon values: the 5 tabs share the full height of the photo panel (top and bottom edges line up) ---------- */
@media (min-width: 901px) {
  .lt-values { align-items: stretch; }
  .lt-vtabs { grid-auto-rows: 1fr; align-content: stretch; }
  .lt-vtabs > button { height: 100%; }
}
/* Life at Trackon: heading keeps the position it had when the intro text + buttons sat under it (that block was centred as a whole) */
.pg-hero.lt-hero .wrap { padding-bottom: 192px; }
@media (max-width: 600px) { .pg-hero.lt-hero .wrap { padding-bottom: 420px; } }

/* ---------- About: CEO photo is landscape with him at ~46% across; centre the crop on him so both arms stay in the portrait frame ---------- */
.ld-ceo-img img { object-position: 46% center; }

/* ---------- About: CEO photo is exactly as tall as the text beside it (desktop/tablet); stacked layout on phones unchanged ---------- */
@media (min-width: 821px) {
  .ld-ceo { align-items: stretch; }
  .ld-ceo-img { aspect-ratio: auto; height: 100%; min-height: 300px; }
}

/* ---------- Franchise 'Run your own counter': the Partner With Trackon graphic (4:5, has text) is shown whole at every size ---------- */
.fr-who-img { aspect-ratio: 1 / 1; min-height: 0 !important; align-self: center; }
.fr-who-img img { object-fit: cover; object-position: center; }
@media (max-width: 1100px) { .fr-who-img { aspect-ratio: 1 / 1 !important; max-width: 480px; margin-inline: auto; } }

/* ---------- Customer Service hero: phone crop keeps the Trackon courier in view ---------- */
@media (max-width: 600px) {
  .pg-hero .pg-bg.cs-hero-bg { background-image: url("/assets/img/pages/customer-service-phone.webp?v=1") !important; background-position: center center !important; }
}

/* ---------- About Us hero: phone crop keeps the Trackon truck and courier in view ---------- */
@media (max-width: 600px) {
  .pg-hero .pg-bg.ab-hero-bg { background-image: url("/assets/img/pages/about-us-mobile.webp?v=1") !important; background-position: center top !important; }
}

/* ---------- FAQs hero: phone crop keeps the Trackon courier in view ---------- */
@media (max-width: 600px) {
  .pg-hero .pg-bg.fq-hero-bg { background-image: url("/assets/img/pages/faqs-mobile.webp?v=1") !important; background-position: center top !important; }
}

/* ---------- Careers hero: phone crop keeps both people and the Trackon truck in view ---------- */
@media (max-width: 600px) {
  .pg-hero .pg-bg.cr-hero-bg { background-image: url("/assets/img/pages/careers-mobile.webp?v=1") !important; background-position: center top !important; }
}

/* ---------- Service photo heroes: keep the heading clear of the vehicle on every desktop width.
   Heading width tracks where the content column starts; photo anchors left so the subject sits further right. ---------- */
@media (min-width: 1101px) {
  .banner.banner-photo h1 { font-size: clamp(30px, 2.5vw, 46px); max-width: min(720px, 38vw, calc(687px - 6.5vw)); }
  .banner.banner-photo .banner-bg.bg-fit { background-position-x: 0% !important; }
}

/* ---------- News & Media hero: phone crop keeps the spokesperson and microphones in view ---------- */
@media (max-width: 600px) {
  .pg-hero .pg-bg.nw-hero-bg { background-image: url("/assets/img/pages/news-mobile.webp?v=1") !important; background-position: center top !important; }
}

/* ---------- Service photo heroes: let the orange heading line wrap inside its column so it never runs over the subject ---------- */
@media (min-width: 1101px) {
  .banner.banner-photo h1 .hl { white-space: normal; }
}
@media (min-width: 1101px) {
  .banner.banner-photo .lede { max-width: min(580px, calc(43vw - 40px)); }
}

/* 2026-10-29 client feedback: every page banner uses the lighter shade of the home slider
   (maroon behind the text, photo clear from the middle). Life at Trackon and Gallery (.lt-hero) keep theirs. */
@media (min-width: 1101px) {
  .banner.banner-photo::before, .banner.fr-banner::before, .pg-hero.has-photo:not(.lt-hero)::before {
    background: linear-gradient(90deg, rgba(122, 20, 24, .78) 0%, rgba(122, 20, 24, .62) 36%, rgba(122, 20, 24, .25) 56%, rgba(122, 20, 24, 0) 72%) !important;
  }
}
@media (min-width: 769px) and (max-width: 1100px) {
  .banner.banner-photo::before, .banner.fr-banner::before, .pg-hero.has-photo:not(.lt-hero)::before {
    background: linear-gradient(90deg, rgba(122, 20, 24, .82) 0%, rgba(122, 20, 24, .66) 42%, rgba(122, 20, 24, .3) 66%, rgba(122, 20, 24, .1) 100%) !important;
  }
}
