/* ==========================================================================
   Finance Studio — canonical chrome stylesheet
   Extracted from index.html + styles.css
   ========================================================================== */

:root {
  --primary: #0a2540;
  --secondary: #1a73e8;
  --accent: #00d4aa;
  --surface: #f8fafc;
  --surface-alt: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg-elevated: #ffffff;
  --gradient-primary: linear-gradient(135deg, #0a2540 0%, #1a4a7a 100%);
  --gradient-accent: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
  --shadow-sm: 0 1px 3px rgba(10, 37, 64, 0.08);
  --shadow-md: 0 4px 12px rgba(10, 37, 64, 0.12);
  --shadow-lg: 0 8px 32px rgba(10, 37, 64, 0.16);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--secondary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  line-height: 1.2;
  color: var(--primary);
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
p  { margin-bottom: 1rem; }

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

/* ==========================================================================
   Header (sticky)
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 2rem;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.header__logo img {
  width: 44px;
  height: 44px;
}

/* Scope nav rules to header so .toc / .breadcrumbs inside articles aren't hit */
header nav.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

header nav .nav__link {
  color: var(--text);
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}

header nav .nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

header nav .nav__link:hover::after,
header nav .nav__link--active::after { width: 100%; }
header nav .nav__link:hover { color: var(--primary); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn--primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: #fff;
}

.btn--accent {
  background: var(--gradient-accent);
  color: var(--primary);
}
.btn--accent:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--primary);
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn--outline:hover {
  background: var(--primary);
  color: #fff;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background: var(--primary);
  color: #fff;
  padding: 4rem 0 2rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer__brand p {
  opacity: 0.7;
  margin-top: 1rem;
  font-size: 0.9375rem;
  max-width: 300px;
}

.footer__col h4 {
  color: var(--accent);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer__links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  transition: color var(--transition);
}

.footer__links a:hover { color: var(--accent); }

.footer__bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  opacity: 0.7;
  text-align: center;
}

/* ==========================================================================
   Fixed/sticky nav compensation for blog-style pages
   Header sticky height ≈ 76px (44px logo + 2 × 1rem padding) → add 24px
   ========================================================================== */

body.pbn-blog-page > main {
  padding-top: 24px;
}

/* ==========================================================================
   Blog / article typography
   ========================================================================== */

.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.article-container h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--primary);
  margin-bottom: 1rem;
  line-height: 1.15;
}

.article-container .meta {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.article-container .featured-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-md);
}

.article-container .content {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
}

.article-container .content h2 {
  font-size: 1.75rem;
  color: var(--primary);
  margin-top: 2.75rem;
  margin-bottom: 1rem;
}

.article-container .content h3 {
  font-size: 1.375rem;
  color: var(--primary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-container .content h4 {
  font-size: 1.125rem;
  color: var(--primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.article-container .content p {
  margin-bottom: 1.25rem;
  color: var(--text);
}

.article-container .content ul,
.article-container .content ol {
  margin: 0 0 1.25rem 1.5rem;
  padding-left: 0.5rem;
}

.article-container .content li {
  margin-bottom: 0.5rem;
}

.article-container .content img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.article-container .content blockquote {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--text);
  font-style: italic;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.article-container .content pre {
  background: var(--primary);
  color: #fff;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.article-container .content code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  background: var(--surface);
  color: var(--primary);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.article-container .content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.article-container .content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.article-container .content th,
.article-container .content td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}

.article-container .content th {
  background: var(--surface);
  color: var(--primary);
  font-weight: 700;
}

.article-container .content a {
  color: var(--secondary);
  text-decoration: underline;
}

.article-container .content a:hover { color: var(--accent); }

/* ==========================================================================
   Table of contents — nav.toc override to defeat header nav cascade
   ========================================================================== */

nav.toc, .toc {
  position: static;
  z-index: auto;
  width: auto;
  top: auto;
  left: auto;
  right: auto;
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}

.toc h2, .toc .toc-title {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.toc ul, .toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li {
  margin: 0.3rem 0;
}

.toc a {
  color: var(--text);
  font-size: 0.9375rem;
}

.toc a:hover { color: var(--accent); }

/* ==========================================================================
   Breadcrumbs — nav.breadcrumbs override
   ========================================================================== */

nav.breadcrumbs, .breadcrumbs {
  position: static;
  z-index: auto;
  width: auto;
  top: auto;
  left: auto;
  right: auto;
  padding: 1rem 0;
  font-size: 0.875rem;
  background: transparent;
  border: 0;
  display: block;
}

.breadcrumbs ol, .breadcrumbs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li:not(:last-child)::after {
  content: '/';
  margin-left: 0.5rem;
  opacity: 0.5;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover { color: var(--secondary); }

/* ==========================================================================
   Tags
   ========================================================================== */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.tag {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
}

.tag:hover {
  background: var(--accent);
  color: var(--primary);
  border-color: var(--accent);
}

/* ==========================================================================
   Share buttons
   ========================================================================== */

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.share-buttons .share-label {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.9375rem;
}

.share-btn-twitter,
.share-btn-linkedin,
.share-btn-facebook {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  transition: all var(--transition);
}

.share-btn-twitter { background: #1da1f2; }
.share-btn-linkedin { background: #0a66c2; }
.share-btn-facebook { background: #1877f2; }

.share-btn-twitter:hover,
.share-btn-linkedin:hover,
.share-btn-facebook:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: #fff;
}

/* ==========================================================================
   Related posts
   ========================================================================== */

.related-posts {
  max-width: 1200px;
  margin: 4rem auto 0;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border);
}

.related-posts h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.75rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.related-card {
  display: block;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  color: var(--text);
  transition: all var(--transition);
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  color: var(--text);
}

.related-card h3 {
  font-size: 1.125rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.related-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0;
}

/* ==========================================================================
   Blog index — post cards
   ========================================================================== */

.post-card {
  display: block;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text);
  transition: all var(--transition);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  color: var(--text);
}

.post-card h2,
.post-card h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1.375rem;
}

.post-card .meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.post-card p {
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ==========================================================================
   Categories pill strip
   ========================================================================== */

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 1.5rem 0 2rem;
}

.categories-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.5rem;
}

.categories a {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.875rem;
  color: var(--text);
  transition: all var(--transition);
}

.categories a:hover,
.categories a.active {
  background: var(--accent);
  color: var(--primary);
  border-color: var(--accent);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 3rem 0 1rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition);
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--primary);
}

.pagination .current,
.pagination a.active {
  background: var(--gradient-accent);
  color: var(--primary);
  border-color: var(--accent);
  font-weight: 700;
}

.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  header nav.nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--surface-alt);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    border-bottom: 1px solid var(--border);
  }

  header nav.nav--open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-toggle { display: flex; }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .article-container {
    padding: 2rem 1.25rem 3rem;
  }

  .article-container .content { font-size: 1rem; }
}

@media (max-width: 480px) {
  .post-card { padding: 1.5rem; }
  .related-posts { padding: 2rem 1rem; }
}
