/* ==========================================================================
   LEAFORGE TECHNOLOGIES — RESPONSIVE BASE
   MOBILE CONSISTENCY BUILD: VER10015

   PURPOSE
   -------
   Base tablet/mobile corrections. Loaded before page-specific late overrides where required.

   SECTION DIRECTORY
   -----------------
   01. Global mobile safety
   02. Shared sections / grids
   03. Page-family responsive rules
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. Tablet header and navigation
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  img, picture, video, canvas, svg, iframe {
    max-width: 100%;
  }
}

/* --------------------------------------------------------------------------
   02. Mobile color consistency and global readability
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .lf-bc-modules-green-section, body.home-page .lf-bc-modules-green-section, body:not(.home-page) .lf-bc-modules-green-section {
    background: #04414b !important;
    background-color: #04414b !important;
  }

  .lf-bc-modules-green-heading, body.home-page .lf-bc-modules-green-heading, .lf-bc-modules-green-grid, body.home-page .lf-bc-modules-green-grid {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  body.home-page .lf-home-transform {
    background: linear-gradient(180deg, #268ed3 0 46%, #093c6e 46% 100%) !important;
  }
}

@media (max-width: 768px) {
  /* Preserve the approved desktop palette on mobile. */
  .lf-v7-why-section > .lf-v7-why-wrap, .lf-page-reusable-why-section > .lf-v7-why-wrap, body.home-page .lf-v7-why-section > .lf-v7-why-wrap, body:not(.home-page) .lf-page-reusable-why-section > .lf-v7-why-wrap, .lf-v7-why-section > .lf-v7-why-wrap > .lf-v7-why-content, .lf-page-reusable-why-section > .lf-v7-why-wrap > .lf-v7-why-content {
    background: #005953 !important;
    background-color: #005953 !important;
  }

  .lf-v7-why-section > .lf-v7-why-wrap > .lf-v7-why-image, .lf-page-reusable-why-section > .lf-v7-why-wrap > .lf-v7-why-image {
    background: #33c5cf !important;
    background-color: #33c5cf !important;
  }
}

/* --------------------------------------------------------------------------
   03. Home slider - readable content over the image
   -------------------------------------------------------------------------- */

@media (max-width: 430px) {
  body.lf-header-scrolled:not(.home-page) {
    padding-top: 72px !important;
  }

}

/* --------------------------------------------------------------------------
   04. Common section sizing, typography and text wrapping
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  body {
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  main, section, article, aside, header, footer, div {
    min-width: 0;
  }

  h1, h2, h3, h4, h5, h6, p, li, a, label, button, input, select, textarea {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  p, li {
    line-height: 1.68;
  }

  section[class], .lf-modern-card-section, .lf-bc-area-section, .lf-benefits-section, .lf-cap-section, .lf-impl-section {
    scroll-margin-top: 82px;
  }

  .lf-page-container, .lf-modern-container, .lf-cap-container, .lf-impl-container, .lf-training-container, .lf-pricing-container, .lf-partner-container, .lf-sa-container, .lf-support-container, .lf-rapid-container, .lf-blog-container, .lf365-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .lf-modern-card-section, .lf-bc-area-section, .lf-benefits-section{
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .lf-modern-heading, .lf-bc-heading, .lf-cap-heading, .lf-impl-heading, .lf-training-heading, .lf-pricing-heading, .lf-partner-heading {
    margin-bottom: 34px !important;
  }

  .lf-modern-heading h2, .lf-bc-heading h2, .lf-cap-heading h2, .lf-impl-heading h2, .lf-training-heading h2, .lf-pricing-heading h2, .lf-partner-heading h2, .lf-section-title{
    font-size: clamp(28px, 8vw, 36px) !important;
    line-height: 1.2 !important;
    letter-spacing: -0.45px !important;
  }

  .lf-section-subtitle, [class*="small-title"], [class*="eyebrow"] {
    letter-spacing: 2.2px !important;
  }

  .lf-modern-card, .lf-cap-card, .lf-impl-card, .lf-training-card, .lf-pricing-card, .lf-partner-card, .lf-support-card, .lf-sa-card, .lf-blog-card {
    min-height: 0 !important;
    padding: 22px 20px !important;
  }

  .lf-modern-card p, .lf-cap-card p, .lf-impl-card p, .lf-training-card p, .lf-pricing-card p, .lf-partner-card p, .lf-support-card p, .lf-sa-card p, .lf-blog-card p {
    font-size: 14px !important;
    line-height: 1.7 !important;
  }

  img {
    height: auto;
  }

  button, [role="button"], input[type="submit"], input[type="button"], a[class*="btn"], a[class*="button"] {
    min-height: 44px;
  }

  .lf-partner-cta-inner, body.home-page .lf-home-adviser-cta__inner, body.page-leaforge365 .lf-book-demo__inner{
    align-items: stretch !important;
  }

  .lf-partner-cta-inner > a, body.home-page .lf-home-adviser-cta__inner a, body.page-leaforge365 .lf-book-demo__inner a{
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
  }
}

/* --------------------------------------------------------------------------
   05. Inner-page hero correction
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   06. One-column mobile layouts for major content sections
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  :is( .lf-modern-card, .lf-bc-classic-card, .lf-bc-feature, .lf-v7-project-card, .bc-service-item, .lf-ri-card, .lf-r5-fit-card, .lf-support-card, .lf-sa-cap-card, .lf-cap-feature-card, .lf-impl-card, .lf-training-audience-card, .lf-training-module-card ) {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
  }

  :is( .lf-ri-card-content, .lf-modern-card-content, .lf-cap-card-content, .lf-support-card-content, .lf-sa-card-content, .lf-blog-card-content ) {
    min-height: 0 !important;
  }
}

/* --------------------------------------------------------------------------
   07. Images, split sections and cards
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  :is( .lf-v7-about-image, .lf-gym-about-image, .lf-np-studio-image, .lf-wd-home-image, .lf-help-image-wrap, .lf-rapid-why-image, .lf-sa-intro-image, .lf-impl-feature-media, .lf-training-formats-media ) {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
  }

  :is( .lf-v7-about-image img, .lf-gym-about-image img, .lf-np-studio-image img, .lf-wd-home-image img, .lf-help-image-wrap img, .lf-rapid-why-image img, .lf-sa-intro-image img, .lf-impl-feature-media img, .lf-training-formats-media img ) {
    width: 100% !important;
    height: clamp(230px, 68vw, 320px) !important;
    min-height: 0 !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  .lf-v7-why-section > .lf-v7-why-wrap > .lf-v7-why-image, .lf-page-reusable-why-section > .lf-v7-why-wrap > .lf-v7-why-image, .lf-v7-why-image img {
    min-height: 290px !important;
    height: 290px !important;
  }

  .lf-bc-module-green-card {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  .lf-bc-module-green-content h3 {
    font-size: 20px !important;
  }

  .lf-bc-module-green-content p {
    font-size: 14px !important;
    line-height: 1.68 !important;
  }

  #industries-we-serve .lf-v7-project-inner, #industries-we-serve .lf-v7-project-card {
    min-height: 0 !important;
  }

  #industries-we-serve .lf-v7-project-info, #industries-we-serve .lf-v7-project-hover {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    min-height: 0 !important;
  }

  #industries-we-serve .lf-v7-project-hover {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   08. Forms, tables and long content
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  input, select, textarea, button {
    max-width: 100%;
    font-size: 16px;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
    width: 100% !important;
  }

  textarea {
    min-height: 135px;
  }

  .table-responsive, .lf-table-wrap, [class*="table-wrap"], [class*="table-responsive"] {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  table {
    max-width: 100%;
    font-size: 13px;
  }

  pre, code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

/* --------------------------------------------------------------------------
   09. Footer
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   10. Extra-small screens
   -------------------------------------------------------------------------- */


/* Final hero animation safeguard: prevent partially animated text/overlay states
   on slower mobile devices and during page restoration. */

/* --------------------------------------------------------------------------
   11. Mobile media frames and comparison tables
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .lf-small-business-help__image, .lf-home-why-overview__image, .lf-small-business-help__image picture, .lf-home-why-overview__image picture, .lf-small-business-help__image img, .lf-home-why-overview__image img {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
  }

  .lf-small-business-help__image, .lf-home-why-overview__image {
    overflow: hidden !important;
  }

  .lf-small-business-help__image img, .lf-home-why-overview__image img {
    height: clamp(240px, 72vw, 330px) !important;
    min-height: 0 !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  .lf-pricing-table-wrap, .lf-impl-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    padding-bottom: 10px !important;
  }

  .lf-pricing-table, .lf-impl-comparison-table {
    width: 680px !important;
    min-width: 680px !important;
    max-width: none !important;
  }

  .lf-pricing-table th, .lf-pricing-table td, .lf-impl-comparison-table th, .lf-impl-comparison-table td {
    padding: 13px 12px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    white-space: normal !important;
  }

  .lf-pricing-table-wrap::after, .lf-impl-table-wrap::after {
    content: "Swipe table horizontally to compare";
    display: block;
    padding-top: 9px;
    color: #65777c;
    font: 500 12px/1.4 "Poppins", Arial, sans-serif;
    text-align: left;
  }

  .lf-bc-features-table-section, .lf-bc-features-table-container, .lf-bc-features-content, .lf-bc-features-table, .lf-bc-feature-row, .lf-bc-feature-category, .lf-bc-feature-items {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .lf-bc-features-table-section {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .lf-bc-feature-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
  }

  .lf-bc-feature-category {
    padding: 15px 16px !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
  }

  .lf-bc-feature-items {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    padding: 8px 0 !important;
  }

  .lf-bc-feature-items span {
    width: 100% !important;
    min-width: 0 !important;
    padding: 11px 16px !important;
    font-size: 13.5px !important;
    line-height: 1.5 !important;
    white-space: normal !important;
  }
}

@media (max-width: 767px) {
  .lf-pricing-table-wrap::after, .lf-impl-table-wrap::after {
    margin-top: 0;
    padding: 10px 12px !important;
    color: #04414b !important;
    background: #eef4f3 !important;
  }
}

/* Mobile mega-menu: stack the full navigation in one readable column. */
