/* ═══════════════════════════════════════════════════════════════════
   FlushLab Golf — Blog Stylesheet
   Layout, Sidebar, Article Typography, Tables, CTA
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Blog Layout ─── */
.blog-layout { display: flex; min-height: 100vh; }
.blog-sidebar {
  width: 240px;
  min-width: 240px;
  background: #10141a;
  border-right: 1px solid rgba(212,168,83,0.1);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}
.blog-sidebar::-webkit-scrollbar { width: 4px; }
.blog-sidebar::-webkit-scrollbar-thumb { background: rgba(212,168,83,0.15); border-radius: 2px; }
.blog-main { flex: 1; min-width: 0; position: relative; padding: 0 16px; }

/* ─── Sidebar Header ─── */
.sidebar-header { padding: 20px 20px 20px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sidebar-brand { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 14px; color: var(--text-primary); }
.sidebar-title { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; color: var(--gold-bright); margin-top: 2px; }
.sidebar-count { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--text-dim); margin-top: 6px; letter-spacing: 0.5px; }

/* ─── Sidebar Home Link ─── */
.sidebar-home-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(30, 38, 50, 0.5);
  transition: color 0.2s, background 0.2s;
}
.sidebar-home-link:hover { color: var(--gold-bright); background: rgba(232, 184, 75, 0.04); }

/* ─── Sidebar Categories ─── */
.cat-item { border-bottom: 1px solid rgba(30, 38, 50, 0.5); }
.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
  background: none;
  border: none;
  font: inherit;
  text-align: left;
  width: 100%;
}
.cat-header:hover { background: rgba(232, 184, 75, 0.04); }
.cat-header.active { background: rgba(232, 184, 75, 0.06); }
.cat-header-left { display: flex; align-items: center; gap: 10px; }
.cat-icon { font-size: 15px; width: 22px; text-align: center; }
.cat-name { font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 600; color: var(--text-primary); transition: color 0.2s; }
.cat-header:hover .cat-name, .cat-header.active .cat-name { color: var(--gold-bright); }
.cat-header-right { display: flex; align-items: center; gap: 8px; }
.cat-count { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--text-dim); background: rgba(30, 38, 50, 0.6); padding: 2px 7px; border-radius: 10px; }
.cat-chevron { font-size: 10px; color: var(--text-dim); transition: transform 0.25s ease, color 0.2s; display: inline-block; }
.cat-header.active .cat-chevron, .cat-header:hover .cat-chevron { color: var(--gold-dim); }
.cat-item.expanded > .cat-header .cat-chevron { transform: rotate(90deg); }
.cat-children { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; background: rgba(0, 0, 0, 0.15); }
.cat-item.expanded > .cat-children { max-height: 800px; }
.cat-article-link {
  display: block;
  padding: 8px 20px 8px 52px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, background 0.2s, padding-left 0.2s;
  line-height: 1.5;
  border-left: 2px solid transparent;
}
.cat-article-link:hover { color: var(--gold-bright); background: rgba(232, 184, 75, 0.03); padding-left: 56px; border-left-color: var(--gold-bright); }
.cat-article-link.active { color: var(--gold-bright); background: rgba(232, 184, 75, 0.08); font-weight: 600; border-left-color: var(--gold-bright); }

/* ─── Subcategories ─── */
.subcat-header {
  padding: 10px 20px 4px 42px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
  background: none;
  border: none;
  text-align: left;
  width: 100%;
}
.subcat-header:hover { color: var(--gold-bright); }
.subcat-header.active { color: var(--gold-bright); }
.subcat-children { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.subcat-group.expanded > .subcat-children { max-height: 400px; }

/* ─── Sidebar Mobile Toggle ─── */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #10141a;
  border: 1px solid rgba(212,168,83,0.25);
  color: #e8b84b;
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.sidebar-overlay { display: none; }

@media (max-width: 900px) {
  .sidebar-toggle { display: flex; }
  .blog-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .blog-sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0,0,0,0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .sidebar-overlay.visible { opacity: 1; pointer-events: auto; }
  .blog-main { width: 100%; }
  .blog-main > .container { padding-left: 0; padding-right: 0; }
}

/* ─── Back Navigation ─── */
.nav-back {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-dim);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--glow);
  transition: border-color 0.3s;
}
.nav-back:hover { border-color: var(--gold-dim); }

/* ═══════════════════════════════════════════════════════════════════
   ARTICLE TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════ */
.doc-header { margin-bottom: 56px; }
.doc-eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 4px; text-transform: uppercase; color: var(--gold-bright); margin-bottom: 16px; }
.doc-title { font-family: 'Playfair Display', serif; font-size: clamp(28px, 5vw, 44px); font-weight: 700; color: var(--text-bright); margin-bottom: 16px; line-height: 1.15; }
.doc-meta { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text-muted); }
.doc-meta span { color: var(--text-secondary); }
.doc-intro { margin-top: 24px; font-size: 16px; line-height: 1.75; color: var(--text-secondary); padding: 24px; background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--gold-bright); border-radius: 0 8px 8px 0; }

.doc-section { margin-bottom: 48px; }
.doc-section h2 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--text-bright); margin-top: 40px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.doc-section h3 { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 600; color: var(--gold-bright); margin-bottom: 10px; margin-top: 24px; letter-spacing: 0.5px; }
.doc-section p { font-size: 15px; line-height: 1.8; color: var(--text-secondary); margin-bottom: 14px; }
.doc-section strong { color: var(--text-primary); font-weight: 600; }

/* ─── Blockquote ─── */
.doc-section blockquote { background: var(--bg-card); border-left: 3px solid var(--gold-bright); padding: 16px 20px; margin: 20px 0; border-radius: 0 8px 8px 0; font-family: 'IBM Plex Mono', monospace; font-size: 14px; color: var(--text-primary); line-height: 1.7; }

/* ─── Data Table ─── */
.data-table { width: 100%; border-collapse: collapse; margin: 20px 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; font-size: 13px; }
.data-table thead th { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-bright); padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); background: var(--bg-surface); }
.data-table tbody td { padding: 10px 16px; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody td:first-child { color: var(--text-primary); font-weight: 500; }

/* ─── CTA Box ─── */
.cta-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 28px 32px; margin-top: 48px; text-align: center; }
.cta-box p { font-size: 15px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 0; }
.cta-box p em { font-style: italic; color: var(--text-muted); }

/* ─── Crest Watermark ─── */
.crest-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60vmin;
  height: auto;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}

/* ─── Related Articles ─── */
.related-articles { margin: 40px 0 0; padding: 32px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; }
.related-articles h2 { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-bright); margin-bottom: 20px; }
.related-articles-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.related-articles-grid a { display: block; padding: 14px 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); text-decoration: none; font-size: 14px; line-height: 1.5; transition: border-color 0.3s, color 0.3s; }
.related-articles-grid a:hover { border-color: var(--gold-dim); color: var(--gold-bright); }
@media (max-width: 768px) { .related-articles-grid { grid-template-columns: 1fr; } }

/* ─── Blog Mobile Responsive ─── */
@media (max-width: 600px) {
  .doc-header { margin-bottom: 40px; }
  .data-table { font-size: 11px; }
  .data-table thead th, .data-table tbody td { padding: 8px 10px; }
}
