/* TradesFolks 18.4.42 — Responsive Industry Cards
   Smaller, denser and device-aware category grid.
   Images stay proportional with object-fit:contain; no stretching. */

.tf-home-v3-industries{
  overflow:hidden!important;
}
.tf-home-v3-industries .shell{
  width:min(calc(100% - 32px),1880px)!important;
  max-width:1880px!important;
  margin-inline:auto!important;
}
.tf-home-v3-section-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:end!important;
  gap:14px!important;
}
.tf-home-v3-section-head>div{
  min-width:0!important;
}
.tf-home-v3-section-head h2{
  margin:0!important;
}
.tf-home-v3-section-head p{
  margin:4px 0 0!important;
}
.tf-home-v3-section-head>a{
  align-self:end!important;
  white-space:nowrap!important;
}

.tf-home-v3-category-grid{
  width:100%!important;
  min-width:0!important;
  display:grid!important;
  grid-auto-flow:row!important;
  overflow:visible!important;
}
.tf-home-v3-category-card{
  display:grid!important;
  grid-template-rows:auto auto!important;
  min-width:0!important;
  width:100%!important;
  overflow:hidden!important;
  background:#fff!important;
  border:1px solid #dfe6ef!important;
  box-shadow:none!important;
  transform:none!important;
}
.tf-home-v3-category-card:hover{
  border-color:#e4b644!important;
  box-shadow:0 4px 14px rgba(15,35,70,.06)!important;
  transform:translateY(-1px)!important;
}
.tf-home-v3-category-media{
  width:100%!important;
  overflow:hidden!important;
  display:grid!important;
  place-items:center!important;
  background:#fff!important;
}
.tf-home-v3-category-media img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  object-position:center center!important;
  transform:none!important;
  aspect-ratio:auto!important;
}
.tf-home-v3-category-body{
  min-width:0!important;
}
.tf-home-v3-category-body strong{
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.tf-home-v3-subcategories{
  min-width:0!important;
}
.tf-home-v3-subcategories>div{
  min-width:0!important;
  overflow-x:auto!important;
  scrollbar-width:none!important;
  -webkit-overflow-scrolling:touch!important;
}
.tf-home-v3-subcategories>div::-webkit-scrollbar{display:none!important}

/* Ultra-wide desktop: six compact cards per row. */
@media(min-width:1600px){
  .tf-home-v3-industries{padding-top:22px!important;padding-bottom:24px!important}
  .tf-home-v3-section-head{margin-bottom:10px!important}
  .tf-home-v3-section-head>div>span{font-size:8px!important;letter-spacing:.13em!important}
  .tf-home-v3-section-head h2{font-size:28px!important;line-height:1.04!important}
  .tf-home-v3-section-head p{font-size:11px!important}
  .tf-home-v3-section-head>a{min-height:32px!important;padding:0 10px!important;font-size:9px!important;border-radius:8px!important}

  .tf-home-v3-category-grid{
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:9px!important;
  }
  .tf-home-v3-category-card{border-radius:10px!important}
  .tf-home-v3-category-media{height:150px!important;min-height:150px!important}
  .tf-home-v3-category-body{padding:7px 9px 9px!important}
  .tf-home-v3-category-body>span{font-size:7px!important;margin-bottom:2px!important}
  .tf-home-v3-category-body>strong{font-size:10px!important;line-height:1.18!important}
}

/* Desktop / laptop: five columns. */
@media(min-width:1200px) and (max-width:1599px){
  .tf-home-v3-industries{padding-top:20px!important;padding-bottom:24px!important}
  .tf-home-v3-section-head h2{font-size:27px!important}
  .tf-home-v3-section-head p{font-size:11px!important}
  .tf-home-v3-category-grid{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:8px!important;
  }
  .tf-home-v3-category-card{border-radius:10px!important}
  .tf-home-v3-category-media{height:142px!important;min-height:142px!important}
  .tf-home-v3-category-body{padding:7px 8px 9px!important}
  .tf-home-v3-category-body>span{font-size:7px!important}
  .tf-home-v3-category-body>strong{font-size:9.5px!important;line-height:1.18!important}
}

/* Tablet landscape / small desktop: four columns. */
@media(min-width:768px) and (max-width:1199px){
  .tf-home-v3-industries .shell{width:calc(100% - 24px)!important}
  .tf-home-v3-industries{padding:18px 0 24px!important}
  .tf-home-v3-section-head{grid-template-columns:minmax(0,1fr) auto!important;gap:10px!important}
  .tf-home-v3-section-head h2{font-size:24px!important}
  .tf-home-v3-section-head p{font-size:10.5px!important}
  .tf-home-v3-category-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:8px!important;
  }
  .tf-home-v3-category-media{height:126px!important;min-height:126px!important}
  .tf-home-v3-category-body{padding:7px 8px 8px!important}
  .tf-home-v3-category-body>strong{font-size:9.5px!important;line-height:1.18!important}
}

/* Mobile: true three-column compact grid; no horizontal strips or ghost rails. */
@media(max-width:767px){
  .tf-home-v3-industries{
    padding:15px 0 84px!important;
    overflow:hidden!important;
  }
  .tf-home-v3-industries .shell{
    width:100%!important;
    max-width:none!important;
    padding-inline:10px!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }

  .tf-home-v3-section-head{
    grid-template-columns:1fr!important;
    align-items:start!important;
    gap:8px!important;
    margin-bottom:10px!important;
  }
  .tf-home-v3-section-head>div>span{
    font-size:7.5px!important;
    letter-spacing:.12em!important;
  }
  .tf-home-v3-section-head h2{
    font-size:21px!important;
    line-height:1.04!important;
    letter-spacing:-.025em!important;
  }
  .tf-home-v3-section-head p{
    font-size:9.5px!important;
    line-height:1.35!important;
    margin-top:3px!important;
  }
  .tf-home-v3-section-head>a{
    width:100%!important;
    min-height:34px!important;
    padding:0 10px!important;
    font-size:9.5px!important;
    border-radius:9px!important;
    justify-self:stretch!important;
  }

  .tf-home-v3-category-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
    padding:0!important;
    margin:0!important;
    overflow:visible!important;
  }
  .tf-home-v3-category-card{
    border-radius:9px!important;
    min-width:0!important;
    width:100%!important;
  }
  .tf-home-v3-category-media{
    height:86px!important;
    min-height:86px!important;
    background:#fff!important;
  }
  .tf-home-v3-category-media img{
    width:100%!important;
    height:100%!important;
    object-fit:contain!important;
    padding:5px!important;
    box-sizing:border-box!important;
  }
  .tf-home-v3-category-body{
    padding:6px 6px 7px!important;
    min-height:50px!important;
  }
  .tf-home-v3-category-body>span{
    font-size:6.5px!important;
    margin-bottom:2px!important;
  }
  .tf-home-v3-category-body>strong{
    font-size:8.5px!important;
    line-height:1.18!important;
    white-space:normal!important;
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  .tf-home-v3-subcategories{
    margin-top:12px!important;
  }
  .tf-home-v3-subcategories>strong{
    font-size:9.5px!important;
    margin-bottom:6px!important;
  }
  .tf-home-v3-subcategories>div{
    display:flex!important;
    flex-wrap:nowrap!important;
    gap:5px!important;
    overflow-x:auto!important;
    padding-bottom:2px!important;
  }
  .tf-home-v3-subcategories a{
    flex:0 0 auto!important;
    white-space:nowrap!important;
    font-size:8.5px!important;
    padding:5px 8px!important;
    border-radius:999px!important;
  }
}

/* Small phones: keep three columns, reduce media/text rather than forcing horizontal scroll. */
@media(max-width:390px){
  .tf-home-v3-industries .shell{padding-inline:8px!important}
  .tf-home-v3-category-grid{gap:6px!important}
  .tf-home-v3-category-media{height:78px!important;min-height:78px!important}
  .tf-home-v3-category-body{padding:5px 5px 6px!important;min-height:47px!important}
  .tf-home-v3-category-body>strong{font-size:8px!important}
  .tf-home-v3-section-head h2{font-size:19px!important}
  .tf-home-v3-section-head p{font-size:9px!important}
}
