/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Blog prose */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.025em;
}

.prose h1 {
    font-size: 2em;
    margin-top: 2em;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid #e5e7eb;
}

.prose h2 {
    font-size: 1.875em;
    margin-top: 2em;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid #e5e7eb;
}

.prose h3 {
    font-size: 1.5em;
    margin-top: 1.75em;
    margin-bottom: 0.75em;
    color: #1f2937;
}

.prose h4 {
    font-size: 1.25em;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #374151;
}

.prose h5, .prose h6 {
    font-size: 1.125em;
    margin-top: 1.25em;
    margin-bottom: 0.5em;
    color: #4b5563;
}

.prose p {
    margin-top: 1em;
    margin-bottom: 1em;
    line-height: 1.6;
}

.prose img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.prose ul {
    list-style-type: disc !important;
    padding-left: 1.5em !important;
    margin-top: 1em;
    margin-bottom: 1em;
}

.prose ol {
    list-style-type: decimal !important;
    padding-left: 1.5em !important;
    margin-top: 1em;
    margin-bottom: 1em;
}

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    display: list-item !important;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    font-size: 0.875em;
    overflow-x: auto;
    display: block;
}

.prose th,
.prose td {
    padding: 0.5em 0.75em;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.prose th {
    background-color: #f9fafb;
    font-weight: 600;
}

.prose pre {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    overflow-x: auto;
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 1em;
    border-radius: 0.5em;
    border: 1px solid #374151;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    font-size: 0.875em;
    line-height: 1.5;
    font-family: 'Monaco', 'Courier New', monospace;
}

.prose code {
    background-color: #f3f4f6;
    padding: 0.2em 0.4em;
    border-radius: 0.25em;
    font-size: 0.875em;
    font-family: 'Monaco', 'Courier New', monospace;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

.prose pre > .code-copy-btn {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    background-color: #4b5563;
    color: #fff;
    border: none;
    padding: 0.4em 0.8em;
    border-radius: 0.25em;
    cursor: pointer;
    font-size: 0.75em;
    font-weight: 600;
    transition: background-color 0.2s;
}

.prose pre > .code-copy-btn:hover {
    background-color: #6b7280;
}

.prose pre > .code-copy-btn.copied {
    background-color: #10b981;
}

.prose blockquote {
    border-left: 4px solid #6366f1;
    padding-left: 1em;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    color: #4b5563;
    font-style: italic;
}

/* Syntax highlighting colors (Rouge tokens) */
.prose pre .k { color: #f59e0b; font-weight: bold; } /* Keywords */
.prose pre .n { color: #93c5fd; } /* Names */
.prose pre .s { color: #86efac; } /* Strings */
.prose pre .s1 { color: #86efac; } /* Single-quoted strings */
.prose pre .s2 { color: #86efac; } /* Double-quoted strings */
.prose pre .m { color: #fca5a5; } /* Numbers */
.prose pre .c { color: #6b7280; font-style: italic; } /* Comments */
.prose pre .c1 { color: #6b7280; font-style: italic; } /* Single-line comments */
.prose pre .cm { color: #6b7280; font-style: italic; } /* Multi-line comments */
.prose pre .o { color: #f3f4f6; } /* Operators */
.prose pre .p { color: #f3f4f6; } /* Punctuation */
.prose pre .nv { color: #60a5fa; } /* Variables */
.prose pre .nb { color: #f472b6; } /* Built-ins */
.prose pre .ss { color: #a78bfa; } /* Symbols */
.prose pre .err { color: #ff9999; } /* Errors */
.prose pre .w { color: #f3f4f6; } /* Whitespace */
.prose pre .nd { color: #fbbf24; } /* Decorators */
.prose pre .no { color: #60a5fa; } /* Constants */
.prose pre .nc { color: #a78bfa; } /* Classes */

/* Author avatar spacing */
.author-avatar {
    margin-bottom: 1.5rem;
    margin-right: 0;
}

@media (min-width: 640px) {
    .author-avatar {
        margin-bottom: 0;
        margin-right: 3rem;
    }
}

/* TOAST */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}
.toast {
    background-color: #333;
    color: #fff;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    opacity: 0.9;
}
.toast.notice, .toast.success {
    background-color: #4caf50; /* Green */
}
.toast.alert {
    background-color: #ff9800; /* Orange */
}
.toast.error {
    background-color: #FFCCCC; /* Red */
}
