/*
 * ModBarn News Network articles: the latest-news strip and article list on Mods/News, the article page
 * (views/custom/mods/news/) and the editor's preview and toolbar in Admin > ModBarn > News Articles.
 * .mbn-prose is the text ModNews::render() makes.
 */
.mbn-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #fff; background: var(--mbn-color, #22c55e); text-decoration: none; white-space: nowrap; }
a.mbn-chip:hover { color: #fff; filter: brightness(1.1); }
.mbn-meta { font-size: .8rem; color: var(--bs-secondary-color); }

/* Latest news on Mods/News: one lead story and a short list. */
.mbn-latest { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; }
.mbn-lead { position: relative; display: block; min-height: 300px; border-radius: .6rem; overflow: hidden; background: #10151c; color: #fff; text-decoration: none; isolation: isolate; }
.mbn-lead img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .35s ease; }
.mbn-lead::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, .05) 25%, rgba(0, 0, 0, .88) 100%); }
.mbn-lead:hover { color: #fff; }
.mbn-lead:hover img { transform: scale(1.04); }
.mbn-lead__text { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.1rem; }
.mbn-lead__title { font-size: clamp(1.15rem, 2.2vw, 1.6rem); font-weight: 800; line-height: 1.2; margin: .5rem 0 .35rem; text-wrap: balance; }
.mbn-lead__sum { font-size: .9rem; opacity: .9; margin: 0 0 .4rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mbn-lead .mbn-meta { color: rgba(255, 255, 255, .75); }
.mbn-list { display: flex; flex-direction: column; gap: .5rem; }
.mbn-item { display: flex; gap: .75rem; align-items: center; padding: .45rem; border-radius: .5rem; border: 1px solid var(--bs-border-color); color: inherit; text-decoration: none; flex: 1; transition: border-color .15s, background .15s; }
.mbn-item:hover { border-color: var(--bs-success); background: rgba(255, 255, 255, .03); color: inherit; }
.mbn-item__img { flex: 0 0 112px; width: 112px; height: auto; aspect-ratio: 16 / 9; border-radius: .35rem; object-fit: cover; background: #10151c; display: flex; align-items: center; justify-content: center; color: var(--bs-secondary-color); font-size: 1.4rem; }
.mbn-item__title { font-weight: 700; line-height: 1.25; margin: .25rem 0 .1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 767.98px) {
  .mbn-latest { grid-template-columns: 1fr; }
  .mbn-lead { min-height: 220px; }
}

/* Article cards (the list page and "More news"). */
.mbn-card { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--bs-border-color); border-radius: .6rem; overflow: hidden; background: var(--bs-dark); color: inherit; text-decoration: none; transition: transform .15s, border-color .15s; }
.mbn-card:hover { transform: translateY(-2px); border-color: var(--bs-success); color: inherit; }
.mbn-card__img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #10151c; display: flex; align-items: center; justify-content: center; color: var(--bs-secondary-color); font-size: 2rem; }
.mbn-card__body { padding: .85rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.mbn-card__title { font-size: 1.05rem; font-weight: 700; line-height: 1.25; margin: 0; text-wrap: balance; }
.mbn-card__sum { font-size: .875rem; color: var(--bs-secondary-color); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mbn-card .mbn-meta { margin-top: auto; }

/* The article page. */
.mbn-article { max-width: 820px; margin: 0 auto; }
.mbn-article__title { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.15; margin: .75rem 0 .6rem; text-wrap: balance; }
.mbn-article__lead { font-size: 1.15rem; line-height: 1.55; color: var(--bs-secondary-color); margin-bottom: 1rem; }
.mbn-article__hero { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .6rem; margin: 1rem 0 1.5rem; }
.mbn-toc { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .85rem 1rem; margin-bottom: 1.5rem; }
.mbn-toc ol { margin: .4rem 0 0; padding-left: 1.2rem; }
.mbn-share { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.mbn-prose { font-size: 1.06rem; line-height: 1.7; overflow-wrap: anywhere; }
.mbn-prose h2 { font-size: 1.55rem; font-weight: 800; margin: 2rem 0 .75rem; scroll-margin-top: 5rem; }
.mbn-prose h3 { font-size: 1.25rem; font-weight: 700; margin: 1.6rem 0 .6rem; }
.mbn-prose h4 { font-size: 1.08rem; font-weight: 700; margin: 1.3rem 0 .5rem; }
.mbn-prose p { margin: 0 0 1.1rem; }
.mbn-prose ul, .mbn-prose ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
.mbn-prose li { margin-bottom: .3rem; }
.mbn-prose li > ul, .mbn-prose li > ol { margin: .3rem 0 0; }
.mbn-prose blockquote { border-left: 4px solid var(--bs-success); margin: 0 0 1.1rem; padding: .5rem 0 .5rem 1rem; color: var(--bs-secondary-color); }
.mbn-prose blockquote p:last-child { margin-bottom: 0; }
.mbn-prose code { background: rgba(255, 255, 255, .08); border-radius: 4px; padding: .1rem .35rem; color: inherit; font-size: .9em; }
.mbn-prose pre { background: #0d1117; border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .85rem 1rem; overflow-x: auto; margin: 0 0 1.1rem; }
.mbn-prose pre code { background: none; padding: 0; }
.mbn-prose a { text-decoration: underline; text-underline-offset: 2px; }
.mbn-prose .ms-subtext { font-size: .82rem; color: var(--bs-secondary-color); margin: -.6rem 0 1.1rem; }
.mbn-prose .ms-spoiler { background: var(--bs-body-color); color: transparent; border-radius: 3px; cursor: pointer; }
.mbn-prose .ms-spoiler * { visibility: hidden; }
.mbn-prose .ms-spoiler.is-shown, .mbn-prose .ms-spoiler:focus-visible { background: rgba(255, 255, 255, .1); color: inherit; cursor: auto; }
.mbn-prose .ms-spoiler.is-shown *, .mbn-prose .ms-spoiler:focus-visible * { visibility: visible; }
.mbn-figure { margin: 0 0 1.1rem; }
.mbn-figure img { max-width: 100%; height: auto; border-radius: .5rem; display: block; margin: 0 auto; }
.mbn-video { margin: 0 0 1.1rem; }

/* The editor. */
.mbn-toolbar { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; padding: .35rem; border: 1px solid var(--bs-border-color); border-bottom: 0; border-radius: .375rem .375rem 0 0; background: rgba(255, 255, 255, .03); position: sticky; top: 0; z-index: 2; }
.mbn-toolbar__gap { width: 1px; align-self: stretch; background: var(--bs-border-color); margin: 0 .25rem; }
.mbn-editor { border-radius: 0 0 .375rem .375rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem; line-height: 1.6; resize: vertical; min-height: 320px; }
.mbn-editor.is-drop { border-color: var(--bs-success); box-shadow: 0 0 0 .25rem rgba(25, 135, 84, .25); }
.mbn-serp { background: #fff; color: #4d5156; border-radius: .5rem; padding: .75rem .9rem; font-family: Arial, sans-serif; overflow-wrap: anywhere; }
.mbn-serp__url { font-size: .75rem; color: #202124; }
.mbn-serp__title { font-size: 1.1rem; color: #1a0dab; line-height: 1.3; margin: .15rem 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mbn-serp__text { font-size: .82rem; line-height: 1.45; }

@media (prefers-reduced-motion: reduce) {
  .mbn-lead img, .mbn-card { transition: none; }
  .mbn-lead:hover img, .mbn-card:hover { transform: none; }
}
