/* Iska's Blog – Custom Theme */

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

body {
    font-family: "Trebuchet MS", Arial, sans-serif;
    background: #e8e4dc;
    color: #2a2a2a;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: #2878a8; text-decoration: none; }
a:hover { color: #1a5a80; text-decoration: underline; }

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ── Header ───────────────────────────────────── */

.site-header {
    background-color: #f2efe8;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(120,128,132,0.12) 0.8px, transparent 1px),
        linear-gradient(180deg, #f5f3ed 0%, #eae7df 100%);
    background-size: 5px 5px, auto;
    border-bottom: 1px solid #c8c3b8;
    box-shadow: 0 2px 6px rgba(80,70,50,0.1);
    padding: 0;
    position: relative;
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 20px;
    padding-bottom: 16px;
}

.home-btn {
    position: absolute;
    left: max(12px, calc((100vw - 960px) / 6));
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 16px;
    border-radius: 5px;
    background: linear-gradient(180deg, #fff 0%, #e8e5de 100%);
    border: 1px solid #b8b3a8;
    box-shadow: 0 1px 2px rgba(80,70,50,0.12), inset 0 1px 0 rgba(255,255,255,0.6);
    color: #5a5650;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}
.home-btn:hover {
    background: linear-gradient(180deg, #e8f4f0 0%, #c8e8d8 100%);
    border-color: #80b898;
    text-decoration: none;
}
.home-btn svg { width: 16px; height: 16px; margin-right: 6px; }

.site-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #34383b;
    text-decoration: none;
    text-shadow: 0 1px 0 rgba(255,255,255,0.6);
    white-space: nowrap;
}
.site-title:hover { color: #2878a8; text-decoration: none; }

.site-description {
    width: 100%;
    color: #6a6660;
    font-size: 0.9rem;
    margin-top: -4px;
}

/* ── Main ─────────────────────────────────────── */

main {
    flex: 1;
    padding: 36px 0 30px;
}

/* ── Layout ───────────────────────────────────── */

.content-wrapper {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.content-main {
    flex: 1;
    min-width: 0;
}
.content-sidebar {
    width: 260px;
    flex-shrink: 0;
}

/* ── Panel (reusable window-like box) ─────────── */

.panel {
    background: #fff;
    border: 1px solid #c8c3b8;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(80,70,50,0.08);
    overflow: hidden;
}

.panel-head {
    background: linear-gradient(180deg, #4a5a68 0%, #384858 100%);
    color: #e2e4d8;
    font-weight: 700;
    font-size: 1rem;
    padding: 8px 14px;
}
.panel-head a { color: inherit; text-decoration: none; }
.panel-head a:hover { text-decoration: none; opacity: 0.85; }

.panel-body {
    padding: 14px;
}

/* ── Tags ─────────────────────────────────────── */

.tags-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 14px;
}
.tags-label {
    color: #888;
    font-size: 0.85rem;
    margin-right: 4px;
}
.tag {
    display: inline-block;
    padding: 3px 10px;
    background: #f0ede6;
    border: 1px solid #d0cbbf;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #5a6860;
    text-decoration: none;
}
.tag:hover {
    background: #48a890;
    color: #fff;
    border-color: #48a890;
    text-decoration: none;
}
.tag.active {
    background: #48a890;
    color: #fff;
    border-color: #48a890;
}
.tag.pinned {
    background: #d8a030;
    color: #fff;
    border-color: #d8a030;
}
.tag.pinned-nav {
    background: #f0ede6;
    color: #b08020;
    border-color: #d0b860;
}
.tag.pinned-nav:hover, .tag.pinned-nav.active {
    background: #d8a030;
    color: #fff;
    text-decoration: none;
}

/* ── Post cards (list) ────────────────────────── */

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.post-card {
    padding: 16px;
}

.post-card .post-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.post-card .post-title a { color: #2a2a2a; }
.post-card .post-title a:hover { color: #2878a8; text-decoration: underline; }

.post-date {
    display: block;
    color: #28a888;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.post-excerpt {
    color: #555;
    margin-bottom: 6px;
}
.post-card .post-tags { margin-bottom: 6px; }

.post-stats {
    display: flex;
    gap: 14px;
    font-size: 0.85rem;
    color: #888;
}
.stat { display: flex; align-items: center; gap: 4px; }

/* ── Full post ────────────────────────────────── */

.post-full {
    padding: 20px;
}

.post-full .post-header {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e8e4dc;
}
.post-full .post-title {
    font-size: 2rem;
    font-weight: 800;
    color: #2a2a2a;
    margin-bottom: 6px;
    line-height: 1.2;
}
.post-meta {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 6px;
}
.post-meta .updated {
    margin-left: 10px;
    color: #d8a030;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.75;
}
.post-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1.75rem 0 10px;
    color: #c06088;
}
.post-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.25rem 0 8px;
    color: #509830;
}
.post-content p { margin-bottom: 14px; }
.post-content a { color: #2878a8; text-decoration: underline; }
.post-content a:hover { color: #1a5a80; }

.post-content ul, .post-content ol {
    margin-bottom: 0;
    padding-left: 24px;
}
.post-content li { margin-bottom: 4px; }

.post-content blockquote {
    border-left: 3px solid #48a890;
    padding-left: 14px;
    margin: 14px 0;
    color: #666;
    font-style: italic;
}
.post-content code {
    background: #f0ede6;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: "SF Mono", Monaco, monospace;
    font-size: 0.9em;
    color: #c06088;
}
.post-content pre {
    background: #2a2a2a;
    color: #ddd;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 14px 0;
}
.post-content pre code { background: none; color: inherit; padding: 0; }
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 14px 0;
}

#table-of-contents { margin-bottom: 14px; }

/* ── Post footer / activity ───────────────────── */

.post-footer {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #e0dcd4;
}
.activity-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 14px;
}
.stat-item { display: flex; align-items: center; gap: 6px; }
.stat-icon { font-size: 1.1rem; }
.stat-count { font-weight: 700; font-size: 1.1rem; color: #c06088; }
.stat-label { color: #888; font-size: 0.85rem; }

.activity-info {
    background: #f0f8f4;
    padding: 14px;
    border-radius: 6px;
    border: 1px solid #c8e0d0;
}
.activity-info p {
    color: #555;
    font-size: 0.85rem;
    margin-bottom: 6px;
}
.activity-id {
    display: block;
    font-family: "SF Mono", Monaco, monospace;
    font-size: 0.75rem;
    background: #e8e4dc;
    padding: 6px;
    border-radius: 3px;
    word-break: break-all;
    color: #888;
}

/* ── Comments ─────────────────────────────────── */

.comments-section {
    padding: 20px;
}
.comments-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: #28a888;
}
.no-comments { color: #999; font-style: italic; }

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.comment {
    padding: 12px;
    background: #f8f6f0;
    border-radius: 6px;
    position: relative;
}
.comment-reply { background: #f0ede6; padding: 10px; }
.comment-reply .comment-reply { background: #e8e4dc; padding: 8px; }

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.comment-author { font-weight: 600; color: #2878a8; text-decoration: none; }
.comment-author:hover { color: #1a5a80; }
.comment-header time { font-size: 0.75rem; color: #999; }
.comment-date {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.75rem;
    color: #999;
}
.comment-content {
    color: #444;
    overflow-wrap: break-word;
}
.comment-content p { margin-bottom: 6px; }
.comment-content p:last-child { margin-bottom: 0; }

.comment-content img,
.comment-content video,
.comment-content audio {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 8px 0;
    border-radius: 4px;
}
.comment-content video { max-height: 400px; background: #000; }
.comment-content img { max-height: 500px; object-fit: contain; }
.comment-content audio { width: 100%; max-width: 300px; }

.ap-image, .ap-video, .ap-audio { max-width: 100%; display: block; margin: 8px 0; }
.ap-image { max-height: 500px; object-fit: contain; border-radius: 4px; }
.ap-video { max-height: 400px; background: #000; border-radius: 4px; }
.ap-audio { width: 100%; max-width: 300px; }

/* ── Navigation ───────────────────────────────── */

.post-nav { margin-top: 20px; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
}
.back-link:hover { color: #28a888; text-decoration: underline; }

/* ── Empty / Error ────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}
.empty-state p { margin-bottom: 8px; }
.empty-state code {
    background: #f0ede6;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "SF Mono", Monaco, monospace;
}
.error-page { text-align: center; padding: 40px 0; }
.error-page h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #28a888;
    margin-bottom: 14px;
}
.error-page p { color: #888; margin-bottom: 20px; }

/* ── IDs ──────────────────────────────────────── */

.post-id {
    font-family: monospace;
    font-size: 0.85rem;
    color: #aaa;
    margin-left: 6px;
    font-weight: normal;
}
.comment-id {
    font-family: monospace;
    font-size: 0.7rem;
    color: #bbb;
    font-weight: normal;
    position: absolute;
    bottom: 10px;
    right: 10px;
}

/* ── Pagination ───────────────────────────────── */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #e0dcd4;
}
.pagination-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: linear-gradient(180deg, #fff 0%, #ece9e0 100%);
    border: 1px solid #c8c3b8;
    border-radius: 5px;
    color: #3a3a3a;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 1px 2px rgba(80,70,50,0.08);
}
.pagination-link:hover:not(.pagination-disabled) {
    background: linear-gradient(180deg, #e8f8f0 0%, #c0e8d0 100%);
    border-color: #80b898;
    text-decoration: none;
}
.pagination-link.pagination-disabled {
    color: #bbb;
    cursor: not-allowed;
}
.pagination-info { color: #888; font-size: 0.85rem; }

/* ── Sidebar / Archive ────────────────────────── */

.archive-widget { overflow: hidden; }
.archive-widget .panel-head { font-size: 0.95rem; }

.archive-list { list-style: none; }
.archive-list li { margin-bottom: 4px; }
.archive-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    color: #444;
    text-decoration: none;
    font-size: 0.85rem;
}
.archive-link:hover { color: #28a888; text-decoration: underline; }
.archive-count { color: #aaa; font-size: 0.75rem; }

/* ── Footer ───────────────────────────────────── */

.site-footer {
    background-color: #f2efe8;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(120,128,132,0.12) 0.8px, transparent 1px),
        linear-gradient(180deg, #eae7df 0%, #f5f3ed 100%);
    background-size: 5px 5px, auto;
    border-top: 1px solid #c8c3b8;
    box-shadow: 0 -1px 4px rgba(80,70,50,0.06);
    padding: 16px 0;
    text-align: center;
    margin-top: auto;
}
.site-footer p { color: #888; font-size: 0.85rem; }
.site-footer a { color: #2878a8; }
.site-footer a:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────── */

@media (max-width: 1300px) {
    .site-header .container {
        padding-left: max(20px, calc(110px - (100vw - 960px) / 3));
    }
}

@media (max-width: 900px) {
    .content-wrapper { flex-direction: column; }
    .content-sidebar { width: 100%; order: 2; margin-top: 20px; }
    .archive-list { display: flex; flex-wrap: wrap; gap: 6px 12px; }
    .archive-list li { margin-bottom: 0; }
    .archive-link {
        padding: 4px 8px;
        background: #f0ede6;
        border-radius: 4px;
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {
    .site-header .container {
        padding-left: 0;
        justify-content: center;
        flex-wrap: wrap;
    }
    .home-btn {
        position: static;
        transform: none;
    }
    .site-title {
        font-size: 1.3rem;
        width: 100%;
        text-align: center;
    }
    .site-description {
        text-align: center;
    }
    .post-full .post-title { font-size: 1.5rem; }
    .post-content { font-size: 1rem; }
    .activity-stats { flex-direction: column; gap: 8px; }
    .comment-header { flex-direction: column; align-items: flex-start; gap: 4px; }
    .pagination { flex-direction: column; gap: 8px; }
}
