/* =============================================================
   Custom styles layered on top of Tailwind CSS.
   Focus: rendering Markdown output nicely (prose styles).
   ============================================================= */

/* Smooth defaults for the article body ------------------------ */
.md-body {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #334155;
}
.md-body > * + * { margin-top: 1.1em; }

.md-body h1, .md-body h2, .md-body h3,
.md-body h4, .md-body h5, .md-body h6 {
    color: #0f172a;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 1.9em;
    scroll-margin-top: 5rem;              /* anchor offset under sticky nav */
}
.md-body h1 { font-size: 1.9rem; }
.md-body h2 { font-size: 1.5rem; padding-bottom: .35rem; border-bottom: 1px solid #e2e8f0; }
.md-body h3 { font-size: 1.25rem; }
.md-body h4 { font-size: 1.1rem; }

.md-body a {
    color: #1b6ef5;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.md-body a:hover { color: #1457e1; }

.md-body strong { color: #0f172a; font-weight: 700; }

.md-body ul, .md-body ol { padding-left: 1.4rem; }
.md-body ul { list-style: disc; }
.md-body ol { list-style: decimal; }
.md-body li + li { margin-top: .45em; }
.md-body li::marker { color: #1b6ef5; }

.md-body blockquote {
    border-left: 4px solid #338eff;
    background: #eef7ff;
    color: #1e3a5f;
    padding: .85rem 1.1rem;
    border-radius: 0 .75rem .75rem 0;
    font-style: italic;
}
.md-body blockquote > * + * { margin-top: .8em; }

.md-body pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem 1.15rem;
    border-radius: .75rem;
    overflow-x: auto;
    font-size: .9rem;
    line-height: 1.6;
}
.md-body code {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: .9em;
}
.md-body :not(pre) > code {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #b45309;
    padding: .12em .4em;
    border-radius: .4rem;
}

.md-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
    display: block;
    overflow-x: auto;
}
.md-body th, .md-body td {
    border: 1px solid #e2e8f0;
    padding: .55rem .8rem;
    text-align: left;
}
.md-body th { background: #f8fafc; color: #0f172a; font-weight: 600; }
.md-body tbody tr:nth-child(even) { background: #f8fafc; }

.md-body hr { border: 0; border-top: 1px solid #e2e8f0; margin: 2rem 0; }

.md-body img {
    max-width: 100%;
    border-radius: .9rem;
    margin: 1.2rem 0;
}

/* Card hover lift --------------------------------------------- */
.card-hover { transition: transform .18s ease, box-shadow .18s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: 0 14px 30px -12px rgb(15 23 42 / .18); }

/* Category accent top-bar on cards ---------------------------- */
.cat-bar { height: 4px; border-radius: 9999px 9999px 0 0; }

/* Toast for "link copied" ------------------------------------- */
#copy-toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%) translateY(120%);
    transition: transform .25s ease;
    z-index: 60;
}
#copy-toast.show { transform: translateX(-50%) translateY(0); }

/* Prose-ish fallback for empty search results ------------------ */
.empty-state { background-image: radial-gradient(circle at 1px 1px, #e2e8f0 1px, transparent 0); background-size: 22px 22px; }

/* Bookmark buttons --------------------------------------------- */
.bm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 2.5rem;
    min-width: 2.5rem;
    padding: 0 0.7rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.bm-btn:hover { color: #1b6ef5; border-color: #8ecdff; transform: translateY(-1px); }
.bm-btn.is-saved { background: #1b6ef5; border-color: #1b6ef5; color: #fff; }
.bm-btn.is-saved svg { fill: currentColor; }

/* Bookmarks page ----------------------------------------------- */
.bm-item { animation: bm-in .18s ease-out; }
@keyframes bm-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
