/* AviationStream Hub – frontend. Override the variables in your theme's Additional CSS to match branding. */
.avsh-app, .avsh-ticker, .avsh-latest, .avsh-submit {
	--avsh-bg: #ffffff;
	--avsh-surface: #f6f8fb;
	--avsh-border: #e3e8ef;
	--avsh-text: #0f1b2d;
	--avsh-muted: #5d6b82;
	--avsh-accent: #0a5bd3;
	--avsh-live: #e5372b;
	--avsh-radius: 12px;
	--avsh-news: #0a5bd3;
	--avsh-press: #6b3fd4;
	--avsh-regulator: #0e7c86;
	--avsh-ad: #c92a2a;
	--avsh-nprm: #d9480f;
	--avsh-sb: #1c7c3c;
	--avsh-sl: #2b8a3e;
	--avsh-manual: #1864ab;
	--avsh-safety: #b7791f;
	font-family: inherit;
	color: var(--avsh-text);
	box-sizing: border-box;
}
.avsh-app *, .avsh-ticker *, .avsh-latest *, .avsh-submit * { box-sizing: border-box; }
.avsh-app [hidden] { display: none !important; }

/* ---------- Live dot ---------- */
.avsh-live-dot {
	display: inline-block; width: 9px; height: 9px; border-radius: 50%;
	background: var(--avsh-live); position: relative; flex: none;
}
.avsh-live-dot::after {
	content: ""; position: absolute; inset: -4px; border-radius: 50%;
	border: 2px solid var(--avsh-live); opacity: 0; animation: avsh-pulse 1.8s ease-out infinite;
}
@keyframes avsh-pulse { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- App ---------- */
.avsh-app { background: var(--avsh-bg); max-width: 960px; margin: 0 auto 2rem; }
.avsh-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.avsh-head-title { display: flex; align-items: center; gap: 10px; }
.avsh-head h2 { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.avsh-head-meta { color: var(--avsh-muted); font-size: .85rem; }

.avsh-toolbar {
	position: sticky; top: 0; z-index: 5; background: var(--avsh-bg);
	padding: 8px 0 10px; border-bottom: 1px solid var(--avsh-border); margin-bottom: 12px;
}
.admin-bar .avsh-toolbar { top: 32px; }
.avsh-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.avsh-tabs::-webkit-scrollbar { display: none; }
.avsh-tab {
	border: 1px solid var(--avsh-border); background: var(--avsh-surface); color: var(--avsh-text);
	padding: 7px 14px; border-radius: 999px; font-size: .9rem; cursor: pointer; white-space: nowrap; line-height: 1.2;
}
.avsh-tab:hover { border-color: var(--avsh-accent); }
.avsh-tab.is-active { background: var(--avsh-text); color: #fff; border-color: var(--avsh-text); }

.avsh-controls { display: flex; gap: 8px; margin-top: 6px; }
.avsh-search, .avsh-maker {
	border: 1px solid var(--avsh-border); border-radius: 8px; padding: 8px 12px; font-size: .95rem;
	background: #fff; color: var(--avsh-text); min-height: 40px;
}
.avsh-search { flex: 1 1 auto; min-width: 0; }
.avsh-maker { flex: 0 0 220px; max-width: 45%; }

.avsh-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.avsh-chip {
	border: 1px dashed var(--avsh-border); background: transparent; color: var(--avsh-muted);
	padding: 3px 10px; border-radius: 999px; font-size: .8rem; cursor: pointer; line-height: 1.4;
}
.avsh-chip.is-active { border-style: solid; border-color: var(--avsh-accent); color: var(--avsh-accent); background: rgba(10, 91, 211, .07); }

.avsh-newbar {
	display: block; width: 100%; margin: 0 0 10px; padding: 9px; border: 0; border-radius: 8px; cursor: pointer;
	background: var(--avsh-accent); color: #fff; font-weight: 600; font-size: .9rem;
}

.avsh-list { display: flex; flex-direction: column; gap: 10px; transition: opacity .2s; }
.avsh-app.is-busy .avsh-list { opacity: .55; }

/* ---------- Card ---------- */
.avsh-card {
	display: flex; gap: 12px; padding: 14px 16px; background: var(--avsh-bg);
	border: 1px solid var(--avsh-border); border-radius: var(--avsh-radius); border-left: 4px solid var(--avsh-news);
}
.avsh-card:hover { box-shadow: 0 2px 12px rgba(15, 27, 45, .07); }
.avsh-card.is-new { animation: avsh-flash 2.5s ease-out; }
@keyframes avsh-flash { 0% { background: #fff6d6; } 100% { background: var(--avsh-bg); } }
.avsh-card.is-featured { background: #fffdf3; }
.avsh-card.is-archived { opacity: .85; }
.avsh-type-press { border-left-color: var(--avsh-press); }
.avsh-type-regulator { border-left-color: var(--avsh-regulator); }
.avsh-type-ad { border-left-color: var(--avsh-ad); }
.avsh-type-nprm { border-left-color: var(--avsh-nprm); }
.avsh-type-sb { border-left-color: var(--avsh-sb); }
.avsh-type-sl { border-left-color: var(--avsh-sl); }
.avsh-type-manual { border-left-color: var(--avsh-manual); }
.avsh-type-safety { border-left-color: var(--avsh-safety); }

.avsh-card-side { flex: none; }
.avsh-icon {
	display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
	border-radius: 10px; background: var(--avsh-surface); font-size: 18px;
}
.avsh-card-body { flex: 1 1 auto; min-width: 0; }
.avsh-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .78rem; color: var(--avsh-muted); }
.avsh-src { font-weight: 600; color: var(--avsh-text); }
.avsh-time::before { content: "·"; margin-right: 6px; color: var(--avsh-muted); }

.avsh-badge {
	display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .7rem; font-weight: 700;
	letter-spacing: .02em; text-transform: uppercase; color: #fff; background: var(--avsh-news); line-height: 1.5;
}
.avsh-t-press { background: var(--avsh-press); }
.avsh-t-regulator { background: var(--avsh-regulator); }
.avsh-t-ad { background: var(--avsh-ad); }
.avsh-t-nprm { background: var(--avsh-nprm); }
.avsh-t-sb { background: var(--avsh-sb); }
.avsh-t-sl { background: var(--avsh-sl); }
.avsh-t-manual { background: var(--avsh-manual); }
.avsh-t-safety { background: var(--avsh-safety); }
.avsh-badge-soft { background: var(--avsh-surface); color: var(--avsh-text); border: 1px solid var(--avsh-border); }
.avsh-badge-warn { background: #fff3bf; color: #7a5b00; }
.avsh-badge-pin { background: #ffe066; color: #5c4400; }

.avsh-title { margin: 6px 0 4px; font-size: 1.05rem; line-height: 1.35; font-weight: 700; }
.avsh-title a { color: var(--avsh-text); text-decoration: none; }
.avsh-title a:hover { color: var(--avsh-accent); text-decoration: underline; }
.avsh-excerpt {
	margin: 0 0 6px; color: var(--avsh-muted); font-size: .92rem; line-height: 1.5;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.avsh-facts {
	display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 6px 0;
	font-size: .85rem; background: var(--avsh-surface); padding: 8px 10px; border-radius: 8px;
}
.avsh-facts dt { color: var(--avsh-muted); font-weight: 600; margin: 0; }
.avsh-facts dd { margin: 0; word-break: break-word; }

.avsh-refs { margin: 6px 0; font-size: .85rem; }
.avsh-refs-toggle {
	background: none; border: 0; padding: 0; color: var(--avsh-accent); cursor: pointer; font-size: .85rem; font-weight: 600;
}
.avsh-refs-toggle::before { content: "▸ "; }
.avsh-refs-toggle[aria-expanded="true"]::before { content: "▾ "; }
.avsh-refs-list { margin: 6px 0 6px 18px; padding: 0; }
.avsh-refs-list li { margin: 2px 0; }
.avsh-mandated { margin: 4px 0; }
.avsh-mandated a { color: var(--avsh-ad); font-weight: 600; }
.avsh-portal {
	display: inline-block; margin-top: 4px; padding: 5px 12px; border-radius: 6px; font-weight: 600; font-size: .82rem;
	background: var(--avsh-text); color: #fff !important; text-decoration: none;
}
.avsh-portal:hover { opacity: .9; }

.avsh-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; align-items: center; }
.avsh-tag { font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: var(--avsh-surface); color: var(--avsh-muted); border: 1px solid var(--avsh-border); }
.avsh-tag-maker { color: var(--avsh-text); font-weight: 600; }
.avsh-host { font-size: .72rem; color: var(--avsh-muted); margin-left: auto; }

.avsh-empty { text-align: center; color: var(--avsh-muted); padding: 30px 0; }
.avsh-foot { text-align: center; margin: 16px 0; }
.avsh-more, .avsh-btn {
	border: 1px solid var(--avsh-border); background: var(--avsh-surface); color: var(--avsh-text);
	padding: 10px 22px; border-radius: 8px; cursor: pointer; font-weight: 600;
}
.avsh-btn { background: var(--avsh-accent); color: #fff; border-color: var(--avsh-accent); }
.avsh-loading { color: var(--avsh-muted); margin-left: 8px; }
.avsh-disclaimer { font-size: .78rem; color: var(--avsh-muted); border-top: 1px solid var(--avsh-border); padding-top: 10px; margin-top: 10px; }

/* ---------- Ticker ---------- */
.avsh-ticker {
	display: flex; align-items: center; background: #0f1b2d; color: #fff; border-radius: 8px;
	overflow: hidden; font-size: .9rem; min-height: 42px;
}
.avsh-tk-label {
	display: flex; align-items: center; gap: 8px; padding: 0 14px; font-weight: 800; letter-spacing: .08em;
	background: var(--avsh-live); align-self: stretch; flex: none; font-size: .8rem;
}
.avsh-tk-label .avsh-live-dot { background: #fff; }
.avsh-tk-label .avsh-live-dot::after { border-color: #fff; }
.avsh-tk-viewport { overflow: hidden; flex: 1 1 auto; position: relative; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.avsh-tk-track { display: inline-flex; white-space: nowrap; animation: avsh-scroll linear infinite; will-change: transform; }
.avsh-ticker:hover .avsh-tk-track { animation-play-state: paused; }
@keyframes avsh-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.avsh-tk-item { color: #fff !important; text-decoration: none; padding: 10px 22px; display: inline-flex; align-items: center; gap: 8px; border-right: 1px solid rgba(255, 255, 255, .15); }
.avsh-tk-item:hover { text-decoration: underline; }
.avsh-tk-src { color: #9fb0c8; font-size: .78rem; }
.avsh-tk-more { flex: none; color: #fff !important; padding: 0 14px; font-weight: 700; text-decoration: none; font-size: .82rem; }
@media (prefers-reduced-motion: reduce) {
	.avsh-tk-track { animation: none; }
	.avsh-tk-viewport { overflow-x: auto; }
	.avsh-live-dot::after { animation: none; }
}

/* ---------- Latest list ---------- */
.avsh-latest { border: 1px solid var(--avsh-border); border-radius: var(--avsh-radius); padding: 14px 16px; background: var(--avsh-bg); }
.avsh-latest-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1.05rem; }
.avsh-latest ul { list-style: none; margin: 0; padding: 0; }
.avsh-latest li { padding: 8px 0; border-bottom: 1px solid var(--avsh-border); line-height: 1.4; }
.avsh-latest li:last-child { border-bottom: 0; }
.avsh-latest li .avsh-badge { margin-right: 6px; vertical-align: 1px; }
.avsh-latest li a { color: var(--avsh-text); font-weight: 600; text-decoration: none; }
.avsh-latest li a:hover { color: var(--avsh-accent); }
.avsh-latest li small { display: block; color: var(--avsh-muted); font-size: .76rem; margin-top: 2px; }
.avsh-latest-more { display: inline-block; margin-top: 8px; font-weight: 700; color: var(--avsh-accent); text-decoration: none; }

/* ---------- Submission form ---------- */
.avsh-submit { max-width: 760px; }
.avsh-form-table { width: 100%; border-collapse: collapse; border: 0; }
.avsh-form-table th, .avsh-form-table td { border: 0; padding: 6px 0; vertical-align: top; text-align: left; }
.avsh-form-table th { width: 32%; padding-right: 12px; font-weight: 600; font-size: .9rem; }
.avsh-f, .avsh-submit select, .avsh-submit input[type="date"] {
	width: 100%; border: 1px solid var(--avsh-border); border-radius: 8px; padding: 8px 10px; font-size: .95rem;
}
.avsh-hp { position: absolute !important; left: -9999px !important; height: 1px; overflow: hidden; }
.avsh-note { padding: 10px 14px; border-radius: 8px; background: #f1f3f5; margin-bottom: 12px; }
.avsh-note.avsh-ok { background: #e6fcf5; color: #0b7255; }
.avsh-note.avsh-err { background: #fff5f5; color: #c92a2a; }
.avsh-intro { color: #5d6b82; }

/* ---------- Aggregated news: source branding + publisher thumbnail ---------- */
.avsh-stream-intro { margin: 0 0 12px; padding: 12px 14px; background: var(--avsh-surface); border: 1px solid var(--avsh-border); border-radius: 10px; font-size: .9rem; color: var(--avsh-text); }
.avsh-stream-intro p { margin: 0; }
.avsh-pubs { margin-top: 6px; }
.avsh-pubs summary { cursor: pointer; color: var(--avsh-accent); font-weight: 600; font-size: .85rem; }
.avsh-pubs ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; }
.avsh-pubs a { color: var(--avsh-muted); }

.avsh-card.avsh-news { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.avsh-card.avsh-news.has-thumb { grid-template-columns: minmax(0, 1fr) 190px; }
.avsh-srcmark { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: var(--avsh-text); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .02em; flex: none; overflow: hidden; }
.avsh-srcmark img { position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; object-fit: contain; opacity: 0; }
.avsh-srcmark.has-img { background: #fff; border: 1px solid var(--avsh-border); }
.avsh-srcmark.has-img img { opacity: 1; }
.avsh-srcmark.has-img .avsh-srcmark-t { visibility: hidden; }
.avsh-news .avsh-src { font-size: .82rem; }
.avsh-thumb { display: block; align-self: start; border-radius: 8px; overflow: hidden; background: var(--avsh-surface); aspect-ratio: 16 / 10; }
.avsh-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.avsh-news:hover .avsh-thumb img { transform: scale(1.03); }
.avsh-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.avsh-card-foot .avsh-tags { margin-top: 0; }
.avsh-readon { font-size: .82rem; font-weight: 700; color: var(--avsh-accent) !important; text-decoration: none; white-space: nowrap; }
.avsh-readon:hover { text-decoration: underline; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
	.avsh-card.avsh-news.has-thumb { grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; }
	.avsh-news .avsh-excerpt { -webkit-line-clamp: 2; }
	.avsh-card-foot .avsh-tags { display: none; }
	.avsh-card { padding: 12px; gap: 10px; }
	.avsh-card-side { display: none; }
	.avsh-controls { flex-direction: column; }
	.avsh-maker { flex: none; max-width: none; width: 100%; }
	.avsh-head h2 { font-size: 1.25rem; }
	.avsh-host { margin-left: 0; }
	.avsh-form-table th, .avsh-form-table td { display: block; width: 100%; }
	.avsh-tk-more { display: none; }
	.admin-bar .avsh-toolbar { top: 0; }
}
