/* ============================================
   DISPATCH GHOST THEME — screen.css
   ============================================ */

/* Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: #000;
    color: #fff;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #fff;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* Site Wrapper
   ============================================ */
.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header
   ============================================ */
.site-header {
    border-bottom: 1px solid #222;
    padding: 1rem 0;
}

.site-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-logo {
    max-height: 40px;
    width: auto;
}

.site-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.site-title:hover {
    color: #fff;
}

/* Navigation
   ============================================ */
.site-nav {
    position: relative;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-list li a {
    display: block;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-list li a:hover {
    color: #fff;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: #fff;
    width: 100%;
    transition: opacity 0.2s;
}

/* Layout
   ============================================ */
.site-content {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
}

/* Post Feed
   ============================================ */
.post-feed {
    display: flex;
    flex-direction: column;
}

/* Post Card
   ============================================ */
.post-card {
    border-bottom: 1px solid #1e1e1e;
    padding: 1.4rem 0;
}

.post-card:first-child {
    padding-top: 0;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.post-card-tag {
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
}

.post-card-tag:hover {
    color: #fff;
}

.post-card-divider {
    color: #444;
}

.post-card-date {
    color: #666;
    font-size: 0.78rem;
}

.post-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.post-card-title a {
    color: #fff;
}

.post-card-title a:hover {
    color: #ccc;
}

.post-card-excerpt {
    color: #888;
    font-size: 0.88rem;
    line-height: 1.6;
}

/* Feed Header (tag pages)
   ============================================ */
.feed-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #222;
}

.feed-title {
    font-size: 1.6rem;
    font-weight: 700;
}

.feed-description {
    color: #888;
    margin-top: 0.4rem;
    font-size: 0.9rem;
}

/* Single Post
   ============================================ */
.post {
    max-width: 100%;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #1e1e1e;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    font-size: 0.78rem;
    color: #888;
}

.post-tag {
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.72rem;
}

.post-tag:hover {
    color: #fff;
}

.post-date {
    color: #666;
}

.post-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    color: #fff;
}

.post-byline {
    font-size: 0.82rem;
    color: #666;
}

.post-byline a {
    color: #888;
}

.post-byline a:hover {
    color: #fff;
}

/* Post Content
   ============================================ */
.post-content {
    font-size: 0.97rem;
    line-height: 1.8;
    color: #ddd;
}

.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: #fff;
    font-weight: 700;
    line-height: 1.3;
    margin: 2rem 0 0.75rem;
}

.post-content h2 { font-size: 1.4rem; }
.post-content h3 { font-size: 1.2rem; }
.post-content h4 { font-size: 1.05rem; }

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

.post-content a {
    color: #aaa;
    text-decoration: underline;
    text-decoration-color: #444;
}

.post-content a:hover {
    color: #fff;
    text-decoration-color: #888;
}

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

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

.post-content blockquote {
    border-left: 3px solid #444;
    margin: 1.5rem 0;
    padding: 0.5rem 0 0.5rem 1.25rem;
    color: #888;
    font-style: italic;
}

.post-content code {
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 3px;
    padding: 0.15em 0.4em;
    font-family: "Courier New", monospace;
    font-size: 0.88em;
    color: #ccc;
}

.post-content pre {
    background: #0d0d0d;
    border: 1px solid #222;
    border-radius: 4px;
    padding: 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.4rem;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
}

.post-content hr {
    border: none;
    border-top: 1px solid #222;
    margin: 2rem 0;
}

.post-content img,
.post-content figure {
    margin: 1.5rem 0;
    border-radius: 3px;
}

.post-content figcaption {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
    text-align: center;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.4rem;
    font-size: 0.9rem;
}

.post-content th,
.post-content td {
    border: 1px solid #222;
    padding: 0.6rem 0.8rem;
    text-align: left;
}

.post-content th {
    background: #0d0d0d;
    color: #ccc;
    font-weight: 700;
}

/* Post Footer
   ============================================ */
.post-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #1e1e1e;
}

.post-tags-list {
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
}

.post-tags-list a {
    display: inline-block;
    border: 1px solid #333;
    padding: 0.2rem 0.6rem;
    margin: 0.2rem 0.2rem 0.2rem 0;
    border-radius: 2px;
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.post-tags-list a:hover {
    border-color: #666;
    color: #fff;
}

.post-author-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.post-author-info {
    font-size: 0.85rem;
}

.author-name {
    font-weight: 700;
    color: #ccc;
    display: block;
    margin-bottom: 0.2rem;
}

.author-bio {
    color: #666;
    line-height: 1.5;
}

/* Page
   ============================================ */
.page .post-header {
    border-bottom: 1px solid #1e1e1e;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.page .post-title {
    font-size: 1.8rem;
}

/* Pagination
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0 0;
    margin-top: 0.5rem;
    border-top: 1px solid #1e1e1e;
    font-size: 0.85rem;
}

.pagination-link {
    color: #888;
    border: 1px solid #333;
    padding: 0.4rem 0.9rem;
    border-radius: 2px;
}

.pagination-link:hover {
    color: #fff;
    border-color: #666;
}

.pagination-info {
    color: #555;
    font-size: 0.8rem;
}

/* Error Page
   ============================================ */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-code {
    font-size: 5rem;
    font-weight: 700;
    color: #333;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.1rem;
    color: #888;
    margin-bottom: 2rem;
}

.error-link {
    color: #888;
    border: 1px solid #333;
    padding: 0.5rem 1.2rem;
}

.error-link:hover {
    color: #fff;
    border-color: #666;
}

/* Sidebar
   ============================================ */
.sidebar-widget {
    margin-bottom: 2rem;
}

.sidebar-widget-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #1e1e1e;
}

/* Author Box
   ============================================ */
.author-box {
    border: 1px solid #1e1e1e;
    border-radius: 4px;
    padding: 1.25rem;
    background: #080808;
    text-align: center;
}

.author-box-image {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 0.9rem;
    border: 2px solid #2a2a2a;
}

.author-box-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.author-box-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 0.4rem;
}

.author-box-bio {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.5;
    margin-bottom: 0.9rem;
}

.author-box-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
}

.author-box-link {
    display: inline-block;
    font-size: 0.72rem;
    color: #888;
    border: 1px solid #2a2a2a;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: border-color 0.15s, color 0.15s;
}

.author-box-link:hover {
    color: #fff;
    border-color: #555;
}

/* Search Widget
   ============================================ */
.search-form {
    display: flex;
    gap: 0;
}

.search-input {
    flex: 1;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-right: none;
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 2px 0 0 2px;
    outline: none;
    transition: border-color 0.15s;
}

.search-input::placeholder {
    color: #555;
}

.search-input:focus {
    border-color: #444;
}

.search-btn {
    background: #111;
    border: 1px solid #2a2a2a;
    color: #666;
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    font-size: 0.8rem;
    border-radius: 0 2px 2px 0;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.search-btn:hover {
    background: #1a1a1a;
    color: #fff;
}

/* Tags Widget
   ============================================ */
.tags-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tags-list-item {
    border-bottom: 1px solid #111;
}

.tag-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    font-size: 0.83rem;
    color: #888;
}

.tag-link:hover {
    color: #fff;
}

.tag-count {
    font-size: 0.72rem;
    color: #444;
    background: #111;
    padding: 0.1rem 0.4rem;
    border-radius: 2px;
    min-width: 22px;
    text-align: center;
}

/* Recent Posts Widget
   ============================================ */
.recent-posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.recent-post-item {
    padding: 0.55rem 0;
    border-bottom: 1px solid #111;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.recent-post-link {
    font-size: 0.83rem;
    color: #ccc;
    line-height: 1.4;
}

.recent-post-link:hover {
    color: #fff;
}

.recent-post-date {
    font-size: 0.72rem;
    color: #555;
}

/* Footer
   ============================================ */
.site-footer {
    border-top: 1px solid #1e1e1e;
    padding: 1.25rem 0;
    margin-top: auto;
}

.site-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    font-size: 0.78rem;
    color: #555;
    text-align: center;
}

.site-footer-inner a {
    color: #666;
}

.site-footer-inner a:hover {
    color: #aaa;
}

/* Ghost Card Assets
   ============================================ */
.kg-width-wide {
    margin: 1.5rem -2rem;
}

.kg-width-full {
    margin: 1.5rem calc(50% - 50vw);
    width: 100vw;
}

.kg-image-card img {
    margin: 0 auto;
}

.kg-gallery-container {
    display: flex;
    flex-direction: column;
    margin: 1.5rem 0;
}

.kg-gallery-row {
    display: flex;
    gap: 4px;
}

.kg-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-embed-card {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.kg-embed-card iframe {
    max-width: 100%;
}

.kg-bookmark-card {
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    margin: 1.5rem 0;
    overflow: hidden;
}

.kg-bookmark-container {
    display: flex;
    color: inherit;
}

.kg-bookmark-container:hover {
    color: #fff;
}

.kg-bookmark-content {
    padding: 1rem;
    flex: 1;
}

.kg-bookmark-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #ccc;
}

.kg-bookmark-description {
    font-size: 0.82rem;
    color: #666;
    margin-top: 0.3rem;
}

.kg-bookmark-metadata {
    font-size: 0.75rem;
    color: #555;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.kg-bookmark-icon {
    width: 16px;
    height: 16px;
}

.kg-bookmark-thumbnail {
    width: 140px;
    flex-shrink: 0;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-callout-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    padding: 1rem;
    margin: 1.5rem 0;
    background: #0d0d0d;
}

.kg-callout-emoji {
    font-size: 1.2rem;
    line-height: 1.5;
    flex-shrink: 0;
}

.kg-toggle-card {
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    margin: 1.5rem 0;
    overflow: hidden;
}

.kg-toggle-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: #0d0d0d;
}

.kg-toggle-heading-text {
    font-weight: 700;
    font-size: 0.9rem;
}

.kg-toggle-content {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: #888;
}

/* Last.fm Widget
   ============================================ */
.lastfm-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.lastfm-loading {
    font-size: 0.8rem;
    color: #555;
}

.lastfm-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #111;
    position: relative;
}

.lastfm-item:last-child {
    border-bottom: none;
}

.lastfm-art {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
    background: #1a1a1a;
}

.lastfm-art--placeholder {
    display: block;
}

.lastfm-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
    flex: 1;
}

.lastfm-track {
    font-size: 0.82rem;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lastfm-artist {
    font-size: 0.72rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lastfm-item.is-playing .lastfm-track {
    color: #fff;
}

.lastfm-now {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c0392b;
    flex-shrink: 0;
    animation: lfm-pulse 1.4s ease-in-out infinite;
}

@keyframes lfm-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* Responsive
   ============================================ */
@media (max-width: 900px) {
    .layout {
        flex-direction: column;
        gap: 2.5rem;
    }

    .sidebar {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .site-header-inner {
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-list {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 0.5rem 0;
    }

    .nav-list.is-open {
        display: flex;
    }

    .nav-list li a {
        padding: 0.5rem 0;
    }

    .post-title {
        font-size: 1.4rem;
    }

    .post-card-title {
        font-size: 1.05rem;
    }

    .kg-width-wide {
        margin: 1.5rem 0;
    }
}
