/* Insight.lk | Homepage category cards
   Tag 20261128cats3: product photos replaced with theme line icons
   on a soft-yellow circle. Load after home-theme.css and mobile-theme.css. */

body.page-home.dt-theme .cats3,
body.page-home.mt-theme .mt-cats {
  --cat-bg: #fbf8f0;
  --cat-yellow: var(--yellow, #ffd200);
  --cat-yellow-soft: #fff4c2;
  --cat-yellow-line: #f1d75a;
  --cat-ink: #111;
  --cat-hover-shadow: 0 16px 34px rgba(40,32,0,.12);
  background: var(--cat-bg) !important;
  font-family: var(--font, "Inter", "Noto Sans Sinhala", "Noto Sans Tamil", system-ui, sans-serif);
  color: var(--cat-ink);
  overflow: visible;
}

/* Product photos are removed from the markup; keep this as a safety net. */
body.page-home.dt-theme .cats3 .cat3 .cat3__img,
body.page-home.mt-theme .mt-cats .mt-cat img {
  display: none !important;
}

/* Shared icon circle: ink line-icon on soft yellow. */
body.page-home.dt-theme .cats3 .cat3 .cat3__ico,
body.page-home.mt-theme .mt-cats .mt-cat .mt-cat__ico {
  display: grid !important;
  place-items: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--cat-yellow-soft, #fff4c2);
  border: 1px solid var(--cat-yellow-line, #f1d75a);
  color: #111;
  pointer-events: none;
}
body.page-home.dt-theme .cats3 .cat3 .cat3__ico svg,
body.page-home.mt-theme .mt-cats .mt-cat .mt-cat__ico svg {
  display: block;
  width: 32px;
  height: 32px;
  overflow: visible;
}

/* ========================================================================
   Mobile-first (≤767px): 2×4 grid, crisp icons, 44px+ tap targets,
   room above the sticky WhatsApp/Call bar and chat bubble.
   ======================================================================== */
@media (max-width: 767.98px) {
  body.page-home.mt-theme .mt-cats {
    --cat-bg: var(--mt-bg, #fbf8f0);
    --cat-yellow: var(--mt-y, var(--yellow, #ffd200));
    padding: 16px 12px 20px;
  }
  body.page-home.mt-theme .mt-cats .mt-h {
    margin: 0 0 12px;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.15;
    color: #111;
    text-align: left;
  }
  body.page-home.mt-theme .mt-cats .mt-cats__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 12px;
    overflow: visible;
  }
  body.page-home.mt-theme .mt-cats a.mt-cat {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
    min-width: 0;
    min-height: 112px;
    background: #fff;
    border: 1px solid var(--mt-line, #ece6d6);
    border-radius: 14px;
    box-shadow: var(--mt-sh, 0 6px 18px rgba(40,32,0,.07), 0 1px 3px rgba(40,32,0,.06));
    color: #111;
    text-decoration: none;
    overflow: visible;
    transform: none;
    transition: transform .18s ease, box-shadow .18s ease;
    /* Keep a focused/scrolled card clear of the 68px .m45-bar and the chat FAB. */
    scroll-margin-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  }
  body.page-home.mt-theme .mt-cats .mt-cat .mt-cat__ico {
    width: 64px;
    height: 64px;
    margin: 10px auto 0;
  }
  body.page-home.mt-theme .mt-cats .mt-cat .mt-cat__ico svg {
    width: 32px;
    height: 32px;
  }
  body.page-home.mt-theme .mt-cats .mt-cat__t {
    display: flex;
    flex: 1 0 auto;
    align-items: center;
    box-sizing: content-box;
    min-height: 2.2em;
    padding: 6px 36px 8px 10px;
    font-size: .8125rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  body.page-home.mt-theme .mt-cats .mt-cat__go {
    position: absolute;
    right: 8px;
    bottom: 10px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--cat-yellow);
    color: #111;
    pointer-events: none;
  }
  body.page-home.mt-theme .mt-cats a.mt-cat:focus-visible {
    outline: 3px solid #111 !important;
    outline-offset: 2px;
    box-shadow: var(--cat-hover-shadow);
    z-index: 1;
  }
}

/* 360px-wide phones: slightly tighter circle, same 2-col grid and tap size. */
@media (max-width: 360px) {
  body.page-home.mt-theme .mt-cats {
    padding: 14px 10px 18px;
  }
  body.page-home.mt-theme .mt-cats .mt-cats__grid {
    gap: 10px;
  }
  body.page-home.mt-theme .mt-cats a.mt-cat {
    min-height: 108px;
  }
  body.page-home.mt-theme .mt-cats .mt-cat .mt-cat__ico {
    width: 60px;
    height: 60px;
    margin-top: 8px;
  }
  body.page-home.mt-theme .mt-cats .mt-cat .mt-cat__ico svg {
    width: 30px;
    height: 30px;
  }
  body.page-home.mt-theme .mt-cats .mt-cat__t {
    font-size: .8125rem;
    padding: 6px 34px 8px 10px;
  }
}

/* ========================================================================
   Desktop and tablet share the existing desktop markup. 4×2 grid.
   ======================================================================== */
@media (min-width: 768px) {
  body.page-home.dt-theme .cats3 {
    --cat-bg: var(--dt-bg, #fbf8f0);
    --cat-yellow: var(--dt-y, var(--yellow, #ffd200));
    padding-block: clamp(24px, 2.4vw, 40px) 12px;
  }
  body.page-home.dt-theme .cats3 .cats3__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin: 0 0 18px;
  }
  body.page-home.dt-theme .cats3 .cats3__eyebrow {
    margin: 0 0 6px;
    color: #7a6a2a;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .14em;
    line-height: 1.4;
  }
  body.page-home.dt-theme .cats3 h2 {
    margin: 0;
    color: #111;
    font-size: clamp(1.55rem, .9rem + 1.05vw, 2.15rem);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.15;
  }
  body.page-home.dt-theme .cats3 .cats3__dot { color: var(--cat-yellow); }
  body.page-home.dt-theme .cats3 .cats3__aside {
    margin: 0 0 2px;
    color: var(--dt-mute, #5f5f5f);
    font-size: .8125rem;
    line-height: 1.4;
  }
  body.page-home.dt-theme .cats3 .preview-wrap { overflow: visible; }
  body.page-home.dt-theme .cats3 .cats3__grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-rows: 1fr;
    gap: clamp(12px, 1.2vw, 18px) !important;
    overflow: visible;
  }
  body.page-home.dt-theme .cats3 a.cat3 {
    position: relative;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    min-width: 0;
    gap: 8px;
    padding: 22px 12px 14px;
    background: #fff !important;
    border: 1px solid #f0ead8 !important;
    border-radius: var(--dt-r, 18px) !important;
    box-shadow: var(--dt-sh, 0 10px 30px rgba(40,32,0,.07), 0 2px 6px rgba(40,32,0,.05));
    color: #111 !important;
    text-align: center;
    text-decoration: none !important;
    overflow: visible;
    transform: none;
    transition: transform .18s ease, box-shadow .18s ease;
  }
  body.page-home.dt-theme .cats3 .cat3 .cat3__ico {
    width: 96px;
    height: 96px;
    margin: 4px 0 2px;
  }
  body.page-home.dt-theme .cats3 .cat3 .cat3__ico svg {
    width: 44px;
    height: 44px;
  }
  body.page-home.dt-theme .cats3 .cat3 strong {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.5em;
    margin: 0;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  body.page-home.dt-theme .cats3 .cat3 .cat3__arr {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid !important;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--cat-yellow);
    color: #111;
    pointer-events: none;
  }
  body.page-home.dt-theme .cats3 a.cat3:focus-visible {
    outline: 3px solid #111 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--cat-yellow), var(--cat-hover-shadow) !important;
    z-index: 1;
  }
}

/* Tablet: same icon treatment, slightly smaller circle. */
@media (min-width: 768px) and (max-width: 900.98px) {
  body.page-home.dt-theme .cats3 .cats3__grid { gap: 12px !important; }
  body.page-home.dt-theme .cats3 a.cat3 { padding: 16px 8px 12px; }
  body.page-home.dt-theme .cats3 .cat3 .cat3__ico {
    width: 80px;
    height: 80px;
  }
  body.page-home.dt-theme .cats3 .cat3 .cat3__ico svg {
    width: 38px;
    height: 38px;
  }
  body.page-home.dt-theme .cats3 .cat3 strong { font-size: .8125rem; }
}

/* Pointer hover only: avoids sticky hover on touchscreens. */
@media (hover: hover) and (pointer: fine) {
  body.page-home.dt-theme .cats3 a.cat3:hover,
  body.page-home.mt-theme .mt-cats a.mt-cat:hover {
    transform: translateY(-3px);
    box-shadow: var(--cat-hover-shadow);
  }
  body.page-home.dt-theme .cats3 a.cat3:hover .cat3__arr,
  body.page-home.mt-theme .mt-cats a.mt-cat:hover .mt-cat__go {
    background: #ffdf3d;
  }
  body.page-home.dt-theme .cats3 a.cat3:hover .cat3__ico,
  body.page-home.mt-theme .mt-cats a.mt-cat:hover .mt-cat__ico {
    background: var(--cat-yellow, #ffd200);
  }
}

/* Keep focus indication, but remove motion when requested. */
@media (prefers-reduced-motion: reduce) {
  body.page-home.dt-theme .cats3 a.cat3,
  body.page-home.mt-theme .mt-cats a.mt-cat {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
