/* A finite set of semantic editor attributes, shared by writing and reading. */
:is(.news-article .story-body,.tiptap) [data-align=left]{text-align:left}:is(.news-article .story-body,.tiptap) [data-align=center]{text-align:center}:is(.news-article .story-body,.tiptap) [data-align=right]{text-align:right}:is(.news-article .story-body,.tiptap) [data-align=justify]{text-align:justify}
:is(.news-article .story-body,.tiptap) [data-indent="1"]{margin-inline-start:1.5em}:is(.news-article .story-body,.tiptap) [data-indent="2"]{margin-inline-start:3em}:is(.news-article .story-body,.tiptap) [data-indent="3"]{margin-inline-start:4.5em}:is(.news-article .story-body,.tiptap) [data-indent="4"]{margin-inline-start:6em}
:is(.news-article .story-body,.tiptap) [data-color=red]{color:#a51832}:is(.news-article .story-body,.tiptap) [data-color=navy]{color:#192b4a}:is(.news-article .story-body,.tiptap) [data-color=blue]{color:#1d4f91}:is(.news-article .story-body,.tiptap) [data-color=green]{color:#227156}:is(.news-article .story-body,.tiptap) [data-color=gray]{color:#5d6877}
:is(.news-article .story-body,.tiptap) [data-highlight=yellow]{background:#fff0a0}:is(.news-article .story-body,.tiptap) [data-highlight=mint]{background:#d9f1df}:is(.news-article .story-body,.tiptap) [data-highlight=blue]{background:#e0edfc}
:is(.news-article .story-body,.tiptap) pre{white-space:pre-wrap;overflow-wrap:anywhere;overflow:auto;max-width:100%;padding:16px;background:#f4f6fa;border:1px solid #dfe5ee;font:14px/1.7 ui-monospace,monospace}:is(.news-article .story-body,.tiptap) code{font-family:ui-monospace,monospace;font-size:.88em}:is(.news-article .story-body,.tiptap) hr{border:0;border-top:1px solid #cfd8e5;margin:28px 0}.news-article .story-body :is(h5,h6){font-family:inherit;font-size:1em;font-weight:750;line-height:1.5;margin:1.5em 0 .6em}
.editor-advanced-formatting{position:relative}.editor-advanced-formatting>summary{cursor:pointer;font-size:13px;padding:8px;border:1px solid #dbe3ee;border-radius:4px;min-height:36px;color:#435d7d;list-style:none}.editor-advanced-formatting>summary::-webkit-details-marker{display:none}.editor-advanced-panel{display:flex;flex-wrap:wrap;gap:8px;padding:15px;background:#f8fafd;border:1px solid #dfe6ef;margin-top:8px;max-width:100%}.editor-advanced-formatting:not([open])>.editor-advanced-panel{display:none}.editor-advanced-panel label{display:grid;gap:5px}.editor-advanced-panel>p{flex-basis:100%;font-size:12px;color:#6e7d91;line-height:1.7;margin:4px 0}.editor-find-dialog{width:min(520px,calc(100vw - 32px));max-height:85dvh;overflow:auto;border:1px solid #dce4ef;border-radius:9px;padding:24px;color:#263d5d;background:#fff}.editor-find-dialog::backdrop{background:#17284466}.editor-find-dialog label{display:grid;gap:7px;margin:14px 0}.editor-find-dialog :is(input,textarea){width:100%;font:inherit;padding:10px;border:1px solid #cad5e4;border-radius:4px}.editor-find-dialog textarea{min-height:180px}.editor-find-dialog button{margin:5px;padding:8px 12px}.scoped-workspace:lang(ne) .editor-advanced-formatting>summary{font-size:17px}.scoped-workspace:lang(ne) .editor-advanced-panel>p{font-size:16px}
@media(max-width:700px){.editor-advanced-panel{gap:6px;padding:10px}.editor-find-dialog{padding:18px}.editor-find-dialog button{min-height:40px}}
/* Upload feedback stays in normal flow and never covers the writing canvas. */
.editor-upload-list:empty{display:none}.editor-upload-list{display:grid;gap:8px;padding:12px;min-width:0}.editor-upload-list>div{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px;border:1px solid #dce4ec;border-radius:8px;background:#f7f9fc}.editor-upload-list span{flex:1 1 220px;min-width:0;overflow-wrap:anywhere;font-size:13px}.editor-upload-list button{min-height:40px}.editor-inline-upload{display:grid;gap:8px;min-width:0;padding:12px}.editor-inline-upload input{max-width:100%;min-width:0}
.editor-upload-metadata{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;flex-basis:100%;min-width:0}.editor-upload-metadata label{display:grid;gap:4px;font-size:12px}.editor-upload-metadata input{width:100%;min-width:0}@media(max-width:600px){.editor-upload-metadata{grid-template-columns:minmax(0,1fr)}}
/* A gallery is semantic figures; it remains readable with JavaScript disabled. */
:is(.news-article .story-body,.tiptap) figure[data-gallery]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:28px 0;padding:0;min-width:0;width:100%}
:is(.news-article .story-body,.tiptap) figure[data-gallery=wide]{grid-template-columns:minmax(0,1fr)}
:is(.news-article .story-body,.tiptap) figure[data-gallery]>figure{margin:0;padding:0;min-width:0;width:100%}
:is(.news-article .story-body,.tiptap) figure[data-gallery] img{display:block;width:100%;max-width:100%;height:auto;object-fit:contain}
:is(.news-article .story-body,.tiptap) figure[data-gallery] figcaption{overflow-wrap:anywhere;text-align:start;font-size:.85em;line-height:1.65;margin:8px 0 0}
.editor-gallery-dialog{width:min(850px,calc(100vw - 24px));max-height:88dvh;overflow:auto;box-sizing:border-box;border:1px solid #d7e1ed;border-radius:12px;padding:22px;color:#213954;background:#fff}.editor-gallery-dialog::backdrop{background:#152b466b}.editor-gallery-dialog :is(input,select){max-width:100%;box-sizing:border-box;font:inherit;padding:9px;border:1px solid #ccd7e4;border-radius:5px}.editor-gallery-dialog>input{display:block;width:100%;margin:12px 0}.editor-gallery-dialog h2{font-size:22px;margin:0}.editor-gallery-dialog button{min-height:40px;white-space:normal;overflow-wrap:anywhere}.gallery-library{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0}.gallery-library button{min-width:0;display:grid;gap:6px;padding:7px;font-size:12px;text-align:start}.gallery-library button[aria-pressed=true]{outline:2px solid #2777bb}.gallery-library img{width:100%;height:84px;object-fit:contain;background:#edf2f7}.gallery-selection{padding:0;list-style:none;display:grid;gap:12px}.gallery-selection li{min-width:0;display:grid;gap:10px;padding:14px;border:1px solid #dce4ef;border-radius:8px}.gallery-selection strong{overflow-wrap:anywhere}.gallery-selection label{display:grid;gap:5px;font-size:13px}.gallery-selection input{width:100%;min-width:0}.gallery-order-controls,.gallery-actions{display:flex;flex-wrap:wrap;gap:8px}.gallery-actions{padding-top:14px;border-top:1px solid #e0e7ef}
@media(max-width:600px){:is(.news-article .story-body,.tiptap) figure[data-gallery]{grid-template-columns:minmax(0,1fr);gap:18px}.editor-gallery-dialog{padding:14px}.gallery-library{grid-template-columns:repeat(2,minmax(0,1fr))}}

.gallery-library{max-height:280px;overflow:auto;padding:3px;align-content:start}.gallery-library button span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.5}.gallery-actions{position:sticky;bottom:-22px;background:#fff;padding:14px 0}.gallery-actions button:first-child{background:#173d65;color:#fff;border:1px solid #173d65;padding:9px 16px;border-radius:6px}.gallery-actions button:disabled{opacity:.5}@media(max-width:600px){.gallery-library{max-height:230px}.gallery-actions{bottom:-14px}}

.gallery-photo-open{display:block;width:100%;padding:0;border:0;background:transparent;cursor:zoom-in}.gallery-photo-open:focus-visible{outline:3px solid #d71f41;outline-offset:4px}.reader-gallery{width:min(1050px,calc(100vw - 24px));max-height:94dvh;box-sizing:border-box;overflow:auto;padding:18px;border:0;border-radius:12px;color:#f5f7fb;background:#142039}.reader-gallery::backdrop{background:#070f20df}.reader-gallery>button{display:block;margin-left:auto}.reader-gallery button{font:inherit;min-height:44px;padding:9px 14px;border:1px solid #7a8aa5;border-radius:7px;background:#233450;color:white;cursor:pointer}.reader-gallery button:disabled{opacity:.4;cursor:default}.reader-gallery>img{display:block;max-width:100%;width:auto;max-height:68dvh;height:auto;object-fit:contain;margin:16px auto}.reader-gallery-controls{display:flex;align-items:center;justify-content:space-between;gap:12px}.reader-gallery-caption{line-height:1.7;overflow-wrap:anywhere}.reader-gallery-controls p{white-space:nowrap}@media(max-width:480px){.reader-gallery{padding:12px}.reader-gallery-controls{gap:7px;font-size:13px}}

html:has(.reader-gallery[open]){overflow:hidden;scrollbar-gutter:stable}

.news-article .story-body figure[data-gallery=slider]{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:0;overscroll-behavior-x:contain}.news-article .story-body figure[data-gallery=slider]>figure{flex:0 0 100%;scroll-snap-align:start;scroll-snap-stop:always}.gallery-slider-controls{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:-10px 0 28px;font-size:14px}.gallery-slider-controls button{font:inherit;padding:9px 14px;min-height:44px;background:#fff;border:1px solid #ced9e7;border-radius:7px;color:#203854}.gallery-slider-controls button:disabled{opacity:.45}.gallery-slider-controls span{white-space:nowrap}.story-body figure[data-gallery=slider]:focus-visible{outline:3px solid #cc2447;outline-offset:3px}

.photo-transform-dialog{width:min(780px,calc(100vw - 24px));max-height:92dvh;overflow:auto;box-sizing:border-box;border:1px solid #d7e1ed;border-radius:12px;padding:20px;color:#203650;background:#fff}.photo-transform-dialog::backdrop{background:#10233ac9}.photo-transform-dialog canvas{display:block;max-width:100%;max-height:45dvh;object-fit:contain;margin:16px auto;background:repeating-conic-gradient(#eee 0 25%,#fff 0 50%) 0 / 16px 16px}.photo-transform-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.photo-transform-fields label{min-width:0;display:grid;gap:5px}.photo-transform-fields input{width:100%;min-width:0;box-sizing:border-box}.photo-transform-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}.photo-transform-actions button{min-height:44px}.photo-transform-dialog h2{font-size:22px}@media(max-width:480px){.photo-transform-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.photo-transform-dialog{padding:14px}}

.editor-video-dialog{width:min(620px,calc(100vw - 24px));max-height:90dvh;overflow:auto;box-sizing:border-box;padding:22px;border:1px solid #ced9e7;border-radius:12px;background:#fff;color:#203650}.editor-video-dialog::backdrop{background:#152b46aa}.editor-video-dialog label{display:grid;gap:7px;margin:15px 0}.editor-video-dialog input{box-sizing:border-box;width:100%;min-width:0;font:inherit;padding:11px;border:1px solid #cbd6e4;border-radius:6px}.editor-video-dialog button{font:inherit;min-height:44px}.editor-video-dialog h2{font-size:23px}.editor-video-dialog [role=status]{color:#b21d36}.news-article .story-body iframe{display:block;width:100%;max-width:100%;height:auto;aspect-ratio:16/9;border:0;margin:26px 0}
