/* Page layout with starfield */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #000;
}

/* Content area below starfield */
.content-area {
    flex: 1;
    padding: 30px 20px;
    padding-top: 15px;
    max-width: 1200px;
    margin: 0;
    width: 100%;
    position: relative;
    top: var(--pos-content-top, 0%);
    /* Align with nav-links by using the same variable */
    margin-left: var(--pos-navlinks-left, 5%);
}

/* Page title */
.page-title {
    color: #CC5500;
    font-size: 24px;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 
        0 0 5px rgba(204, 85, 0, 0.5),
        0 0 10px rgba(204, 85, 0, 0.3);
}

/* Entry list */
.entry-list {
    list-style: none;
}

.entry-item {
    border-bottom: 1px solid #333;
    padding: 20px 0;
}

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

/* Entry header (title + date) */
.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.entry-title {
    color: #CC5500;
    font-size: 18px;
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* Arrow before entry titles in category listing (not in article view) */
.entry-item .entry-title::before {
    content: '→ ';
    opacity: 0.7;
}

.entry-title:hover {
    color: #FF7722;
    text-shadow: 0 0 10px rgba(255, 119, 34, 0.5);
}

.entry-date {
    color: #666;
    font-size: 12px;
}

/* Entry description */
.entry-description {
    color: #999;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
}

/* Entry tags */
.entry-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background: #1a1a1a;
    color: #666;
    padding: 2px 8px;
    font-size: 11px;
    border: 1px solid #333;
}

/* Entry link */
.entry-link {
    color: #666;
    font-size: 12px;
    text-decoration: none;
}

.entry-link:hover {
    color: #CC5500;
}

/* =============================================================================
 * SINGLE ENTRY PAGE
 * ============================================================================= */

.entry-full {
    max-width: 900px;
    margin: 0 auto;
}

.entry-full .entry-header {
    margin-bottom: 20px;
    flex-direction: column;
    gap: 5px;
}

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

.entry-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 12px;
    margin-bottom: 20px;
}

/* Entry content (rendered markdown) */
.entry-content {
    color: #ccc;
    font-size: 14px;
    line-height: 1.8;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    color: #CC5500;
    margin: 20px 0 10px;
}

.entry-content h1 { font-size: 24px; }
.entry-content h2 { font-size: 20px; }
.entry-content h3 { font-size: 18px; }
.entry-content h4 { font-size: 16px; }

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

.entry-content a {
    color: #CC5500;
    text-decoration: underline;
}

.entry-content a:hover {
    color: #FF7722;
}

.entry-content code {
    background: #1a1a1a;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 13px;
    color: #FF7722;
}

.entry-content pre {
    background: #111;
    padding: 15px;
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid #333;
}

.entry-content pre code {
    background: none;
    padding: 0;
    color: #ccc;
}

.entry-content blockquote {
    border-left: 3px solid #CC5500;
    padding-left: 15px;
    margin: 15px 0;
    color: #999;
    font-style: italic;
}

.entry-content ul,
.entry-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

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

/* Nested lists */
.entry-content li ul,
.entry-content li ol {
    margin: 5px 0;
}

/* Definition lists */
.entry-content dl {
    margin: 15px 0;
}

.entry-content dt {
    color: #CC5500;
    font-weight: bold;
    margin-top: 10px;
}

.entry-content dd {
    margin-left: 20px;
    color: #aaa;
    margin-bottom: 5px;
}

/* Nested blockquotes */
.entry-content blockquote blockquote {
    border-left-color: #666;
    margin-left: 10px;
}

/* Abbreviations */
.entry-content abbr {
    border-bottom: 1px dotted #666;
    cursor: help;
}

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

.entry-content th,
.entry-content td {
    border: 1px solid #333;
    padding: 8px 12px;
    text-align: left;
}

.entry-content th {
    background: #1a1a1a;
    color: #CC5500;
}

/* Screenshots gallery */
.screenshots {
    margin-top: 30px;
}

.screenshots-title {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.screenshot-item {
    border: 1px solid #333;
    overflow: hidden;
}

.screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.screenshot-item:hover img {
    transform: scale(1.05);
}

.screenshot-item a {
    display: block;
}

/* =============================================================================
 * ATTACHMENTS
 * ============================================================================= */

.attachments {
    margin-top: 30px;
    padding: 20px;
    background: #0a0a0a;
    border: 1px solid #333;
}

.attachments-title {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attachment-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #111;
    border: 1px solid #222;
    flex-wrap: wrap;
    gap: 10px;
}

.attachment-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.attachment-link {
    color: #CC5500;
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
}

.attachment-link:hover {
    color: #FF7722;
    text-decoration: underline;
}

.attachment-size {
    color: #666;
    font-size: 12px;
    white-space: nowrap;
}

.attachment-files {
    display: flex;
    gap: 10px;
}

.attachment-hash,
.attachment-sig {
    padding: 4px 8px;
    font-size: 11px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attachment-hash {
    background: #1a2a1a;
    color: #5a5;
    border: 1px solid #2a3a2a;
}

.attachment-hash:hover {
    background: #2a3a2a;
    color: #7a7;
}

.attachment-sig {
    background: #2a2a1a;
    color: #aa5;
    border: 1px solid #3a3a2a;
}

.attachment-sig:hover {
    background: #3a3a2a;
    color: #cc7;
}

/* Back link */
.back-link {
    display: inline-block;
    color: #666;
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 20px;
}

.back-link:hover {
    color: #CC5500;
}

.back-link::before {
    content: '← ';
}

/* =============================================================================
 * BIO PAGE
 * ============================================================================= */

.bio-content {
    max-width: 800px;
    margin: 0 auto;
}

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

/* =============================================================================
 * HIERARCHY STYLING
 * =============================================================================
 * Controls indentation of entries relative to categories.
 * Default: entries are indented (hierarchical view)
 * With .flat-hierarchy: entries are on same level as categories
 * ============================================================================= */

/* Default: Hierarchical view - entries indented under categories */
.entry-list {
    margin-left: 30px;
    border-left: 1px solid #333;
    padding-left: 20px;
}

.entry-full {
    margin-left: 30px;
    border-left: 1px solid #333;
    padding-left: 20px;
}

/* Flat hierarchy - entries on same level as categories */
.flat-hierarchy .entry-list {
    margin-left: 0;
    border-left: none;
    padding-left: 0;
}

.flat-hierarchy .entry-full {
    margin-left: 0;
    border-left: none;
    padding-left: 0;
}

/* =============================================================================
 * READING TIME
 * ============================================================================= */

.entry-reading-time {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.entry-meta .entry-reading-time::before {
    content: '•';
    margin: 0 8px;
    color: #444;
}

/* =============================================================================
 * RELATED POSTS
 * ============================================================================= */

.related-posts {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #333;
}

.related-posts-title {
    color: #CC5500;
    font-size: 16px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.related-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-posts-list li {
    padding: 8px 0;
    border-bottom: 1px solid #222;
}

.related-posts-list li:last-child {
    border-bottom: none;
}

.related-posts-list a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.related-posts-list a:hover {
    color: #CC5500;
}

.related-post-meta {
    color: #555;
    font-size: 12px;
    margin-left: 10px;
}

/* =============================================================================
 * TABLE OF CONTENTS
 * ============================================================================= */

.table-of-contents {
    position: fixed;
    right: 20px;
    top: 150px;
    width: 220px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 15px;
    z-index: 100;
}

.toc-title {
    color: #CC5500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

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

.toc-list li {
    padding: 4px 0;
}

.toc-list li.toc-indent {
    padding-left: 15px;
}

.toc-list a {
    color: #888;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    display: block;
    transition: color 0.2s;
}

.toc-list a:hover {
    color: #CC5500;
}

/* Hide TOC on mobile */
@media (max-width: 1400px) {
    .table-of-contents {
        display: none !important;
    }
}
