/* Blog library index + category pages. Extracted verbatim from
   BlogIndexLayout.astro's <style is:global> and served as a static /public asset
   so Astro can't drop it. Own <head>, own token set. */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900; font-display: swap; font-style: normal;
}
:root {
  --navy: #000000; --mint: #ff6a00; --white: #ffffff; --ink: #1b2432;
  --slate: #55627a; --muted: #8b98ad; --line: #e5e9f0; --soft: #f8fafc;
  --card: #ffffff; --page: #f4f6f9;
  --cat-buy: #0f9d6b; --cat-buy-bg: #ecfdf5; --cat-buy-line: #a7f3d0;
  --cat-safe: #b45309; --cat-safe-bg: #fff7ed; --cat-safe-line: #fed7aa;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.07);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
button { -webkit-appearance: none; appearance: none; }
html { -webkit-text-size-adjust: 100%; }
/* iOS Safari ignores overflow-x on body alone; the root html needs it too. */
@media (max-width: 1119px) { html, body { overflow-x: hidden; } }
body { margin: 0; overflow-x: hidden; font-family: Inter, system-ui, -apple-system, sans-serif;
       color: var(--ink); background: var(--page); line-height: 1.65; font-size: 16px;
       -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
.serif { font-family: 'Cabinet Grotesk', system-ui, sans-serif; }

.site-header, .site-footer { background: var(--navy); color: var(--white); }
.site-header { padding: 18px 0; }
.brand { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.brand .cited { font-family: 'Cabinet Grotesk', system-ui, sans-serif; }
.brand .labs { font-family: Inter, sans-serif; color: var(--mint); }
.brand a { color: var(--white); }
.site-footer { padding: 28px 0; font-size: 14px; color: var(--slate); }
.site-footer a { color: var(--slate); }
.site-footer a:hover { color: var(--white); }

.lib-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
main.lib { padding: 4px 0 40px; }

/* Masthead */
.masthead { padding: 52px 0 26px; text-align: center; }
.masthead h1 { font-family: 'Cabinet Grotesk', system-ui, sans-serif; font-size: clamp(32px, 5vw, 50px); line-height: 1.08;
               margin: 0 0 14px; color: var(--ink); text-wrap: balance; font-weight: 700; }
.masthead p { font-size: 18.5px; color: var(--slate); max-width: 60ch; margin: 0 auto; }
.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 26px; }
.cat-nav a { font-size: 13.5px; font-weight: 600; padding: 7px 15px; border-radius: 999px;
             border: 1px solid var(--line); background: var(--card); color: var(--slate); transition: all .15s ease; }
.cat-nav a:hover { border-color: var(--mint); color: var(--ink); }
.cat-nav a.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Blog index search */
.lib-search { display: flex; align-items: center; gap: 8px; max-width: 480px; margin: 24px auto 0;
              border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 14px; background: var(--card);
              box-shadow: var(--shadow-sm); }
.lib-search:focus-within { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(255,106,0,.16); }
.lib-search .s-ic { width: 18px; height: 18px; color: var(--muted); flex: none; }
.lib-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent;
                    font-size: 16px; color: var(--ink); font-family: inherit; }
.lib-search button { background: var(--navy); color: #fff; border: none; font-weight: 700; font-size: 14.5px;
                     padding: 10px 17px; border-radius: 9px; cursor: pointer; }
.lib-search button:hover { background: #12233f; }
.lib-results { max-width: 480px; margin: 10px auto 0; text-align: left; display: grid; gap: 6px; }
.lib-results .r-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
                       border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; background: var(--card); color: var(--ink); }
.lib-results .r-item:hover { border-color: var(--mint); }
.lib-results .rt { font-weight: 600; font-size: 15px; }
.lib-results .rc { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.lib-results .none { color: var(--slate); font-size: 14.5px; padding: 4px 2px; margin: 0; }
.lib-results .none a { color: var(--mint); }

/* Category hero (SEO) */
.cat-hero { text-align: center; padding: 46px 24px 34px; margin: 12px 0 6px; border-radius: 20px;
            border: 1px solid var(--line); background: var(--card); }
.cat-hero.buy { background:
    radial-gradient(120% 130% at 50% -20%, var(--cat-buy-bg), transparent 60%), var(--card); }
.cat-hero.safe { background:
    radial-gradient(120% 130% at 50% -20%, var(--cat-safe-bg), transparent 60%), var(--card); }
.crumb { display: flex; gap: 8px; justify-content: center; align-items: center; font-size: 13px;
         color: var(--muted); margin-bottom: 18px; }
.crumb a { color: var(--mint); font-weight: 600; }
.crumb a:hover { text-decoration: underline; }
.cat-badge { display: inline-grid; place-items: center; width: 66px; height: 66px; border-radius: 18px;
             margin-bottom: 18px; }
.cat-badge svg { width: 34px; height: 34px; }
.cat-badge.buy { background: var(--cat-buy-bg); color: var(--cat-buy); box-shadow: inset 0 0 0 1px var(--cat-buy-line); }
.cat-badge.safe { background: var(--cat-safe-bg); color: var(--cat-safe); box-shadow: inset 0 0 0 1px var(--cat-safe-line); }
.cat-badge.brand { background: #ecfdf5; color: var(--mint); box-shadow: inset 0 0 0 1px #a7f3d0; }
.cat-hero h1 { font-family: 'Cabinet Grotesk', system-ui, sans-serif; font-size: clamp(32px, 4.8vw, 46px); line-height: 1.1;
               margin: 0 0 14px; color: var(--ink); text-wrap: balance; }
.cat-lead { font-size: 19px; line-height: 1.6; color: var(--slate); max-width: 60ch; margin: 0 auto; }
.cat-meta-row { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 20px;
                font-size: 13.5px; color: var(--muted); }
.cat-meta-row .pill { font-weight: 700; color: var(--ink); background: var(--soft);
                      border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; }

/* Category intro + FAQ (unique content for ranking) */
.cat-more { margin: 56px auto 0; max-width: 760px; }
.cat-more h2, .faq h2 { font-family: 'Cabinet Grotesk', system-ui, sans-serif; font-size: 26px; color: var(--ink); margin: 0 0 16px; text-align: center; }
.cat-more p { font-size: 16.5px; color: var(--slate); line-height: 1.75; margin: 0 0 16px; }
.faq { margin: 56px auto 0; max-width: 820px; }
.qa-list { display: grid; gap: 14px; }
.qa { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; box-shadow: var(--shadow-sm); }
.qa h3 { font-family: 'Cabinet Grotesk', system-ui, sans-serif; font-size: 18.5px; color: var(--ink); margin: 0 0 8px; }
.qa p { font-size: 15.5px; color: var(--slate); line-height: 1.7; margin: 0; }

/* Category tag */
.cat { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em;
       text-transform: uppercase; padding: 4px 10px; border-radius: 5px; margin-bottom: 14px; align-self: flex-start; }
.cat.buy { color: var(--cat-buy); background: var(--cat-buy-bg); box-shadow: inset 0 0 0 1px var(--cat-buy-line); }
.cat.safe { color: var(--cat-safe); background: var(--cat-safe-bg); box-shadow: inset 0 0 0 1px var(--cat-safe-line); }
.cat.brand { color: var(--mint); background: #ecfdf5; box-shadow: inset 0 0 0 1px #a7f3d0; }

/* Featured */
.featured { display: grid; grid-template-columns: 1.05fr .95fr; background: var(--card);
            border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
            box-shadow: var(--shadow); margin-top: 12px; }
.featured .body { padding: 40px; display: flex; flex-direction: column; }
.flag { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
        color: var(--mint); margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }
.flag::before { content: ""; width: 20px; height: 2px; background: var(--mint); }
.featured h2 { font-family: 'Cabinet Grotesk', system-ui, sans-serif; font-size: 32px; line-height: 1.14; margin: 0 0 14px;
               color: var(--ink); text-wrap: balance; }
.featured .excerpt { font-size: 17px; color: var(--slate); margin: 0 0 auto; }
.featured .hero-frame { display: block; height: 100%; background: #000; }
/* Banners are pure-black with the headline on the left; `contain` on a black
   frame shows the whole banner (letterbox blends into the black) so the
   headline is never sliced by the card's crop. */
.featured .hero-img { width: 100%; height: 100%; object-fit: contain; object-position: center; min-height: 320px; display: block; }
.featured h2 a:hover { text-decoration: underline; }
.hero-panel { position: relative; background:
    radial-gradient(120% 120% at 80% 10%, rgba(255,106,0,.28), transparent 55%),
    linear-gradient(160deg, #141414, #000000 70%);
    display: grid; place-items: center; min-height: 320px; }
.hero-panel .mark { width: 120px; height: 120px; }

/* Meta row */
.meta { display: flex; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap;
        font-size: 13.5px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--mint); color: var(--navy);
          font-weight: 800; font-size: 12px; display: grid; place-items: center; flex: none;
          font-family: 'Cabinet Grotesk', system-ui, sans-serif; }
.meta .who { color: var(--slate); font-weight: 600; }
.dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

/* Clusters */
.cluster { margin-top: 54px; }
.cluster-head { display: flex; align-items: baseline; gap: 14px; border-bottom: 2px solid var(--line);
                padding-bottom: 13px; margin-bottom: 26px; }
.cluster-head h3 { font-family: 'Cabinet Grotesk', system-ui, sans-serif; font-size: 25px; margin: 0; color: var(--ink); }
.cluster-head .tick { width: 10px; height: 21px; border-radius: 3px; flex: none; transform: translateY(3px); }
.cluster-head.buy .tick { background: var(--cat-buy); }
.cluster-head.safe .tick { background: var(--cat-safe); }
.cluster-head.brand .tick { background: var(--mint); }
.cluster-head .more { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--mint); white-space: nowrap; }
.cluster-head .more:hover { text-decoration: underline; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
        padding: 24px 24px 20px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
        transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow);
              border-color: color-mix(in srgb, var(--mint) 40%, var(--line)); }
.card h4 { font-family: 'Cabinet Grotesk', system-ui, sans-serif; font-size: 20px; line-height: 1.22; margin: 0 0 10px;
           color: var(--ink); text-wrap: balance; }
.card .excerpt { font-size: 14.5px; color: var(--slate); margin: 0 0 auto; }
.card .meta { margin-top: 18px; font-size: 12.5px; }
.card .avatar { width: 26px; height: 26px; font-size: 11px; }
.card.filler { justify-content: center; align-items: center; text-align: center;
               border-style: dashed; background: transparent; box-shadow: none; color: var(--muted); font-size: 14px; }
.card.filler:hover { transform: none; }
@media (prefers-reduced-motion: reduce) { .card, .cat-nav a { transition: none; } }

/* Digest */
.digest { margin: 60px 0 8px; background:
    radial-gradient(100% 140% at 0% 0%, rgba(255,106,0,.18), transparent 50%), var(--navy);
    border-radius: 18px; padding: 40px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: center; }
.digest h3 { font-family: 'Cabinet Grotesk', system-ui, sans-serif; color: #fff; font-size: 26px; margin: 0 0 8px; }
.digest p { color: #aebfd6; margin: 0; font-size: 15px; }
.digest form { display: flex; gap: 10px; }
.digest input { flex: 1; min-width: 0; padding: 13px 15px; border-radius: 10px; border: 1px solid #24344f;
                background: #0e1c31; color: #fff; font-size: 15px; }
.digest input::placeholder { color: #7b8aa3; }
.digest button { background: var(--mint); color: var(--navy); font-weight: 800; border: none;
                 padding: 13px 20px; border-radius: 10px; font-size: 15px; cursor: pointer; }
.digest button:hover { filter: brightness(0.96); }

@media (max-width: 860px) {
  .featured { grid-template-columns: 1fr; }
  .featured .hero-panel, .featured .hero-frame { order: -1; }
  .featured .hero-img { min-height: 200px; }
  .digest { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  .featured .body { padding: 28px 24px; }
  /* CTA box: tighter padding + stacked, full-width form so nothing gets squeezed. */
  .digest { padding: 28px 22px; margin: 44px 0 8px; gap: 20px; }
  .digest h3 { font-size: 22px; }
  .digest form { flex-direction: column; gap: 12px; }
  .digest input, .digest button { width: 100%; }
}
