/* =============================================================
 * Utilities Bunker — Home Styles (v2.1)
 * File: /assets/css/home.v2.1.css
 * Purpose:
 *  - Home-only styling (hero, grids, cards, FAQ)
 *  - Keep consistent with UB Toolkit v2.1 tokens + spacing
 * Notes:
 *  - Do NOT modify /assets/css/ub-toolkit.v2.1.css
 *  - Mobile-first, touch targets, clamp() typography
 * ============================================================= */

/* ------------------------------
   Home background (subtle)
   Uses :root tokens already set by toolkit themes.
------------------------------ */
body{
  position: relative;
}
body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .42;
  background:
    radial-gradient(900px 450px at 10% -10%, rgba(13,110,253,.10), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(10,173,97,.09), transparent 55%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.020) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.018) 0 1px, transparent 1px 42px);
}
html.ub-theme-dark body::before{
  opacity: .25;
  background:
    radial-gradient(900px 450px at 10% -10%, rgba(96,165,250,.10), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(34,197,94,.08), transparent 55%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.030) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.020) 0 1px, transparent 1px 46px);
}

/* ------------------------------
   Home hero
------------------------------ */
.ub-home-hero{
  overflow: hidden;
  position: relative;
}

/* Hero top row (title + theme button) */
.ub-home-hero-top{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

/* CTA buttons row */
.ub-home-cta{
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Category pills row */
.ub-home-pills{
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Gentle glow accents inside hero card (v1-ish but v2.1-clean) */
.ub-home-hero::after{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(420px 200px at 15% 0%, rgba(255,116,38,.18), transparent 60%),
    radial-gradient(380px 220px at 100% 10%, rgba(249,58,19,.16), transparent 62%);
  opacity: .55;
  pointer-events:none;
}
html.ub-theme-dark .ub-home-hero::after{
  opacity: .35;
}

/* ------------------------------
   Home grid
   Used for popular, categories, related, FAQ
------------------------------ */
.ub-home-grid{
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

/* >= 540px: 2 columns */
@media (min-width: 540px){
  .ub-home-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* >= 980px: 3 columns */
@media (min-width: 980px){
  .ub-home-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ------------------------------
   Home cards (links)
------------------------------ */
.ub-home-card{
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--ub-border);
  border-radius: var(--ub-radius-2);
  background:
    linear-gradient(180deg, rgba(0,0,0,.02), transparent 55%);
  padding: 14px;
  min-height: 112px;
  transition:
    transform .12s ease,
    background .12s ease,
    border-color .12s ease,
    box-shadow .12s ease;
}

html.ub-theme-dark .ub-home-card{
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 60%);
  border-color: rgba(255,255,255,.12);
}

.ub-home-card:hover{
  transform: translateY(-1px);
  background: var(--ub-surface-2);
  box-shadow: var(--ub-shadow);
}

.ub-home-card:focus-visible{
  outline: 3px solid var(--ub-focus);
  outline-offset: 2px;
}

.ub-home-card .kicker{
  display: inline-block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ub-link);
}

.ub-home-card h3{
  margin: 0 0 6px;
  font-size: clamp(15px, 0.95rem + 0.25vw, 17px);
  letter-spacing: -0.01em;
  font-weight: 950;
}

.ub-home-card p{
  margin: 0;
  color: var(--ub-muted);
  font-size: var(--ub-fs-1);
  line-height: 1.45;
}

/* ------------------------------
   Popular section: keep it compact
------------------------------ */
.ub-home-popular .ub-home-card{
  min-height: 106px;
}

/* ------------------------------
   FAQ styling (details)
------------------------------ */
.ub-home-faq details{
  border: 1px solid var(--ub-border);
  border-radius: var(--ub-radius-1);
  background: var(--ub-surface-1);
  padding: 12px 14px;
}

html.ub-theme-dark .ub-home-faq details{
  border-color: rgba(255,255,255,.12);
  background: var(--ub-surface-1);
}

.ub-home-faq details summary{
  cursor: pointer;
  list-style: none;
  font-weight: 950;
  min-height: var(--ub-hit);
  display: flex;
  align-items: center;
}

.ub-home-faq details summary:focus{
  outline: none;
  box-shadow: 0 0 0 4px var(--ub-focus);
  border-radius: 12px;
}

.ub-home-faq details p{
  margin: 10px 0 0;
  color: var(--ub-muted);
  font-size: var(--ub-fs-1);
}

/* ------------------------------
   Rail helpers (home)
------------------------------ */
.ub-rail .ub-btn--block{
  width: 100%;
}

/* ------------------------------
   Small screen polish
------------------------------ */
@media (max-width: 420px){
  .ub-home-card{
    padding: 12px;
  }
  .ub-home-cta{
    gap: 8px;
  }
  .ub-home-pills{
    gap: 8px;
  }
}