/* =====================================================
   BLOG LIST (main.html)
   ===================================================== */

body {
    height: 130%;
}

.blogs-section {
    padding-top: 120px;
    padding-bottom: 5rem;
}

.blogs-header {
    margin-bottom: 3rem;
}

.blogs-header h1 {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.blogs-header p {
    max-width: 700px;
    color: var(--text-dim);
    font-size: 1rem;
}

.blog-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 10px;
    padding: 2rem;
    transition: transform .2s ease, border-color .3s ease;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, .2);
}

.blog-date {
    color: var(--text-dim);
    font-size: .85rem;
}

.blog-title {
    color: var(--accent);
    margin: .6rem 0;
    font-size: 1.6rem;
}

.blog-description {
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.blog-tags {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}

.tag {
    padding: .3rem .8rem;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    color: var(--text-dim);
    font-size: .8rem;
}


/* =====================================================
   BLOG READER (blog.html)
   ===================================================== */

/* Page shell — sits directly on the dark background */
.post-page {
    padding-top: 110px;
    padding-bottom: 6rem;
    min-height: 100vh;
}

/* The readable prose column */
.post-body {
    display: none;                /* shown by JS when content loads */
    max-width: 900px;
    margin: 0 0 0 8%;
    padding: 0 2rem;
}

/* Back link */
.back-link {
    display: inline-block;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    margin-bottom: 3rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--accent);
}

/* ---- Post header ---- */
.post-head {
    margin-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding-bottom: 2.5rem;
}

/* Tags row above the title */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.post-tags .tag {
    font-size: .75rem;
    padding: .2rem .7rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    color: var(--text-dim);
    letter-spacing: 0.03em;
}

#post-title {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--accent);
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-dim);
    font-size: 0.875rem;
}

.meta-sep {
    opacity: 0.4;
}

/* ---- Cover image ---- */
.post-cover-container {
    display: none;           /* revealed by JS if coverImage exists */
    margin-bottom: 3rem;
    border-radius: 8px;
    overflow: hidden;
    max-height: 420px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.blog-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---- Prose content ---- */
.post-content {
    color: var(--text-main);
    font-size: 1.05rem;
    line-height: 1.85;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--accent);
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2.8rem;
    margin-bottom: 0.9rem;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.6rem; }
.post-content h3 { font-size: 1.3rem; }
.post-content h4 { font-size: 1.1rem; }

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content ul,
.post-content ol {
    margin: 0 0 1.5rem 1.4rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    padding-left: 0.3rem;
}

.post-content blockquote {
    border-left: 3px solid rgba(255, 255, 255, 0.25);
    margin: 2.5rem 0;
    padding: 0.3rem 0 0.3rem 1.5rem;
    color: var(--text-dim);
    font-style: italic;
}

.post-content code {
    background: rgba(255, 255, 255, 0.07);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.875em;
    color: #d4d4d4;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.post-content pre {
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 1.4rem 1.6rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.9em;
    color: #c9c9c9;
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: opacity 0.2s ease;
}

.post-content a:hover {
    opacity: 0.7;
}

.post-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 2rem 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.post-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 3rem 0;
}

/* ---- Post footer ---- */
.post-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ---- Status states (loading / error) ---- */
.blog-status {
    display: none;
    text-align: center;
    padding: 8rem 2rem;
    color: var(--text-dim);
}

/* loading shown by default — JS hides it */
#blog-loading {
    display: block;
}

#blog-error {
    display: none;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 1.2rem;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-status h2 {
    font-size: 1.6rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.return-btn {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.return-btn:hover {
    color: var(--accent);
}


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

@media (max-width: 768px) {
    .post-body {
        padding: 0 1.2rem;
    }

    #post-title {
        font-size: 1.9rem;
    }

    .post-content {
        font-size: 1rem;
    }
}