/* Stowd guides (static blog) styling. Self-contained, same-origin (CSP-safe),
   brand-matched to the in-app Cream theme and the SPA's index.css tokens.
   These pages do not load Tailwind or the React bundle. */

:root {
  --page: #f5eddd;
  --page-warm: #fdf6e8;
  --surface: #fffdf6;
  --surface-2: #f1e8d6;
  --line: #e6dbc5;
  --ink: #2b2522;
  --muted: #6b6354;
  --muted-2: #6f6556;
  --clay: #a8380c;
  --clay-deep: #872d08;
  --clay-warm: #d35e1d;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI",
    Inter, Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(120% 70% at 50% -10%, var(--page-warm) 0%, var(--page) 55%) no-repeat;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }

/* Masthead */
.site-header {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.brand img { border-radius: 9px; box-shadow: 0 4px 12px -3px rgba(120, 50, 10, 0.35); }
.site-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--clay); }
.site-nav a[aria-current="page"] { color: var(--clay); }

/* Content column */
.container { max-width: 720px; margin: 0 auto; padding: 8px 22px 0; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}
.eyebrow a { color: var(--clay); text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

/* Article typography */
.article h1,
.blog-index h1 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--ink);
}
.meta { margin: 0 0 26px; font-size: 14px; color: var(--muted-2); }
.lede { font-size: 18.5px; line-height: 1.55; color: var(--ink); margin: 0 0 26px; }
.article h2 {
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 800;
  color: var(--ink);
  margin: 36px 0 12px;
}
.article h3 { font-size: 18px; font-weight: 700; color: var(--ink); margin: 26px 0 8px; }
.article p { font-size: 16.5px; color: var(--muted); margin: 0 0 16px; }
.article strong { color: var(--ink); font-weight: 700; }
.article ul, .article ol { margin: 0 0 18px; padding-left: 22px; }
.article li { font-size: 16.5px; color: var(--muted); margin: 0 0 9px; padding-left: 4px; }
.article li::marker { color: var(--clay); }
.article a {
  color: var(--clay);
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 3px;
}
.article a:hover { color: var(--clay-deep); }
.note { font-size: 14.5px; color: var(--muted-2); font-style: italic; }

/* Table */
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 22px;
  font-size: 15.5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.article th, .article td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.article thead th { background: var(--surface-2); font-weight: 700; color: var(--ink); font-size: 13.5px; }
.article tbody tr:last-child td { border-bottom: 0; }
.article td { color: var(--muted); }
.article td:first-child { color: var(--ink); font-weight: 600; }

/* App CTA */
.cta {
  margin: 40px 0 8px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(88, 54, 22, 0.10);
  text-align: center;
}
.cta-line { font-size: 16.5px; color: var(--ink); font-weight: 600; margin: 0 0 16px; }
.cta-sub { font-size: 13px; color: var(--muted-2); margin: 14px 0 0; }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--page);
  text-decoration: none;
  border-radius: 14px;
  padding: 13px 20px;
  box-shadow: 0 10px 26px -8px rgba(43, 37, 34, 0.45);
  transition: transform 0.16s ease-out, box-shadow 0.16s ease-out;
}
.store-btn::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--clay-warm); }
.store-btn svg { opacity: 0.8; }
.store-btn-label { display: flex; flex-direction: column; text-align: left; line-height: 1.1; }
.store-btn-label small { font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; opacity: 0.7; }
.store-btn-label b { font-size: 16px; font-weight: 700; }
.store-btn:active { transform: translateY(0); }
/* The button lives inside .article, where `.article a` (and `.article a:hover`)
   outrank a bare `.store-btn` and were painting the label + icon clay and
   underlining them. Scope-beat that so the label/icon stay cream, no underline. */
.cta a.store-btn,
.cta a.store-btn:hover {
  color: var(--page);
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
  .store-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -8px rgba(43, 37, 34, 0.55); }
}

/* Blog index */
.index-lede { font-size: 17px; color: var(--muted); margin: 0 0 30px; max-width: 560px; }
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.post-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 1px 0 rgba(43, 37, 34, 0.05), 0 14px 36px rgba(88, 54, 22, 0.08);
  transition: transform 0.16s ease-out, box-shadow 0.16s ease-out;
}
.post-card h2 { margin: 0 0 8px; font-size: 20px; font-weight: 800; letter-spacing: -0.015em; color: var(--ink); }
.post-card p { margin: 0 0 12px; font-size: 15px; color: var(--muted); }
.post-meta { font-size: 12.5px; font-weight: 600; color: var(--clay); }
@media (hover: hover) and (pointer: fine) {
  .post-card:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(43, 37, 34, 0.05), 0 22px 48px rgba(88, 54, 22, 0.13); }
}

/* Blog hub: topic/category cards */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cat-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 0 rgba(43, 37, 34, 0.05), 0 14px 36px rgba(88, 54, 22, 0.08);
  transition: transform 0.16s ease-out, box-shadow 0.16s ease-out;
}
.cat-head { display: flex; align-items: center; gap: 11px; margin: 0 0 10px; }
.cat-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(168, 56, 12, 0.10); color: var(--clay); flex: 0 0 auto; }
.cat-icon svg { width: 21px; height: 21px; }
.cat-name { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.cat-count { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--muted-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.cat-blurb { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.cat-list { list-style: none; margin: 0 0 12px; padding: 0; }
.cat-list li { font-size: 13.5px; color: var(--muted); padding: 6px 0; border-top: 1px dashed var(--line); }
.cat-list li:first-child { border-top: 0; }
.cat-card .more { color: var(--clay); font-weight: 700; font-size: 13.5px; text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .cat-card:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(43, 37, 34, 0.05), 0 22px 48px rgba(88, 54, 22, 0.13); }
}
@media (max-width: 600px) { .cat-grid { grid-template-columns: 1fr; } }

/* "Back / up one level" link (category + article pages) */
.back-link { display: inline-flex; align-items: center; gap: 5px; margin: 0 0 16px; color: var(--clay); text-decoration: none; font-size: 14px; font-weight: 600; }
.back-link svg { width: 16px; height: 16px; }
.back-link span { line-height: 1; }
.back-link:hover { color: var(--clay-deep); text-decoration: underline; }

/* Footer */
.site-footer {
  max-width: 1000px;
  margin: 60px auto 0;
  padding: 28px 22px 50px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}
.copyright { font-size: 13px; color: var(--muted-2); margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-nav a { font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer-nav a:hover { color: var(--clay); }

:where(a):focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 4px; }

/* Mobile: 44px tap targets for nav/footer, extended hit area for inline links */
@media (max-width: 767px) {
  .site-nav a, .footer-nav a, .eyebrow a { display: inline-flex; align-items: center; min-height: 44px; }
  .site-nav { gap: 4px 16px; }
  .article a, .back-link { padding-block: 0.7rem; margin-block: -0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
