﻿/*
 * TTSL responsive overrides
 * Load this file AFTER assets/css/style.css on every page.
 * Desktop styles intentionally remain outside these breakpoints.
 */

@media (max-width: 991.98px) {
  .ttsl-header .navbar { padding-block: .75rem; }
  .ttsl-navbar .navbar-collapse {
    margin-top: .75rem;
    padding: .75rem;
    background: #fff;
    border-radius: .5rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .12);
  }
  .ttsl-navbar .nav-link { padding: .65rem .5rem; }
  .ttsl-navbar .nav-item + .nav-item { border-top: 1px solid rgba(0, 0, 0, .07); }

  .hero-banner { min-height: auto; }
  .hero-inner { padding-block: 5rem !important; }
  .section-pad { padding-block: 4rem; }
  .ttsl-footer { padding-top: 3.5rem; }
}

@media (max-width: 767.98px) {
  :root { --mobile-gutter: 1.125rem; }

  body { overflow-x: hidden; }
  .container { padding-inline: var(--mobile-gutter); }
  .row { --bs-gutter-x: 1.5rem; }

  /* Header and menu */
  .ttsl-header .navbar-brand img { max-height: 48px; width: auto; }
  .ttsl-navbar .navbar-toggler { padding: .4rem .55rem; }
  .ttsl-navbar .navbar-collapse { margin-inline: 0; }
  .ttsl-navbar .nav-link { font-size: .94rem; }

  /* Hero / internal banners */
  .hero-banner,
  .inner-banner,
  .page-banner { min-height: 0; background-position: center; }
  .hero-inner { padding-block: 4.5rem !important; }
  .hero-eyebrow,
  .section-eyebrow { font-size: .73rem; letter-spacing: .07em; }
  .hero-banner .display-6,
  .inner-banner h1,
  .page-banner h1 { font-size: clamp(2rem, 9vw, 2.75rem); line-height: 1.12; }
  .hero-banner .fs-4 { font-size: 1.05rem !important; line-height: 1.45; }
  .hero-banner .mb-4 { margin-bottom: 1.5rem !important; }
  .hero-banner .d-flex.gap-3 { gap: .75rem !important; }
  .hero-banner .btn { width: 100%; justify-content: center; }

  /* Fact/stat boxes */
  .stat-strip { margin-block: 0 !important; }
  .stat-strip .container { padding-inline: 0; }
  .stat-strip .row { --bs-gutter-x: 0; }
  .stat-item { min-height: 116px; padding: 1rem .65rem; text-align: center; }
  .stat-item .icon-circle { width: 2.5rem; height: 2.5rem; margin-inline: auto; font-size: 1.05rem; }
  .stat-text { margin-top: .55rem; font-size: .78rem; line-height: 1.3; }
  .stat-text strong,
  .stat-text .h3 { display: block; font-size: 1.25rem; }

  /* Shared section rhythm and text */
  .section-pad { padding-block: 3rem; }
  .section-title { font-size: clamp(1.65rem, 7.5vw, 2.15rem); line-height: 1.2; }
  .section-title + .title-bar { margin-block: .75rem 1.25rem; }
  .section-pad .row.g-5 { --bs-gutter-y: 2rem; }
  .text-justify { text-align: left !important; }
  p { line-height: 1.7; }

  /* Cards, grids and media */
  .ttsl-card,
  .service-card,
  .product-card { height: auto; }
  .service-card,
  .product-card { margin-bottom: .25rem; }
  .service-card .card-body,
  .product-card .card-body,
  .ttsl-card .card-body { padding: 1.25rem; }
  .client-logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .client-logo-grid > * { min-height: 82px; padding: .75rem; }
  .ind-icon { width: 50px; height: 50px; object-fit: contain; }
  img, svg, video, iframe { max-width: 100%; }
  iframe { width: 100%; }
  .img-card,
  .img-card img { min-height: 0; }

  /* Buttons and forms */
  .btn { min-height: 44px; padding: .68rem 1rem; }
  .form-control,
  .form-select { min-height: 46px; font-size: 16px; }
  textarea.form-control { min-height: 130px; }
  .contact-form .row { --bs-gutter-y: 1rem; }

  /* Footer */
  .ttsl-footer { padding-top: 3rem; }
  .ttsl-footer .row { --bs-gutter-y: 1.75rem; }
  .footer-logo { max-width: 175px; height: auto; }
  .footer-about { max-width: none; }
  .footer-links li + li { margin-top: .55rem; }
  .footer-bottom { margin-top: 2rem; padding-block: 1rem; text-align: center; }
  .footer-bottom .d-flex { justify-content: center !important; gap: .75rem !important; }
}

/* Homepage emergency override: load last to prevent a fixed image ratio from
   clipping the title/content on narrow screens. */
@media (max-width: 575.98px) {
  .home-page { padding-top: 0 !important; }
  .home-page .hero-banner.home-hero {
    aspect-ratio: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    background-size: cover !important;
    background-position: center !important;
  }
  .home-page .hero-banner.home-hero .hero-inner {
    min-height: 0 !important;
    padding: 3.5rem 0 3rem !important;
  }
  .home-page .hero-banner.home-hero h1,
  .home-page .home-hero h1 {
    font-size: 1.8rem !important;
    overflow-wrap: anywhere;
  }
  .home-page .hero-banner.home-hero {
    background-position: 82% center !important;
  }
  .home-page .hero-eyebrow {
    display: inline-flex !important;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 0 1rem !important;
    padding: .5rem .7rem !important;
    overflow-wrap: normal !important;
    color: #fff7d3 !important;
    background: rgba(53, 6, 8, .78) !important;
    border: 1px solid rgba(242, 183, 5, .85) !important;
    border-radius: .45rem !important;
    font-size: .68rem !important;
    line-height: 1.35 !important;
    text-shadow: none;
  }
  .home-page .hero-banner.home-hero .hero-inner {
    padding-top: 2.25rem !important;
  }
  .home-page .hero-banner.home-hero .hero-inner .hero-eyebrow {
    overflow: visible !important;
  }
  .home-page .stat-strip .col-6 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    width: 50% !important;
  }
  .home-page .stat-item {
    min-height: 122px !important;
    padding: .8rem .45rem !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: .45rem !important;
    text-align: center !important;
  }
  .home-page .stat-item .stat-text {
    width: 100% !important;
    font-size: .78rem !important;
    line-height: 1.25 !important;
  }
}

/* Products: remove Bootstrap column gutters inside the mobile fact grid. */
@media (max-width: 575.98px) {
  .products-fact-strip .row {
    --bs-gutter-x: 0 !important;
    --bs-gutter-y: 0 !important;
  }
  .products-fact-strip .row > [class*="col-"] {
    padding: 0 !important;
  }
  .products-fact-strip .fact-box { width: 100%; }
}

/* Careers: remove the mobile gutters between application-step fact cards. */
@media (max-width: 575.98px) {
  .careers-fact-strip .row {
    --bs-gutter-x: 0 !important;
    --bs-gutter-y: 0 !important;
  }
  .careers-fact-strip .row > [class*="col-"] {
    padding: 0 !important;
  }
  .careers-fact-strip .fact-box { width: 100%; }
}

/* Testing & Validation: five highlights need a deliberate 2 + 2 + 1 grid. */
@media (max-width: 575.98px) {
  .testing-validation-page main > .container[style*="margin-top"] > .bg-white > .row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px !important;
    width: 100%;
    margin: 0 !important;
    --bs-gutter-x: 0 !important;
    --bs-gutter-y: 0 !important;
  }
  .testing-validation-page main > .container[style*="margin-top"] > .bg-white {
    padding: 0 !important;
    overflow: hidden;
    border: 0 !important;
    border-radius: 14px !important;
  }
  .testing-validation-page:not(.home-page):not(.about-page) main > .container[style*="margin-top"] > .bg-white > .row > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .testing-validation-page main > .container[style*="margin-top"] > .bg-white > .row > [class*="col-"]:last-child {
    grid-column: 1 / -1;
  }
  .testing-validation-page main > .container[style*="margin-top"] .fact-box {
    width: 100%;
    min-height: 118px !important;
  }
}

/* Active Testing redesign trust strip: remove inherited column widths/gutters. */
@media (max-width: 575.98px) {
  .testing-validation-page .tv-trust-strip .row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px !important;
    margin: 0 !important;
    --bs-gutter-x: 0 !important;
    --bs-gutter-y: 0 !important;
  }
  .testing-validation-page .tv-trust-strip .row > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .testing-validation-page .tv-trust-strip .row > [class*="col-"]:last-child {
    grid-column: 1 / -1;
  }
  .testing-validation-page .tv-trust-strip .tv-trust-item {
    width: 100%;
    min-height: 118px !important;
  }
}

/* Shared image-banner pages: products, services, testing, leadership,
   careers and contact. The source images are very wide (5:1), therefore a
   fixed mobile crop is required to keep their text readable. */
@media (max-width: 575.98px) {
  body:not(.home-page):not(.about-page) main > .hero-banner.position-relative.overflow-hidden:not(.d-none) {
    height: 300px;
    min-height: 300px;
    overflow: hidden;
    background: #300407;
  }
  body:not(.home-page):not(.about-page) main > .hero-banner.position-relative.overflow-hidden:not(.d-none) > .hero-img,
  body:not(.home-page):not(.about-page) main > .hero-banner.position-relative.overflow-hidden:not(.d-none) > img {
    display: block;
    width: 100% !important;
    height: 300px !important;
    max-width: none;
    object-fit: cover;
    object-position: center;
  }
  body:not(.home-page):not(.about-page) main > .hero-banner.position-relative.overflow-hidden:not(.d-none) .banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(47, 4, 7, .92), rgba(47, 4, 7, .54));
  }
  body:not(.home-page):not(.about-page) main > .hero-banner.position-relative.overflow-hidden:not(.d-none) .container.position-absolute {
    padding-inline: var(--mobile-gutter);
  }
  body:not(.home-page):not(.about-page) main > .hero-banner.position-relative.overflow-hidden:not(.d-none) h1 {
    font-size: 1.7rem !important;
    line-height: 1.15;
  }
  body:not(.home-page):not(.about-page) main > .hero-banner.position-relative.overflow-hidden:not(.d-none) .lead,
  body:not(.home-page):not(.about-page) main > .hero-banner.position-relative.overflow-hidden:not(.d-none) p {
    font-size: .96rem;
    line-height: 1.5;
  }

  /* Reuse the compact About-page card treatment for page fact strips. */
  body:not(.home-page):not(.about-page) .col-sm-6:has(> .fact-box) {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    width: 50% !important;
  }
  body:not(.home-page):not(.about-page) .fact-box {
    min-height: 120px !important;
    padding: .8rem .55rem !important;
    gap: .55rem !important;
    flex-direction: column;
    align-items: center;
    justify-content: center !important;
    text-align: center;
  }
  body:not(.home-page):not(.about-page) .fact-box .icon-circle {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }
  body:not(.home-page):not(.about-page) .fact-box .fact-text {
    font-size: .77rem;
    line-height: 1.25;
  }

  .services-process-strip .process-flow,
  .ceo-fact-boxes,
  .contact-info-strip .container > .row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px !important;
  }
  .services-process-strip .process-step {
    min-height: 132px;
    padding: .75rem .45rem;
  }
  .services-process-strip .step-circle { width: 50px; height: 50px; }
  .services-process-strip .step-label { font-size: .78rem; line-height: 1.25; }
  .ceo-fact-boxes .fact-box,
  .contact-info-strip .contact-info-item {
    min-height: 120px;
    padding: .85rem .6rem;
  }
  .contact-info-strip .contact-info-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .contact-info-strip .contact-info-item p { font-size: .76rem; }
  .contact-info-strip .container > .row > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding: 0 !important;
  }
  .contact-info-strip .contact-info-item { width: 100%; }

  /* CEO strip contains an additional Bootstrap .row; remove its desktop
     gutters so the four cards can use the full two-column phone width. */
  .ceo-fact-boxes { display: block !important; }
  .ceo-fact-boxes > .row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1px !important;
    width: 100%;
    margin: 0 !important;
    justify-content: stretch !important;
    align-items: stretch !important;
  }
  body:not(.home-page):not(.about-page) .ceo-fact-boxes > .row > .col-sm-6,
  body:not(.home-page):not(.about-page) .ceo-fact-boxes > .row > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding: 0 !important;
  }
  .ceo-fact-boxes .fact-box {
    width: 100%;
    max-width: none !important;
    box-sizing: border-box;
    min-height: 136px !important;
  }
}

/* About page banner and trust facts use custom markup rather than the shared
   home components, so they need their own phone layout. */
@media (max-width: 575.98px) {
  .about-page main > .hero-banner:first-of-type {
    height: 330px;
    min-height: 330px;
    overflow: hidden;
    background: #300407;
  }
  .about-page main > .hero-banner:first-of-type .hero-img {
    display: block;
    width: 100% !important;
    height: 330px !important;
    max-width: none;
    object-fit: cover;
    object-position: center;
  }
  .about-page main > .hero-banner:first-of-type .banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(47, 4, 7, .93), rgba(47, 4, 7, .62));
  }
  .about-page main > .hero-banner:first-of-type .container.position-absolute {
    padding-inline: var(--mobile-gutter);
  }
  .about-page main > .hero-banner:first-of-type h1 {
    font-size: 1.75rem !important;
    line-height: 1.15;
    margin-bottom: .75rem !important;
  }
  .about-page main > .hero-banner:first-of-type .lead {
    font-size: .97rem;
    line-height: 1.55;
  }
  .about-page main > .hero-banner:first-of-type + .hero-banner + .container .col-sm-6 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    width: 50% !important;
  }
  .about-page main > .hero-banner:first-of-type + .hero-banner + .container .fact-box {
    min-height: 120px !important;
    padding: .8rem .55rem !important;
    gap: .55rem !important;
    flex-direction: column;
    align-items: center;
    justify-content: center !important;
    text-align: center;
  }
  .about-page main > .hero-banner:first-of-type + .hero-banner + .container .fact-box .icon-circle {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }
  .about-page main > .hero-banner:first-of-type + .hero-banner + .container .fact-box .fact-text {
    font-size: .77rem;
    line-height: 1.25;
  }
}

@media (max-width: 399.98px) {
  .stat-item { min-height: 110px; padding-inline: .45rem; }
  .stat-text { font-size: .72rem; }
  .hero-inner { padding-block: 3.75rem !important; }
  .section-pad { padding-block: 2.5rem; }
}

@media (max-width: 575.98px) {
  /* The five Testing highlights must not retain desktop auto-margins. */
  body:not(.home-page):not(.about-page) main > .hero-banner.position-relative.overflow-hidden + .container .row > .ms-auto,
  body:not(.home-page):not(.about-page) main > .hero-banner.position-relative.overflow-hidden + .container .row > .me-auto {
    margin-inline: 0 !important;
  }
}

/* Shared mobile rhythm: retain comfortable reading space without oversized gaps. */
@media (max-width: 767.98px) {
  .section-pad,
  body:not(.home-page) .section-pad {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  p,
  li {
    font-size: .95rem;
    line-height: 1.65;
  }

  .ttsl-footer .footer-links li,
  .ttsl-footer p.footer-about,
  .ttsl-footer .contact-line {
    font-size: .92rem;
  }
}

/* About Us: keep the banner image and its container the same height on phones.
   This removes the empty space that appears below the narrow source image. */
@media (max-width: 575.98px) {
  .about-page main#main-content > section.hero-banner.position-relative.overflow-hidden:not(.d-none) {
    height: 260px !important;
    min-height: 260px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .about-page main#main-content > section.hero-banner.position-relative.overflow-hidden:not(.d-none) > img.hero-img {
    height: 260px !important;
    min-height: 260px !important;
    object-fit: cover !important;
    object-position: center !important;
  }
  .about-page main#main-content > section.hero-banner.position-relative.overflow-hidden:not(.d-none) + .hero-banner.d-none + .container {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
}





