/* ClassNews module styles — all selectors scoped to .classnews */

/* =============================================================================
   Base wrapper
   ============================================================================= */

.classnews {
    padding: 8px;
}

/* =============================================================================
   Shared utilities
   ============================================================================= */

.cn-success {
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid rgba(0, 150, 0, .18);
    background: rgba(0, 150, 0, .06);
    font-weight: 700;
}

.cn-error {
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid rgba(200, 0, 0, .18);
    background: rgba(200, 0, 0, .06);
    font-weight: 700;
}

.cn-muted {
    color: rgba(0, 0, 0, .45);
}

/* =============================================================================
   Shared form controls
   ============================================================================= */

.cn-input,
.cn-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, .14);
    font-size: 1rem;
    background: #fff;
    box-sizing: border-box;
}

.cn-input:focus,
.cn-select:focus {
    outline: none;
    border-color: rgba(0, 120, 215, .55);
    box-shadow: 0 0 0 3px rgba(0, 120, 215, .14);
}

.cn-btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, .14);
    background: #f5f5f5;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.cn-btn:hover {
    background: #ebebeb;
}

.cn-btn--secondary {
    background: #fff;
    border-color: rgba(0, 0, 0, .14);
    font-weight: 600;
}

.cn-btn--discard {
    color: #d32f2f;
}

.cn-btn--discard:hover {
    background: rgba(211, 47, 47, .06);
    border-color: rgba(211, 47, 47, .3);
}

.cn-btn--preview {
    background: #0078d7;
    border-color: #0078d7;
    color: #fff;
}

.cn-btn--preview:hover {
    background: #005a9e;
    border-color: #005a9e;
}

.cn-btn-sm {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, .14);
    background: #f5f5f5;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.cn-btn-sm:hover {
    background: #ebebeb;
}

.cn-link {
    background: transparent;
    border: 0;
    padding: 0;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
}

.cn-mini-btn {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, .14);
    background: transparent;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.cn-mini-btn:hover {
    background: rgba(0, 0, 0, .06);
    text-decoration: none;
}

.cn-input-with-btn {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.cn-input-with-btn .cn-input {
    flex: 1 1 auto;
    min-width: 0;
}

/* =============================================================================
   Shared: filter bar
   ============================================================================= */

.cn-filters {
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, .08);
    background: #fff;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .04);
}

.cn-filterrow {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.cn-filteractions {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (min-width: 600px) {
    .cn-filterrow {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* =============================================================================
   Shared: tag + category pills
   ============================================================================= */

.cn-tag {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, .12);
    background: rgba(0, 0, 0, .04);
    color: rgba(0, 0, 0, .7);
    margin-right: 4px;
    margin-bottom: 4px;
}

.cn-category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    border: 1px solid rgba(0, 100, 200, .2);
    background: rgba(0, 100, 200, .06);
    color: rgba(0, 80, 180, .85);
    margin-right: 4px;
    margin-bottom: 4px;
}

/* =============================================================================
   Public: article list (NewsSummary)
   ============================================================================= */

.classnews-summary {
    padding: 8px;
}

.cn-empty {
    padding: 20px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, .08);
    background: #fff;
    color: rgba(0, 0, 0, .6);
    margin-bottom: 16px;
}

/* Card grid */
.cn-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

@media (min-width: 640px) {
    .cn-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .cn-cards {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Card wrapper (holds card link + admin edit button as siblings) */
.cn-card-wrap {
    position: relative;
}

/* Card — the article link */
.cn-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, .08);
    background: #fff;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .04);
    overflow: hidden;
    height: 100%;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.cn-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
    border-color: rgba(0, 0, 0, .14);
    text-decoration: none;
    color: inherit;
}

/* Hero image */
.cn-card__hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(0, 0, 0, .04);
    flex-shrink: 0;
}

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

/* Card body */
.cn-card__body {
    flex: 1 1 auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Date badge */
.cn-card__date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
    margin-bottom: 4px;
}

.cn-date-day {
    font-size: 1.6rem;
    font-weight: 800;
    color: #111;
    line-height: 1;
}

.cn-date-month {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(0, 0, 0, .5);
    margin-top: 1px;
}

/* Title */
.cn-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
}

/* Summary */
.cn-card__summary {
    font-size: .9rem;
    color: rgba(0, 0, 0, .65);
    line-height: 1.5;
    flex: 1 1 auto;
}

/* Author */
.cn-card__author {
    font-size: .8rem;
    color: rgba(0, 0, 0, .5);
}

/* Tags row */
.cn-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 4px;
}

/* CTA row */
.cn-card__cta {
    padding: 10px 14px;
    border-top: 1px solid rgba(0, 0, 0, .06);
    font-size: .85rem;
    font-weight: 700;
    color: rgba(0, 0, 0, .7);
    flex-shrink: 0;
}

.cn-card:hover .cn-card__cta {
    color: #111;
}

/* Admin inline edit shortcut */
.cn-card-edit {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 2;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
    background: #fff3cd;
    color: #8a6d3b;
    border: 1px solid #f0d97a;
    line-height: 1.5;
}

.cn-card-edit:hover {
    background: #ffe88a;
    text-decoration: none;
}

/* =============================================================================
   Public: pagination
   ============================================================================= */

.cn-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 4px;
    font-size: .9rem;
    color: rgba(0, 0, 0, .6);
}

.cn-pager__btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, .12);
    background: #fff;
    text-decoration: none;
    font-weight: 600;
    color: #111;
}

.cn-pager__btn:hover {
    background: rgba(0, 0, 0, .04);
    text-decoration: none;
}

/* =============================================================================
   Public: article detail (NewsDetails)
   ============================================================================= */

.classnews-detail {
    padding: 0;
}

/* Shown only when viewed via the admin "Preview" button */
.cn-preview-banner {
    padding: 10px 14px;
    margin: 8px;
    border-radius: 10px;
    border: 1px solid rgba(0, 120, 215, .25);
    background: rgba(0, 120, 215, .08);
    font-weight: 700;
    text-align: center;
}

/* Hero image */
.cn-detail-hero {
    width: 100%;
    max-height: 420px;
    overflow: hidden;
    background: rgba(0, 0, 0, .04);
    margin-bottom: 0;
}

.cn-detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-height: 420px;
}

/* Article wrapper */
.cn-article {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Article header */
.cn-article__header {
    margin-bottom: 20px;
}

.cn-detail__categories {
    margin-bottom: 8px;
}

.cn-article__title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    color: #111;
    margin: 0 0 8px;
}

@media (max-width: 640px) {
    .cn-article__title {
        font-size: 1.5rem;
    }
}

.cn-article__meta {
    font-size: .9rem;
    color: rgba(0, 0, 0, .55);
}

/* Article body — rich HTML from the CKEditor */
.cn-article__body {
    line-height: 1.7;
    color: #222;
    margin-bottom: 24px;
    word-break: break-word;
}

    .cn-article__body h1,
    .cn-article__body h2,
    .cn-article__body h3,
    .cn-article__body h4,
    .cn-article__body h5,
    .cn-article__body h6 {
        margin-top: 20px;
        margin-bottom: 8px;
        line-height: 1.25;
    }

    .cn-article__body p {
        margin: 0 0 14px;
    }

    .cn-article__body ul,
    .cn-article__body ol {
        padding-left: 22px;
        margin: 0 0 14px;
    }

    .cn-article__body img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
    }

    .cn-article__body table {
        width: 100%;
        border-collapse: collapse;
        margin: 0 0 14px;
        font-size: .95rem;
    }

    .cn-article__body th,
    .cn-article__body td {
        padding: 8px 10px;
        border: 1px solid rgba(0, 0, 0, .1);
        text-align: left;
    }

    .cn-article__body th {
        background: rgba(0, 0, 0, .03);
        font-weight: 700;
    }

    .cn-article__body blockquote {
        border-left: 4px solid rgba(0, 0, 0, .15);
        padding-left: 14px;
        margin: 14px 0;
        color: rgba(0, 0, 0, .65);
        font-style: italic;
    }

    .cn-article__body pre {
        background: rgba(0, 0, 0, .04);
        border-radius: 6px;
        padding: 12px;
        overflow-x: auto;
        font-size: .875rem;
    }

    .cn-article__body a {
        color: #1565c0;
        text-decoration: underline;
    }

/* Tags at bottom of article */
.cn-detail__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 24px;
}

/* =============================================================================
   Public: social share row
   ============================================================================= */

.cn-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    border-top: 1px solid rgba(0, 0, 0, .08);
}

.cn-share__label {
    font-weight: 700;
    font-size: .9rem;
    color: rgba(0, 0, 0, .6);
    margin-right: 4px;
}

/* Base share button */
.cn-share__btn {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, .14);
    background: #f5f5f5;
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    line-height: 1.4;
}

.cn-share__btn:hover {
    filter: brightness(0.95);
    text-decoration: none;
    color: inherit;
}

/* Platform-specific colours */
.cn-share__btn--whatsapp  { background: #25d366; color: #fff; border-color: #25d366; }
.cn-share__btn--facebook  { background: #1877f2; color: #fff; border-color: #1877f2; }
.cn-share__btn--linkedin  { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.cn-share__btn--x         { background: #111;    color: #fff; border-color: #111; }
.cn-share__btn--email     { background: #fff;    color: #111; border-color: rgba(0,0,0,.2); }
.cn-share__btn--copy      { background: #fff;    color: #111; border-color: rgba(0,0,0,.2); }
.cn-share__btn--native    { background: #111;    color: #fff; border-color: #111; }

/* Copy-link toast */
.cn-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 10px 18px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .85);
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
}

/* 404 not-found */
.cn-notfound {
    padding: 24px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, .08);
    background: #fff;
}

/* =============================================================================
   Admin: list page (NewsList)
   ============================================================================= */

.classnews-adminlist {
    padding: 8px;
}

/* Admin-specific filter bar overrides (inline row for desktop) */
.classnews-adminlist .cn-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
}

.classnews-adminlist .cn-filters .cn-input,
.classnews-adminlist .cn-filters .cn-select {
    width: auto;
    flex: 1 1 160px;
    min-width: 0;
}

/* Status dropdown: roughly half the width of the other filters — frees up
   room for the date-range group to sit on the same row */
.classnews-adminlist .cn-filters .cn-select--status {
    flex: 0 1 140px;
    min-width: 120px;
}

.classnews-adminlist .cn-filters .cn-btn {
    flex: 0 0 auto;
    height: 42px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
}

/* Date range filter — From/To pair of native date pickers, always inline */
.classnews-adminlist .cn-daterange-group {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.classnews-adminlist .cn-daterange-group .cn-date {
    width: auto;
    flex: 0 0 auto;
    max-width: 150px;
}

.classnews-adminlist .cn-daterange-label {
    font-size: .875rem;
    font-weight: 600;
    color: rgba(0, 0, 0, .65);
    white-space: nowrap;
}

/* Actions bar */
.classnews-adminlist .cn-admin-actions {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

/* Selects inside the action bar must never expand full-width */
.classnews-adminlist .cn-admin-actions .cn-select {
    width: auto !important;
    flex: none !important;
    min-width: 130px;
    max-width: 210px;
}

/* Bulk-action group: action dropdown + Apply sit side by side */
.cn-bulk-group {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
}

/* Page-size group: pushed to the far right of the action bar */
.cn-pagesize-group {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.cn-pagesize-label {
    font-size: .9rem;
    color: rgba(0, 0, 0, .6);
    white-space: nowrap;
}

/* Grid table */
.cn-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .04);
    overflow: hidden;
}

    .cn-grid th {
        text-align: left;
        padding: 10px 12px;
        font-weight: 800;
        font-size: .9rem;
        border-bottom: 1px solid rgba(0, 0, 0, .08);
        background: rgba(0, 0, 0, .02);
        white-space: nowrap;
    }

    .cn-grid td {
        padding: 10px 12px;
        border-bottom: 1px solid rgba(0, 0, 0, .06);
        vertical-align: middle;
    }

    .cn-grid tr:last-child td {
        border-bottom: 0;
    }

    .cn-grid tr:nth-child(even) td {
        background: rgba(0, 0, 0, .012);
    }

    .cn-grid a {
        font-weight: 700;
        color: rgba(0, 0, 0, .75);
        text-decoration: underline;
    }

    .cn-grid a:hover {
        color: #111;
    }

    .cn-grid input[type="checkbox"] {
        transform: translateY(1px);
    }

/* Title cell */
.cn-articletitle {
    font-size: .98rem;
    font-weight: 700;
    color: #111;
    line-height: 1.25;
}

.cn-articledate {
    font-size: .85rem;
    color: rgba(0, 0, 0, .55);
    margin-top: 3px;
}

/* Status badge */
.cn-status {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.cn-status--active {
    background: rgba(0, 150, 0, .07);
    border-color: rgba(0, 150, 0, .2);
    color: #155724;
}

.cn-status--inactive {
    background: rgba(0, 0, 0, .04);
    border-color: rgba(0, 0, 0, .1);
    color: rgba(0, 0, 0, .65);
}

.cn-status--deleted {
    background: rgba(200, 0, 0, .06);
    border-color: rgba(200, 0, 0, .18);
    color: #721c24;
}

/* Bulk-select column — narrow, centred */
.cn-th-chk,
.cn-td-chk {
    width: 64px;
    text-align: center !important;
    padding-left: 10px !important;
    padding-right: 6px !important;
}

.cn-chk-all,
.cn-chk-row {
    cursor: pointer;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.cn-selectall-label {
    display: block;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: rgba(0, 0, 0, .45);
    white-space: nowrap;
    margin-bottom: 3px;
}

/* Selection summary text above the grid */
.cn-selection-summary {
    font-size: .85rem;
    color: rgba(0, 0, 0, .6);
    margin-bottom: 10px;
}

.cn-sel-count {
    font-weight: 700;
}

/* Custom pager */
.classnews-adminlist .cn-admin-pager {
    display: flex !important;
    align-items: center;
    justify-content: center !important;
    flex-wrap: wrap;
    gap: 5px;
    padding: 18px 0;
}

/* Pager buttons — !important on visual properties the theme overrides on <a> */
.classnews-adminlist .cn-pgr-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 13px !important;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, .18) !important;
    background: #fff !important;
    font-size: .9rem;
    font-weight: 600;
    color: #222 !important;
    text-decoration: none !important;
    cursor: pointer;
    line-height: 1;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
    transition: background 0.12s;
}

.classnews-adminlist .cn-pgr-btn:hover {
    background: #f0f0f0 !important;
    color: #111 !important;
    text-decoration: none !important;
}

.classnews-adminlist .cn-pgr-btn--active {
    background: #222 !important;
    color: #fff !important;
    border-color: #222 !important;
    font-weight: 700;
    box-shadow: none;
}

.classnews-adminlist .cn-pgr-btn--active:hover {
    background: #444 !important;
    color: #fff !important;
    text-decoration: none !important;
}

.classnews-adminlist .cn-pgr-btn--disabled {
    background: #f4f4f4 !important;
    color: rgba(0, 0, 0, .28) !important;
    border-color: rgba(0, 0, 0, .1) !important;
    cursor: default;
    box-shadow: none;
}

/* Horizontal scroll on narrow screens */
@media (max-width: 900px) {
    .classnews-adminlist {
        overflow-x: auto;
    }

    .cn-grid {
        min-width: 820px;
    }
}

/* =============================================================================
   Admin: editor (NewsEdit)
   ============================================================================= */

.classnews-editor {
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 10px rgba(0, 0, 0, .04);
    margin-top: 12px;
    overflow: hidden;
}

.cn-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    font-weight: 800;
    font-size: 1.05rem;
}

.cn-editor-body {
    padding: 16px;
}

.cn-editor-empty {
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 10px rgba(0, 0, 0, .04);
    margin-top: 12px;
}

.cn-editor-emptycard {
    padding: 24px;
    color: rgba(0, 0, 0, .6);
}

    .cn-editor-emptycard h3 {
        margin: 0 0 6px;
        font-size: 1.1rem;
        color: #111;
    }

    .cn-editor-emptycard p {
        margin: 0;
    }

/* Audit info bar */
.cn-audit {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, .08);
    background: rgba(0, 0, 0, .02);
    margin-bottom: 14px;
    font-size: .85rem;
    color: rgba(0, 0, 0, .6);
}

/* Form layout */
.cn-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cn-required-note {
    margin: 0;
    padding: 6px 12px;
    background: rgba(211, 47, 47, .04);
    border-left: 3px solid rgba(211, 47, 47, .35);
    border-radius: 4px;
    font-size: .85rem;
    color: rgba(0, 0, 0, .65);
}

.cn-required-asterisk {
    color: #d32f2f;
    font-weight: 700;
}

.cn-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cn-label {
    font-weight: 700;
    font-size: .9rem;
    color: rgba(0, 0, 0, .75);
}

.cn-label--required::after {
    content: " *";
    color: #d32f2f;
    font-weight: 700;
}

.cn-optional {
    font-weight: 400;
    font-size: .8rem;
    color: rgba(0, 0, 0, .5);
}

.cn-hint {
    font-size: .8rem;
    color: rgba(0, 0, 0, .5);
    line-height: 1.4;
}

.cn-hint--note {
    padding: 8px 12px;
    background: rgba(0, 100, 200, .05);
    border-left: 3px solid rgba(0, 100, 200, .3);
    border-radius: 4px;
    color: rgba(0, 80, 180, .8);
    font-size: .85rem;
}

/* Body rich text editor — keep its drag-resize handle within the page width */
.cn-richtext-wrap {
    max-width: 100%;
}

.cn-richtext-wrap .cke,
.cn-richtext-wrap .cke_chrome {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.cn-richtext-wrap .cke_resizer {
    cursor: ns-resize !important;
}

/* Hero image preview */
.cn-hero-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 4px;
}

.cn-hero-preview-img {
    max-width: 12.5vw;
    max-height: 7.3vw;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, .2);
    object-fit: cover;
}

.cn-hero-filename {
    font-size: .8rem;
    color: rgba(0, 0, 0, .55);
    cursor: default;
}

/* Date input — narrower */
.cn-date {
    max-width: 180px;
}

/* Flags row */
.cn-formrow--flags {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.cn-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
}

/* Label + action button in one row */
.cn-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Checkbox list */
.cn-checkboxlist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

/* Inline add-category / add-tag form */
.cn-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .03);
    border: 1px solid rgba(0, 0, 0, .08);
    margin-top: 6px;
}

.cn-inline-form .cn-input {
    flex: 1 1 180px;
    min-width: 0;
    width: auto;
}

/* Advanced section toggle */
.cn-advanced-toggle {
    margin: 4px 0;
}

.cn-advanced-link {
    display: inline-block;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    color: rgba(0, 0, 0, .65);
}

.cn-advanced-link:hover {
    color: #111;
    text-decoration: underline;
}

.cn-hr {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, .08);
    margin: 6px 0 14px;
}

/* Save button row */
.cn-formactions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 6px;
}

/* =============================================================================
   Public: tag checkbox dropdown
   ============================================================================= */

/* Toggle button: .cn-select covers the visual; these add the flex layout for the arrow */
.cn-tag-dropdown__toggle {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
    text-align: left;
    color: inherit;
}

.cn-tag-dropdown__lbl {
    flex: 1 1 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cn-tag-dropdown__arrow {
    flex-shrink: 0;
    font-size: .7rem;
    color: rgba(0, 0, 0, .45);
    transition: transform 0.15s ease;
}

.cn-tag-dropdown__toggle[aria-expanded="true"] .cn-tag-dropdown__arrow {
    transform: rotate(180deg);
}

.cn-tag-dropdown__group {
    padding: 0 4px 4px;
}

.cn-tag-dropdown__group + .cn-tag-dropdown__group {
    border-top: 1px solid rgba(0, 0, 0, .06);
    margin-top: 4px;
    padding-top: 4px;
}

.cn-tag-dropdown__group-label {
    padding: 6px 10px 3px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(0, 0, 0, .45);
}

.cn-tag-dropdown__item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .9rem;
    color: #222;
    user-select: none;
}

.cn-tag-dropdown__item:hover {
    background: rgba(0, 0, 0, .04);
}

.cn-tag-dropdown__item input[type="checkbox"] {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #1565c0;
}

/* Per-category tag grid group — full width, stacked vertically */
.cn-tag-grid-group {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, .025);
    border: 1px solid rgba(0, 0, 0, .07);
    border-radius: 6px;
    padding: 8px 12px 10px;
    margin-bottom: 8px;
}
.cn-tag-grid-group:last-child {
    margin-bottom: 0;
}

/* Category heading inside each group */
.cn-tag-grid-heading {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 6px;
}

/* Tag table — 5 equal columns spanning full width */
.cn-tag-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.cn-tag-table td {
    padding: 2px 8px 2px 0;
    vertical-align: middle;
}

/* Individual tag label — constrained to its table cell; long names wrap
   onto a second line instead of overflowing into the next checkbox */
.cn-tag-check {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-break: break-word;
}

.cn-tag-check input {
    flex-shrink: 0;
    margin-top: 3px;
}
