/* ═══════════════════════════════════════════════════════════════════
   MrBox24 — BLOG MODULE STYLES (blog.css)
   Clean, premium look integrated with CMS light theme.
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --blog-accent: #a142f4;
    --blog-bg: #fafaf8;
    --blog-white: #ffffff;
    --blog-text: #1a1a1a;
    --blog-text-muted: #64748b;
    --blog-border: #e2e8f0;
}

/* ── EDITOR PANEL (fullscreen slide-over) ──────────────────────── */
.blog-editor-panel {
    position: fixed;
    inset: 0;
    z-index: 10010;
    display: flex;
    flex-direction: column;
    background: var(--blog-bg);
    transform: translateX(100%);
    transition: transform .4s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
}
.blog-editor-panel.active {
    transform: translateX(0);
}

.blog-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    border-bottom: 1px solid var(--blog-border);
    background: var(--blog-white);
    flex-shrink: 0;
}

.blog-editor-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    flex: 1;
    overflow: hidden;
}

.blog-editor-main {
    display: flex;
    flex-direction: column;
    padding: 30px 40px;
    overflow-y: auto;
    background: var(--blog-white);
    margin: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.blog-editor-title-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #f1f5f9;
    color: var(--blog-text);
    font-size: 32px;
    font-weight: 700;
    padding: 10px 0;
    outline: none;
    margin-bottom: 20px;
}
.blog-editor-title-input:focus {
    border-bottom-color: var(--blog-accent);
}

/* ── Toolbar ─────────────────────────────────────────────────────── */
.blog-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid var(--blog-border);
    border-radius: 10px;
    margin-bottom: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.blog-tool-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    cursor: pointer;
    transition: all .2s;
}
.blog-tool-btn:hover {
    background: #fff;
    color: var(--blog-accent);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.blog-tool-sep {
    width: 1px;
    height: 24px;
    background: var(--blog-border);
    margin: 0 5px;
}

/* ── Content Area ───────────────────────────────────────────────── */
.blog-content-area {
    flex: 1;
    min-height: 500px;
    padding: 10px 0;
    color: #334155;
    font-size: 16px;
    line-height: 1.8;
    outline: none;
}
.blog-content-area h2 { font-size: 24px; margin-top: 1.5em; color: #0f172a; }
.blog-content-area h3 { font-size: 20px; margin-top: 1.2em; color: #0f172a; }
.blog-content-area img { max-width: 100%; border-radius: 12px; margin: 20px 0; display: block; }

/* ── Sidebar ────────────────────────────────────────────────────── */
.blog-editor-sidebar {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}
.blog-meta-card {
    background: var(--blog-white);
    border: 1px solid var(--blog-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.blog-meta-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--blog-text-muted);
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

/* ── BADGES ─────────────────────────────────────────────────────── */
.blog-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-green { background: #dcfce7; color: #166534; }
.badge-muted { background: #f1f5f9; color: #475569; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #e0f2fe; color: #075985; }

/* ── MEDIA GRID ─────────────────────────────────────────────────── */
.blog-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 10px 0;
}
.blog-media-item {
    background: #fff;
    border: 1px solid var(--blog-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all .3s cubic-bezier(.4,0,.2,1);
}
.blog-media-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    border-color: var(--blog-accent);
}
.blog-media-item img {
    width: 100%;
    aspect-ratio: 1.2;
    object-fit: cover;
    display: block;
}
.blog-media-name {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── JS-generated table rows ─────────────────────────────────────── */
.blog-td { padding: 12px 15px; }
.blog-td-thumb { display: flex; align-items: center; gap: 10px; }
.blog-thumb-img {
    width: 40px; height: 30px;
    object-fit: cover; border-radius: 4px;
    background: #eee; flex-shrink: 0;
}
.blog-thumb-placeholder {
    width: 40px; height: 30px;
    background: #f0f0f0; border-radius: 4px;
    flex-shrink: 0;
}
.blog-post-title { font-weight: 500; }

/* Inline category badge (kolor z JS, reszta tu) */
.blog-inline-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* ── JS-generated category list ─────────────────────────────────── */
.blog-cat-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.blog-cat-item-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.blog-cat-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.blog-cat-label { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blog-cat-actions { display: flex; gap: 5px; flex-shrink: 0; }

/* ── Small action buttons: reset .cms-btn defaults ───────────────── */
/*    .cms-btn ma width:100% i duży padding — te klasy to wyłączają */
.blog-btn-sm {
    width: auto !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
    margin: 0 !important;
}
.blog-btn-xs {
    width: auto !important;
    padding: 3px 8px !important;
    font-size: 10px !important;
    margin: 0 !important;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .blog-editor-body { grid-template-columns: 1fr; }
    .blog-editor-main { margin: 10px; padding: 20px; }
}

@media (max-width: 600px) {
    .blog-cat-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .blog-cat-actions {
        width: 100%;
    }
    .blog-cat-actions .cms-btn {
        flex: 1;
        justify-content: center;
    }
}
