/* =========================================================
   finglobalsoft.com — canonical chrome stylesheet
   Dark space-fintech theme: deep indigo bg, electric blue
   primary, cyan secondary, mint accent.
   ========================================================= */

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

:root {
    /* Legacy brand tokens (kept for backwards compat with inline pages) */
    --primary: #0066ff;
    --secondary: #00d4ff;
    --dark: #0a0e27;
    --darker: #050714;
    --light: #ffffff;
    --gray: #8892b0;

    /* Canonical tokens consumed by external pipelines */
    --bg: #050714;
    --bg-card: #0a0e27;
    --bg-elevated: #121a3a;
    --text: #ffffff;
    --text-muted: #8892b0;
    --accent: #0066ff;
    --accent-fg: #ffffff;
    --accent-hover: #3385ff;
    --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;
    -moz-osx-font-smoothing: grayscale;
}

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

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

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

/* =========================================================
   HEADER / NAV  (scoped to `header nav` only)
   ========================================================= */

header {
    position: relative;
    z-index: 1000;
}

header nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    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: 2rem;
}

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;
    letter-spacing: 0.01em;
    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: color 0.3s ease;
    position: relative;
    font-size: 1rem;
}

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

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: 220px;
    background: rgba(10, 14, 39, 0.98);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem 0;
    list-style: none;
    display: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    margin-top: 0.75rem;
}

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

header .submenu li a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--gray);
}

header .submenu li a:hover {
    color: var(--light);
    background: rgba(0, 102, 255, 0.1);
}

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(--light);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

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

/* Fixed-nav compensation for content pages */
body.pbn-blog-page > main {
    padding-top: 104px; /* nav height ~80px + 24px gap */
}

/* =========================================================
   FOOTER
   ========================================================= */

footer {
    padding: 3rem 2rem;
    background: var(--dark);
    color: var(--gray);
    text-align: center;
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.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-section h4 {
    margin-bottom: 1rem;
    color: var(--light);
    font-size: 1rem;
    font-weight: 600;
}

.footer-section p,
.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.6;
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

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

.footer-social .social-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.footer-social .social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--gray);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 0;
}

.footer-social .social-icon:hover {
    color: var(--light);
    border-color: var(--primary);
    background: rgba(0, 102, 255, 0.1);
}

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

/* =========================================================
   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(2rem, 4.5vw, 3rem);
    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;
}

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

.article-container .meta span,
.article-container .meta time {
    color: var(--text-muted);
}

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

.article-container .featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

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

.article-container .content h2 {
    font-size: 1.75rem;
    margin: 2.5rem 0 1rem;
    color: var(--light);
    line-height: 1.3;
}

.article-container .content h3 {
    font-size: 1.35rem;
    margin: 2rem 0 0.75rem;
    color: var(--light);
    line-height: 1.3;
}

.article-container .content h4 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.5rem;
    color: var(--light);
}

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

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

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

.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 {
    width: 100%;
    height: auto;
    border-radius: 15px;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

.article-container .content blockquote {
    border-left: 4px solid var(--primary);
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    background: rgba(0, 102, 255, 0.05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.article-container .content pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.article-container .content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--secondary);
}

.article-container .content pre code {
    background: transparent;
    padding: 0;
    color: var(--text);
}

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

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

.article-container .content table th {
    background: var(--bg-card);
    color: var(--light);
    font-weight: 600;
}

.article-container .content table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

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

/* ---- TOC ---- */
nav.toc,
.toc {
    position: static;
    z-index: auto;
    width: auto;
    top: auto;
    left: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 2rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

nav.toc h2,
.toc h2,
nav.toc .toc-title,
.toc .toc-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    font-weight: 600;
}

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

nav.toc li,
.toc li {
    margin: 0.35rem 0;
}

nav.toc a,
.toc a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.95rem;
}

nav.toc a:hover,
.toc a:hover {
    color: var(--primary);
    text-decoration: underline;
}

nav.toc ul ul,
.toc ul ul {
    padding-left: 1rem;
    margin-top: 0.25rem;
}

/* ---- Breadcrumbs ---- */
nav.breadcrumbs,
.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.85rem;
    color: var(--text-muted);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

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

nav.breadcrumbs li,
.breadcrumbs li {
    display: flex;
    align-items: center;
}

nav.breadcrumbs li + li::before,
.breadcrumbs li + li::before {
    content: '/';
    margin: 0 0.4rem;
    color: var(--text-muted);
    opacity: 0.5;
}

nav.breadcrumbs a,
.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

nav.breadcrumbs a:hover,
.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.35rem 0.85rem;
    background: rgba(0, 102, 255, 0.1);
    border: 1px solid rgba(0, 102, 255, 0.3);
    color: var(--secondary);
    border-radius: 999px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag:hover {
    background: rgba(0, 102, 255, 0.2);
    border-color: var(--primary);
    color: var(--light);
}

/* ---- Share buttons (bottom inline row) ---- */
.share-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.share-buttons .share-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.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 14px rgba(0, 0, 0, 0.35);
    color: #fff;
}

.share-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.share-btn-x { background: #000; }
.share-btn-fb { background: #1877F2; }
.share-btn-li { background: #0A66C2; }
.share-btn-wa { background: #25D366; }
.share-btn-tg { background: #229ED9; }

/* ---- Share popover (top, BBC-style) ---- */
.share-popover-wrap {
    position: relative;
    display: inline-block;
}

.share-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
}

.share-toggle:hover {
    background: rgba(0, 102, 255, 0.15);
    color: var(--light);
}

.share-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.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.05);
    color: var(--light);
}

.share-pop-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.share-pop-x { color: #fff; }
.share-pop-fb { color: #1877F2; }
.share-pop-li { color: #0A66C2; }
.share-pop-wa { color: #25D366; }
.share-pop-tg { color: #229ED9; }

/* ---- Related posts ---- */
.related-posts {
    margin: 3rem 0 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.related-posts h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--light);
}

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

.related-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
    display: block;
}

.related-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 102, 255, 0.15);
    color: var(--light);
}

.related-card h3 {
    font-size: 1rem;
    color: var(--light);
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

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

/* =========================================================
   BLOG LIST
   ========================================================= */

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

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

@media (max-width: 640px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.post-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 102, 255, 0.2);
}

.post-card-image {
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    position: relative;
    background: var(--bg-elevated);
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-image-fallback {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 102, 255, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 212, 255, 0.35) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(100, 255, 218, 0.25) 0%, transparent 50%),
        linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 1rem;
}

.post-card-image-fallback .ph-cat {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--light);
    background: rgba(5, 7, 20, 0.5);
    padding: 0.25rem 0.6rem;
    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(--primary);
}

.post-card-title {
    font-size: 1.2rem;
    line-height: 1.3;
    color: var(--light);
    margin: 0;
    font-weight: 600;
}

.post-card-title a {
    color: inherit;
    text-decoration: none;
}

.post-card-title a:hover {
    color: var(--secondary);
}

.post-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.post-card-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* ---- Category chips ---- */
.categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 2rem;
    overflow-x: auto;
}

@media (max-width: 640px) {
    .categories {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
}

.cat-chip {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 999px;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.cat-chip:hover {
    color: var(--light);
    border-color: var(--primary);
    background: rgba(0, 102, 255, 0.1);
}

.cat-chip.active {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem auto 0;
    padding: 0 2rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pagination a:hover {
    color: var(--light);
    border-color: var(--primary);
    background: rgba(0, 102, 255, 0.1);
}

.pagination .current,
.pagination [aria-current="page"] {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {
    header .nav-links {
        display: none;
    }

    header .nav-container {
        padding: 1rem 1.25rem;
    }

    header .cta-button {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }

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

    .article-container {
        padding: 1.5rem 1rem 3rem;
    }

    footer {
        padding: 2.5rem 1.25rem;
    }

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