/* ======================================================
   HomeTriks – Category Archive
====================================================== */

.ht-cat-wrap{
  --ht-ink: #0f172a;
  --ht-muted: #64748b;
  --ht-line: rgba(15,23,42,.10);
  --ht-card: #ffffff;
  --ht-soft: #f6f7fb;
  --ht-shadow: 0 18px 44px rgba(15,23,42,.10);
  --ht-shadow-sm: 0 10px 26px rgba(15,23,42,.08);
  --ht-radius: 18px;
  --ht-radius-lg: 22px;
  --ht-accent: #2b6cb0;            /* align with your theme token */
  --ht-accent-soft: rgba(43,108,176,.12);

  color: var(--ht-ink);
  background:
    radial-gradient(900px 520px at 15% 5%, rgba(43,108,176,.10), transparent 60%),
    radial-gradient(900px 520px at 85% 10%, rgba(15,23,42,.06), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, var(--ht-soft) 55%, #ffffff 100%);
}

/* content container rhythm */
.ht-cat-wrap .container{
  max-width: 1120px;
}

/* =======================
   HERO
======================= */
.ht-cat-hero{
  position: relative;
  padding: clamp(2.25rem, 4.2vw, 3.75rem) 0;
  overflow: hidden;
  border-bottom: 1px solid var(--ht-line);
  background:
    linear-gradient(180deg, rgba(2,6,23,.55) 0%, rgba(2,6,23,.65) 45%, rgba(2,6,23,.12) 100%),
    var(--ht-hero) center/cover no-repeat;
}

.ht-cat-hero::after{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(800px 420px at 20% 20%, rgba(255,255,255,.14), transparent 55%),
    radial-gradient(900px 520px at 80% 10%, rgba(43,108,176,.16), transparent 60%);
  pointer-events:none;
}

.ht-cat-hero > .container{
  position: relative;
  z-index: 1;
}

.ht-cat-hero .hero-card{
  max-width: 980px;
  padding: clamp(1.25rem, 2.2vw, 1.85rem);
  border-radius: var(--ht-radius-lg);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 44px rgba(0,0,0,.22);
}

.ht-cat-hero .breadcrumb{
  --bs-breadcrumb-divider: "›";
  margin-bottom: .25rem !important;
}

.ht-cat-hero .breadcrumb a{
  color: rgba(50,83,118,.85);
  text-decoration: none;
}
.ht-cat-hero .breadcrumb a:hover{
  color: #fff;
  text-decoration: underline;
}
.ht-cat-hero .breadcrumb-item.active{
  color: rgba(50,83,118,.75);
}

.ht-cat-hero h1,
.ht-cat-hero p{
  color: #3f3c3c;
}
.ht-cat-hero p{
  color: rgba(255,255,255,.80);
}

/* =======================
   SECTIONS + SURFACES
======================= */
.ht-cat-wrap .section{
  padding: clamp(1.35rem, 2.6vw, 2.15rem) 0;
}

.ht-cat-wrap .surface{
  background: rgba(255,255,255,.72);
  border: 1px solid var(--ht-line);
  border-radius: var(--ht-radius-lg);
  box-shadow: var(--ht-shadow-sm);
}

.ht-cat-wrap .section-title h2{
  font-size: clamp(1.1rem, 1.7vw, 1.45rem);
  font-weight: 850;
  letter-spacing: -0.3px;
  margin: 0;
}

.ht-cat-wrap .text-muted-ht{
  color: var(--ht-muted) !important;
}

/* =======================
   CHIPS (Intro links + tags)
======================= */
.ht-cat-wrap .chip{
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--ht-line);
  background: rgba(255,255,255,.92);
  color: var(--ht-ink);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.ht-cat-wrap .chip i{
  color: var(--ht-accent);
}

.ht-cat-wrap .chip:hover{
  transform: translateY(-1px);
  border-color: rgba(43,108,176,.30);
  box-shadow: 0 14px 30px rgba(15,23,42,.10);
}

.ht-cat-wrap .chip:focus-visible{
  outline: none;
  box-shadow: 0 0 0 .25rem var(--ht-accent-soft), 0 14px 30px rgba(15,23,42,.12);
  border-color: rgba(43,108,176,.38);
}

/* =======================
   POST CARDS
======================= */
.ht-cat-wrap .post-card,
.ht-cat-wrap .cat-card{
  height: 100%;
  border-radius: var(--ht-radius-lg);
  overflow: hidden;
  border: 1px solid var(--ht-line);
  background: var(--ht-card);
  box-shadow: var(--ht-shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.ht-cat-wrap .post-card:hover,
.ht-cat-wrap .cat-card:hover{
  transform: translateY(-3px);
  border-color: rgba(15,23,42,.16);
  box-shadow: var(--ht-shadow);
}

.ht-cat-wrap .thumb{
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: #eaeef6;
}

/* subtle image polish */
.ht-cat-wrap .post-card .thumb,
.ht-cat-wrap .cat-card .thumb{
  transform: scale(1.001);
}

.ht-cat-wrap .tag-pill{
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .28rem .65rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .1px;
  border: 1px solid rgba(43,108,176,.22);
  background: rgba(43,108,176,.10);
  color: #1e3a8a;
  white-space: nowrap;
}

.ht-cat-wrap .meta{
  font-size: .9rem;
  color: var(--ht-muted);
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  white-space: nowrap;
}

.ht-cat-wrap .post-card h3 a{
  color: var(--ht-ink);
  text-decoration: none;
  display: inline;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .18s ease;
}

.ht-cat-wrap .post-card:hover h3 a{
  background-size: 100% 2px;
}

.ht-cat-wrap .post-card p{
  color: var(--ht-muted);
  line-height: 1.7;
}

/* Ratio wrapper MUST create a box */
.ht-cat-wrap .thumb-wrap{
  position: relative;
  display: block;              /* important for <a> */
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eaeef6;
  /*border-radius: inherit;       keeps corners consistent */
  contain: layout paint; /* tighten CLS */
}

/* Image fills wrapper */
.ht-cat-wrap .thumb-wrap > img.thumb{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* =======================
   SUBTOPICS BLOCK (make it feel like a “hub”)
======================= */
.ht-cat-wrap #subtopics .surface{
  background: #fff;
}

.ht-cat-wrap #subtopics .chip{
  background: #fff;
}

/* =======================
   PAGINATION
======================= */
.ht-cat-wrap .pagination{
  gap: .35rem;
}

.ht-cat-wrap .pagination .page-numbers{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 44px;
  height: 44px;
  padding: 0 .9rem;
  border-radius: 999px;
  border: 1px solid var(--ht-line);
  background: rgba(255,255,255,.92);
  color: var(--ht-ink);
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.ht-cat-wrap .pagination .page-numbers:hover{
  transform: translateY(-1px);
  border-color: rgba(43,108,176,.30);
  box-shadow: 0 14px 30px rgba(15,23,42,.10);
}

.ht-cat-wrap .pagination .page-numbers.current{
  background: rgba(43,108,176,.14);
  border-color: rgba(43,108,176,.34);
  color: #123a6b;
}

.ht-cat-wrap .pagination .page-numbers:focus-visible{
  outline: none;
  box-shadow: 0 0 0 .25rem var(--ht-accent-soft), 0 14px 30px rgba(15,23,42,.12);
}

/* =======================
   RESPONSIVE TWEAKS
======================= */
@media (max-width: 575.98px){
  .ht-cat-hero .hero-card{
    border-radius: var(--ht-radius);
  }

  .ht-cat-wrap .chip{
    font-size: .92rem;
    padding: .5rem .8rem;
  }

  .ht-cat-wrap .meta{
    white-space: normal;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .ht-cat-wrap .chip,
  .ht-cat-wrap .post-card,
  .ht-cat-wrap .cat-card,
  .ht-cat-wrap .pagination .page-numbers{
    transition: none !important;
  }
}

/* =======================================
   Custom category hero background image
======================================== */
.ht-category-hero {
  position: relative;
  min-height: 280px;
  padding: clamp(2rem, 4vw, 4rem);
  background-size: cover;
  background-position: center;
  border-radius: 1.25rem;
  overflow: hidden;
}

.ht-category-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.35),
    rgba(0,0,0,.55)
  );
}

.ht-category-hero > * {
  position: relative;
  z-index: 1;
}
