/* ══════════════════════════════════════
   INNER PAGES — Blog, Single, Page, Archive, 404, Search
   Inherits all CSS variables from theme-dark.css / theme-light.css
   ══════════════════════════════════════ */

/* ── Layout ── */
.site-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 24px 60px;
    position: relative;
    z-index: 1;
    min-height: 60vh;
}

.site-main.has-sidebar {
    max-width: var(--container);
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
}

.page-header {
    margin-bottom: 40px;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
}

.page-description {
    font-size: 15px;
    color: var(--t3);
    line-height: 1.7;
}

/* ── Entry Cards (blog/archive listing) ── */
.entry-card {
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--card-r);
    padding: var(--card-p);
    margin-bottom: 24px;
    transition: border-color .3s, transform .3s, box-shadow .3s;
    position: relative;
    overflow: hidden;
}

.entry-card:hover {
    border-color: var(--bdr-h);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.entry-card .entry-thumbnail {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.entry-card .entry-thumbnail img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.entry-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}

.entry-title a {
    color: var(--t1);
    transition: color .2s;
}

.entry-title a:hover {
    color: var(--blue);
}

.entry-meta {
    font-size: 12px;
    color: var(--t4);
    margin-bottom: 14px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.entry-meta a {
    color: var(--t3);
    transition: color .2s;
}

.entry-meta a:hover {
    color: var(--blue);
}

.entry-excerpt {
    font-size: 14px;
    color: var(--t3);
    line-height: 1.7;
    margin-bottom: 16px;
}

.read-more {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap .2s;
}

.read-more:hover {
    gap: 8px;
}

/* ── Single Post / Page Content ── */
.single-header {
    margin-bottom: 32px;
}

.single-header .entry-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
}

.single-header .entry-meta {
    margin-bottom: 24px;
}

.entry-content {
    font-size: 16px;
    color: var(--t2);
    line-height: 1.8;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    color: var(--t1);
    margin: 32px 0 12px;
    line-height: 1.3;
}

.entry-content h2 { font-size: 26px; font-weight: 700; scroll-margin-top: 90px; }
.entry-content h3 { font-size: 21px; font-weight: 700; }
.entry-content h4 { font-size: 18px; font-weight: 600; }

.entry-content p {
    margin-bottom: 18px;
}

.entry-content a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.entry-content a:hover {
    opacity: 0.8;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
}

.entry-content blockquote {
    border-left: 3px solid var(--blue);
    padding: 12px 24px;
    margin: 24px 0;
    background: var(--bg-card);
    border-radius: 0 var(--card-r) var(--card-r) 0;
    font-style: italic;
    color: var(--t3);
}

.entry-content pre,
.entry-content code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 14px;
}

.entry-content pre {
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
}

.entry-content code {
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.entry-content ul,
.entry-content ol {
    padding-left: 24px;
    margin-bottom: 18px;
}

.entry-content li {
    margin-bottom: 6px;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.entry-content th,
.entry-content td {
    padding: 10px 14px;
    border: 1px solid var(--bdr);
    text-align: left;
    font-size: 14px;
}

.entry-content th {
    background: var(--bg-card);
    font-weight: 600;
    color: var(--t1);
}

.entry-featured-image {
    border-radius: var(--card-r);
    overflow: hidden;
    margin-bottom: 28px;
}

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

/* ── Post Navigation ── */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--bdr);
}

.post-navigation a {
    display: block;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--card-r);
    transition: border-color .2s;
}

.post-navigation a:hover {
    border-color: var(--bdr-h);
}

.post-navigation .nav-label {
    font-size: 11px;
    color: var(--t4);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 4px;
}

.post-navigation .nav-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--t1);
}

.post-navigation .nav-next {
    text-align: right;
}

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--bdr);
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--t3);
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    transition: all .2s;
}

.pagination .page-numbers:hover {
    border-color: var(--bdr-h);
    color: var(--t1);
}

.pagination .page-numbers.current {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

/* ── Sidebar ── */
.sidebar {
    padding-top: 8px;
}

.widget {
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--card-r);
    padding: 24px;
    margin-bottom: 20px;
}

.widget-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--t4);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bdr);
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget li {
    padding: 6px 0;
}

.widget a {
    font-size: 14px;
    color: var(--t3);
    transition: color .2s;
}

.widget a:hover {
    color: var(--blue);
}

/* ── Comments ── */
.comments-area {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--bdr);
}

.comments-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment-body {
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--card-r);
    padding: 20px;
    margin-bottom: 16px;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.comment-author img {
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

.comment-author .fn {
    font-size: 14px;
    font-weight: 600;
    color: var(--t1);
}

.comment-metadata {
    font-size: 11px;
    color: var(--t4);
}

.comment-metadata a {
    color: var(--t4);
}

.comment-content {
    font-size: 14px;
    color: var(--t2);
    line-height: 1.7;
}

.comment-content p {
    margin-bottom: 8px;
}

.comment-reply-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--blue);
}

.children {
    list-style: none;
    padding-left: 32px;
}

/* Comment form */
.comment-respond {
    margin-top: 32px;
}

.comment-reply-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.comment-form label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--t2);
    margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--t1);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    margin-bottom: 14px;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-form .submit {
    background: linear-gradient(135deg, var(--blue), var(--blue-d));
    color: #fff;
    border: none;
    border-radius: var(--btn-r);
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform .2s, box-shadow .2s;
}

.comment-form .submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

/* ── Search Form ── */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 400px;
}

.search-form .search-field {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--t1);
    font-size: 14px;
    font-family: inherit;
}

.search-form .search-field:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-form .search-submit {
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

/* ── 404 Page ── */
.error-404 {
    text-align: center;
    padding: 80px 0;
}

.error-404 .error-code {
    font-size: 120px;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.error-404 h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.error-404 p {
    font-size: 15px;
    color: var(--t3);
    margin-bottom: 28px;
}

.error-404 .btn-primary {
    display: inline-block;
    margin-top: 8px;
}

/* ── Tags ── */
.entry-tags {
    margin-top: 24px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.entry-tags a {
    padding: 4px 14px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    font-size: 12px;
    color: var(--t3);
    transition: border-color .2s, color .2s;
}

.entry-tags a:hover {
    border-color: var(--bdr-h);
    color: var(--blue);
}

/* ── Auto Table of Contents Layout ── */
.site-main.has-toc {
    max-width: var(--container);
}

.wzl-toc-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 48px;
    align-items: start;
}

.wzl-toc-layout > article {
    min-width: 0;
}

/* TOC Sidebar */
.wzl-toc-sidebar {
    position: sticky;
    top: 90px;
    align-self: start;
    max-height: 50vh;
}

.wzl-toc {
    max-height: 50vh;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--card-r);
}

.wzl-toc-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--t4);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--bdr);
}

.wzl-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wzl-toc-list li {
    margin-bottom: 2px;
}

.wzl-toc-list a {
    display: block;
    padding: 5px 10px;
    font-size: 12.5px;
    color: var(--t3);
    border-radius: 6px;
    border-left: 2px solid transparent;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    line-height: 1.4;
    text-decoration: none;
}

.wzl-toc-list a:hover {
    color: var(--t1);
    background: rgba(255, 255, 255, 0.03);
}

.wzl-toc-list a.active {
    color: #fff;
    border-left-color: var(--blue);
    background: var(--blue);
    font-weight: 600;
}

/* Scrollbar for TOC */
.wzl-toc::-webkit-scrollbar {
    width: 3px;
}
.wzl-toc::-webkit-scrollbar-track {
    background: transparent;
}
.wzl-toc::-webkit-scrollbar-thumb {
    background: var(--bdr);
    border-radius: 3px;
}

/* Light mode */
body.light .wzl-toc {
    background: rgba(255, 255, 255, 0.85);
    border-color: #e2e8f0;
}
body.light .wzl-toc-list a:hover {
    background: rgba(0, 0, 0, 0.03);
}
body.light .wzl-toc-list a.active {
    color: #fff;
    background: var(--blue);
}

/* ── Responsive — Tablet (≤ 1024px) ── */
@media (max-width: 1024px) {
    .site-main.has-sidebar {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .wzl-toc-layout {
        grid-template-columns: 1fr 200px;
        gap: 32px;
    }
}

/* ── Responsive — Mobile (≤ 768px) ── */
@media (max-width: 768px) {
    .site-main {
        padding-top: 80px;
    }

    .site-main.has-sidebar {
        grid-template-columns: 1fr;
    }

    .wzl-toc-layout {
        display: block;
    }

    .wzl-toc-sidebar {
        display: none;
    }

    .site-main.has-toc {
        max-width: 800px;
    }

    .single-header .entry-title {
        font-size: 28px;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

    .error-404 .error-code {
        font-size: 80px;
    }

    .page-title {
        font-size: 26px;
    }

    .entry-card .entry-thumbnail img {
        height: 180px;
    }

    .entry-title {
        font-size: 18px;
    }
}

/* ── Responsive — Small phone (≤ 480px) ── */
@media (max-width: 480px) {
    .site-main {
        padding: 70px 16px 40px;
    }

    .page-title {
        font-size: 22px;
    }

    .page-description {
        font-size: 13px;
    }

    .entry-card {
        padding: 16px;
    }

    .entry-card .entry-thumbnail img {
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .entry-title {
        font-size: 17px;
    }

    .entry-meta {
        font-size: 11px;
        gap: 8px;
    }

    .entry-excerpt {
        font-size: 13px;
    }

    .single-header .entry-title {
        font-size: 24px;
    }

    .entry-content {
        font-size: 15px;
    }

    .error-404 .error-code {
        font-size: 60px;
    }

    .comment-body {
        padding: 16px;
    }

    .comment-form input,
    .comment-form textarea {
        padding: 10px 14px;
        font-size: 14px;
    }
}

/* ── Light Theme Overrides for Inner Pages ── */
body.light .entry-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: #e2e8f0;
}

body.light .entry-card:hover {
    background: #fff;
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

body.light .widget {
    background: rgba(255, 255, 255, 0.85);
    border-color: #e2e8f0;
}

body.light .comment-body {
    background: rgba(255, 255, 255, 0.85);
    border-color: #e2e8f0;
}

body.light .comment-form input,
body.light .comment-form textarea {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.light .search-form .search-field {
    background: #f8fafc;
    border-color: #e2e8f0;
}
