/*
 * Sapphire Mind — front-end styles
 * Ported from the old sapphire-theme so the Mind UI is theme-independent.
 * Self-contained: hardcoded dark palette + per-item hsl() rainbow hues.
 */

/* === [sapphire_mind] list === */
.post-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.post-item {
    padding: 1.5em 0;
    border-bottom: 1px solid #2a2a4a;
}

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

.post-item h3 {
    margin-bottom: 0.3em;
}

.post-item h3 a {
    color: #f0f0f0;
}

.post-item h3 a:hover {
    color: #4a7cf7;
}

/* === [sapphire_mind_browser] — tabbed rainbow layout === */
.mind-browser {
    display: flex;
    gap: 0;
    align-items: stretch;
    min-height: 400px;
}

/* --- Tabs (left column) --- */
.mind-tabs {
    display: flex;
    flex-direction: column;
    width: 200px;
    flex-shrink: 0;
    gap: 2px;
    padding-right: 0;
}

.mind-tab {
    --tab-sat: 65%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7em 1em;
    background: #16213e;
    border: none;
    border-left: 4px solid hsl(var(--tab-hue), var(--tab-sat), 55%);
    border-right: 2px solid #2a2a4a;
    border-radius: 6px 0 0 6px;
    color: #a0a0b0;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    text-align: left;
}

.mind-tab:hover {
    background: #1e2a4a;
    color: hsl(var(--tab-hue), var(--tab-sat), 70%);
}

.mind-tab.active {
    background: #1a1a2e;
    color: hsl(var(--tab-hue), var(--tab-sat), 70%);
    border-left-width: 4px;
    border-left-color: hsl(var(--tab-hue), var(--tab-sat), 55%);
    border-right-color: transparent;
    position: relative;
    z-index: 2;
}

.tab-label {
    font-weight: 500;
}

.tab-count {
    font-size: 0.75rem;
    opacity: 0.5;
    margin-left: 0.5em;
}

/* --- Panels (right content area) --- */
.mind-panels {
    flex: 1;
    min-width: 0;
    border-left: 2px solid #2a2a4a;
    padding: 1rem 0 1rem 2rem;
}

.mind-panel {
    display: none;
}

.mind-panel.active {
    display: block;
}

/* --- Entry cards --- */
.mind-card {
    padding: 1em 0;
    border-bottom: 1px solid #2a2a4a;
}

.mind-card:last-child {
    border-bottom: none;
}

.mind-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.3em;
}

.mind-card-header h3 {
    font-size: 1.15rem;
    margin: 0;
}

.mind-card-header h3 a {
    color: #f0f0f0;
}

.mind-card-header h3 a:hover {
    color: #4a7cf7;
}

.mind-card-header time {
    font-size: 0.8rem;
    color: #606070;
    white-space: nowrap;
    flex-shrink: 0;
}

.mind-card-cat {
    display: inline-block;
    font-size: 0.75rem;
    color: hsl(var(--cat-hue), 65%, 65%);
    background: hsla(var(--cat-hue), 65%, 50%, 0.1);
    padding: 0.1em 0.5em;
    border-radius: 3px;
    margin-bottom: 0.3em;
}

.mind-card-excerpt {
    color: #b0b0c0;
    font-size: 0.95rem;
    margin: 0.3em 0 0;
}

/* Legacy category tag (single view + list) */
.mind-category-tag {
    display: inline-block;
    font-size: 0.8rem;
    color: #4a7cf7;
    background: rgba(74, 124, 247, 0.1);
    padding: 0.15em 0.6em;
    border-radius: 3px;
    margin-bottom: 0.5em;
}

/* === [sapphire_mind_recent] grid === */
.mind-recent {
    display: grid;
    grid-template-columns: repeat(var(--mind-cols, 2), 1fr);
    gap: 1rem;
}

.mind-recent-item {
    display: flex;
    flex-direction: column;
    background: #16213e;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    padding: 1em 1.2em;
    color: #c0c0c0;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.mind-recent-item:hover {
    border-color: #4a7cf7;
    background: #1a2540;
    text-decoration: none;
}

.mind-recent-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5em;
    margin-bottom: 0.4em;
}

.mind-recent-item h4 {
    font-size: 1rem;
    margin: 0;
    color: #f0f0f0;
}

.mind-recent-cat {
    font-size: 0.7rem;
    color: #4a7cf7;
    background: rgba(74, 124, 247, 0.1);
    padding: 0.1em 0.5em;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.mind-recent-item p {
    font-size: 0.9rem;
    margin: 0 0 0.5em;
    flex: 1;
}

.mind-recent-item time {
    font-size: 0.75rem;
    color: #606070;
}

/* === Mobile === */
@media (max-width: 768px) {
    .mind-recent {
        grid-template-columns: 1fr !important;
    }

    .mind-browser {
        flex-direction: column;
    }

    .mind-tabs {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #2a2a4a;
    }

    .mind-tab {
        border-radius: 4px;
        border-left-width: 3px;
        border-right: none;
        padding: 0.4em 0.7em;
        font-size: 0.85rem;
    }

    .mind-tab.active {
        border-right: none;
    }

    .mind-panels {
        border-left: none;
        padding: 1rem 0 0;
    }
}
