/* ============================================================================
   Blog styles — generor.com
   Classes are namespaced with .blog- to avoid collisions.
   Post content styles (.post-content, .post-table, .post-chart-wrap) match
   the HTML output of transformBlogContent() and must stay in sync.
   ============================================================================ */

/* ----- Wrap ----- */
.blog-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 20px 60px;
}
.blog-single-wrap {
    max-width: 820px;
}

/* ----- Hero ----- */
.blog-hero {
    text-align: center;
    padding: 20px 10px 10px;
}
.blog-hero h1 {
    font-size: 36px;
    margin: 0 0 8px;
    color: #fff;
}
.blog-hero-tagline {
    color: #999;
    font-size: 16px;
    margin: 0;
}
.blog-hero-breadcrumb {
    color: #888;
    font-size: 13px;
    margin: 0 0 6px;
}
.blog-hero-breadcrumb a {
    color: #888;
    text-decoration: none;
}
.blog-hero-breadcrumb a:hover {
    color: #ffe454;
}

/* ----- Categories bar ----- */
.blog-categories-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 16px 0 24px;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 25px;
}
.blog-cat-pill {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid #333;
    border-radius: 20px;
    color: #aaa;
    font-size: 13px;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
.blog-cat-pill:hover,
.blog-cat-pill.active {
    border-color: #ffe454;
    color: #ffe454;
}

/* ----- Post grid ----- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    padding: 0 0 30px;
}
.blog-grid-small {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
@media (max-width: 900px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .blog-grid-small { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .blog-grid, .blog-grid-small { grid-template-columns: 1fr; }
}

/* ----- Post card ----- */
.blog-card {
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}
.blog-card:hover {
    transform: translateY(-3px);
    border-color: #bdbdbd;
}
.blog-card-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #1a1a1a;
}
.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.blog-card:hover .blog-card-image img { transform: scale(1.03); }
.blog-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.blog-card-category {
    display: inline-block;
    align-self: flex-start;
    padding: 2px 10px;
    background: rgba(255, 228, 84, 0.1);
    border: 1px solid rgba(255, 228, 84, 0.3);
    border-radius: 14px;
    color: #ffe454;
    font-size: 11px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.blog-card-title {
    font-size: 18px;
    color: #f0f0f0;
    margin: 4px 0 2px;
    line-height: 1.3;
    font-family: Georgia, serif;
}
.blog-card-title a {
    color: inherit;
    text-decoration: none;
}
.blog-card-title a:hover { color: #ffe454; }
.blog-card-excerpt {
    font-size: 14px;
    color: #888;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #bdbdbd;
    margin-top: auto;
    padding-top: 6px;
}

/* ----- Single post ----- */
.blog-post {
    text-align: left;
}
.blog-post-hero {
    width: 100%;
    max-height: 480px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 25px;
}
.blog-post-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.blog-post-header {
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 18px;
    margin-bottom: 25px;
}
.blog-post-categories { margin-bottom: 12px; }
.blog-post-header h1 {
    font-size: 36px;
    line-height: 1.2;
    color: #fff;
    margin: 0 0 14px;
}
.blog-post-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #888;
}
.blog-post-status-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.blog-post-status-draft {
    background: rgba(255, 228, 84, 0.15);
    color: #ffe454;
}
.blog-post-status-archived {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}

/* ----- Post content typography ----- */
.blog-post-content {
    font-size: 17px;
    line-height: 1.8;
    color: #c0c0c0;
    overflow-wrap: break-word;
}
.blog-post-content h2 {
    font-size: 26px;
    color: #f0f0f0;
    margin: 35px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a2a2a;
}
.blog-post-content h3 {
    font-size: 21px;
    color: #e0e0e0;
    margin: 28px 0 12px;
}
.blog-post-content p { margin: 0 0 18px; }
.blog-post-content a {
    color: #ffe454;
    text-underline-offset: 3px;
}
.blog-post-content a:hover { color: #fff; }
.blog-post-content blockquote {
    margin: 25px 0;
    padding: 15px 25px;
    border-left: 4px solid #ffe454;
    background: rgba(255, 228, 84, 0.05);
    font-style: italic;
    color: #bbb;
}
.blog-post-content ul,
.blog-post-content ol { margin: 15px 0; padding-left: 30px; }
.blog-post-content li { margin-bottom: 8px; }
.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 20px 0;
}
.blog-post-content code {
    background: #1a1a1a;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 15px;
    color: #e0c080;
}
.blog-post-content pre {
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
}
.blog-post-content pre code { background: none; padding: 0; }

/* ----- Shortcode: tables ----- */
.post-table-wrap {
    margin: 30px 0;
    width: 100%;
    overflow: hidden;
}
.post-table-caption {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #ffe454;
    margin: 0 0 10px;
}
.post-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}
.post-table {
    min-width: 100%;
    width: max-content;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.5;
}
.post-table thead th {
    text-align: left;
    padding: 10px 12px;
    color: #f0f0f0;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 2px solid #ffe454;
}
.post-table tbody td {
    padding: 9px 12px;
    color: #c0c0c0;
    border-bottom: 1px solid #1e1e1e;
}
.post-table tbody tr:last-child td { border-bottom: none; }
.post-table tbody tr:hover td { background: rgba(255, 228, 84, 0.03); }
.post-table .cell-highlight {
    color: #ffe454;
    font-weight: 600;
}

/* ----- Shortcode: charts ----- */
.post-chart-wrap {
    margin: 30px 0;
    padding: 20px;
    background: #0d1117;
    border: 1px solid #1e2a3a;
    border-radius: 8px;
}
.post-chart-caption {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #ffe454;
    margin: 0 0 15px;
}
.post-chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}
.post-chart-container canvas { max-width: 100%; }
@media (max-width: 600px) {
    .post-chart-container { height: 260px; }
    .post-chart-wrap { padding: 14px; }
}

/* ----- Related ----- */
.blog-related {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #2a2a2a;
}
.blog-related h2 {
    font-size: 22px;
    margin: 0 0 20px;
    color: #f0f0f0;
}

/* ----- Pagination ----- */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 30px 0;
    flex-wrap: wrap;
}
.blog-page,
.blog-page-prev,
.blog-page-next {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid #333;
    border-radius: 6px;
    color: #aaa;
    font-size: 13px;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}
.blog-page:hover,
.blog-page-prev:hover,
.blog-page-next:hover,
.blog-page.active {
    border-color: #ffe454;
    color: #ffe454;
}
.blog-page.active { pointer-events: none; }
.blog-page-ellipsis { color: #666; padding: 6px 4px; }

/* ----- Admin wrap (dash-blog*) ----- */
.dash-blog-wrap { padding: 20px 24px 60px; max-width: 1200px; margin: 0 auto; }
.dash-blog-nav {
    display: flex;
    gap: 14px;
    padding: 10px 0 20px;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 20px;
    font-size: 14px;
}
.dash-blog-nav a {
    color: #aaa;
    text-decoration: none;
    padding: 4px 2px;
    border-bottom: 2px solid transparent;
}
.dash-blog-nav a:hover,
.dash-blog-nav a.active {
    color: #ffe454;
    border-bottom-color: #ffe454;
}
.dash-blog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}
.dash-blog-toolbar h2 { margin: 0; color: #f0f0f0; font-size: 22px; }
.dash-blog-filters {
    display: flex;
    gap: 10px;
    padding: 0 0 14px;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 14px;
    font-size: 13px;
    flex-wrap: wrap;
}
.dash-blog-filters a {
    color: #888;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 4px;
}
.dash-blog-filters a.active { color: #ffe454; background: rgba(255, 228, 84, 0.08); }

.dash-blog-table { display: flex; flex-direction: column; gap: 1px; background: #181818; border: 1px solid #2a2a2a; border-radius: 6px; }
.dash-blog-row {
    display: grid;
    grid-template-columns: 2fr 1fr 0.8fr 1fr 1fr 0.6fr 1.1fr;
    gap: 12px;
    padding: 10px 14px;
    align-items: center;
    font-size: 13px;
    background: #111;
}
.dash-blog-row.dash-blog-head {
    background: #181818;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #888;
}
.dash-blog-row a { color: #e0e0e0; text-decoration: none; }
.dash-blog-row a:hover { color: #ffe454; }
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.status-draft { background: rgba(255, 228, 84, 0.12); color: #ffe454; }
.status-published { background: rgba(81, 207, 102, 0.12); color: #51cf66; }
.status-archived { background: rgba(255, 107, 107, 0.12); color: #ff6b6b; }

.dash-blog-empty { padding: 40px; text-align: center; color: #888; }

/* ----- Editor ----- */
.blog-editor-form {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 900px) {
    .blog-editor-form { grid-template-columns: 1fr; }
}
.blog-editor-main .field-group,
.sidebar-section {
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.field-group label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #aaa;
    margin-bottom: 6px;
}
.field-hint {
    font-size: 11px;
    color: #666;
    text-transform: none;
    letter-spacing: 0;
}
.field-group input[type=text],
.field-group input[type=number],
.field-group textarea,
.sidebar-section input[type=text],
.sidebar-section input[type=number],
.sidebar-section textarea,
.sidebar-section select {
    width: 100%;
    padding: 8px 10px;
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    color: #f0f0f0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}
.field-group textarea { min-height: 60px; resize: vertical; }

.blog-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}
.blog-editor-toolbar button {
    background: transparent;
    border: 1px solid transparent;
    color: #ccc;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
}
.blog-editor-toolbar button:hover { background: #1a1a1a; border-color: #333; }
.blog-editor-toolbar .toolbar-separator {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: #2a2a2a;
    margin: 0 4px;
    align-self: center;
}
.blog-editor-content {
    min-height: 420px;
    padding: 14px 16px;
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    border-radius: 0 0 4px 4px;
    color: #e0e0e0;
    font-size: 15px;
    line-height: 1.7;
    outline: none;
}
.blog-editor-content:focus { border-color: #ffe454; }
.blog-editor-source {
    width: 100%;
    min-height: 420px;
    padding: 14px 16px;
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    border-radius: 0 0 4px 4px;
    color: #e0c080;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    line-height: 1.6;
    box-sizing: border-box;
}

.sidebar-section h3 {
    margin: 0 0 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ccc;
}
.editor-actions {
    display: flex;
    gap: 8px;
}
.editor-actions .btn { flex: 1; }
.btn {
    display: inline-block;
    padding: 8px 14px;
    background: #ffe454;
    color: #000;
    border: 1px solid #ffe454;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
}
.btn:hover { background: #fff27a; border-color: #fff27a; }
.btn-secondary {
    background: transparent;
    color: #ccc;
    border-color: #444;
}
.btn-secondary:hover { background: #1a1a1a; color: #fff; border-color: #666; }
.btn-small { padding: 4px 10px; font-size: 12px; }
.btn-warning {
    background: transparent;
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.4);
}
.btn-warning:hover {
    background: rgba(255, 107, 107, 0.08);
    color: #ff8b8b;
}
.editor-status { font-size: 12px; color: #888; margin: 10px 0 0; min-height: 16px; }
.editor-status.success { color: #51cf66; }
.editor-status.error { color: #ff6b6b; }
.editor-meta { font-size: 12px; color: #888; margin: 6px 0 0; }
.editor-meta a { color: #ffe454; text-decoration: none; }

#image-preview img {
    margin-top: 10px;
    max-width: 100%;
    border-radius: 4px;
}

/* ----- Category admin ----- */
.dash-category-form {
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dash-category-form input[type=text],
.dash-category-form input[type=number],
.dash-category-form textarea {
    padding: 8px 10px;
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    color: #f0f0f0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}
.dash-category-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.dash-category-row input[type=text] { flex: 1; min-width: 120px; }
.dash-category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dash-category-item {
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dash-category-main {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
    color: #e0e0e0;
}
.dash-category-main .muted { color: #888; font-size: 12px; }
.dash-category-desc { color: #aaa; font-size: 13px; margin: 0; }
.dash-category-actions { display: flex; gap: 8px; }

/* ----- Misc ----- */
.blog-empty {
    padding: 60px 20px;
    text-align: center;
    color: #888;
}
.blog-admin-link {
    text-align: center;
    padding: 10px 0;
    font-size: 12px;
    color: #666;
}
.blog-admin-link a {
    color: #888;
    text-decoration: none;
}
.blog-admin-link a:hover { color: #ffe454; }
.blog-admin-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #2a2a2a;
}

/* ----- Frontpage blog section ----- */
.frontpage-blog {
    max-width: 1100px;
    margin: 40px auto 20px;
    padding: 0 20px;
}
.frontpage-blog-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}
.frontpage-blog-header h2 {
    margin: 0;
    font-size: 24px;
    color: #f0f0f0;
}
.frontpage-blog-more {
    color: #ffe454;
    text-decoration: none;
    font-size: 14px;
}
.frontpage-blog-more:hover { color: #fff; }
