@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg: #0a0a0a;
    --bg-elevated: #111111;
    --bg-card: #161616;
    --text: #f0f0f0;
    --text-muted: #888888;
    --accent: #c8ff00;
    --accent-fg: #0a0a0a;
    --accent-hover: #a3cc00;
    --accent-dim: #a3cc00;
    --border: #222222;
    --radius: 12px;
}

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

html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 1000;
    width: auto;
    height: auto;
    padding: 12px 20px;
    background: var(--accent);
    color: var(--accent-fg);
    font-weight: 600;
    font-size: .9rem;
    border-radius: 8px;
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

/* ========== HEADER / NAV ========== */
header nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 0;
    transition: background .3s, backdrop-filter .3s, padding .3s;
}

header nav.scrolled {
    background: rgba(10,10,10,.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

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

header .logo,
footer .logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

header .logo span,
footer .logo span { color: var(--accent); }

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

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

header nav .nav-links a {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color .2s;
}

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

header nav .nav-links .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 0;
    min-width: 180px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
    z-index: 101;
}

header nav .nav-links > li:hover .submenu,
header nav .nav-links > li:focus-within .submenu {
    opacity: 1;
    visibility: visible;
}

header nav .nav-links .submenu li { margin: 0; }

header nav .nav-links .submenu a {
    display: block;
    padding: 8px 16px;
    font-size: .85rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--accent);
    color: var(--accent-fg);
    font-weight: 600;
    font-size: .9rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, background .2s;
    font-family: inherit;
    text-decoration: none;
    line-height: 1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(200,255,0,.25);
    background: var(--accent-hover);
}

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

.btn-outline:hover {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 8px 30px rgba(200,255,0,.1);
}

/* HAMBURGER */
header .hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
header .hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: .3s;
}

/* MOBILE MENU */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 99;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}
.mobile-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.8rem;
    cursor: pointer;
}

/* Fixed-nav compensation for content pages */
body.pbn-blog-page > main { padding-top: 88px; }

/* ========== FOOTER ========== */
footer {
    border-top: 1px solid var(--border);
    padding: 60px 0 40px;
    background: var(--bg);
}

footer .footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 60px;
}

footer .footer-brand p {
    color: var(--text-muted);
    font-size: .9rem;
    margin-top: 12px;
    max-width: 280px;
    line-height: 1.6;
}

footer .footer-partner {
    margin-top: 20px;
    max-width: 320px;
}

footer .footer-partner a {
    color: var(--text);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: rgba(200, 255, 0, 0.35);
    text-underline-offset: 3px;
    transition: color .2s, text-decoration-color .2s;
}

footer .footer-partner a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

footer .footer-col h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    margin-bottom: 16px;
    font-size: .95rem;
    color: var(--text);
}

footer .footer-col ul { list-style: none; margin: 0; padding: 0; }
footer .footer-col li { margin-bottom: 10px; }

footer .footer-col a {
    color: var(--text-muted);
    font-size: .9rem;
    transition: color .2s;
}
footer .footer-col a:hover { color: var(--text); }

footer .footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    font-size: .85rem;
    color: var(--text-muted);
    gap: 24px;
    flex-wrap: wrap;
}

footer .footer-socials {
    display: flex;
    gap: 20px;
}

footer .footer-socials a {
    color: var(--text-muted);
    transition: color .2s;
}
footer .footer-socials a:hover { color: var(--accent); }

/* ========== BLOG ARTICLE ========== */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.article-container h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 16px;
    color: var(--text);
}

.article-container .meta {
    color: var(--text-muted);
    font-size: .85rem;
    margin-bottom: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.article-container .featured-image {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    margin: 0 0 32px;
}

.article-container .featured-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
}

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

.article-container .content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin: 48px 0 16px;
    color: var(--text);
}

.article-container .content h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 32px 0 12px;
    color: var(--text);
}

.article-container .content h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 24px 0 10px;
    color: var(--text);
}

.article-container .content p { margin: 0 0 20px; }

.article-container .content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(200, 255, 0, 0.35);
    text-underline-offset: 3px;
    transition: text-decoration-color .2s;
}
.article-container .content a:hover {
    text-decoration-color: var(--accent);
}

.article-container .content ul,
.article-container .content ol {
    margin: 0 0 20px;
    padding-left: 1.4rem;
}

.article-container .content li { margin-bottom: 8px; }

.article-container .content img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 24px 0;
}

.article-container .content blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    border-left: 3px solid var(--accent);
    background: var(--bg-card);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-muted);
    font-style: italic;
}

.article-container .content pre {
    margin: 24px 0;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: .9rem;
    line-height: 1.6;
}

.article-container .content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .92em;
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.article-container .content pre code {
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
}

.article-container .content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: .95rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.article-container .content th {
    background: var(--bg-elevated);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    color: var(--text);
}

.article-container .content tr:last-child td { border-bottom: none; }

/* Table of contents — reset nav cascade */
nav.toc,
.toc {
    position: static;
    z-index: auto;
    width: auto;
    top: auto;
    left: auto;
    right: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 0 0 32px;
    padding-top: 20px;
}

nav.toc h2,
.toc h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

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

nav.toc li,
.toc li { margin-bottom: 6px; }

nav.toc a,
.toc a {
    color: var(--text);
    font-size: .95rem;
    transition: color .2s;
}
nav.toc a:hover,
.toc a:hover { color: var(--accent); }

/* Breadcrumbs — reset nav cascade */
nav.breadcrumbs,
.breadcrumbs {
    position: static;
    z-index: auto;
    width: auto;
    top: auto;
    left: auto;
    right: auto;
    padding: 0;
    margin: 0 0 20px;
    font-size: .85rem;
    color: var(--text-muted);
}

nav.breadcrumbs ol,
.breadcrumbs ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

nav.breadcrumbs li,
.breadcrumbs li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

nav.breadcrumbs li + li::before,
.breadcrumbs li + li::before {
    content: '/';
    color: var(--border);
}

nav.breadcrumbs a,
.breadcrumbs a {
    color: var(--text-muted);
    transition: color .2s;
}
nav.breadcrumbs a:hover,
.breadcrumbs a:hover { color: var(--accent); }

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 32px 0;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: .8rem;
    color: var(--text-muted);
    transition: color .2s, border-color .2s;
}
.tag:hover {
    color: var(--accent);
    border-color: var(--accent);
}

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

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform .2s, opacity .2s;
    text-decoration: none;
    font-size: .9rem;
}
.share-btn:hover { transform: translateY(-2px); opacity: .9; }

.share-btn-x  { background: #000; border: 1px solid #222; }
.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-of-article dropdown) */
.share-popover-wrap {
    position: relative;
    display: inline-block;
    margin: 24px 0;
}

.share-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.share-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.share-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 0;
    list-style: none;
    margin: 0;
    box-shadow: 0 12px 30px rgba(0,0,0,.4);
    z-index: 50;
}
.share-popover[hidden] { display: none; }

.share-pop-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: .9rem;
    color: var(--text);
    transition: background .2s;
}
.share-pop-item:hover { background: var(--bg-elevated); }

.share-pop-item .share-pop-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .7rem;
    flex-shrink: 0;
}

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

/* Related posts */
.related-posts {
    margin-top: 64px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.related-posts h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 24px;
    letter-spacing: -0.01em;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.related-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .3s, transform .3s;
}
.related-card:hover {
    border-color: #333;
    transform: translateY(-2px);
}

.related-card a {
    display: block;
    padding: 20px;
    color: var(--text);
}

.related-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 8px;
}

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

/* ========== BLOG LIST ========== */
.blog-header {
    max-width: 1200px;
    margin: 0 auto 1.5rem;
    padding: 0 1.5rem;
    text-align: left;
}

.blog-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    margin: 0 0 0.5rem;
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text);
}

.blog-header .blog-intro {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 720px;
}

/* Category pills above grid */
.categories {
    max-width: 1200px;
    margin: 0 auto 32px;
    padding: 0 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    overflow-x: auto;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color .2s, border-color .2s, background .2s;
}
.cat-chip:hover {
    color: var(--text);
    border-color: #333;
}
.cat-chip.active {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
}

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

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

.post-card:hover {
    transform: translateY(-2px);
    border-color: #333;
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

.post-card a { display: block; color: inherit; }

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

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .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;
    padding: 16px;
    background:
        linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%),
        radial-gradient(circle at 30% 30%, rgba(200,255,0,.08) 0%, transparent 60%);
    background-blend-mode: screen;
    position: relative;
}

.post-card-image-fallback::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(45deg, rgba(200,255,0,.05) 0 1px, transparent 1px 12px);
    pointer-events: none;
}

.post-card-image-fallback .ph-cat {
    position: relative;
    font-family: 'Space Grotesk', sans-serif;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.post-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.cat-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.post-card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.01em;
}

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

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

/* Pagination */
.pagination {
    max-width: 1200px;
    margin: 48px auto 0;
    padding: 0 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.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 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: .9rem;
    font-weight: 500;
    transition: color .2s, border-color .2s, background .2s;
}

.pagination a:hover {
    color: var(--text);
    border-color: #333;
}

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

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

@media (max-width: 768px) {
    header nav .nav-links { display: none; }
    header .hamburger { display: flex; }
    footer .footer-grid { grid-template-columns: 1fr; }
    footer .footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
    .posts-grid { grid-template-columns: 1fr; gap: 20px; }
    .related-grid { grid-template-columns: 1fr; }
    .article-container { padding: 24px 20px 64px; }
    body.pbn-blog-page > main { padding-top: 80px; }
}

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