/* =====================================================================
   Browse software categories  (/directories/software)
   Page-scoped bundle, loaded by src/app/directories/software/page.tsx.
   Everything is scoped under `.swd` so it cannot leak into
   /directories (the service hub), which shares this route's layout and
   therefore also loads common.css + directory.css.

   ⚠️ BUMP ?v ON EVERY EDIT — /static/css/* is served from a stable URL
   behind the CDN, so the query string is the only cache key.

   Structure from browse-software.html (owner, 2026-09-18). Colours use
   the site's existing navy/gold rather than the reference's own tokens.
   ===================================================================== */

.swd {
  --swd-navy: #171923;
  --swd-gold: #c5a063;
  --swd-gold-strong: #b58e4c;
  --swd-ink: #20232e;
  --swd-ink-soft: #5b606e;
  --swd-ink-faint: #8a8f9c;
  --swd-line: #ececec;
  --swd-cream: #f8f6f1;
  --swd-cream-2: #f3f0e9;
  --swd-r-sm: 6px;
  --swd-r-lg: 12px;
  --swd-t: 200ms ease;
  --swd-maxw: 1180px;

  color: var(--swd-ink);
  background: #fff;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.swd *, .swd *::before, .swd *::after { box-sizing: border-box; }
.swd a { color: inherit; text-decoration: none; }
.swd h1, .swd h2, .swd h3 { font-family: "Manrope", system-ui, sans-serif; margin: 0; letter-spacing: -.01em; }
.swd :focus-visible { outline: 2px solid var(--swd-gold); outline-offset: 2px; border-radius: 4px; }

.swd .swd-wrap { max-width: var(--swd-maxw); margin: 0 auto; padding: 0 24px; }

/* ------------------------------------------------------------- hero ---- */
.swd .swd-hero {
  position: relative; overflow: hidden;
  background: var(--swd-navy); color: #e7e9ef;
  padding: 38px 0 46px;
}
/* Faint grid, faded out from the top-right so it never competes with the
   headline on the left. */
.swd .swd-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(120% 90% at 88% 0%, #000 0%, transparent 60%);
          mask-image: radial-gradient(120% 90% at 88% 0%, #000 0%, transparent 60%);
}
.swd .swd-hero .swd-wrap { position: relative; z-index: 1; }
.swd .swd-crumb { font-size: 13px; color: #9296a3; margin-bottom: 18px; }
.swd .swd-crumb a:hover { color: #fff; }
.swd .swd-crumb span { color: #61667a; margin: 0 7px; }
.swd .swd-hero h1 { font-size: clamp(28px, 4.4vw, 46px); font-weight: 800; line-height: 1.05; color: #fff; }
.swd .swd-hero p { max-width: 640px; margin: 14px 0 0; color: #b5b9c4; font-size: 16px; }

.swd .swd-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.swd .swd-stat {
  min-width: 150px; padding: 14px 20px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--swd-r-lg);
}
.swd .swd-stat b {
  display: flex; align-items: center; gap: 5px; line-height: 1;
  font-family: "Manrope", system-ui, sans-serif; font-weight: 800;
  font-size: 22px; color: var(--swd-gold);
}
/* 🔴 The child combinator is load-bearing, not tidiness. The caption span is a
   direct child of .swd-stat; the star sits one level deeper, inside the <b>.
   As a descendant selector this rule is (0,2,1) and BEATS .swd-star's (0,2,0),
   so it repainted the star grey and shrank it to 13px. The reference sheet has
   no such clash only because its unprefixed `.stat span` is (0,1,1) - adding
   the `.swd` page scope to every rule is what flipped the comparison. */
.swd .swd-stat > span { display: block; margin-top: 6px; font-size: 13px; color: #9296a3; }
.swd .swd-star { font-size: 16px; color: var(--swd-gold); }

/* ---------------------------------------------------- sticky filter ---- */
.swd .swd-filter {
  position: sticky; top: 0; z-index: 40;
  background: var(--swd-cream); border-bottom: 1px solid var(--swd-line);
  box-shadow: 0 1px 2px rgba(23,25,35,.04);
}
.swd .swd-filter-inner { display: flex; align-items: center; gap: 18px; height: 66px; }

.swd .swd-search { position: relative; flex: 0 0 320px; max-width: 340px; }
.swd .swd-search svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--swd-ink-faint);
}
.swd .swd-search input {
  width: 100%; height: 42px; padding: 0 14px 0 38px;
  font: inherit; font-size: 14px; color: var(--swd-ink);
  background: #fff; border: 1px solid #dcd8cf; border-radius: var(--swd-r-sm);
  transition: border-color var(--swd-t), box-shadow var(--swd-t);
}
.swd .swd-search input:focus {
  outline: none; border-color: var(--swd-gold);
  box-shadow: 0 0 0 3px rgba(197,160,99,.18);
}

.swd .swd-jumpwrap { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.swd .swd-lbl { flex: none; font-size: 13px; font-weight: 500; color: var(--swd-ink-soft); }
.swd .swd-jnav {
  flex: none; width: 30px; height: 30px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font: inherit; font-size: 18px; line-height: 0; color: var(--swd-ink-soft);
  background: #fff; border: 1px solid #e3ded4; border-radius: var(--swd-r-sm);
  cursor: pointer; transition: color var(--swd-t), border-color var(--swd-t);
}
.swd .swd-jnav:hover { color: var(--swd-navy); border-color: var(--swd-gold); }
.swd .swd-jnav:disabled { opacity: .3; cursor: default; pointer-events: none; }

/* Horizontal letter strip. Scrollbar hidden because the arrows are the
   affordance; the strip still scrolls by wheel, drag and keyboard. */
.swd .swd-jump {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0; overflow-x: auto; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none;
}
.swd .swd-jump::-webkit-scrollbar { display: none; }
.swd .swd-chip {
  flex: none; min-width: 30px; height: 30px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--swd-ink-soft);
  background: #fff; border: 1px solid #e3ded4; border-radius: var(--swd-r-sm);
  transition: color var(--swd-t), border-color var(--swd-t), background var(--swd-t);
}
.swd a.swd-chip:hover { color: var(--swd-navy); border-color: var(--swd-gold); }
.swd .swd-chip.is-on { background: var(--swd-gold); border-color: var(--swd-gold); color: var(--swd-navy); }
/* A letter with nothing behind it stays in place so the strip never reflows
   mid-search - it just stops being a target. */
.swd .swd-chip.is-off { opacity: .35; pointer-events: none; }

.swd .swd-meta { flex: none; font-size: 13px; color: var(--swd-ink-faint); white-space: nowrap; }
.swd .swd-meta b { color: var(--swd-ink-soft); font-weight: 600; }

/* ---------------------------------------------------------- content ---- */
.swd .swd-main { padding: 40px 0 64px; background: #fff; }
/* Clears the sticky bar when a letter link jumps to a section. */
.swd .swd-sec { margin-bottom: 40px; scroll-margin-top: 82px; }
.swd .swd-sec-head { padding: 0 0 14px; margin-bottom: 22px; border-bottom: 1px solid var(--swd-line); }
.swd .swd-sec-head h2 { font-size: 26px; font-weight: 800; color: var(--swd-ink); }

.swd .swd-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px 40px; }
/* font-size:16px — was 15px (owner, 2026-09-22). This is the ONLY rule that
   sizes a category name: the two `.swd-cat-grid` media queries below change
   `grid-template-columns` only, so there is no responsive override to keep in
   step. `width: fit-content` keeps the hover target on the text rather than the
   full grid cell, so a slightly wider label does not widen the hit area. */
.swd .swd-cat { width: fit-content; font-size: 16px; line-height: 1.4; color: var(--swd-ink); transition: color var(--swd-t); }
.swd .swd-cat:hover { color: var(--swd-gold-strong); }

.swd .swd-empty { padding: 60px 20px; text-align: center; color: var(--swd-ink-soft); }
.swd .swd-empty b {
  display: block; margin-bottom: 6px;
  font-family: "Manrope", system-ui, sans-serif; font-weight: 700;
  font-size: 18px; color: var(--swd-navy);
}

/* -------------------------------------------------------------- cta ---- */
.swd .swd-cta { background: var(--swd-cream-2); border-top: 1px solid var(--swd-line); border-bottom: 1px solid var(--swd-line); }
.swd .swd-cta .swd-wrap { padding: 34px 24px; }
.swd .swd-sponsor {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 20px;
  padding: 20px 24px; background: #fff;
  border: 1px solid var(--swd-line); border-radius: var(--swd-r-lg);
}
.swd .swd-sponsor::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 140% at 100% 0%, rgba(197,160,99,.16), transparent 55%);
}
.swd .swd-s-ic {
  flex: none; z-index: 1; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--swd-navy);
  background: var(--swd-gold); border-radius: 10px;
}
.swd .swd-s-body { z-index: 1; flex: 1; min-width: 0; }
.swd .swd-s-body h3 { margin-bottom: 3px; font-size: 17px; font-weight: 800; color: var(--swd-navy); }
.swd .swd-s-body p { margin: 0; font-size: 13.5px; color: var(--swd-ink-soft); }
.swd .swd-s-cta {
  flex: none; z-index: 1; padding: 10px 18px;
  font-size: 14px; font-weight: 700; color: var(--swd-navy);
  background: var(--swd-gold); border-radius: var(--swd-r-sm);
  transition: background var(--swd-t), transform var(--swd-t);
}
.swd .swd-s-cta:hover { background: #d4b177; transform: translateY(-1px); }

/* ------------------------------------------------------- responsive ---- */
@media (max-width: 900px) {
  .swd .swd-cat-grid { grid-template-columns: repeat(2, 1fr); }
  .swd .swd-search { flex-basis: 220px; }
}
@media (max-width: 620px) {
  .swd .swd-cat-grid { grid-template-columns: 1fr; }
  /* The bar becomes two stacked rows; keeping it sticky at that height would
     eat most of a phone viewport, so it scrolls away instead. */
  .swd .swd-filter { position: static; }
  .swd .swd-filter-inner { height: auto; flex-direction: column; align-items: stretch; gap: 12px; padding: 12px 0; }
  .swd .swd-search { flex-basis: auto; max-width: none; }
  .swd .swd-meta { display: none; }
  .swd .swd-sec { scroll-margin-top: 16px; }
  .swd .swd-stat { flex: 1 1 45%; min-width: 0; }
  .swd .swd-sponsor { flex-direction: column; align-items: flex-start; }
  .swd .swd-s-cta { width: 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .swd *, .swd .swd-jump { transition: none !important; scroll-behavior: auto !important; }
  .swd .swd-s-cta:hover { transform: none; }
}
