/* Custom styles for the example site */

/* Enhanced code blocks */
pre {
    position: relative;
}

pre::before {
    content: attr(data-lang);
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--code-bg);
    border-bottom-left-radius: 4px;
}

/* Tag and context pills */
a[href^="/tags/"],
a[href^="/contexts/"] {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    margin: 0.125rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    background: var(--code-bg);
}

a[href^="/tags/"]:hover,
a[href^="/contexts/"]:hover {
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
}

/* Collection list improvements */
.collection-list {
    list-style: none;
    padding: 0;
}

.collection-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.collection-list time {
    flex-shrink: 0;
    margin-left: 1rem;
}

/* Snippet styling */
.snippet-code {
    margin: 1rem 0;
}

.language {
    font-size: 0.875rem;
    color: var(--muted);
}

/* Responsive tables */
table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

@media (min-width: 768px) {
    table {
        display: table;
        white-space: normal;
    }
}

/* Print styles */
@media print {
    nav, .backlinks, footer {
        display: none;
    }

    body {
        max-width: none;
        padding: 0;
    }

    a {
        color: inherit;
        text-decoration: underline;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}
