/* ======================================================================
   FINTECH GLOBAL SOFTWARE LTD — site chrome
   Self-contained stylesheet for header, footer, and shared content classes.
   ====================================================================== */

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

:root {
  /* Brand tokens (legacy, kept for index.html parity) */
  --primary: #0066ff;
  --secondary: #00d4ff;
  --dark: #0a0e27;
  --darker: #050714;
  --light: #ffffff;
  --gray: #8892b0;

  /* Canonical chrome tokens (read by other pipelines) */
  --bg: #050714;
  --bg-card: #0e1330;
  --bg-elevated: #161c40;
  --text: #ffffff;
  --text-muted: #8892b0;
  --accent: #0066ff;
  --accent-fg: #ffffff;          /* white text reads on saturated blue */
  --accent-hover: #00d4ff;
  --border: rgba(255, 255, 255, 0.1);
  --radius: 20px;
}

html { scroll-behavior: smooth; }

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

a { color: var(--accent-hover); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--text); }

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

/* ============================================================
   HEADER / PRIMARY NAV
   Scoped to `header nav` so .toc / .breadcrumbs inside articles
   don't inherit fixed positioning.
   ============================================================ */
header nav {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  background: rgba(10, 14, 39, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

header nav.scrolled {
  background: rgba(5, 7, 20, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

header .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  white-space: nowrap;
}

header .nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

header .nav-links > li { position: relative; }

header .nav-links a {
  color: var(--gray);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  font-size: 1rem;
}

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

header .nav-links > li > a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: width 0.3s ease;
}

header .nav-links > li > a:hover::after { width: 100%; }

header .submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: rgba(10, 14, 39, 0.98);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  list-style: none;
  display: none;
  margin-top: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

header .nav-links > li:hover > .submenu,
header .nav-links > li:focus-within > .submenu { display: block; }

header .submenu li { display: block; }
header .submenu a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--gray);
}
header .submenu a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }

header .header-cta { display: flex; gap: 0.75rem; align-items: center; }

header .cta-button,
.cta-button {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--accent-fg);
  padding: 0.75rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
  font-weight: 500;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 102, 255, 0.4);
  color: var(--accent-fg);
}

/* Reset any nested nav (TOC, breadcrumbs) so it doesn't inherit
   the header's fixed positioning */
nav.toc,
nav.breadcrumbs {
  position: static;
  z-index: auto;
  width: auto;
  top: auto;
  left: auto;
  background: var(--bg-elevated);
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

/* ============================================================
   FIXED-NAV COMPENSATION
   Header is position:fixed, ~76px tall; add 24px breathing room.
   ============================================================ */
body.pbn-blog-page > main { padding-top: 100px; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 3rem 2rem;
  background: var(--dark);
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
}

footer .footer-content {
  max-width: 1200px;
  margin: 0 auto 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  text-align: left;
}

footer .footer-section h4 {
  margin-bottom: 1rem;
  color: var(--light);
  font-size: 1rem;
  font-weight: 600;
}

footer .footer-section p,
footer .footer-section a {
  color: var(--gray);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
  font-size: 0.95rem;
  line-height: 1.7;
}

footer .footer-section ul { list-style: none; margin: 0; padding: 0; }
footer .footer-section li { margin: 0; padding: 0; }

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

footer .footer-brand .logo {
  font-size: 1.15rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

footer .footer-social .social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

footer .footer-social .social-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--gray);
  margin: 0;
  text-transform: capitalize;
}
footer .footer-social .social-list a:hover {
  background: rgba(0, 102, 255, 0.1);
  border-color: var(--primary);
  color: var(--text);
}

footer .footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--gray);
  text-align: center;
  font-size: 0.9rem;
}

/* ============================================================
   ARTICLE / BLOG POST
   ============================================================ */
.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  color: var(--text);
}

.article-container h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  line-height: 1.2;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--light), var(--gray));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.article-container .meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.article-container .featured-image {
  width: 100%;
  border-radius: var(--radius);
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--border);
  overflow: hidden;
}
.article-container .featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.article-container .content { font-size: 1.05rem; line-height: 1.8; color: #cfd5e8; }

.article-container .content h2 {
  font-size: 1.7rem;
  margin: 2.25rem 0 1rem;
  color: var(--text);
  line-height: 1.3;
  font-weight: 700;
}
.article-container .content h3 {
  font-size: 1.35rem;
  margin: 1.75rem 0 0.85rem;
  color: var(--text);
  line-height: 1.35;
  font-weight: 600;
}
.article-container .content h4 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
  font-weight: 600;
}
.article-container .content p { margin: 0 0 1.1rem; }
.article-container .content ul,
.article-container .content ol { margin: 0 0 1.1rem 1.5rem; padding-left: 0.5rem; }
.article-container .content li { margin-bottom: 0.4rem; }
.article-container .content a {
  color: var(--secondary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.article-container .content a:hover { color: var(--primary); }
.article-container .content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}
.article-container .content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--primary);
  background: rgba(0, 102, 255, 0.08);
  border-radius: 0 12px 12px 0;
  color: var(--text);
  font-style: italic;
}
.article-container .content pre {
  background: var(--bg-card);
  color: #e6ecff;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
  margin: 1.25rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.article-container .content code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  color: #c8d3ff;
}
.article-container .content pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
}
.article-container .content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.article-container .content th,
.article-container .content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.article-container .content th {
  background: rgba(0, 102, 255, 0.12);
  color: var(--text);
  font-weight: 600;
}
.article-container .content tr:last-child td { border-bottom: none; }

/* ============================================================
   TABLE OF CONTENTS — scoped reset to break out of nav cascade
   ============================================================ */
nav.toc {
  position: static;
  z-index: auto;
  width: auto;
  top: auto;
  left: auto;
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
nav.toc h2,
nav.toc .toc-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  font-weight: 600;
}
nav.toc ol,
nav.toc ul { list-style: none; margin: 0; padding-left: 0; }
nav.toc li { margin: 0.25rem 0; }
nav.toc a { color: var(--secondary); text-decoration: none; font-size: 0.95rem; }
nav.toc a:hover { color: var(--text); text-decoration: underline; }

/* ============================================================
   BREADCRUMBS — same anti-cascade pattern as TOC
   ============================================================ */
nav.breadcrumbs {
  position: static;
  z-index: auto;
  width: auto;
  top: auto;
  left: auto;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
nav.breadcrumbs ol,
nav.breadcrumbs ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}
nav.breadcrumbs li { display: inline-flex; align-items: center; }
nav.breadcrumbs li + li::before {
  content: '/';
  margin: 0 0.4rem;
  color: var(--border);
}
nav.breadcrumbs a { color: var(--secondary); }
nav.breadcrumbs a:hover { color: var(--text); }

/* ============================================================
   TAGS (pill chips)
   ============================================================ */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(0, 102, 255, 0.12);
  color: var(--secondary);
  border: 1px solid rgba(0, 212, 255, 0.25);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.25s ease;
}
.tag:hover {
  background: rgba(0, 102, 255, 0.25);
  color: var(--text);
  transform: translateY(-1px);
}

/* ============================================================
   SHARE BUTTONS — circular row at the bottom of articles
   ============================================================ */
.share-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 1.5rem 0;
}
.share-buttons .label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-right: 0.25rem;
}
.share-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  cursor: pointer;
}
.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  color: #fff;
}
.share-btn svg { width: 16px; height: 16px; fill: currentColor; }
.share-btn-x  { background: #000000; }
.share-btn-fb { background: #1877F2; }
.share-btn-li { background: #0A66C2; }
.share-btn-wa { background: #25D366; }
.share-btn-tg { background: #229ED9; }

/* ============================================================
   SHARE POPOVER (BBC-style top share)
   ============================================================ */
.share-popover-wrap {
  position: relative;
  display: inline-block;
}
.share-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.share-toggle:hover {
  border-color: var(--primary);
  background: rgba(0, 102, 255, 0.12);
}
.share-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 50;
}
.share-popover[hidden] { display: none; }
.share-pop-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}
.share-pop-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.share-pop-item .icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.share-pop-x  .icon { background: #000000; }
.share-pop-fb .icon { background: #1877F2; }
.share-pop-li .icon { background: #0A66C2; }
.share-pop-wa .icon { background: #25D366; }
.share-pop-tg .icon { background: #229ED9; }

/* ============================================================
   RELATED POSTS
   ============================================================ */
.related-posts { margin: 3rem 0 1rem; }
.related-posts h2 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.related-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 12px 30px rgba(0, 102, 255, 0.18);
}
.related-card a { color: var(--text); text-decoration: none; padding: 1rem 1.1rem; display: block; }
.related-card h3 { font-size: 1rem; line-height: 1.4; margin: 0; }
.related-card .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ============================================================
   BLOG LISTING
   ============================================================ */
.blog-header {
  max-width: 1200px;
  margin: 0 auto 1.5rem;
  padding: 0 1.5rem;
  text-align: left;
}
.blog-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  background: linear-gradient(135deg, var(--light), var(--gray));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.blog-header .blog-intro {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Categories pill nav */
.categories {
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.cat-chip:hover { color: var(--text); border-color: var(--primary); }
.cat-chip.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

/* Posts grid */
.posts-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 14px 32px rgba(0, 102, 255, 0.18);
}
.post-card-image {
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: var(--bg-elevated);
  position: relative;
}
.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.post-card:hover .post-card-image img { transform: scale(1.04); }

.post-card-image-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 1rem;
  background:
    linear-gradient(135deg, rgba(0, 102, 255, 0.35), rgba(0, 212, 255, 0.15)),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 12px, transparent 12px 24px);
}
.post-card-image-fallback .ph-cat {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.post-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.cat-link {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary);
  text-decoration: none;
  font-weight: 600;
}
.cat-link:hover { color: var(--text); }
.post-card-title {
  font-size: 1.15rem;
  line-height: 1.35;
  margin: 0;
  color: var(--text);
  font-weight: 600;
}
.post-card-title a { color: inherit; text-decoration: none; }
.post-card-title a:hover { color: var(--secondary); }
.post-card-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
}
.post-card-excerpt {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin: 2.5rem 0 1.5rem;
  flex-wrap: wrap;
}
.pagination ul,
.pagination ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: contents;
}
.pagination li {
  list-style: none;
  display: inline-flex;
  margin: 0;
  padding: 0;
}
.pagination a,
.pagination span {
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.pagination a:hover {
  border-color: var(--primary);
  color: var(--text);
}
.pagination .current,
.pagination [aria-current="page"] {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.pagination .disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}

@media (max-width: 768px) {
  header .nav-links { display: none; }
  header .nav-container { padding: 1rem 1.25rem; }
  body.pbn-blog-page > main { padding-top: 80px; }

  footer { padding: 2.5rem 1.25rem; }
  footer .footer-content { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; gap: 20px; }
  .article-container { padding: 1.5rem 1.1rem 3rem; }
  .blog-header { padding: 0 1.1rem; }
  .categories { padding: 0 1.1rem; flex-wrap: nowrap; }
}
