/* ============================================================
   X9Z7 Single Post Page CSS
   ============================================================ */

.post-page { padding-top: 0; min-height: 100vh; }

/* Back to blog */
.post-back-wrap {
    padding: calc(var(--nav-height) + 0.75rem) 1.5rem 0;
    max-width: 800px;
    margin: 0 auto;
}
.post-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #00ff41;
    text-decoration: none;
    letter-spacing: 0.1em;
    border: 1px solid rgba(0,255,65,0.6);
    padding: 0.5rem 1.25rem;
    border-radius: 2px;
    background: rgba(0,255,65,0.08);
    transition: all 0.2s;
    text-transform: uppercase;
    box-shadow: 0 0 8px rgba(0,255,65,0.08);
}
.post-back-btn:hover {
    color: #000;
    border-color: #00ff41;
    background: #00ff41;
    box-shadow: 0 0 16px rgba(0,255,65,0.3);
}
.post-back-bottom {
    max-width: 800px;
    margin: 2.5rem auto 0;
    padding: 1rem 1.5rem 4rem;
    display: flex;
    justify-content: center;
}
.post-back-bottom .post-back-btn {
    font-size: 0.8rem;
    padding: 0.6rem 1.75rem;
    border-color: rgba(0,255,65,0.35);
    letter-spacing: 0.12em;
}
@media (max-width: 600px) {
    .post-back-bottom {
        padding: 1rem 1rem 3rem;
    }
    .post-back-bottom .post-back-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Banner */
.post-banner {
    background: linear-gradient(180deg, rgba(0,0,0,0.97) 0%, rgba(0,10,0,0.9) 100%);
    border-bottom: 1px solid rgba(0,255,65,0.2);
    padding-top: calc(var(--nav-height) + 1.5rem);
    padding-bottom: 1.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    position: relative;
    overflow: hidden;
}

.post-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 100% at 50% 50%, rgba(0,255,65,0.04) 0%, transparent 70%);
    pointer-events: none;
}

.post-banner-inner {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.post-meta-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.post-cat {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(0,255,65,0.12);
    border: 1px solid rgba(0,255,65,0.25);
    color: var(--matrix-green);
    padding: 0.15rem 0.6rem;
    border-radius: 2px;
}

.post-date, .post-readtime {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
}

.post-title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 4vw, 2.5rem);
    font-weight: 900;
    color: var(--matrix-green);
    letter-spacing: 0.04em;
    line-height: 1.15;
    text-shadow: 0 0 20px rgba(0,255,65,0.3);
    margin-bottom: 0.75rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.post-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: rgba(0,255,65,0.6);
    background: rgba(0,255,65,0.06);
    border: 1px solid rgba(0,255,65,0.15);
    padding: 0.1rem 0.5rem;
    border-radius: 2px;
}

/* Content area */
.post-content-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 5rem;
    background: #000;
    border-left: 1px solid rgba(0,255,65,0.08);
    border-right: 1px solid rgba(0,255,65,0.08);
}

/* Featured image */
.post-featured-image {
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
    border: 1px solid rgba(0,255,65,0.12);
}
.post-featured-image img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
}

/* Media links bar */
.post-media-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    padding: 0.6rem 0.85rem;
    background: rgba(0,255,65,0.03);
    border: 1px solid rgba(0,255,65,0.1);
    border-radius: 3px;
}
.post-media-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(0,255,65,0.6);
    text-decoration: none;
    transition: color 0.2s;
    max-width: 100%;
    overflow: hidden;
}
.post-media-link:hover { color: var(--matrix-green); }
.post-media-link svg { flex-shrink: 0; }
.post-media-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}
@media (max-width: 600px) {
    .post-media-link span { max-width: 200px; }
}

/* Body text */
.post-body {
    font-family: var(--font-body, 'Courier New', monospace);
    font-size: 1.05rem;
    line-height: 1.9;
    color: #fff;
}

.post-body h2,
.post-body h3 {
    font-family: var(--font-display);
    color: var(--matrix-green);
    font-weight: 700;
    margin-top: 1.8rem;
    margin-bottom: 0.6rem;
    text-shadow: 0 0 10px rgba(0,255,65,0.2);
}

.post-body h2 { font-size: 1.3rem; }
.post-body h3 { font-size: 1.05rem; }

.post-body p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.9;
    color: #fff;
}

.post-body a {
    color: var(--matrix-green);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-body a:hover { opacity: 0.75; }

.post-body ul, .post-body ol {
    padding-left: 1.4rem;
    margin-bottom: 1rem;
}

.post-body li { margin-bottom: 0.4rem; }

.post-body blockquote {
    border-left: 3px solid rgba(0,255,65,0.4);
    padding: 0.5rem 1rem;
    margin: 1.2rem 0;
    color: rgba(255,255,255,0.6);
    font-style: italic;
    background: rgba(0,255,65,0.03);
}

.post-body strong, .post-body b { color: rgba(255,255,255,0.95); }

.post-body code {
    font-family: var(--font-mono);
    background: rgba(0,255,65,0.08);
    border: 1px solid rgba(0,255,65,0.15);
    padding: 0.1em 0.4em;
    border-radius: 2px;
    font-size: 0.88em;
}

/* Media sections */
.post-media-section {
    margin-top: 2.5rem;
    border-top: 1px solid rgba(0,255,65,0.12);
    padding-top: 1.5rem;
}

.post-media-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: rgba(0,255,65,0.5);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

/* YouTube embeds */
.post-video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border: 1px solid rgba(0,255,65,0.15);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.post-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* X links */
.post-x-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-x-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: rgba(0,255,65,0.7);
    border: 1px solid rgba(0,255,65,0.2);
    padding: 0.35rem 0.75rem;
    border-radius: 2px;
    text-decoration: none;
    transition: all 0.2s;
}

.post-x-link:hover {
    border-color: var(--matrix-green);
    color: var(--matrix-green);
    background: rgba(0,255,65,0.05);
}

/* Back button */
.post-back {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,255,65,0.1);
}

.btn-outline-post {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: rgba(0,255,65,0.6);
    border: 1px solid rgba(0,255,65,0.25);
    padding: 0.4rem 1rem;
    border-radius: 2px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-outline-post:hover {
    color: var(--matrix-green);
    border-color: var(--matrix-green);
    background: rgba(0,255,65,0.05);
}

/* Reading progress bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0,255,65,0.1);
    z-index: 9999;
    pointer-events: none;
}
#reading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff41, rgba(0,255,65,0.6));
    box-shadow: 0 0 8px rgba(0,255,65,0.6);
    transition: width 0.1s linear;
}

/* Related posts */
.related-posts-wrap {
    background: rgba(0,5,0,0.98);
    border-top: 1px solid rgba(0,255,65,0.15);
    padding: 3rem 1.5rem;
}
.related-posts-inner {
    max-width: 800px;
    margin: 0 auto;
}
.related-posts-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    color: rgba(0,255,65,0.5);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}
.related-card {
    display: block;
    text-decoration: none;
    background: #000;
    border: 1px solid rgba(0,255,65,0.15);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    height: 100%;
}
.related-card:hover {
    border-color: rgba(0,255,65,0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,255,65,0.08);
}
.related-card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #0a0a0a;
}
.related-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.related-card:hover .related-card-thumb img { transform: scale(1.04); }
.related-card-body {
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.related-card-cat {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #000;
    background: var(--matrix-green);
    padding: 1px 6px;
    border-radius: 2px;
    align-self: flex-start;
}
.related-card-title {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: rgba(255,255,255,0.88);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-card-date {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: rgba(255,255,255,0.3);
}

@media (max-width: 600px) {
    .post-content-wrap { padding: 1.5rem 1rem 3rem; }
    .post-videos-grid { grid-template-columns: 1fr; }
    .post-body { font-size: 0.88rem; }
    .related-posts-wrap { padding: 2rem 1rem; }
}
