/* ───────────────────────────────────────────────────────────────
   Fireproof Studio — Blog stylesheet
   Seeded from the homepage :root tokens (Code/website/index.html).
   Shared across all generated blog pages (index, post, category).
   ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #050505;
  --bg-elevated: #0c0a08;
  --bg-card: #12100c;
  --bg-card-hover: #1a1610;
  --accent: #d4700a;
  --accent-light: #f09030;
  --accent-glow: rgba(240, 144, 48, 0.25);
  --fire: #f09030;
  --fire-glow: rgba(240, 144, 48, 0.2);
  --gold: #e8b84a;
  --ember: #c45a10;
  --text: #f5f0e8;
  --text-secondary: #a89880;
  --text-dim: #6a5a48;
  --border: rgba(255, 200, 100, 0.06);
  --border-hover: rgba(255, 200, 100, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Noise overlay (copied from homepage) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Nav (copied from homepage) ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  background: rgba(5, 5, 7, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo img { height: 38px; width: auto; }

.nav-links { display: flex; gap: 2rem; align-items: center; }

.nav-links a {
  position: relative;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

/* Active "Blog" link state */
.nav-links a[aria-current="page"] { color: var(--text); }

.nav-links a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ember), var(--gold));
}

.nav-cta {
  padding: 0.5rem 1.25rem !important;
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: 8px;
  font-weight: 600 !important;
  transition: all 0.2s !important;
}

.nav-cta:hover {
  background: var(--accent-light) !important;
  box-shadow: 0 0 24px var(--accent-glow);
}
.nav-cta[aria-current="page"]::after { display: none; }

/* ── Buttons (copied from homepage) ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s;
  cursor: pointer;
  border: none;
}

.btn-primary { background: var(--accent); color: #fff; }

.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 0 32px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-hover);
}

.btn-ghost:hover {
  border-color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-2px);
}

.btn svg { width: 18px; height: 18px; }

/* ── Section labels (copied from homepage) ── */
.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-light);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.7;
}

/* ── app-card base (copied from homepage) ── */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
}

.app-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ── Category tag chips (color also drives sidebar dot + card hover bar) ── */
.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tag-gaming             { background: rgba(232, 184, 74, 0.12); color: #e8b84a; }
.tag-saas               { background: rgba(240, 144, 48, 0.12); color: #f09030; }
.tag-web-small-business { background: rgba(14, 107, 107, 0.18); color: #2bb8a8; }
.tag-smart-shopping     { background: rgba(247, 164, 0, 0.12);  color: #f7a400; }
.tag-behind-fireproof   { background: rgba(124, 58, 237, 0.12); color: #a78bfa; }
.tag-product-updates    { background: rgba(212, 112, 10, 0.14); color: #f09030; }

/* ═══════════════════════════════════════════════════════════════
   BLOG INDEX
   ═══════════════════════════════════════════════════════════════ */

/* Compact header */
.blog-header {
  background: var(--bg-elevated);
  padding: 9rem 0 3rem;
  border-bottom: 1px solid var(--border);
}

.blog-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.blog-main { padding: 3rem 0 5rem; }

/* Single-column full-width list of post cards */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.5rem;
  align-items: stretch;
  padding: 0;
}

/* category-tinted top bar revealed on hover */
.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cat-color, var(--accent));
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 3;
}

.post-card:hover::before { opacity: 1; }

.post-card-thumb {
  width: 160px;
  min-height: 160px;
  object-fit: cover;
  align-self: stretch;
}

/* image-less fallback panel = amber-radial gradient + category initial */
.post-card-thumb-fallback {
  width: 160px;
  min-height: 160px;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--cat-color, var(--accent-light));
  background:
    radial-gradient(circle at 30% 30%, var(--accent-glow) 0%, transparent 60%),
    linear-gradient(180deg, #1a120a 0%, #0e0a06 100%);
}

.post-card-body {
  padding: 1.4rem 1.6rem 1.4rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.post-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0.1rem 0;
}

.post-card-excerpt {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card .tag { align-self: flex-start; }

.load-more-row {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

.blog-empty {
  color: var(--text-secondary);
  font-size: 1.05rem;
  padding: 2rem 0;
}

/* ═══════════════════════════════════════════════════════════════
   POST PAGE
   ═══════════════════════════════════════════════════════════════ */

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 3rem;
  padding: 9rem 1.5rem 5rem;
  max-width: 1140px;
  margin: 0 auto;
}

.post-body { max-width: 720px; }

.post-head { margin-bottom: 2.5rem; }

.post-head .tag { margin-bottom: 1rem; }

.post-head h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0.5rem 0 1rem;
}

.post-meta {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.post-author-line {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
}

.post-hero {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5rem 0 0;
}

/* Long-form body type */
.post-content { color: var(--text); }
.post-content p { font-size: 1.05rem; line-height: 1.8; margin: 0 0 1.25rem; }
.post-content h2 { font-size: 1.6rem; font-weight: 700; margin: 2.5rem 0 1rem; letter-spacing: -0.01em; }
.post-content h3 { font-size: 1.25rem; font-weight: 700; margin: 2rem 0 0.75rem; }

.post-content a {
  color: var(--accent-light);
  text-decoration: underline;
  text-decoration-color: var(--border-hover);
  text-underline-offset: 3px;
}
.post-content a:hover { text-decoration-color: var(--accent-light); }

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-content ul, .post-content ol { margin: 0 0 1.25rem 1.5rem; }
.post-content li { margin: 0.4rem 0; line-height: 1.7; }
.post-content li::marker { color: var(--accent); }

.post-content code {
  font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--gold);
  background: var(--bg-card);
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
}

.post-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

.post-content pre code {
  background: none;
  color: var(--text);
  padding: 0;
  font-size: 0.85rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 1.25rem 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */

.sidebar {
  position: sticky;
  top: 5.5rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.sidebar-card h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-light);
  margin-bottom: 1rem;
}

.sidebar-list { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }

.sidebar-list a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.sidebar-list a:hover { color: var(--text); }

/* Categories module */
.cat-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.cat-row a { display: inline-flex; align-items: center; gap: 0.5rem; }

.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat-color, var(--accent));
  flex: 0 0 8px;
}

.count-pill {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.05rem 0.5rem;
}

/* Most Read module */
.ranked-row { display: flex; align-items: baseline; gap: 0.75rem; }

.rank-num {
  font-size: 1.25rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold) 0%, var(--accent-light) 50%, var(--ember) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  flex: 0 0 auto;
}

.ranked-row a { flex: 1; }

/* Recent module */
.recent-row a { display: block; }
.recent-date { display: block; font-size: 0.75rem; color: var(--text-dim); margin-top: 0.1rem; }

/* Subscribe / CTA card (loudest) */
.sidebar-card.subscribe {
  background:
    radial-gradient(circle at 80% 0%, var(--accent-glow) 0%, transparent 55%),
    var(--bg-card);
  border-color: var(--border-hover);
}

.subscribe h4 { color: var(--gold); }
.subscribe p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.9rem; }

.subscribe-form { display: flex; flex-direction: column; gap: 0.6rem; }

.subscribe-form input[type="email"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}

.subscribe-form input[type="email"]::placeholder { color: var(--text-dim); }
.subscribe-form input[type="email"]:focus { outline: none; border-color: var(--border-hover); }

.subscribe-form .btn-primary { width: 100%; justify-content: center; }

.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--accent-light);
  text-decoration: none;
  margin-top: 0.9rem;
}
.rss-link:hover { color: var(--gold); }

.subscribe-divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

.subscribe-apps {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
}
.subscribe-apps a { color: var(--accent-light); text-decoration: none; }
.subscribe-apps a:hover { color: var(--gold); }

/* ═══════════════════════════════════════════════════════════════
   FOOTER (copied from homepage)
   ═══════════════════════════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-left .logo { margin-bottom: 0.5rem; display: inline-block; }
.footer-left p { font-size: 0.85rem; color: var(--text-dim); }

.footer-links-row { display: flex; gap: 2rem; flex-wrap: wrap; }

.footer-links-row a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links-row a:hover { color: var(--text); }

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ── Mobile nav (copied from homepage) ── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* ── Fireproof Studio branded footer snippet ── */
.fp-studio-footer { text-align: center; padding: 1rem 0 0.75rem; }
.fp-studio-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.25);
  transition: color 0.2s ease;
}
.fp-studio-link:hover { color: rgba(255, 255, 255, 0.45); }
.fp-studio-logo { width: 14px; height: 14px; }
.fp-studio-text strong { font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; gap: 2rem; }
  .sidebar { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { position: static; }
  html { scroll-behavior: auto; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(5, 5, 7, 0.95);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
  }
  .nav-links a[aria-current="page"]::after { display: none; }
  .post-card { grid-template-columns: 1fr; }
  .post-card-thumb, .post-card-thumb-fallback { width: 100%; min-height: 180px; }
  .post-card-body { padding: 1.25rem 1.5rem 1.5rem; }
  .blog-header { padding: 7rem 0 2.5rem; }
  .post-layout { padding: 7rem 1.25rem 4rem; }
  .footer-content { flex-direction: column; text-align: center; }
  .footer-links-row { flex-wrap: wrap; justify-content: center; }
}
