/* ===== Blog pages ===== */
.blog-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 7rem 1.5rem 4rem;
    color: #e8e8e8;
    font-family: 'Inter', system-ui, sans-serif;
}

.blog-header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
}

.blog-header p {
    color: #9ea3aa;
    margin: 0 0 3rem;
    font-size: 1.05rem;
}

.blog-empty {
    color: #9ea3aa;
    text-align: center;
    padding: 3rem 0;
}

.blog-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1.5rem;
}

.blog-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.2s, transform 0.2s;
}

.blog-card:hover {
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

.blog-card:not(:has(.blog-card-cover)) {
    grid-template-columns: 1fr;
}

.blog-card-cover {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.blog-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-card-body time {
    color: #8a8f97;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-card-body h2 {
    margin: 0.4rem 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.blog-card-body h2 a {
    color: #fff;
    text-decoration: none;
}

.blog-card-body h2 a:hover {
    color: #ffd700;
}

.blog-subtitle {
    color: #b4b9c0;
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.blog-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #ffd700;
    padding: 0.2rem 0.55rem;
    border: 1px solid rgba(255, 215, 0, 0.35);
    text-transform: lowercase;
}

/* ===== Single article ===== */
.blog-article {
    max-width: 760px;
    margin: 0 auto;
}

.blog-back {
    display: inline-block;
    color: #ffd700;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.blog-back:hover {
    text-decoration: underline;
}

.blog-article-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
    line-height: 1.15;
}

.blog-article-subtitle {
    color: #b4b9c0;
    font-size: 1.2rem;
    margin: 0 0 1rem;
    line-height: 1.45;
}

.blog-article-meta {
    color: #8a8f97;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-article-cover {
    width: 100%;
    margin: 2rem 0 1rem;
    display: block;
}

.blog-article-body {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #d8dce2;
    margin-top: 2rem;
}

.blog-article-body h2 {
    margin: 2.5rem 0 1rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.blog-article-body h3 {
    margin: 2rem 0 0.75rem;
    font-size: 1.35rem;
    font-weight: 600;
    color: #fff;
}

.blog-article-body p {
    margin: 0 0 1.25rem;
}

.blog-article-body a {
    color: #ffd700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-article-body code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 215, 0, 0.08);
    color: #ffd700;
    padding: 0.1rem 0.35rem;
    font-size: 0.9em;
    border-radius: 2px;
}

.blog-article-body pre {
    background: #0d0f12;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.blog-article-body pre code {
    background: transparent;
    color: #d8dce2;
    padding: 0;
}

.blog-article-body blockquote {
    border-left: 3px solid #ffd700;
    padding: 0.25rem 0 0.25rem 1.25rem;
    margin: 1.5rem 0;
    color: #b4b9c0;
    font-style: italic;
}

.blog-article-body ul,
.blog-article-body ol {
    margin: 1rem 0 1.25rem 1.25rem;
}

.blog-article-body li {
    margin-bottom: 0.4rem;
}

.blog-article-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
}

.blog-article-body hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2.5rem 0;
}

.blog-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.blog-article-body th,
.blog-article-body td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.6rem 0.85rem;
    text-align: left;
}

.blog-article-body th {
    background: rgba(255, 255, 255, 0.04);
    font-weight: 600;
}

@media (max-width: 700px) {
    .blog-card {
        grid-template-columns: 1fr;
    }
}

/* ===== Admin ===== */
.admin-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 7rem 1.5rem 4rem;
    color: #e8e8e8;
    font-family: 'Inter', system-ui, sans-serif;
}

.admin-page h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0 0 1.5rem;
    letter-spacing: -0.02em;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-btn {
    display: inline-block;
    background: #ffd700;
    color: #0d0f12;
    border: 1px solid #ffd700;
    padding: 0.55rem 1.1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
}

.admin-btn:hover {
    background: #ffeb6b;
    transform: translateY(-1px);
}

.admin-btn.secondary {
    background: transparent;
    color: #ffd700;
}

.admin-btn.secondary:hover {
    background: rgba(255, 215, 0, 0.1);
}

.admin-btn.danger {
    background: transparent;
    color: #ff6b6b;
    border-color: #ff6b6b;
}

.admin-btn.danger:hover {
    background: rgba(255, 107, 107, 0.1);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table th {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #8a8f97;
    letter-spacing: 0.05em;
}

.admin-status {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-status.published {
    background: rgba(0, 200, 100, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.35);
}

.admin-status.draft {
    background: rgba(150, 150, 150, 0.15);
    color: #b4b9c0;
    border: 1px solid rgba(180, 185, 192, 0.35);
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-form {
    display: grid;
    gap: 1.25rem;
    max-width: 720px;
}

.admin-form label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a8f97;
    margin-bottom: 0.4rem;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e8e8e8;
    padding: 0.7rem 0.85rem;
    font-family: inherit;
    font-size: 1rem;
}

.admin-form input:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: #ffd700;
}

.admin-form .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.admin-form .checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    text-transform: none;
    letter-spacing: 0;
    color: #e8e8e8;
}

.admin-form .checkbox input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #ffd700;
}

.admin-form .form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.admin-error {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.35);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.admin-login {
    max-width: 420px;
    margin: 0 auto;
}

.editor-host {
    min-height: 520px;
}

.EasyMDEContainer .CodeMirror {
    background: #0d0f12;
    color: #e8e8e8;
    border-color: rgba(255, 255, 255, 0.12);
}

.EasyMDEContainer .CodeMirror-cursor {
    border-left-color: #ffd700;
}

.EasyMDEContainer .editor-toolbar {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: none;
    background: #1a1d22;
    opacity: 1;
}

.EasyMDEContainer .editor-toolbar button,
.EasyMDEContainer .editor-toolbar button.active,
.EasyMDEContainer .editor-toolbar button:hover {
    color: #e8e8e8 !important;
    border-color: transparent;
    background: transparent;
}

.EasyMDEContainer .editor-toolbar button:hover {
    background: rgba(255, 215, 0, 0.12) !important;
    border-color: rgba(255, 215, 0, 0.35) !important;
}

.EasyMDEContainer .editor-toolbar button.active {
    background: rgba(255, 215, 0, 0.18) !important;
    color: #ffd700 !important;
}

.EasyMDEContainer .editor-toolbar i.separator {
    border-left-color: rgba(255, 255, 255, 0.18);
    border-right-color: transparent;
}

.EasyMDEContainer .editor-statusbar {
    color: #8a8f97;
    background: #1a1d22;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: none;
    padding: 0.35rem 0.75rem;
}

.EasyMDEContainer .editor-preview,
.EasyMDEContainer .editor-preview-side {
    background: #0d0f12;
    color: #e8e8e8;
    border-color: rgba(255, 255, 255, 0.12);
}

.EasyMDEContainer .editor-preview a,
.EasyMDEContainer .editor-preview-side a {
    color: #ffd700;
}

.EasyMDEContainer .editor-preview code,
.EasyMDEContainer .editor-preview-side code {
    background: rgba(255, 215, 0, 0.08);
    color: #ffd700;
}

/* ===== Upload toasts ===== */
.blog-toast-host {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 9999;
    pointer-events: none;
    max-width: 360px;
}

.blog-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    background: #1a1d22;
    color: #e8e8e8;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left-width: 3px;
    font-family: 'Inter', system-ui, sans-serif;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    animation: blog-toast-in 0.2s ease-out;
}

.blog-toast.pending {
    border-left-color: #ffd700;
}

.blog-toast.success {
    border-left-color: #4ade80;
}

.blog-toast.error {
    border-left-color: #ff6b6b;
}

.blog-toast.dismissing {
    animation: blog-toast-out 0.2s ease-in forwards;
}

.blog-toast-body {
    flex: 1;
    min-width: 0;
}

.blog-toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.blog-toast-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #b4b9c0;
    word-break: break-all;
    line-height: 1.4;
}

.blog-toast-meta > div + a {
    margin-top: 0.25rem;
    display: inline-block;
}

.blog-toast-link {
    color: #ffd700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blog-toast-link:hover {
    color: #ffeb6b;
}

.blog-toast-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 215, 0, 0.25);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: blog-toast-spin 0.7s linear infinite;
    flex-shrink: 0;
    margin-top: 2px;
}

.blog-toast-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    color: #0d0f12;
    flex-shrink: 0;
    margin-top: 2px;
}

.blog-toast.success .blog-toast-icon {
    background: #4ade80;
}

.blog-toast.error .blog-toast-icon {
    background: #ff6b6b;
}

.blog-toast-close {
    background: transparent;
    border: none;
    color: #8a8f97;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 0.4rem;
}

.blog-toast-close:hover {
    color: #e8e8e8;
}

@keyframes blog-toast-spin {
    to { transform: rotate(360deg); }
}

@keyframes blog-toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes blog-toast-out {
    to { opacity: 0; transform: translateX(20px); }
}
