/* =============================================================================
   News Reader Styles — news-specific tweaks only.
   Dialog chrome / toolbar / grid / pagination theming come from the universal
   dialog theme in ext-acs-theme.css (.x-window — promoted shell-wide by
   THEME_REVIEW.md §4.3 Phase 3 PR 3.3 and Phase 4 gate deletion).
   See docs/theme/STYLING_PATTERNS.md § 10 for the universal pattern.
   ============================================================================= */

/* Toolbar icon classes (legacy — used by admin news management) */
.news_close     { background-image: url("/static/images/back.png") !important; }
.grid_filter    { background-image: url("/static/images/tb_filter.gif") !important; }
.news_exit      { background-image: url("/static/images/back.png") !important; }
.news_add       { background-image: url("/static/images/application_form_add.png") !important; }
.news_edit      { background-image: url(/static/images/libraryswitcher.png) !important; background-position: -352px -48px !important; }
.news_copy      { background-image: url("/static/images/copy.png") !important; }
.news_delete    { background-image: url("/static/images/tb_delete.png") !important; }
.news_preview   { background-image: url("/static/images/preview.png") !important; }
.clear_grid_filter {
    background-image: url("/static/images/tb_clear_filter.png") !important;
}

.x-grid-empty {
    text-align: center;
}

.no_news {
    color: black;
    font-size: 12pt;
}

.news_title_highlight {
    font-weight: bold;
}

.news_title_normal {
    font-weight: normal;
}

/* Unread news call-out box (legacy) */
.news_count {
    float: left;
    margin: -14px -16px 0px 0px;
    position: relative;
}
.news_count_mid {
    display: block;
    float: left;
    background: url(/static/images/news_count_mid.png) repeat-x;
    height: 16px;
    line-height: 12px;
    color: white;
}
.news_count_right {
    display: block;
    float: left;
    background: url(/static/images/news_count_right.png) no-repeat;
    width: 7px;
    height: 16px;
}

/* =============================================================================
   News dialog — news-specific tweaks only
   (chrome / header / toolbar / grid / pagination come from universal theme)
   ============================================================================= */

/* Priority column icons — SVG replacement for the legacy GIF sprites.
   Matches the urgency colour vocabulary (red=critical, amber=important). */
.news-priority-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-size: 16px 16px;
    background-position: center;
    background-repeat: no-repeat;
    vertical-align: middle;
}

.news-priority-critical {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23cf3030' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
}

.news-priority-important {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}

/* Row expander body — article HTML container */
.news-dialog .news_body {
    padding: 14px 18px;
    border: 1px solid #e2e6ec;
    border-radius: 6px;
    background: #fafbfc;
    line-height: 1.5;
    color: #1c2127;
    margin: 6px 10px 10px;
}

/* Clear Filters toolbar button → ext-acs-theme.css (global) */

/* -- Pagination page-number input: fix digit crop ------------------------------
   Default ExtJS sizing (1px 4px padding, auto width) crops the "1" in some
   dialog contexts. Give it a minimum width and centered text. */
.news-dialog .x-tbar-page-number {
    width: 34px !important;
    min-width: 34px !important;
    padding: 3px 6px !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

/* -- Grid right-edge fix ------------------------------------------------------
   ExtJS sometimes sets inner-table inline widths wider than the viewport, which
   crops the last column. Force the grid viewport/scroller to fit the panel
   exactly so the Posted column renders its full width. */
.news-dialog .x-grid3,
.news-dialog .x-grid3-viewport,
.news-dialog .x-grid3-scroller,
.news-dialog .x-grid3-header,
.news-dialog .x-grid3-body {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* -- Dialog body / panel body: stretch to full width, no outer scroll ---------
   ExtJS sets inline width + overflow:auto on .x-window-body which (a) leaves a
   visible right gap and (b) puts the scroll outside the grid. We want the grid
   itself to own the scroll so the header/toolbar stay pinned. */
.news-dialog .x-window-body,
.news-dialog .x-panel-body {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* -- Top toolbar & panel body: restore border-right and full width ------------
   The startpage theme sets `border-right: none !important` on
   `.x-panel-body.x-panel-body-noheader, .x-panel-tbar.x-panel-tbar-noheader,
   .x-toolbar.x-small-editor` (see ext-acs-startpage.css § "Removing Panel
   Borders"). The `.news-dialog` wrapper class here adds an extra class to
   the selector chain (specificity 0,3,0 vs the page-wide rule's 0,2,0)
   so these rules win outright on news-dialog scope. Phase 4 of
   THEME_REVIEW.md §4.3 stripped the historical `body.acs-startpage`
   specificity bump (which previously gave 0,4,1 vs the gated page-wide
   rule's 0,3,1); the rules below continue to win on selector specificity
   alone, which is why removing the gate was safe. */
/* Parent wrapper — full width, no border (the child .x-toolbar owns it) */
.news-dialog .x-panel-tbar,
.news-dialog .x-panel-tbar.x-panel-tbar-noheader {
    width: 100% !important;
    box-sizing: border-box !important;
    border-right: none !important;
}

/* Inner toolbar (top tbar only) — full width + visible right border.
   Excludes .x-panel-bbar which has no right border by design. */
.news-dialog .x-panel-tbar .x-toolbar,
.news-dialog .x-panel-tbar .x-toolbar.x-small-editor {
    width: 100% !important;
    box-sizing: border-box !important;
    border-right: 1px solid #aeb6be !important;
}

.x-window.news-dialog .x-panel-body,
.x-window.news-dialog .x-panel-body.x-panel-body-noheader {
    width: 100% !important;
    box-sizing: border-box !important;
    border: 1px solid #aeb6be !important;
    border-top: none !important;
}

/* -- Toolbar buttons — flat themed look, matching startpage toolbar buttons.
   Scoped to .x-window.news-dialog so we don't restyle toolbar buttons on
   pages (e.g. note_summary_report) that the news dialog overlays. */
.x-window.news-dialog .x-toolbar .x-btn:not(.toggleButtons):not(.x-btn-icon) .x-btn-tl,
.x-window.news-dialog .x-toolbar .x-btn:not(.toggleButtons):not(.x-btn-icon) .x-btn-tc,
.x-window.news-dialog .x-toolbar .x-btn:not(.toggleButtons):not(.x-btn-icon) .x-btn-tr,
.x-window.news-dialog .x-toolbar .x-btn:not(.toggleButtons):not(.x-btn-icon) .x-btn-bl,
.x-window.news-dialog .x-toolbar .x-btn:not(.toggleButtons):not(.x-btn-icon) .x-btn-bc,
.x-window.news-dialog .x-toolbar .x-btn:not(.toggleButtons):not(.x-btn-icon) .x-btn-br,
.x-window.news-dialog .x-toolbar .x-btn:not(.toggleButtons):not(.x-btn-icon) .x-btn-ml,
.x-window.news-dialog .x-toolbar .x-btn:not(.toggleButtons):not(.x-btn-icon) .x-btn-mr {
    display: none !important;
}

.x-window.news-dialog .x-toolbar .x-btn:not(.toggleButtons):not(.x-btn-icon) .x-btn-mc {
    background-image: none !important;
    padding: 0 !important;
}

.x-window.news-dialog .x-toolbar .x-btn:not(.toggleButtons):not(.x-btn-icon) {
    border: none !important;
    background: transparent !important;
    background-image: none !important;
    border-radius: 4px !important;
    transition: background-color 0.15s !important;
}

.x-window.news-dialog .x-toolbar .x-btn:not(.toggleButtons):not(.x-btn-icon) button.x-btn-text {
    box-sizing: border-box !important;
    height: auto !important;
    padding: 6px 12px !important;
    line-height: 1.2 !important;
    color: #5a6370 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.x-window.news-dialog .x-toolbar .x-btn:not(.toggleButtons):not(.x-btn-icon).x-btn-over {
    background-color: #F6F8FB !important;
}

.x-window.news-dialog .x-toolbar .x-btn:not(.toggleButtons):not(.x-btn-icon).x-btn-over button.x-btn-text {
    color: #00aeef !important;
}
