/* =====================================================================
   LOCALBUDDY HOMEPAGE — home-refresh.css (2026-11 visual refresh)
   ---------------------------------------------------------------------
   Loaded AFTER index.css. Overrides only — delete the <link> in
   index.php to roll back to the previous look.

   1. Readable type on laptops (index.css scales with --u, which makes
      text ~12px on 1366–1440px screens; these floors keep it legible)
   2. Popular categories: colour-coded icons + hover lift
   3. Trusted providers: server-rendered cards (.lbh-pcard)
   4. Blog: taller thumbnails + nicer fallback when there is no image
   5. Small polish: section headings, steps, CTA
   All rules are scoped to body.lb-home.
   ===================================================================== */

body.lb-home {
  --lbr-radius: 16px;
  --lbr-card-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .07);
  --lbr-card-shadow-hover: 0 2px 4px rgba(16, 24, 40, .05), 0 18px 40px rgba(16, 24, 40, .12);
}


/* ---------------------------------------------------------------------
   1. READABLE TYPE (tablet & desktop)
   --------------------------------------------------------------------- */
@media (min-width: 768px) {
  body.lb-home .lbh-hero-sub            { font-size: max(16px, calc(22 * var(--u))); }

  body.lb-home .lbh-sec-head h2         { font-size: max(28px, calc(46 * var(--u))); letter-spacing: -0.03em; }
  body.lb-home .lbh-sec-head p          { font-size: max(15px, calc(19 * var(--u))); color: var(--lb-text); }
  body.lb-home .lbh-link                { font-size: max(14px, calc(17 * var(--u))); }

  body.lb-home .lbh-cats-title          { font-size: max(18px, calc(25 * var(--u))) !important; }
  body.lb-home .lbh-cats-head .lbh-link { font-size: max(14px, calc(17 * var(--u))); }
  body.lb-home .lbh-cat-txt strong      { font-size: max(14.5px, calc(18 * var(--u))); }
  body.lb-home .lbh-cat-txt small       { font-size: max(12.5px, calc(15 * var(--u))); }

  body.lb-home .lbh-how-head h2         { font-size: max(28px, calc(44 * var(--u))); }
  body.lb-home .lbh-how-head p          { font-size: max(15px, calc(20 * var(--u))); }
  body.lb-home .lbh-step-txt strong     { font-size: max(18px, calc(26 * var(--u))); }
  body.lb-home .lbh-step-txt small      { font-size: max(14px, calc(18 * var(--u))); }

  body.lb-home .lbh-btn                 { font-size: max(15px, calc(18 * var(--u))); height: max(46px, calc(56 * var(--u))); }

  body.lb-home .lbh-adv-top-mid,
  body.lb-home .lbh-adv-bottom-mid      { font-size: max(15px, calc(19 * var(--u))); }

  body.lb-home .lbh-pro-copy h3         { font-size: max(18px, calc(28 * var(--u))); }
  body.lb-home .lbh-pro-copy p          { font-size: max(15px, calc(19 * var(--u))); }
  body.lb-home .lbh-pro-actions .lbh-btn { font-size: max(16px, calc(22 * var(--u))); height: max(50px, calc(66 * var(--u))); }
  body.lb-home .lbh-terms               { font-size: max(13px, calc(18 * var(--u))); }

  body.lb-home .lbh-post h3             { font-size: max(16px, calc(21 * var(--u))); line-height: 1.35; }
  body.lb-home .lbh-post time           { font-size: max(13px, calc(16 * var(--u))); }
}


/* ---------------------------------------------------------------------
   2. SECTION HEADINGS — small accent bar
   --------------------------------------------------------------------- */
body.lb-home .lbh-sec-head h2 { position: relative; }

@media (min-width: 768px) {
  body.lb-home .lbh-sec-head { align-items: flex-end; }
  body.lb-home .lbh-sec-head .lbh-link {
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--lb-green-mint);
    transition: background-color .2s ease;
  }
  body.lb-home .lbh-sec-head .lbh-link:hover { background: var(--lb-green-soft); }
}


/* ---------------------------------------------------------------------
   3. POPULAR CATEGORIES — colour-coded icons
   --------------------------------------------------------------------- */
body.lb-home .lbh-c1 { --cat-bg: #e8f4ec; --cat-fg: #0b6b34; }
body.lb-home .lbh-c2 { --cat-bg: #fdecf3; --cat-fg: #c2185b; }
body.lb-home .lbh-c3 { --cat-bg: #fff4d6; --cat-fg: #b7791f; }
body.lb-home .lbh-c4 { --cat-bg: #e8f1fd; --cat-fg: #1d5fbf; }
body.lb-home .lbh-c5 { --cat-bg: #e6f7f5; --cat-fg: #0f766e; }

body.lb-home .lbh-cat-ico {
  background: var(--cat-bg, var(--lb-green-soft));
  color: var(--cat-fg, var(--lb-green));
  transition: transform .2s ease;
}

body.lb-home .lbh-cat { transition: background-color .2s ease, transform .2s ease; }
body.lb-home .lbh-cat:hover { background: var(--cat-bg, var(--lb-green-mint)); }
body.lb-home .lbh-cat:hover .lbh-cat-ico {
  background: #ffffff;
  transform: scale(1.06);
}

@media (min-width: 768px) {
  body.lb-home .lbh-cats-card {
    padding-top: max(18px, calc(26 * var(--u)));
    padding-bottom: max(16px, calc(22 * var(--u)));
    border: 1px solid #eef1f4;
  }
  body.lb-home .lbh-cats { margin-top: max(10px, calc(14 * var(--u))); }
  body.lb-home .lbh-cat  { padding-top: max(8px, calc(10 * var(--u))); padding-bottom: max(8px, calc(10 * var(--u))); }
  body.lb-home .lbh-cat-ico {
    flex-basis: max(52px, calc(78 * var(--u)));
    width: max(52px, calc(78 * var(--u)));
    height: max(52px, calc(78 * var(--u)));
    border-radius: 16px;
  }
  body.lb-home .lbh-cat-ico svg.i {
    width: max(24px, calc(38 * var(--u))) !important;
    height: max(24px, calc(38 * var(--u))) !important;
  }
}

/* Mobile list items get the colour too */
@media (max-width: 767px) {
  body.lb-home .lbh-cat-ico { border-radius: 12px; }
}


/* ---------------------------------------------------------------------
   4. HOW IT WORKS — softer cards
   --------------------------------------------------------------------- */
body.lb-home .lbh-step {
  border: 1px solid #e6efe9;
  box-shadow: var(--lbr-card-shadow);
}
body.lb-home .lbh-step:hover { box-shadow: var(--lbr-card-shadow-hover); border-color: #cfe5d6; }


/* ---------------------------------------------------------------------
   5. TRUSTED PROVIDERS — .lbh-pcard
   --------------------------------------------------------------------- */
body.lb-home .lbh-providers > .lbh-pcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #eceff3;
  border-radius: var(--lbr-radius);
  box-shadow: var(--lbr-card-shadow);
  color: inherit;
  text-decoration: none;
}
body.lb-home .lbh-providers > .lbh-pcard:hover {
  transform: translateY(-4px);
  box-shadow: var(--lbr-card-shadow-hover);
  border-color: #d5e9dc;
}
body.lb-home .lbh-providers > .lbh-pcard:focus-visible {
  outline: 3px solid rgba(11, 107, 52, .35);
  outline-offset: 2px;
}

body.lb-home .lbh-pcard-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #e8f4ec, #fdf3cf);
}
body.lb-home .lbh-providers .lbh-pcard-media img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center 25%;
  transition: transform .35s ease;
}
body.lb-home .lbh-pcard:hover .lbh-pcard-media img { transform: scale(1.05); }

body.lb-home .lbh-pcard-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 2px 8px rgba(16, 24, 40, .15);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--lb-ink);
}
body.lb-home .lbh-pcard-badge i { color: #f5a524; font-size: 11px; }
body.lb-home .lbh-pcard-badge-new { background: var(--lb-yellow); }

body.lb-home .lbh-pcard-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  padding: 12px 14px 14px;
  min-width: 0;
}
body.lb-home .lbh-providers .lbh-pcard-name {
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--lb-ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.lb-home .lbh-pcard-cat {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  color: var(--lb-green);
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.lb-home .lbh-pcard-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  font-size: 12.5px;
  color: var(--lb-muted);
}
body.lb-home .lbh-pcard-place {
  overflow: hidden;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.lb-home .lbh-pcard-place i { color: var(--lb-green); margin-right: 3px; }
body.lb-home .lbh-pcard-reviews { flex: 0 0 auto; }

/* "Explore all" card */
body.lb-home .lbh-providers > .lbh-pcard-more {
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  min-height: 260px;
  padding: 22px 20px;
  border: 1.5px dashed #b9dcc5;
  background:
    radial-gradient(160px 120px at 100% 0%, rgba(248, 197, 28, .18), transparent 70%),
    var(--lb-green-mint);
  box-shadow: none;
}
body.lb-home .lbh-providers > .lbh-pcard-more:hover { border-color: var(--lb-green); box-shadow: var(--lbr-card-shadow); }
body.lb-home .lbh-pcard-more-ico {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #ffffff;
  color: var(--lb-green);
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(11, 107, 52, .12);
}
body.lb-home .lbh-providers .lbh-pcard-more strong { font-size: 17px; font-weight: 800; color: var(--lb-ink); }
body.lb-home .lbh-pcard-more small { font-size: 13.5px; line-height: 1.5; color: var(--lb-text); }
body.lb-home .lbh-pcard-more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--lb-green);
}
body.lb-home .lbh-pcard-more:hover .lbh-pcard-more-link svg.i { transform: translateX(3px); }
body.lb-home .lbh-pcard-more-link svg.i { transition: transform .2s ease; }

@media (max-width: 767px) {
  body.lb-home .lbh-providers > .lbh-pcard { flex: 0 0 62%; max-width: 230px; }
  body.lb-home .lbh-providers > .lbh-pcard-more { min-height: 0; }
}


/* ---------------------------------------------------------------------
   6. BLOG — taller thumbnails + fallback art
   --------------------------------------------------------------------- */
body.lb-home .lbh-post {
  border: 1px solid #eceff3;
  border-radius: var(--lbr-radius);
  box-shadow: var(--lbr-card-shadow);
}
body.lb-home .lbh-post:hover { box-shadow: var(--lbr-card-shadow-hover); }

body.lb-home .lbh-post-thumb {
  background:
    radial-gradient(120px 90px at 85% 15%, rgba(248, 197, 28, .35), transparent 70%),
    radial-gradient(160px 120px at 10% 100%, rgba(11, 107, 52, .18), transparent 70%),
    linear-gradient(135deg, #eef8f1, #fdf6dc);
}
body.lb-home .lbh-post-thumb > svg.i {
  width: 56px !important;
  height: 56px !important;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .85);
  box-shadow: 0 6px 18px rgba(11, 107, 52, .15);
  color: var(--lb-green);
}

@media (min-width: 768px) {
  body.lb-home .lbh-post-thumb { height: auto; aspect-ratio: 16 / 9; }
  body.lb-home .lbh-blog { gap: max(20px, calc(40 * var(--u))); }
}


/* ---------------------------------------------------------------------
   7. CTA + ADVERTISE — subtle depth
   --------------------------------------------------------------------- */
body.lb-home .lbh-pro { border: 1px solid #dcefe2; }

/* Keep the paragraph clear of the three photos on the right
   (the photo cluster is 530u wide; the old 470u padding let text run under it). */
@media (min-width: 992px) {
  body.lb-home .lbh-pro { padding-right: calc(570 * var(--u)); }
  body.lb-home .lbh-pro-copy p { max-width: none; }
}
body.lb-home .lbh-adv-top { box-shadow: 0 14px 34px rgba(11, 107, 52, .18); }


/* ---------------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  body.lb-home .lbh-pcard,
  body.lb-home .lbh-pcard-media img,
  body.lb-home .lbh-cat,
  body.lb-home .lbh-cat-ico { transition: none !important; }
  body.lb-home .lbh-pcard:hover,
  body.lb-home .lbh-pcard:hover .lbh-pcard-media img { transform: none !important; }
}
