/* Journal Page - css/pages/journal.css */

/* Journal Form */
.journal-form {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.journal-entry-form {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.journal-entry-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.textarea {
    min-height: 200px;
    resize: vertical;
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.textarea:focus {
    border-color: var(--sunset-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Journal Entries Grid */
.journal-entries {
    display: grid;
    gap: 1.5rem;
}

.journal-entry-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    /* A border can't take a gradient value — var(--gradient-sunset) is a
       linear-gradient, so the accent silently failed to render. Use the
       solid brand color instead. */
    border-left: 5px solid var(--sunset-orange);
    transition: box-shadow var(--transition-normal);
}

.journal-entry-card:hover {
    box-shadow: var(--shadow-lg);
}

/* The rendered card also has the .feed-card class, whose
   [data-theme] .feed-card { border-color } rule (specificity 0,2,0) overrode
   the accent's color. Re-assert the sunset left border with higher
   specificity so it actually shows in both themes. */
[data-theme="dark"] .feed-card.journal-entry-card,
[data-theme="light"] .feed-card.journal-entry-card,
.feed-card.journal-entry-card {
    border-left: 5px solid var(--sunset-orange);
}

.journal-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.journal-entry-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.journal-entry-date {
    font-size: var(--font-sm);
    color: var(--text-muted);
}

.journal-entry-content {
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.journal-entry-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-sm);
}

.journal-stats {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .journal-entry-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .journal-entry-footer {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* ── Sticky footer: anchor the footer to the bottom of the content area so it
   doesn't float mid-page on short journals. Scoped to this page. ─────────── */
body[data-page="journal"] .main-content {
    display: flex;
    flex-direction: column;
}
body[data-page="journal"] #journalPage {
    flex: 1 0 auto;
}
body[data-page="journal"] .app-footer {
    margin-top: auto;
    width: 100%;
}

/* ── Edge-to-edge on phones: form + entry cards span the full viewport width,
   matching the feed/explore/planner treatment. ─────────────────────────── */
@media (max-width: 680px) {
    #journalPage {
        padding-left: 0;
        padding-right: 0;
    }
    #journalPage > .page-header,
    #journalPage > #journalFilterRow {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .journal-form {
        max-width: none;
        margin-bottom: 1rem;
    }
    .journal-entry-form,
    .journal-entry-card {
        border-radius: 0;
    }
    .journal-entries {
        gap: 0.5rem;
    }
    /* The fixed bottom-nav already provides these links on phones — the footer
       is redundant here, so hide it. */
    .app-footer {
        display: none;
    }
}

