/* ================================================================= */
/* Blog / auth / editor pages                                         */
/* ================================================================= */

/* ---------------- Toolbar ---------------- */
.blog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 22px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.blog-toolbar__count {
    display: block;
    font-size: 12px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: #8d8d8d;
}
.blog-toolbar__count strong { color: #f0f0f0; font-weight: 600; }
.blog-toolbar__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }

/* ---------------- Buttons ---------------- */
.button--block {
    display: block;
    width: 100%;
    padding: 17px 74px 17px 28px;
    text-align: left;
}
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 26px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 35px;
    background: transparent;
    color: #d5d5d5;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-decoration: none !important;
    line-height: 1;
    cursor: pointer;
    transition: .25s;
}
.btn-ghost:hover, .btn-ghost:focus {
    border-color: rgba(255, 255, 255, .5);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    outline: none;
}
.btn-ghost--danger { border-color: rgba(248, 113, 113, .45); color: #f8a1a1; }
.btn-ghost--danger:hover, .btn-ghost--danger:focus {
    border-color: #f87171;
    background: rgba(248, 113, 113, .14);
    color: #ffd7d7;
}
.btn-ghost.is-block { display: flex; width: 100%; justify-content: center; padding: 15px 24px; }

/* ---------------- Post cards ---------------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}
.blog .post-container {
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    background: #191919;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 10px;
    overflow: hidden;
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}
.blog .post-container:hover {
    transform: translateY(-7px);
    border-color: rgba(255, 255, 255, .16);
    box-shadow: 0 34px 55px -34px rgba(0, 0, 0, .95);
}
.blog .post-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 0;
    background: #101010;
}
.blog .post-thumb a { display: block; width: 100%; height: 100%; border-radius: 0; }
.blog .post-thumb a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform .6s ease;
}
.blog .post-container:hover .post-thumb a img { transform: scale(1.07); }
.post-thumb--empty {
    background: linear-gradient(135deg, #1f1f1f 0%, #121212 55%, #191919 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.post-thumb__ph {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .09);
    color: #8a8a8a;
    font-size: 25px;
}
.post-chip {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    max-width: calc(100% - 28px);
    padding: 7px 14px;
    border-radius: 30px;
    background: rgba(12, 12, 12, .82);
    border: 1px solid rgba(255, 255, 255, .16);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.blog .post-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    background: #191919;
    border-top: 1px solid rgba(255, 255, 255, .07);
    border-radius: 0;
    padding: 20px 22px 24px;
}
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 12px;
    letter-spacing: .05em;
    color: #8f8f8f;
    text-transform: uppercase;
}
.post-meta i { padding-right: 6px; opacity: .8; }
.blog .post-content .entry-header { margin-top: 13px; }
.blog .post-content .entry-header h3 { margin: 0; font-size: 19px; line-height: 1.45; font-weight: 600; }
.blog .post-content .entry-header h3 a {
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog .post-content .entry-content p {
    margin: 11px 0 0;
    color: #a3a3a3;
    font-size: 14.5px;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-more {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding-top: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #f2f2f2;
    text-decoration: none !important;
    transition: color .25s;
}
.post-more i { transition: transform .25s; }
.post-more:hover { color: #fff; }
.post-more:hover i { transform: translateX(5px); }

/* ---------------- Empty state ---------------- */
.blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 70px 26px;
    background: #161616;
    border: 1px dashed rgba(255, 255, 255, .16);
    border-radius: 12px;
}
.blog-empty__icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #9c9c9c;
    font-size: 27px;
}
.blog-empty h3 { margin: 0 0 10px; font-size: 22px; font-weight: 600; color: #f0f0f0; }
.blog-empty p { max-width: 430px; margin: 0 auto 26px; color: #9a9a9a; font-size: 15px; line-height: 1.7; }

/* ---------------- Pagination ---------------- */
.blog .pagination { justify-content: center; flex-wrap: wrap; gap: 8px; margin: 42px 0 0; padding: 0; }
.blog .pagination .page-item { margin: 0; }
.blog .page-link {
    margin: 0;
    border-radius: 50% !important;
    width: 42px;
    height: 42px;
    line-height: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
/* Font Awesome sets `font: …/1 …`, which breaks vertical centering on its own */
.blog .page-link i,
.blog .page-link .fa { line-height: 1; display: block; }
.blog .page-item.disabled .page-link {
    opacity: 1;
    cursor: not-allowed;
    color: rgba(255, 255, 255, .32);
    background-color: #1c1c1c;
    border-color: #2b2b2b;
}
body.light.blog .page-item.disabled .page-link {
    color: rgba(0, 0, 0, .3);
    background-color: #f2f2f2;
    border-color: #e4e4e4;
}

/* ---------------- Single post ---------------- */
.blog-post article { max-width: 760px; margin: 0 auto; }
.post-single__head { margin-bottom: 6px; }
.post-single__head .post-chip {
    position: static;
    display: inline-block;
    margin-bottom: 18px;
    background: rgba(255, 255, 255, .06);
}
.post-single__head h1 {
    margin: 0 0 22px;
    font-size: clamp(27px, 4vw, 40px);
    line-height: 1.22;
    font-weight: 800;
    color: #fff;
    text-transform: none;
}
.post-meta--pills { display: flex; flex-wrap: wrap; gap: 10px; }
.post-meta--pills .pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 30px;
    font-size: 12.5px;
    letter-spacing: .04em;
    color: #b6b6b6;
    text-transform: none;
}
.post-cover {
    margin: 30px 0 34px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 34px 60px -40px rgba(0, 0, 0, .95);
}
.post-cover img { display: block; width: 100%; margin: 0; border-radius: 0; }

/* rich post body */
.post-body {
    color: #cfcfcf;
    font-size: 16.5px;
    line-height: 1.85;
    overflow-wrap: break-word;
}
.post-body > *:first-child { margin-top: 0; }
.post-body p { margin: 0 0 22px; }
.post-body a { color: #ffd479; text-decoration: underline; text-underline-offset: 3px; }
.post-body a:hover { color: #fff; }
.post-body strong, .post-body b { color: #fff; }
.post-body h2, .post-body h3, .post-body h4 {
    color: #fff;
    font-weight: 700;
    line-height: 1.3;
    margin: 38px 0 16px;
}
.post-body h2 { font-size: 27px; }
.post-body h3 { font-size: 22px; }
.post-body h4 { font-size: 18px; }
.post-body ul, .post-body ol { margin: 0 0 22px; padding-left: 24px; }
.post-body li { margin-bottom: 9px; }
.post-body li::marker { color: #9a9a9a; }
.post-body blockquote {
    margin: 28px 0;
    padding: 18px 24px;
    background: #171717;
    border-left: 4px solid rgba(255, 255, 255, .35);
    border-radius: 0 8px 8px 0;
    color: #d8d8d8;
    font-style: italic;
}
.post-body img, .post-body figure img, .post-body video {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
}
.post-body figure { margin: 28px 0; }
.post-body figcaption { margin-top: 10px; font-size: 13px; color: #8f8f8f; text-align: center; }
.post-body iframe { max-width: 100%; border: 0; border-radius: 10px; }
.post-body code {
    padding: 2px 7px;
    background: #232323;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 5px;
    color: #ffd479;
    font-size: .92em;
}
.post-body pre {
    padding: 18px 20px;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 10px;
    overflow-x: auto;
    margin: 0 0 24px;
}
.post-body pre code { padding: 0; background: none; border: 0; color: #e6e6e6; }
.post-body table {
    width: 100%;
    margin: 0 0 26px;
    border-collapse: collapse;
    font-size: 15px;
}
.post-body th, .post-body td {
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, .1);
    text-align: left;
}
.post-body th { background: #1f1f1f; color: #fff; }
.post-body hr { border: 0; border-top: 1px solid rgba(255, 255, 255, .12); margin: 34px 0; }
.post-body .ck-editor__editable { background: transparent !important; }

/* ---------------- Admin action bar ---------------- */
.post-admin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 44px;
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, .09);
}
.post-admin__label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #8d8d8d;
}
.post-admin__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------------- Delete confirmation modal ---------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 4500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 6, 6, .76);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: .25s ease;
}
.modal-overlay.is-open { opacity: 1; visibility: visible; }
.modal-card {
    width: min(430px, 100%);
    padding: 32px 30px 28px;
    background: #1b1b1b;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    box-shadow: 0 50px 80px -50px #000;
    transform: translateY(16px) scale(.97);
    transition: .25s ease;
}
.modal-overlay.is-open .modal-card { transform: none; }
.modal-card__icon {
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 113, 113, .14);
    border: 1px solid rgba(248, 113, 113, .4);
    color: #f87171;
    font-size: 20px;
}
.modal-card h3 { margin: 0 0 8px; font-size: 21px; font-weight: 700; color: #fff; }
.modal-card p { margin: 0 0 24px; color: #a0a0a0; font-size: 15px; line-height: 1.65; }
.modal-card p strong { color: #fff; }
.modal-card__actions { display: flex; justify-content: flex-end; gap: 12px; }

/* ---------------- Shared form controls ---------------- */
.form-field { margin-bottom: 4px; }
.form-field--full { grid-column: 1 / -1; }
.form-field > label,
.field-label {
    display: block;
    margin-bottom: 9px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #9b9b9b;
}
.form-field > label .req { color: #f87171; }
body.light .form-field > label .req { color: #c62828; }
.field-error {
    display: block;
    margin-top: 8px;
    color: #f87171;
    font-size: 13.5px;
    line-height: 1.5;
}
.field-error i { font-size: 7px; vertical-align: middle; padding-right: 7px; }
.field-hint { display: block; margin-top: 8px; color: #9b9b9b; font-size: 13px; line-height: 1.6; }

.form-card .form-control,
.auth-card .form-control {
    display: block;
    width: 100%;
    padding: 14px 16px;
    background: #131313;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    color: #f1f1f1;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color .2s, box-shadow .2s, background .2s;
    box-shadow: none;
}
.form-card .form-control:focus,
.auth-card .form-control:focus {
    outline: none;
    background: #161616;
    border-color: rgba(255, 255, 255, .45);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .06);
}
.form-card .form-control::placeholder,
.auth-card .form-control::placeholder { color: #6b6b6b; }
.form-card textarea.form-control { min-height: 132px; resize: vertical; }
.form-card .has-error .form-control,
.auth-card .has-error .form-control { border-color: #f87171; }
.form-card .has-error .form-control:focus { box-shadow: 0 0 0 4px rgba(248, 113, 113, .16); }

.input-affix { position: relative; }
.input-affix .form-control { padding-right: 52px; }
.input-affix__btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8f8f8f;
    font-size: 16px;
    cursor: pointer;
    transition: .2s;
}
.input-affix__btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.input-affix__btn.is-visible { color: #ffb400; }

/* ---------------- Editor / form card ---------------- */
.form-card {
    width: min(820px, 100%);
    margin: 10px auto 90px;
    padding: 36px 36px 32px;
    background: #1b1b1b;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    box-shadow: 0 44px 70px -55px #000;
}
.form-card__head { margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.form-card__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #8f8f8f;
}
.form-card__head h2 { margin: 0 0 8px; font-size: 26px; font-weight: 700; color: #fff; }
.form-card__head p { margin: 0; color: #9a9a9a; font-size: 14.5px; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 22px; }
.form-card__foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

/* ---------------- File picker ---------------- */
.file-picker {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px;
    background: #131313;
    border: 1px dashed rgba(255, 255, 255, .2);
    border-radius: 10px;
    transition: border-color .2s, background .2s;
}
.file-picker:hover { border-color: rgba(255, 255, 255, .4); }
.file-picker input[type=file] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
/* Django ClearableFileInput leftovers ("Currently:" link + Clear checkbox/label)
   would force a 410px viewport on mobile; the preview + file name replace them. */
.file-picker > a,
.file-picker > input[type=checkbox],
.file-picker > label:not(.file-picker__btn),
.file-picker > br {
    display: none !important;
}
.file-picker__row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.file-picker__btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 !important;
    padding: 12px 22px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 35px;
    background: rgba(255, 255, 255, .05);
    color: #e6e6e6 !important;
    font-size: 12.5px !important;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: .22s;
}
.file-picker__btn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .45); }
.file-picker__name {
    font-size: 13.5px;
    color: #8f8f8f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.file-picker__preview {
    flex: 0 0 auto;
    width: 92px;
    height: 62px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .16);
}

/* ---------------- CKEditor shell ---------------- */
.ckeditor-shell { position: relative; }
.ckeditor-shell .ck-editor { border-radius: 10px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .12); }
.ckeditor-shell .ck-editor__top { border-bottom: 1px solid rgba(0, 0, 0, .1); }
.ckeditor-shell .ck-editor__editable_inline { min-height: 280px !important; }
.ckeditor-shell .ck-content { font-size: 15.5px; line-height: 1.75; }
.ckeditor-shell .ck-focused { box-shadow: none !important; }

/* ---------------- Auth (login) card ---------------- */
.auth-wrap { display: flex; justify-content: center; padding: 6px 0 90px; }
.auth-card {
    width: min(455px, 100%);
    padding: 40px 36px 34px;
    background: #1b1b1b;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    box-shadow: 0 44px 70px -55px #000;
}
.auth-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 23px;
}
.auth-card__title { margin: 0 0 8px; font-size: 25px; font-weight: 700; color: #fff; }
.auth-card__sub { margin: 0 0 28px; color: #9a9a9a; font-size: 14.5px; line-height: 1.7; }
.auth-card .form-field { margin-bottom: 20px; }
.auth-card .button--block { margin-top: 8px; }
.auth-card__back {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 22px;
    color: #8f8f8f;
    font-size: 13px;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: color .2s;
}
.auth-card__back:hover { color: #fff; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1199px) {
    .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (max-width: 991px) {
    .form-card { padding: 30px 26px 26px; }
    .blog-toolbar { align-items: flex-start; }
}
@media (max-width: 767px) {
    .blog-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .blog-toolbar__actions { width: 100%; }
    .blog-toolbar__actions .button { flex: 1 1 auto; }
    .post-admin { flex-direction: column; align-items: flex-start; }
    .post-admin__actions { width: 100%; }
    .post-admin__actions .btn-ghost { flex: 1 1 auto; justify-content: center; }
    .form-card__foot { flex-direction: column-reverse; }
    .form-card__foot > * { width: 100%; justify-content: center; }
    .file-picker { flex-direction: column; align-items: stretch; }
    .file-picker__preview { width: 100%; height: 170px; }
    .auth-card { padding: 32px 24px 28px; }
    .modal-card__actions { flex-direction: column-reverse; }
    .modal-card__actions > * { width: 100%; justify-content: center; }
}
@media (max-width: 576px) {
    .blog-empty { padding: 48px 18px; }
    .blog .page-link { width: 38px; height: 38px; line-height: 38px; }
    .post-meta--pills .pill { font-size: 12px; padding: 8px 13px; }
    .modal-card { padding: 26px 22px 24px; }
}

/* ---------------- Light theme ---------------- */
body.light.blog .post-container { background: #fff; border-color: #e8e8e8; }
body.light.blog .post-container:hover {
    border-color: #d8d8d8;
    box-shadow: 0 30px 50px -35px rgba(0, 0, 0, .45);
}
body.light.blog .post-thumb { background: #eee; }
body.light.blog .post-content { background: #f2f2f2; border-top-color: #e4e4e4; }
body.light.blog .post-content .entry-header h3 a { color: #3a3a3a; }
body.light.blog .post-content .entry-content p { color: #6b6b6b; }
body.light .post-meta { color: #666; }
body.light .post-more { color: #3a3a3a; }
body.light .post-more:hover { color: #111; }
body.light .blog-empty { background: #f7f7f7; border-color: #d9d9d9; }
body.light .blog-empty__icon { background: #fff; border-color: #e2e2e2; color: #8a8a8a; }
body.light .blog-empty h3 { color: #2e2e2e; }
body.light .blog-empty p { color: #6b6b6b; }
body.light .blog-toolbar { border-bottom-color: #e6e6e6; }
body.light .blog-toolbar__count { color: #6e6e6e; }
body.light .blog-toolbar__count strong { color: #2e2e2e; }

body.light .post-single__head h1 { color: #232323; }
body.light .post-meta--pills .pill { background: #fff; border-color: #e6e6e6; color: #666; }
body.light .post-cover { border-color: #e2e2e2; box-shadow: 0 30px 55px -45px rgba(0, 0, 0, .6); }
body.light .post-body { color: #4c4c4c; }
body.light .post-body a { color: #9a6b00; }
body.light .post-body strong, body.light .post-body b { color: #1c1c1c; }
body.light .post-body h2, body.light .post-body h3, body.light .post-body h4 { color: #232323; }
body.light .post-body blockquote { background: #f5f5f5; border-left-color: #cfcfcf; color: #555; }
body.light .post-body code { background: #f2f2f2; border-color: #e2e2e2; color: #9a6b00; }
body.light .post-body pre { background: #f7f7f7; border-color: #e4e4e4; }
body.light .post-body pre code { color: #333; }
body.light .post-body th { background: #f2f2f2; color: #232323; }
body.light .post-body th, body.light .post-body td { border-color: #e2e2e2; }
body.light .post-admin { border-top-color: #e6e6e6; }
body.light .post-admin__label { color: #7b7b7b; }

body.light .form-card,
body.light .auth-card,
body.light .modal-card {
    background: #fff;
    border-color: #e6e6e6;
    box-shadow: 0 40px 65px -55px rgba(0, 0, 0, .6);
}
body.light .form-card__head,
body.light .form-card__foot { border-color: #ececec; }
body.light .form-card__head h2,
body.light .auth-card__title { color: #232323; }
body.light .form-card__head p,
body.light .auth-card__sub,
body.light .field-hint { color: #6b6b6b; }
body.light .form-card__eyebrow,
body.light .post-admin__label { color: #6e6e6e; }
body.light .form-card .form-control,
body.light .auth-card .form-control {
    background: #fafafa;
    border-color: #d9d9d9;
    color: #333;
}
body.light .form-card .form-control:focus,
body.light .auth-card .form-control:focus {
    background: #fff;
    border-color: #9a9a9a;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, .05);
}
body.light .form-card .form-control::placeholder,
body.light .auth-card .form-control::placeholder { color: #9b9b9b; }
body.light .form-field > label,
body.light .field-label { color: #6b6b6b; }
body.light .field-error { color: #d64545; }
body.light .btn-ghost { border-color: #d2d2d2; color: #575757; }
body.light .btn-ghost:hover,
body.light .btn-ghost:focus { background: #f2f2f2; border-color: #bdbdbd; color: #1c1c1c; }
body.light .btn-ghost--danger { border-color: #f0b7b7; color: #c62828; }
body.light .btn-ghost--danger:hover { background: #fdecec; border-color: #e77; color: #a81f1f; }
body.light .file-picker { background: #fafafa; border-color: #d5d5d5; }
body.light .file-picker:hover { border-color: #a9a9a9; }
body.light .file-picker__btn { background: #fff; border-color: #d5d5d5; color: #3a3a3a !important; }
body.light .file-picker__btn:hover { background: #f0f0f0; border-color: #b5b5b5; }
body.light .file-picker__name { color: #6e6e6e; }
body.light .file-picker__preview { border-color: #ddd; }
body.light .input-affix__btn { color: #8a8a8a; }
body.light .input-affix__btn:hover { background: #eee; color: #333; }
body.light .modal-overlay { background: rgba(245, 245, 245, .72); }
body.light .modal-card p { color: #6b6b6b; }
body.light .modal-card p strong { color: #1c1c1c; }
body.light .auth-card__back { color: #6e6e6e; }
body.light .auth-card__back:hover { color: #1c1c1c; }

/* ---------------- CKEditor widget (django_ckeditor_5) ---------------- */
.ck-editor-container { position: relative; }
.ck-editor-container > textarea.django_ckeditor_5 { display: none; }
.ck-editor-container .ck-editor {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
    background: #131313;
}
.ck-editor-container .ck-editor__top { border-bottom: 1px solid rgba(255, 255, 255, .1); }
.ck-editor-container .ck-toolbar { background: #1a1a1a !important; border: 0 !important; flex-wrap: wrap; }
.ck-editor-container .ck-editor__editable_inline {
    min-height: 300px !important;
    background: #131313 !important;
    color: #e9e9e9 !important;
    border: 0 !important;
    box-shadow: none !important;
    font-size: 15.5px !important;
    line-height: 1.8 !important;
}
.ck-editor-container .ck-editor__editable_inline:focus { box-shadow: none !important; }
.ck-editor-container .word-count {
    display: block;
    margin-top: 9px;
    font-size: 12.5px;
    color: #9b9b9b;
    letter-spacing: .05em;
}
body.light .ck-editor-container .ck-editor { border-color: #d9d9d9; background: #fff; }
body.light .ck-editor-container .ck-toolbar { background: #f5f5f5 !important; border-color: #e4e4e4 !important; }
body.light .ck-editor-container .ck-editor__editable_inline {
    background: #fff !important;
    color: #333 !important;
    border-color: #e4e4e4 !important;
}


/* ---------------- Contrast fixes ---------------- */
/* Active / hover pagination: skin accent background + white text is 1.8:1 */
.blog .page-item.active .page-link,
.blog .page-link:hover,
.blog .page-item.active .page-link:focus,
.blog .page-link:hover:focus { color: #111; }
body.light.blog .page-item.active .page-link,
body.light.blog .page-link:hover { color: #111; }

/* Light theme: chip must not be white-on-white */
body.light .post-single__head .post-chip {
    background: #232323;
    border-color: #232323;
    color: #fff;
}

/* Light theme: title accent word needs 3:1 for large display text */
body.light .title-section h1 span { color: #d97706; }

/* Word count under CKEditor */
body.light .word-count { color: #6e6e6e; }
