/* --- GLOBAL COLORS & VARIABLES --- */
:root {
    --bg-color: #0f1115;
    --text-color: #e2e8f0;
    --accent-color: #00ffff; /* Your cyan accent */
    --card-bg: #161b22;
    --border-color: #30363d;
    --meta-text: #8b949e;
}

/* --- GLOBAL NAVIGATION --- */
.global-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-family: monospace;
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 40px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
}

.global-nav a {
    color: var(--meta-text);
    text-decoration: none;
    transition: color 0.15s ease;
}

.global-nav a:hover {
    color: var(--accent-color);
}

.nav-separator {
    color: var(--border-color);
    user-select: none; /* Prevents users from accidentally selecting the slashes when highlighting text */
}

/* --- BASE STYLES --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    margin: 0;
    padding: 40px 20px;
    display: flex;
    flex-direction: column; /* Force column layout to easily anchor footer */
    min-height: 100vh;
}

main {
    flex: 1; /* Pushes footer to the bottom if content is short */
}


/* Widen the container to 960px so a two-column desktop layout feels spacious */
.container {
    max-width: 960px; 
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

header {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

header h1 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin: 0 0 10px 0;
    color: #ffffff;
}

.meta-date {
    color: var(--meta-text);
    font-size: 0.9rem;
    font-family: monospace;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

p {
    margin: 0 0 1.5rem 0;
    font-size: 1.05rem;
}

/* --- HOME INTRO AND LATEST POSTS --- */
.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr);
    gap: 48px;
    align-items: start;
}

.home-intro h2,
.latest-posts h2 {
    margin: 0 0 20px;
    color: #ffffff;
    font-size: 1.3rem;
    text-transform: uppercase;
}

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

.latest-post-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.latest-post-item a {
    color: #ffffff;
    font-weight: 500;
}

.latest-post-meta {
    color: var(--meta-text);
    font-family: monospace;
    font-size: 0.8rem;
}

/* --- REVIEW CONTENT HEADINGS --- */
.column-main h2 {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0px;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 20px;
}

.column-sidebar {
    border-left: 1px solid var(--border-color);
    padding-left: 40px;
}

.column-sidebar h2 {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0px;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 20px;
}

/* --- ISOLATED FLUID REVIEW ENGINE (SPECIFIC MODIFIER) --- */
/* This safely activates ONLY when a review template is being rendered */

.review-body-layout {
    display: block; /* Turns off grid for reviews */
    width: 100%;
    position: relative;
}

/* Force the main text column to act as a 100% fluid wrapper element */
.review-body-layout .column-main {
    display: block;
    width: auto;
    float: none;
    box-sizing: border-box;
}

/* Float the sidebar to the right exclusively inside reviews */
.review-body-layout .column-sidebar {
    float: right;
    width: 38%;
    margin-left: 4%;
    margin-bottom: 30px;
    border-left: none; /* Strip grid-based borders */
    border-right: none;
    padding-left: 0;   /* Resets your old grid padding */
    box-sizing: border-box;
}

/* Clearfix gate to ensure footer doesn't drift into the float */
.review-body-layout::after {
    content: "";
    display: table;
    clear: both;
}

/* Main Tier Panel Styling */
.main-tier-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: monospace;
    font-size: 1.1rem;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.tier-badge {
    font-weight: bold;
    font-size: 1.3rem;
    padding: 2px 10px;
    border: 1px solid currentColor;
    font-family: monospace;
}

.review-catalog-tier {
    flex: 0 0 auto;
    font-size: 0.8rem;
    line-height: 1.2;
    padding: 1px 5px;
}

/* Color matrix for Tier states */
.tier-sss { color: #20ffff; }
.tier-s { color: #ff7878; }
.tier-a { color: #ffb36c; }
.tier-b { color: #fffd84; }
.tier-c { color: #8cff8c; }
.tier-d { color: #ff8bff; }
.tier-f { color: #aaaaaa; }
.tier-x { color: #ffffff; }

/* Review Spec Matrix List */
.spec-matrix-panel {
    padding: 16px;
    margin-bottom: 25px;
}

.spec-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spec-list li {
    display: flex;
    justify-content: space-between;
    font-family: monospace;
    font-size: 0.9rem;
    border-bottom: 1px dashed rgba(48, 54, 61, 0.5); /* Fades cleanly into your border color */
    padding-bottom: 6px;
}

.spec-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.spec-label {
    color: var(--meta-text);
}

.spec-value {
    color: #ffffff;
    font-weight: bold;
}

/* Review Badge Grid Allocation */
.review-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    position: relative
}

/* Review-specific line optimization for prose reading */
.review-body {
    line-height: 1.75;
}

.review-body p {
    margin-bottom: 1.6rem;
}

/* --- THE SPOILER PERIMETER ENGINE --- */

.spoiler-free-zone {
    background: rgba(255, 255, 255, 0.01); /* Ultra-faint background */
    border: 1px dashed var(--border-color);
    padding: 20px;
    margin-bottom: 30px;
    overflow: hidden;
}

.spoiler-zone {
    /* nothing yet... */
    overflow: hidden;
}

/* Warning Gate Banner */
.spoiler-gate {
    position: relative;
    margin: 45px 0;
    text-align: center;
    border-top: 1px dashed #ff4d4d;
    border-bottom: 1px dashed #ff4d4d;
    padding: 12px 0;
    background: rgba(255, 77, 77, 0.03);
    user-select: none;
    overflow: hidden;
}

.spoiler-gate span {
    font-family: monospace;
    font-size: 0.8rem;
    font-weight: bold;
    color: #ff4d4d;
    letter-spacing: 2px;
    text-transform: uppercase;
    overflow: hidden;
}

/* --- RESPONSIVE MOBILE FIX --- */
@media (max-width: 768px) {
    .home-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .column-sidebar {
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-left: 0;
        padding-top: 30px;
    }
    /* Turn off floats and let elements stack in their natural HTML order */
    .review-body-layout .column-main,
    .review-body-layout .column-sidebar {
        width: 100%;
        float: none;
        margin-left: 0;
        box-sizing: border-box;
    }
    /* THE SIDEBAR (Renders first at the top of the screen) */
    .review-body-layout .column-sidebar {
        margin-bottom: 35px; /* Creates a clean structural gap before the review prose starts */
        border-bottom: 1px solid var(--border-color); /* Optional: underlines the metrics card */
        padding-bottom: 25px;
    }
    /* THE MAIN TEXT (Renders immediately below the sidebar) */
    .review-body-layout .column-main {
        margin-top: 0;
    }
}

@media (max-width: 600px) {
    
    .global-nav {
        font-size: 1.1rem; /* Scaled down slightly so it sits on screen comfortably */
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .nav-links {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
        border: 1px solid var(--border-color);
        text-align: center;
    }

    .nav-links a {
        padding: 6px 0;
        font-size: 0.85rem;
        border-right: 1px solid var(--border-color);
    }

    .nav-links a:last-child {
        border-right: none;
    }

    /* Clear out all the separator spans entirely */
    .global-nav .nav-separator {
        display: none;
    }
}

/* --- SCREENSHOTS & IMAGES --- */
.review-body img, .rant-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 30px auto;
    border: 1px solid var(--border-color);
}

.review-body img.align-left, .rant-body img.align-left {
    float: left;
    max-width: 45%;
    margin: 10px 25px 20px 0;
}

.review-body img + em, .rant-body img + em {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    color: var(--meta-text);
    margin-top: -20px;
    margin-bottom: 35px;
}

/* --- AGNOSTIC METADATA PANEL --- */
.meta-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.status-badge.completed {
    background: rgba(0, 255, 128, 0.1);
    color: #00ff80;
    border-color: rgba(0, 255, 128, 0.2);
}

.status-badge.ongoing {
    background: rgba(0, 255, 255, 0.1);
    color: var(--accent-color);
    border-color: rgba(0, 255, 255, 0.2);
}

.status-badge.hiatus {
    background: rgba(255, 170, 0, 0.1);
    color: #ffaa00;
    border-color: rgba(255, 170, 0, 0.2);
}

.status-badge.cancelled {
    background: rgba(255, 77, 77, 0.1);
    color: #ff4d4d;
    border-color: rgba(255, 77, 77, 0.2);
}

.scope-text {
    color: var(--text-color);
}

.scope-text strong {
    font-family: monospace;
    color: #ffffff;
}

/* Horizontal Metadata List */
.meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.meta-list li {
    font-family: monospace;
    color: var(--meta-text);
}

.meta-list li strong {
    color: var(--text-color);
}

/* --- RIFF CARDS --- */
.riffs-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.riff-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    transition: border-color 0.2s ease;
}

.riff-card:hover {
    border-color: var(--accent-color); /* Subtle highlight on hover */
}

.riff-header {
    display: flex;
    gap: 8px;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--meta-text);
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 6px;
}

.riff-context {
    color: var(--accent-color);
    text-transform: uppercase;
    font-weight: bold;
}

.riff-content {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
}

.riff-content p {
    margin: 0; /* Prevents double margins from markdownify */
}

.section-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 40px 0;
}

/* --- RIFF ARCHIVE LAYOUT --- */
.monthly-riff-block {
    margin-bottom: 50px;
}

.month-heading {
    font-family: monospace;
    font-size: 1.3rem;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.riffs-group-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.archive-riff-card {
    background: transparent; /* No heavy backgrounds, keeping it clean like a log */
    border-left: 2px solid var(--border-color); /* Timeline node aesthetic */
    padding-left: 15px;
    margin-bottom: 5px;
}

.archive-riff-card:hover {
    border-left-color: var(--accent-color);
}

.archive-riff-meta {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--meta-text);
    margin-bottom: 6px;
    display: flex;
    gap: 8px;
}

.riff-time {
    font-weight: bold;
    color: #ffffff;
}

.pagination-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-color, #333);
    font-family: monospace;
    font-size: 0.85rem;
}

.pagination-nav[hidden] {
    display: none;
}

.pag-btn {
    background: transparent;
    border: 1px solid var(--border-color, #333);
    color: var(--text-color, #fff);
    padding: 6px 12px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.pag-btn:hover {
    background: var(--border-color, #333);
}

.page-number {
    color: var(--meta-text, #888);
}

/* --- SEARCH & DENSE LIST SYSTEM --- */
.search-wrapper {
    margin-top: 20px;
    margin-bottom: 30px;
}

#index-search {
    width: 100%;
    max-width: 400px;
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    color: #ffffff;
    font-family: monospace;
    font-size: 0.9rem;
    outline: none;
    border-radius: 0;
    transition: border-color 0.15s ease;
}

#index-search:focus {
    border-color: var(--accent-color);
}

.filterable-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.dense-post-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}

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

.dense-post-item[hidden] {
    display: none;
}

.empty-state {
    color: var(--meta-text);
    font-family: monospace;
}

.archive-section + .archive-section {
    margin-top: 56px;
}

.archive-section > h2 {
    font-family: monospace;
    font-size: 1.3rem;
    color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 20px;
}

.dense-post-date {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--meta-text);
    white-space: nowrap;
}

.dense-post-link {
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    flex-grow: 1;
}

.dense-post-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

@media (max-width: 600px) {
    .dense-post-item {
        flex-wrap: wrap;
        gap: 4px 12px;
    }
}

.dense-badge {
    font-family: monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 2px 6px;
    border: 1px solid currentColor;
    position: relative;
    cursor: help;
    font-weight: bold;
}

.dense-badge::after {
    content: attr(data-description); /* Pulls variable data from the liquid pipeline */
    position: absolute;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    width: 180px;
    padding: 6px 10px;
    background: #161b22;             /* Matches dark system profile themes */
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 0.7rem;
    line-height: 1.2;
    font-weight: normal;
    text-transform: none;            /* Stops uppercase leaking into description text */
    border-radius: 3px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

.dense-badge:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* --- COMPONENT: INLINE HELP INDICATORS --- */

.help-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 0.65rem;
    font-family: monospace;
    font-weight: bold;
    color: var(--meta-text, #888888);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50%; /* Perfect circular badge */
    margin-left: 4px;
    cursor: help;
    position: relative;
    vertical-align: middle;
    user-select: none;
    transition: all 0.15s ease;
}

.help-trigger:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--link-color, #ffffff);
}

.help-trigger::after {
    content: attr(data-help); /* Dynamically grabs the text from the HTML attribute */
    position: absolute;
    bottom: 140%;             /* Floating cleanly above the line */
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    width: 180px;             /* Compact boundary layout */
    padding: 6px 10px;
    background: #161b22;      /* Matches your system panel theme background */
    border: 1px solid var(--border-color);
    color: var(--text-color, #ffffff);
    font-size: 0.7rem;
    font-weight: normal;
    line-height: 1.3;
    text-transform: none;     /* Protects description casing from uppercase headers */
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-trigger:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* --- FOOTER --- */
footer {
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    font-size: 0.75rem; /* Slightly larger than 0.5rem for better readability */
    color: var(--meta-text);
    text-align: center;
}
