/* COMMUNITY: private support requests (blog), blog post form fields, home announcement ticker (views/site/_ticker.php).
 * Theme variables from nb.css only; sharp corners. */

/* ------------------------------------------------------------ blog: chips and form */
.nb-chip.bl-private {
	gap: 4px; font-size: 11.5px; padding: 1px 8px;
	background: color-mix(in oklab, var(--warning) 14%, transparent); color: var(--foreground);
	border: 1px solid color-mix(in oklab, var(--warning) 45%, transparent);
}
.nb-chip.bl-private svg { color: var(--warning); }
.nb-chip.bl-ticker-chip { font-size: 11.5px; padding: 1px 8px; gap: 4px; }

.cm-private-field, .cm-ticker-field { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-solid); }
.cm-private-field[hidden] { display: none; }
.cm-private-field.is-locked { border-color: color-mix(in oklab, var(--warning) 45%, var(--border)); background: color-mix(in oklab, var(--warning) 6%, var(--card-solid)); }
.cm-private-locked { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 0; }
.cm-private-locked small { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.5; }
.cm-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; cursor: pointer; font-weight: 400; }
.cm-check input[type="checkbox"] { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--primary); }
.cm-check > span { display: grid; gap: 3px; min-width: 0; }
.cm-check b { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 650; color: var(--foreground); }
.cm-check small { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.5; }
.cm-ticker-field { display: grid; gap: 12px; min-width: 0; margin: 0; }
.cm-ticker-field legend {
	display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 0; padding: 0 6px; border: 0;
	font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); line-height: 1.4;
}
.cm-ticker-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.cm-ticker-grid input[type="text"] { width: 100%; max-width: none; height: 40px; margin: 0; box-sizing: border-box; }
@media (max-width: 640px) { .cm-ticker-grid { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------ home announcement ticker */
.nb-ticker {
	--nb-ticker-h: 40px;
	position: relative; display: flex; align-items: stretch; min-width: 0; max-width: 100%; height: var(--nb-ticker-h);
	margin: 0 0 22px; overflow: hidden; box-sizing: border-box;
	border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
}
.nb-ticker[hidden] { display: none; }
.nb-ticker-label {
	flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px;
	background: var(--primary); color: var(--primary-foreground);
	font-size: 11.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.nb-ticker-label:hover, .nb-ticker-label:focus-visible { color: var(--primary-foreground); text-decoration: none; filter: brightness(1.12); }
.nb-ticker-viewport {
	position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 32px), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 32px), transparent 100%);
}
.nb-ticker-track {
	display: flex; width: max-content; height: 100%;
	animation: nb-ticker-scroll var(--nb-ticker-dur, 40s) linear infinite;
	will-change: transform;
}
/* both copies of the list are identical (a separator after every item) so the -50% loop is seamless */
.nb-ticker-list { flex: none; display: flex; align-items: center; margin: 0; padding: 0; list-style: none; height: 100%; }
.nb-ticker-li { display: flex; align-items: center; height: 100%; white-space: nowrap; }
.nb-ticker-li::after {
	content: ""; flex: none; width: 5px; height: 5px; margin: 0 20px; border-radius: 1px; background: var(--muted-foreground); opacity: .55; transform: rotate(45deg);
}
.nb-ticker-item {
	display: inline-flex; align-items: center; height: 100%; color: var(--foreground);
	font-size: 13.5px; font-weight: 550; line-height: 1; text-decoration: none; white-space: nowrap;
}
.nb-ticker-item:hover { color: var(--link, var(--foreground)); text-decoration: underline; text-underline-offset: 3px; }
.nb-ticker-item:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; border-radius: var(--radius-sm); }
.nb-ticker:hover .nb-ticker-track, .nb-ticker:focus-within .nb-ticker-track, .nb-ticker.is-paused .nb-ticker-track { animation-play-state: paused; }
/* shift = width of one copy of the list (ticker.js adds copies so the line is always full); 50% = the two server copies */
@keyframes nb-ticker-scroll { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(calc(-1 * var(--nb-ticker-shift, 50%)), 0, 0); } }

.nb-ticker-ctrl { flex: none; display: flex; align-items: center; gap: 2px; padding: 0 4px; border-left: 1px solid var(--border); background: var(--card); }
.nb-ticker-btn {
	display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: var(--radius-sm);
	background: transparent; color: var(--muted-foreground); cursor: pointer;
}
.nb-ticker-btn[hidden] { display: none; }
.nb-ticker-btn:hover { background: var(--accent); color: var(--foreground); }
.nb-ticker-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.nb-ticker-pause svg + svg { display: none; }
.nb-ticker.is-paused .nb-ticker-pause svg { display: none; }
.nb-ticker.is-paused .nb-ticker-pause svg + svg { display: block; }


/* reduced motion (set by ticker.js; the media query also covers no-JS): one announcement at a time, arrows */
@media (prefers-reduced-motion: reduce) {
	.nb-ticker-track { animation: none; }
	.nb-ticker-pause { display: none; }
}
.nb-ticker.is-stepper .nb-ticker-track { animation: none; width: 100%; }
.nb-ticker.is-stepper .nb-ticker-list[aria-hidden] { display: none; }
.nb-ticker.is-stepper .nb-ticker-list { width: 100%; padding-left: 14px; }
.nb-ticker.is-stepper .nb-ticker-li { display: none; min-width: 0; }
.nb-ticker.is-stepper .nb-ticker-li.is-current { display: flex; width: 100%; animation: nb-ticker-fade .25s ease-out; }
.nb-ticker.is-stepper .nb-ticker-li::after { display: none; }
.nb-ticker.is-stepper .nb-ticker-item { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: calc(var(--nb-ticker-h) - 2px); }
.nb-ticker.is-stepper .nb-ticker-viewport { -webkit-mask-image: none; mask-image: none; }
@keyframes nb-ticker-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nb-ticker.is-stepper .nb-ticker-li.is-current { animation: none; } }

@media (max-width: 640px) {
	.nb-ticker { --nb-ticker-h: 38px; margin-bottom: 16px; }
	.nb-ticker-label { padding: 0 10px; }
	.nb-ticker-label span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.nb-ticker-item { font-size: 13px; }
	.nb-ticker-btn { width: 28px; }
}

/* touch: the ticker line is 40 px tall and its pause / close / arrow buttons are 36 px squares (were 28 x 30) */
@media (max-width: 760px), (pointer: coarse) {
	.nb-ticker { --nb-ticker-h: 42px; }
	.nb-ticker-ctrl { gap: 0; padding: 0 2px; }
	.nb-ticker-btn { width: 36px; height: 36px; }
	.nb-ticker-label { min-width: 40px; justify-content: center; box-sizing: border-box; }
}
