/* =====================================================================
   Label & Badge Manager — blog / editorial stylesheet
   Clean magazine look, always light. Shared by every blog page and the
   router-generated index / 404 (see web/backend/routes/blog.js).
   ===================================================================== */

:root {
  --ink:        #16181d;   /* headlines */
  --body:       #2c313a;   /* body text */
  --muted:      #6b7280;   /* meta, captions */
  --rule:       #e7e9ee;   /* hairline dividers */
  --bg:         #ffffff;   /* page */
  --bg-soft:    #f7f8fa;   /* section / card fills */
  --accent:     #4f46e5;   /* indigo brand accent */
  --accent-ink: #4338ca;
  --accent-2:   #7c3aed;   /* gradient partner */
  --max:        720px;     /* comfortable reading measure */

  --serif: "Iowan Old Style", "Palatino Linotype", "Georgia", "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Top brand bar -------------------------------------------------- */
.site-bar {
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(160%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-bar .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.site-bar .brand {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  font-size: 1.02rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.site-bar .brand .dot {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-block;
}
.site-bar .spacer { flex: 1; }
.site-bar .bar-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.site-bar .bar-link:hover { color: var(--ink); }
.site-bar .bar-cta {
  color: #fff;
  background: var(--accent);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.site-bar .bar-cta:hover { background: var(--accent-ink); }

/* ---- Gradient hero -------------------------------------------------- */
.hero {
  background:
    radial-gradient(1200px 400px at 15% -10%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(900px 360px at 95% 0%, rgba(79, 70, 229, 0.16), transparent 55%),
    linear-gradient(180deg, #f3f1ff 0%, #ffffff 100%);
  border-bottom: 1px solid var(--rule);
}
.hero .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.25rem 1.5rem 2.5rem;
}
.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: rgba(79, 70, 229, 0.1);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}
.hero h1 {
  font-family: var(--serif);
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 0.85rem;
}
.hero .dek {
  font-size: 1.18rem;
  line-height: 1.6;
  color: #44495a;
  max-width: 38em;
  margin: 0;
}
.byline {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.byline .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.byline .sep { color: var(--rule); }

/* ---- Article body --------------------------------------------------- */
.article {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.75rem 1.5rem 1rem;
}
.article > section { margin-bottom: 1.25rem; }
.article h2 {
  font-family: var(--serif);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 0.6rem;
}
.article h3 {
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 700;
  margin: 1.75rem 0 0.35rem;
}
.article p { margin: 0 0 1.15rem; }
.article ul,
.article ol { margin: 0 0 1.3rem; padding-left: 1.35rem; }
.article li { margin-bottom: 0.55rem; }
.article li::marker { color: var(--accent); }
.article strong { color: var(--ink); font-weight: 700; }

a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1.5px solid rgba(79, 70, 229, 0.3);
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }

/* breadcrumb sits subtle above the hero text in the body version */
.breadcrumb {
  max-width: var(--max);
  margin: 1.25rem auto 0;
  padding: 0 1.5rem;
  font-size: 0.9rem;
}
.breadcrumb a { border-bottom: none; color: var(--muted); }
.breadcrumb a:hover { color: var(--ink); }

code {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 0.86em;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  color: #b4275a;
}
pre {
  background: #0f1117;
  color: #e6e9f0;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0 0 1.4rem;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 0.92rem;
}

/* ---- Call-to-action card ------------------------------------------- */
.cta {
  margin: 2.5rem 0;
  padding: 2rem 2rem;
  border-radius: 16px;
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(124, 58, 237, 0.18), transparent 60%),
    linear-gradient(135deg, #4f46e5, #6d28d9);
  color: #fff;
  text-align: center;
  box-shadow: 0 18px 40px -18px rgba(79, 70, 229, 0.6);
}
.cta p { margin: 0 0 0.4rem; color: rgba(255, 255, 255, 0.92); }
.cta p strong { color: #fff; font-size: 1.15rem; }
.cta .cta-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.8rem 1.9rem;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
  border: none;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.4);
}
.cta .cta-button:hover { background: #f3f1ff; color: var(--accent-ink); }

/* ---- Related / "keep reading" -------------------------------------- */
.related {
  max-width: var(--max);
  margin: 3rem auto 0;
  padding: 1.75rem 1.5rem 0;
  border-top: 1px solid var(--rule);
}
.related h2 {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}
.related ul { list-style: none; padding: 0; margin: 0; }
.related li {
  margin: 0;
  border-bottom: 1px solid var(--rule);
}
.related li:last-child { border-bottom: none; }
.related li a {
  display: block;
  padding: 0.9rem 0;
  border-bottom: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.02rem;
}
.related li a:hover { color: var(--accent-ink); }

/* ---- Blog index (list of posts) ------------------------------------ */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.1rem;
}
.post-list li {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 1.4rem 1.6rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.post-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -22px rgba(22, 24, 29, 0.45);
  border-color: #d7dae2;
}
.post-list li a {
  border-bottom: none;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.post-list li a:hover { color: var(--accent-ink); }
.post-list li p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

/* ---- Figures / captions -------------------------------------------- */
figure { margin: 2rem 0; }
figcaption {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- Mock product cards (CSS-drawn badge previews) ----------------- */
.preview-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}
.product-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 0.9rem;
  text-align: left;
  box-shadow: 0 10px 30px -20px rgba(22, 24, 29, 0.4);
}
.product-card .thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background:
    linear-gradient(135deg, #eef0f6 0%, #e3e7f2 100%);
  overflow: hidden;
}
/* simple CSS "product" silhouette so the card doesn't look empty */
.product-card .thumb::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  width: 52%;
  height: 52%;
  border-radius: 12px 12px 18px 18px;
  background: linear-gradient(160deg, #c3c9da, #aab2c8);
}
.product-card .title {
  margin: 0.7rem 0 0.15rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}
.product-card .price { font-size: 0.9rem; color: var(--muted); }
.product-card .price .was {
  text-decoration: line-through;
  margin-right: 0.4rem;
  opacity: 0.7;
}
.product-card .price .now { color: #b4275a; font-weight: 700; }

/* the badge overlay itself */
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.5);
}
.badge.sale  { background: linear-gradient(135deg, #e11d48, #be123c); }
.badge.new   { background: linear-gradient(135deg, #4f46e5, #6d28d9); }
.badge.best  { background: linear-gradient(135deg, #d97706, #b45309); }
.badge.soldout { background: linear-gradient(135deg, #475569, #334155); }
.badge.low   { background: linear-gradient(135deg, #0d9488, #0f766e); }
.badge.right { left: auto; right: 10px; }

/* inline badge chips for use within text */
.chip {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  color: #fff;
  vertical-align: middle;
}
.chip.sale { background: #e11d48; }
.chip.new  { background: #4f46e5; }
.chip.best { background: #d97706; }
.chip.soldout { background: #475569; }
.chip.low  { background: #0d9488; }

/* ---- Stars ---------------------------------------------------------- */
.stars {
  color: #f5a623;
  font-size: 1rem;
  letter-spacing: 0.06em;
  line-height: 1;
}
.stars[aria-label]::before { content: attr(data-stars); }

/* ---- Review / testimonial cards ------------------------------------ */
.reviews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0 1rem;
}
.review-card {
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.review-card .quote {
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.55;
}
.review-card .quote::before { content: "\201C"; }
.review-card .quote::after  { content: "\201D"; }
.review-card .reviewer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: auto;
}
.review-card .reviewer .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.review-card .reviewer .who {
  font-size: 0.86rem;
  line-height: 1.3;
}
.review-card .reviewer .name { font-weight: 700; color: var(--ink); }
.review-card .reviewer .meta { color: var(--muted); }

.review-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1rem 1.4rem;
  margin: 1.75rem 0;
  text-align: center;
}
.review-banner .rating-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}
.review-banner .label { color: var(--muted); font-size: 0.9rem; }

/* ---- Stat callouts -------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0;
}
.stat {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
}
.stat .num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-ink);
  line-height: 1.1;
}
.stat .desc { font-size: 0.9rem; color: var(--muted); margin-top: 0.25rem; }

/* ---- Comparison table ---------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 1.75rem 0; }
table.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 480px;
}
table.compare th,
table.compare td {
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--rule);
}
table.compare thead th {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-soft);
}
table.compare tbody th {
  font-weight: 600;
  color: var(--ink);
}
table.compare .yes { color: #0d9488; font-weight: 700; }
table.compare .no  { color: #b4275a; font-weight: 700; }
table.compare tr.highlight td,
table.compare tr.highlight th {
  background: rgba(79, 70, 229, 0.06);
}

/* ---- Footer --------------------------------------------------------- */
footer {
  max-width: var(--max);
  margin: 3.5rem auto 0;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }

@media (max-width: 600px) {
  body { font-size: 17px; }
  .hero .inner { padding: 2.5rem 1.25rem 2rem; }
  .article { padding: 2rem 1.25rem 1rem; }
}
