/* TradesFolks 18.4.71 — Premium Category Showcase Refinement
   Additive override for homepage Browse by Category showcase.
   Goals: premium hierarchy, lower vertical density, correct image proportions,
   compact desktop cards and app-style mobile horizontal swipe. */

.tf-homepage .home-category-showcases{
  background:linear-gradient(180deg,#f7f9fc 0%,#f4f7fb 100%)!important;
}
.tf-homepage .home-category-showcase{
  border:1px solid #dfe7f0!important;
  background:#fff!important;
  box-shadow:0 8px 28px rgba(13,35,68,.045)!important;
}
.tf-homepage .home-category-showcase-head{
  align-items:flex-end!important;
}
.tf-homepage .home-category-browse-pill{
  border:1px solid rgba(222,161,0,.10)!important;
  box-shadow:none!important;
}
.tf-homepage .home-category-showcase-head h3{
  color:#0a2242!important;
  letter-spacing:-.035em!important;
}
.tf-homepage .home-category-showcase-head p{
  color:#667991!important;
}
.tf-homepage .home-category-showcase-head>a{
  flex:0 0 auto!important;
  width:auto!important;
  border:1px solid #d8e4f1!important;
  background:#fff!important;
  color:#075bc7!important;
  box-shadow:0 3px 10px rgba(8,39,82,.035)!important;
  font-weight:800!important;
  white-space:nowrap!important;
}
.tf-homepage .home-category-showcase-head>a:hover{
  border-color:#abc7e8!important;
  background:#f7fbff!important;
  transform:translateY(-1px)!important;
}

.tf-homepage .home-category-source-card{
  isolation:isolate!important;
  overflow:hidden!important;
  border:1px solid rgba(8,31,63,.08)!important;
  box-shadow:0 8px 22px rgba(5,26,55,.08)!important;
  background-size:cover!important;
  background-repeat:no-repeat!important;
}
.tf-homepage .home-category-source-card:before{
  content:""!important;
  position:absolute!important;
  inset:0!important;
  z-index:-1!important;
  background:linear-gradient(180deg,rgba(5,24,50,.02) 5%,rgba(5,25,54,.12) 45%,rgba(5,24,52,.90) 100%)!important;
  pointer-events:none!important;
}
.tf-homepage .home-category-source-card strong{
  letter-spacing:-.035em!important;
  text-shadow:0 2px 12px rgba(1,18,41,.22)!important;
}
.tf-homepage .home-category-source-card p,
.tf-homepage .home-category-source-card li{
  text-shadow:0 1px 6px rgba(1,18,41,.18)!important;
}

.tf-homepage .home-category-subcard{
  border:1px solid #dde6ef!important;
  background:#fff!important;
  box-shadow:0 3px 12px rgba(11,37,71,.035)!important;
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease!important;
}
.tf-homepage .home-category-subcard:hover{
  transform:translateY(-2px)!important;
  border-color:#c4d5e8!important;
  box-shadow:0 10px 24px rgba(11,37,71,.075)!important;
}
.tf-homepage .home-category-subcard-image{
  position:relative!important;
  background:#fff!important;
  border-bottom:1px solid #edf1f5!important;
  overflow:hidden!important;
}
.tf-homepage .home-category-subcard-image img{
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
  background:#fff!important;
  transform:none!important;
  transition:transform .22s ease!important;
}
.tf-homepage .home-category-subcard:hover .home-category-subcard-image img{
  transform:scale(1.025)!important;
}
.tf-homepage .home-category-subcard-body{
  background:#fff!important;
}
.tf-homepage .home-category-subcard-body h4{
  color:#102746!important;
  font-weight:800!important;
  letter-spacing:-.015em!important;
}
.tf-homepage .home-category-subcard-body li{
  color:#6a7d94!important;
}
.tf-homepage .home-category-subcard-action{
  border-top:1px solid #edf1f5!important;
  background:#fff!important;
  color:#075bc7!important;
  font-weight:800!important;
}
.tf-homepage .home-category-subcard-action:hover{
  background:#f7fbff!important;
}
.tf-homepage .tf-sub-more{
  display:none;
  color:#7b8da1;
  font-weight:700;
}

/* Large desktop: stronger 25/75 hierarchy and lower section height. */
@media(min-width:1440px){
  .tf-homepage .home-category-showcases{
    padding:14px 0 18px!important;
  }
  .tf-homepage .home-category-showcase-list{
    gap:14px!important;
  }
  .tf-homepage .home-category-showcase{
    padding:13px!important;
    border-radius:16px!important;
  }
  .tf-homepage .home-category-showcase-head{
    margin-bottom:9px!important;
  }
  .tf-homepage .home-category-browse-pill{
    padding:4px 8px!important;
    font-size:7px!important;
  }
  .tf-homepage .home-category-showcase-head h3{
    margin:5px 0 2px!important;
    font-size:23px!important;
  }
  .tf-homepage .home-category-showcase-head p{
    font-size:9px!important;
    line-height:1.35!important;
  }
  .tf-homepage .home-category-showcase-head>a{
    min-height:30px!important;
    padding:0 11px!important;
    border-radius:8px!important;
    font-size:8px!important;
  }
  .tf-homepage .home-category-showcase-grid{
    grid-template-columns:minmax(270px,25%) minmax(0,75%)!important;
    gap:9px!important;
  }
  .tf-homepage .home-category-source-card{
    height:356px!important;
    min-height:356px!important;
    padding:14px!important;
    border-radius:13px!important;
  }
  .tf-homepage .home-category-source-card strong{
    margin-top:auto!important;
    max-width:88%!important;
    font-size:20px!important;
    line-height:1.02!important;
  }
  .tf-homepage .home-category-source-card p{
    max-width:86%!important;
    margin-top:5px!important;
    font-size:8px!important;
    line-height:1.35!important;
  }
  .tf-homepage .home-category-source-card ul{
    margin-top:7px!important;
    gap:3px!important;
  }
  .tf-homepage .home-category-source-card li{
    font-size:7px!important;
  }
  .tf-homepage .home-category-subgrid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  .tf-homepage .home-category-subcard{
    height:174px!important;
    min-height:174px!important;
    grid-template-rows:82px 64px 28px!important;
    border-radius:10px!important;
  }
  .tf-homepage .home-category-subcard-image{
    height:82px!important;
  }
  .tf-homepage .home-category-subcard-image img{
    padding:6px!important;
    box-sizing:border-box!important;
  }
  .tf-homepage .home-category-subcard-body{
    height:64px!important;
    padding:6px 8px 4px!important;
    overflow:hidden!important;
  }
  .tf-homepage .home-category-subcard-body h4{
    margin:0 0 3px!important;
    font-size:9px!important;
    line-height:1.16!important;
  }
  .tf-homepage .home-category-subcard-body ul{
    margin:0!important;
  }
  .tf-homepage .home-category-subcard-body li{
    font-size:6.3px!important;
    line-height:1.2!important;
  }
  .tf-homepage .home-category-subcard-body li:nth-child(n+4){
    display:none!important;
  }
  .tf-homepage .home-category-subcard-action{
    height:28px!important;
    min-height:28px!important;
    padding:0 8px!important;
    font-size:7px!important;
  }
}

/* Laptop / standard desktop: compact without sacrificing readability. */
@media(min-width:900px) and (max-width:1439px){
  .tf-homepage .home-category-showcases{
    padding:13px 0 17px!important;
  }
  .tf-homepage .home-category-showcase-list{
    gap:13px!important;
  }
  .tf-homepage .home-category-showcase{
    padding:11px!important;
    border-radius:14px!important;
  }
  .tf-homepage .home-category-showcase-head{
    margin-bottom:8px!important;
  }
  .tf-homepage .home-category-showcase-head h3{
    font-size:20px!important;
  }
  .tf-homepage .home-category-showcase-head p{
    font-size:8.5px!important;
  }
  .tf-homepage .home-category-showcase-head>a{
    min-height:29px!important;
    padding:0 10px!important;
    font-size:7.5px!important;
  }
  .tf-homepage .home-category-showcase-grid{
    grid-template-columns:minmax(225px,25%) minmax(0,75%)!important;
    gap:8px!important;
  }
  .tf-homepage .home-category-source-card{
    height:330px!important;
    min-height:330px!important;
    padding:12px!important;
    border-radius:12px!important;
  }
  .tf-homepage .home-category-source-card strong{
    font-size:18px!important;
    max-width:90%!important;
  }
  .tf-homepage .home-category-source-card p{
    max-width:90%!important;
    font-size:7.5px!important;
  }
  .tf-homepage .home-category-source-card li{
    font-size:6.7px!important;
  }
  .tf-homepage .home-category-subgrid{
    gap:7px!important;
  }
  .tf-homepage .home-category-subcard{
    height:161px!important;
    min-height:161px!important;
    grid-template-rows:75px 59px 27px!important;
  }
  .tf-homepage .home-category-subcard-image{
    height:75px!important;
  }
  .tf-homepage .home-category-subcard-image img{
    padding:5px!important;
    box-sizing:border-box!important;
  }
  .tf-homepage .home-category-subcard-body{
    height:59px!important;
    padding:5px 7px 4px!important;
  }
  .tf-homepage .home-category-subcard-body h4{
    margin:0 0 2px!important;
    font-size:8.5px!important;
  }
  .tf-homepage .home-category-subcard-body li{
    font-size:6px!important;
    line-height:1.18!important;
  }
  .tf-homepage .home-category-subcard-body li:nth-child(n+4){
    display:none!important;
  }
  .tf-homepage .home-category-subcard-action{
    height:27px!important;
    min-height:27px!important;
    font-size:6.7px!important;
  }
}

/* Tablet: hero + 3-column matrix remain balanced. */
@media(min-width:700px) and (max-width:899px){
  .tf-homepage .home-category-showcase{
    padding:10px!important;
    border-radius:13px!important;
  }
  .tf-homepage .home-category-showcase-head h3{
    font-size:20px!important;
  }
  .tf-homepage .home-category-showcase-grid{
    gap:8px!important;
  }
  .tf-homepage .home-category-source-card{
    min-height:195px!important;
    height:195px!important;
  }
  .tf-homepage .home-category-subcard{
    min-height:170px!important;
    height:170px!important;
    grid-template-rows:78px 64px 28px!important;
  }
  .tf-homepage .home-category-subcard-image{
    height:78px!important;
  }
  .tf-homepage .home-category-subcard-body{
    height:64px!important;
  }
}

/* Mobile: compact header, compact hero and true two-card + peek swipe rail. */
@media(max-width:699px){
  .tf-homepage .home-category-showcases{
    padding:8px 0 12px!important;
  }
  .tf-homepage .home-category-showcases>.shell{
    width:100%!important;
    max-width:none!important;
    padding-inline:7px!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  .tf-homepage .home-category-showcase-list{
    gap:10px!important;
  }
  .tf-homepage .home-category-showcase{
    padding:9px!important;
    border-radius:14px!important;
  }

  .tf-homepage .home-category-showcase-head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-areas:
      "pill action"
      "title action"
      "desc desc"!important;
    column-gap:8px!important;
    row-gap:2px!important;
    align-items:center!important;
    margin-bottom:8px!important;
  }
  .tf-homepage .home-category-browse-pill{
    grid-area:pill!important;
    padding:4px 7px!important;
    font-size:6.7px!important;
    border-radius:999px!important;
  }
  .tf-homepage .home-category-showcase-head>div{
    display:contents!important;
  }
  .tf-homepage .home-category-showcase-head h3{
    grid-area:title!important;
    margin:5px 0 0!important;
    font-size:19px!important;
    line-height:1.04!important;
  }
  .tf-homepage .home-category-showcase-head p{
    grid-area:desc!important;
    margin:3px 0 0!important;
    font-size:8px!important;
    line-height:1.32!important;
  }
  .tf-homepage .home-category-showcase-head>a{
    grid-area:action!important;
    align-self:center!important;
    min-height:28px!important;
    height:28px!important;
    padding:0 9px!important;
    border-radius:8px!important;
    font-size:7px!important;
  }

  .tf-homepage .home-category-showcase-grid{
    grid-template-columns:1fr!important;
    gap:7px!important;
    width:100%!important;
  }

  .tf-homepage .home-category-source-card{
    height:208px!important;
    min-height:208px!important;
    padding:11px!important;
    border-radius:12px!important;
    background-position:center center!important;
  }
  .tf-homepage .home-category-source-card strong{
    margin-top:auto!important;
    max-width:78%!important;
    font-size:17px!important;
    line-height:1.03!important;
  }
  .tf-homepage .home-category-source-card p{
    max-width:80%!important;
    margin:5px 0 0!important;
    font-size:7.2px!important;
    line-height:1.32!important;
  }
  .tf-homepage .home-category-source-card ul{
    margin-top:6px!important;
    gap:2px!important;
  }
  .tf-homepage .home-category-source-card li{
    font-size:6.2px!important;
  }

  .tf-homepage .home-category-subgrid{
    display:flex!important;
    flex-wrap:nowrap!important;
    gap:7px!important;
    width:auto!important;
    max-width:none!important;
    margin:0 -9px!important;
    padding:0 9px 5px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x mandatory!important;
    scroll-padding-inline:9px!important;
    scroll-behavior:smooth!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-inline:contain!important;
    scrollbar-width:none!important;
  }
  .tf-homepage .home-category-subgrid::-webkit-scrollbar{
    display:none!important;
  }

  .tf-homepage .home-category-subcard{
    flex:0 0 clamp(142px,44vw,176px)!important;
    width:clamp(142px,44vw,176px)!important;
    min-width:clamp(142px,44vw,176px)!important;
    max-width:clamp(142px,44vw,176px)!important;
    height:174px!important;
    min-height:174px!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:88px 59px 27px!important;
    scroll-snap-align:start!important;
    scroll-snap-stop:normal!important;
    border-radius:10px!important;
    overflow:hidden!important;
  }
  .tf-homepage .home-category-subcard-image{
    height:88px!important;
    min-height:88px!important;
  }
  .tf-homepage .home-category-subcard-image img{
    padding:5px!important;
    box-sizing:border-box!important;
  }
  .tf-homepage .home-category-subcard-body{
    height:59px!important;
    min-height:59px!important;
    padding:5px 7px 3px!important;
    overflow:hidden!important;
  }
  .tf-homepage .home-category-subcard-body h4{
    margin:0 0 3px!important;
    font-size:8.2px!important;
    line-height:1.15!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .tf-homepage .home-category-subcard-body ul{
    margin:0!important;
    padding-left:10px!important;
  }
  .tf-homepage .home-category-subcard-body li{
    font-size:6.2px!important;
    line-height:1.18!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .tf-homepage .home-category-subcard-body li:nth-child(n+3){
    display:none!important;
  }
  .tf-homepage .tf-sub-more{
    display:block!important;
    margin-top:2px!important;
    padding-left:1px!important;
    font-size:5.8px!important;
    line-height:1!important;
  }
  .tf-homepage .home-category-subcard-action{
    height:27px!important;
    min-height:27px!important;
    padding:0 7px!important;
    font-size:6.8px!important;
  }
}

/* Narrow phones: maintain two cards rather than one oversized card. */
@media(max-width:390px){
  .tf-homepage .home-category-showcase{
    padding:8px!important;
  }
  .tf-homepage .home-category-showcase-head h3{
    font-size:18px!important;
  }
  .tf-homepage .home-category-showcase-head p{
    font-size:7.6px!important;
  }
  .tf-homepage .home-category-source-card{
    min-height:194px!important;
    height:194px!important;
  }
  .tf-homepage .home-category-source-card strong{
    font-size:16px!important;
  }
  .tf-homepage .home-category-subgrid{
    margin-inline:-8px!important;
    padding-inline:8px!important;
    gap:6px!important;
    scroll-padding-inline:8px!important;
  }
  .tf-homepage .home-category-subcard{
    flex-basis:43.5vw!important;
    width:43.5vw!important;
    min-width:43.5vw!important;
    max-width:43.5vw!important;
    height:166px!important;
    min-height:166px!important;
    grid-template-rows:82px 58px 26px!important;
  }
  .tf-homepage .home-category-subcard-image{
    height:82px!important;
    min-height:82px!important;
  }
  .tf-homepage .home-category-subcard-body{
    height:58px!important;
  }
  .tf-homepage .home-category-subcard-action{
    height:26px!important;
    min-height:26px!important;
  }
}

/* Motion accessibility */
@media(prefers-reduced-motion:reduce){
  .tf-homepage .home-category-subcard,
  .tf-homepage .home-category-subcard-image img,
  .tf-homepage .home-category-showcase-head>a{
    transition:none!important;
  }
  .tf-homepage .home-category-subgrid{
    scroll-behavior:auto!important;
  }
}


/* TradesFolks 18.4.72 — Category Showcase Layout Hotfix
   Fixes clipped titles, oversized empty body space and mismatched card heights introduced
   by rigid grid-template rows in 18.4.71. */

.tf-homepage .home-category-subcard{
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
  height:auto!important;
  overflow:hidden!important;
}
.tf-homepage .home-category-subcard-image{
  flex:0 0 auto!important;
  min-height:0!important;
}
.tf-homepage .home-category-subcard-body{
  flex:1 1 auto!important;
  min-height:0!important;
  height:auto!important;
  overflow:hidden!important;
  display:block!important;
}
.tf-homepage .home-category-subcard-action{
  flex:0 0 auto!important;
  margin-top:auto!important;
}
.tf-homepage .home-category-subcard-body h4{
  position:relative!important;
  z-index:1!important;
  display:block!important;
  overflow:visible!important;
  clip:auto!important;
  max-height:none!important;
}

/* Large desktop */
@media(min-width:1440px){
  .tf-homepage .home-category-showcase{
    padding:14px!important;
  }
  .tf-homepage .home-category-showcase-grid{
    grid-template-columns:minmax(330px,25%) minmax(0,75%)!important;
    gap:10px!important;
    align-items:stretch!important;
  }
  .tf-homepage .home-category-source-card{
    height:438px!important;
    min-height:438px!important;
  }
  .tf-homepage .home-category-subgrid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;
    align-items:stretch!important;
  }
  .tf-homepage .home-category-subcard{
    height:214px!important;
    min-height:214px!important;
  }
  .tf-homepage .home-category-subcard-image{
    height:116px!important;
    min-height:116px!important;
    flex-basis:116px!important;
  }
  .tf-homepage .home-category-subcard-image img{
    padding:7px!important;
  }
  .tf-homepage .home-category-subcard-body{
    padding:8px 10px 6px!important;
    min-height:64px!important;
  }
  .tf-homepage .home-category-subcard-body h4{
    margin:0 0 5px!important;
    font-size:10px!important;
    line-height:1.2!important;
  }
  .tf-homepage .home-category-subcard-body ul{
    margin:0!important;
    padding-left:12px!important;
  }
  .tf-homepage .home-category-subcard-body li{
    font-size:6.8px!important;
    line-height:1.3!important;
  }
  .tf-homepage .home-category-subcard-body li:nth-child(n+4){
    display:none!important;
  }
  .tf-homepage .home-category-subcard-action{
    height:31px!important;
    min-height:31px!important;
    padding:0 10px!important;
    font-size:7.2px!important;
  }
}

/* Standard desktop / laptop */
@media(min-width:1000px) and (max-width:1439px){
  .tf-homepage .home-category-showcase-grid{
    grid-template-columns:minmax(280px,27%) minmax(0,73%)!important;
    gap:9px!important;
    align-items:stretch!important;
  }
  .tf-homepage .home-category-source-card{
    height:392px!important;
    min-height:392px!important;
  }
  .tf-homepage .home-category-subgrid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  .tf-homepage .home-category-subcard{
    height:192px!important;
    min-height:192px!important;
  }
  .tf-homepage .home-category-subcard-image{
    height:100px!important;
    min-height:100px!important;
    flex-basis:100px!important;
  }
  .tf-homepage .home-category-subcard-body{
    padding:7px 9px 5px!important;
    min-height:61px!important;
  }
  .tf-homepage .home-category-subcard-body h4{
    margin:0 0 4px!important;
    font-size:9px!important;
    line-height:1.18!important;
  }
  .tf-homepage .home-category-subcard-body li{
    font-size:6.4px!important;
    line-height:1.25!important;
  }
  .tf-homepage .home-category-subcard-action{
    height:30px!important;
    min-height:30px!important;
    padding:0 9px!important;
    font-size:7px!important;
  }
}

/* Tablet */
@media(min-width:700px) and (max-width:999px){
  .tf-homepage .home-category-showcase-grid{
    align-items:stretch!important;
  }
  .tf-homepage .home-category-source-card{
    height:250px!important;
    min-height:250px!important;
  }
  .tf-homepage .home-category-subcard{
    height:184px!important;
    min-height:184px!important;
  }
  .tf-homepage .home-category-subcard-image{
    height:94px!important;
    min-height:94px!important;
    flex-basis:94px!important;
  }
  .tf-homepage .home-category-subcard-body{
    padding:7px 8px 5px!important;
    min-height:60px!important;
  }
  .tf-homepage .home-category-subcard-action{
    height:29px!important;
    min-height:29px!important;
  }
}

/* Mobile keeps horizontal rail but also uses flexible card internals. */
@media(max-width:699px){
  .tf-homepage .home-category-source-card{
    height:214px!important;
    min-height:214px!important;
  }
  .tf-homepage .home-category-subcard{
    height:170px!important;
    min-height:170px!important;
  }
  .tf-homepage .home-category-subcard-image{
    height:88px!important;
    min-height:88px!important;
    flex-basis:88px!important;
  }
  .tf-homepage .home-category-subcard-body{
    min-height:55px!important;
    height:auto!important;
    padding:5px 7px 4px!important;
  }
  .tf-homepage .home-category-subcard-body h4{
    margin:0 0 3px!important;
    font-size:8.2px!important;
    line-height:1.15!important;
  }
  .tf-homepage .home-category-subcard-action{
    height:27px!important;
    min-height:27px!important;
  }
}

/* Prevent image/content collision regardless of upstream styles. */
.tf-homepage .home-category-subcard-image + .home-category-subcard-body{
  margin-top:0!important;
  transform:none!important;
}
.tf-homepage .home-category-subcard-body,
.tf-homepage .home-category-subcard-body *{
  transform:none!important;
}
