/* ============================================================
   Logomentary — canonical chrome stylesheet
   ============================================================ */

@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');

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

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, 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(--bg);
    font-weight: 600;
    font-size: .9rem;
    border-radius: 8px;
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

/* ============================================================
   HEADER / PRIMARY NAV (scoped to header nav, NOT bare 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;
}

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

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

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

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

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

header nav .nav-links a.btn { color: var(--bg); }

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

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

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

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

/* HAMBURGER */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.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 non-home content pages
   ============================================================ */
body.pbn-blog-page > main { padding-top: 104px; }

@media (max-width: 768px) {
    body.pbn-blog-page > main { padding-top: 88px; }
}

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

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

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

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

.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-partner a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

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

.footer-col ul { list-style: none; }

.footer-col li { margin-bottom: 10px; }

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

.footer-col a:hover { color: var(--text); }

.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);
    flex-wrap: wrap;
    gap: 16px;
}

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

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

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

.article-container h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    color: var(--text);
}

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

.article-container .meta .dot { color: var(--border); }

.article-container .featured-image {
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 40px;
    background: var(--bg-card);
}

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

.article-container .content > * + * { margin-top: 1.2em; }

.article-container .content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-top: 2em;
    margin-bottom: .6em;
    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-top: 1.6em;
    margin-bottom: .5em;
    color: var(--text);
}

.article-container .content h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.4em;
    margin-bottom: .4em;
    color: var(--text);
}

.article-container .content p {
    color: var(--text);
}

.article-container .content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(200,255,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 {
    padding-left: 1.4em;
    color: var(--text);
}

.article-container .content li { margin-bottom: .4em; }

.article-container .content img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 1.5em 0;
}

.article-container .content blockquote {
    border-left: 3px solid var(--accent);
    padding: 8px 0 8px 20px;
    margin: 1.4em 0;
    color: var(--text-muted);
    font-style: italic;
    background: var(--bg-elevated);
    border-radius: 0 8px 8px 0;
}

.article-container .content pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    overflow-x: auto;
    font-family: ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;
    font-size: .9rem;
    line-height: 1.55;
    color: var(--text);
}

.article-container .content code {
    font-family: ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;
    font-size: .9em;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 6px;
    color: var(--accent);
}

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

.article-container .content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: .95rem;
    border: 1px solid var(--border);
    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: 0; }

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

/* ============================================================
   TABLE OF CONTENTS — MUST RESET cascade from header nav
   ============================================================ */
nav.toc,
.toc {
    position: static;
    z-index: auto;
    width: auto;
    top: auto;
    left: auto;
    right: auto;
    padding: 20px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 24px 0 32px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: none;
}

nav.toc .toc-title,
.toc .toc-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 12px;
}

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

nav.toc li,
.toc li {
    margin-bottom: 6px;
    font-size: .95rem;
    counter-increment: toc;
}

nav.toc li::before,
.toc li::before {
    content: counter(toc, decimal-leading-zero) ". ";
    color: var(--accent);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    margin-right: 6px;
}

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

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

/* ============================================================
   BREADCRUMBS — reset cascade
   ============================================================ */
nav.breadcrumbs,
.breadcrumbs {
    position: static;
    z-index: auto;
    width: auto;
    top: auto;
    left: auto;
    right: auto;
    padding: 0;
    background: transparent;
    border: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

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

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); }

nav.breadcrumbs [aria-current="page"],
.breadcrumbs [aria-current="page"] { color: var(--text); }

/* ============================================================
   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-elevated);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: .8rem;
    color: var(--text-muted);
    transition: border-color .2s, color .2s;
}

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

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

.share-buttons .share-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-right: 4px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-size: .9rem;
    line-height: 1;
    transition: transform .2s, box-shadow .2s, opacity .2s;
    border: 1px solid transparent;
}

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

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
    color: #fff;
}

.share-btn-x  { background: #000000; border-color: #222; }
.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: 8px;
    padding: 8px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    transition: border-color .2s, color .2s;
}

.share-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

.share-popover[hidden] { display: none; }

.share-pop-item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    font-size: .9rem;
    transition: background .2s, color .2s;
}

.share-pop-item:hover { background: var(--bg-elevated); }

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

.share-pop-item .share-pop-icon svg { width: 14px; height: 14px; fill: currentColor; }

.share-pop-x  .share-pop-icon { background: #000000; border: 1px solid #222; }
.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: 80px;
    padding-top: 48px;
    border-top: 1px solid var(--border);
}

.related-posts h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
}

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

.related-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color .2s, transform .2s;
}

.related-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.related-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
    margin-bottom: 8px;
}

.related-card p {
    font-size: .85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

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

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

/* ============================================================
   BLOG LIST — post grid, cards, categories, pagination
   ============================================================ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin: 40px 0;
}

@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: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .3s, border-color .3s, box-shadow .3s;
}

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

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

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s cubic-bezier(.16,1,.3,1);
}

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

.post-card-image-fallback {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, rgba(200,255,0,.08) 0%, transparent 60%),
        linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 16px;
    position: relative;
}

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

.post-card-image-fallback .ph-cat {
    position: relative;
    z-index: 1;
    font-family: 'Space Grotesk', sans-serif;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    background: rgba(10,10,10,.65);
    padding: 6px 12px;
    border-radius: 50px;
    border: 1px solid var(--border);
}

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

.cat-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    transition: color .2s;
}

.cat-link:hover { color: var(--text); }

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

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

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

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

/* ----- CATEGORY PILL NAV ----- */
.categories {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    margin: 24px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.categories::-webkit-scrollbar { height: 6px; }
.categories::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

@media (min-width: 769px) {
    .categories { flex-wrap: wrap; overflow-x: visible; }
}

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

.cat-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

/* ----- PAGINATION ----- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 48px 0 16px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: border-color .2s, color .2s, background .2s;
}

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

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

.pagination .ellipsis {
    border: 0;
    background: transparent;
    color: var(--text-muted);
}

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

@media (max-width: 768px) {
    header nav .nav-links { display: none; }
    .hamburger { display: flex; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .article-container { padding: 32px 20px 64px; }
}
