/* Data Charts cards (core/DataCharts.php). Works on public pages and in the admin preview. */
.dc-list { display: grid; gap: 18px; }
.dc-list--home { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); margin: 0 0 32px; }
.dc-card { --dc-blue: #1d3f7a; background: var(--np-surface, #fff); color: var(--np-text, #212529); border: 1px solid var(--np-line, #e5e7eb); border-radius: 4px; padding: 18px 18px 12px; box-shadow: var(--np-shadow-sm, 0 1px 2px rgba(0,0,0,.04)); min-width: 0; font-size: 15px; }
[data-bs-theme="dark"] .dc-card { --dc-blue: #8fb4ff; }
.dc-card__title { font-size: 1.15rem; line-height: 1.25; font-weight: 700; color: var(--dc-blue) !important; margin: 0; text-transform: none !important; }
.dc-card__brand { font-weight: 700; opacity: .85; white-space: nowrap; }
.dc-card__refreshed { margin-top: 8px; font-size: .85rem; color: var(--np-muted, #6b7280); }
.dc-card__refreshed time { color: var(--dc-blue); }
.dc-card__sub { margin: 16px 0 4px; font-size: .95rem; font-weight: 600; color: var(--np-muted, #6b7280); }
.dc-table { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.dc-table th, .dc-table td { padding: 7px 8px; border: 0; }
.dc-table thead th { background: rgba(29, 63, 122, .09); color: var(--np-ink, #111); font-weight: 600; }
.dc-table tbody tr:nth-child(even) { background: rgba(47, 158, 68, .09); }
.dc-table tbody th { font-weight: 500; color: var(--np-ink, #111); }
.dc-table tbody tr:last-child { border-bottom: 1px solid var(--np-line, #e5e7eb); }
.dc-table .text-end { text-align: right; white-space: nowrap; }
.dc-up { color: #2f9e44; font-size: .8em; }
.dc-down { color: #e03131; font-size: .8em; }
.dc-flat { color: #adb5bd; font-size: .6em; vertical-align: middle; }
.dc-stats { display: grid; gap: 12px; margin-top: 12px; }
.dc-stat { border-left: 3px solid var(--dc-color); padding-left: 10px; }
.dc-stat__label { font-weight: 700; color: var(--np-muted, #6b7280); font-size: .95rem; }
.dc-stat__value { color: var(--np-muted, #6b7280); font-size: .95rem; margin-top: 2px; }
.dc-stat__value strong { font-size: 1.35rem; color: var(--np-ink, #111); }
.dc-chart { position: relative; height: 210px; margin-top: 10px; }
.dc-list--home .dc-chart { height: 230px; }
.dc-card__note { margin: 10px 0 0; font-size: .78rem; line-height: 1.45; color: var(--np-muted, #6b7280); }
.dc-card__foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--np-line, #e5e7eb); }
.dc-card__logo { height: 22px; width: auto; max-width: 120px; object-fit: contain; flex: 0 0 auto; }
.dc-card__logoText { font-size: .85rem; }
.dc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0; padding: 0; flex: 1; font-size: .85rem; color: var(--np-text, #374151); }
.dc-legend li { display: inline-flex; align-items: center; gap: 6px; }
.dc-legend span { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.dc-card__csv { color: var(--np-muted, #6b7280); text-decoration: none; padding: 4px 6px; border-radius: 4px; }
.dc-card__csv:hover { background: rgba(0, 0, 0, .06); color: var(--np-ink, #111); }

/* Responsive: every part adapts to the card's own width (phone, tablet, narrow sidebar). */
.dc-card { container-type: inline-size; overflow: hidden; }
.dc-chart { width: 100%; min-width: 0; }
.dc-chart canvas { display: block; width: 100% !important; max-width: 100%; }
.dc-table { table-layout: auto; }
.dc-card__foot { flex-wrap: wrap; }
.dc-legend { min-width: 0; }
@container (max-width: 420px) {
	.dc-card__title { font-size: 1.05rem; }
	.dc-card__brand { white-space: normal; }
	.dc-table { font-size: .86rem; }
	.dc-table th, .dc-table td { padding: 6px 5px; }
	.dc-table td.dc-v .dc-up, .dc-table td.dc-v .dc-down, .dc-table td.dc-v .dc-flat { display: none; } /* arrow stays in the Change column */
	.dc-chart, .dc-list--home .dc-chart { height: 190px; }
	.dc-stat__value strong { font-size: 1.2rem; }
}
@container (max-width: 300px) {
	.dc-table { font-size: .8rem; }
	.dc-table th, .dc-table td { padding: 5px 3px; }
	.dc-table thead th { font-size: .75rem; }
	.dc-chart, .dc-list--home .dc-chart { height: 170px; }
	.dc-card__logo { height: 18px; }
}
@media (max-width: 420px) {
	.dc-card { padding: 14px 12px 10px; }
}

/* GSE stock ticker (layout "ticker") ----------------------------------------------- */
.dc-list--home .dc-card--ticker, .dc-list--home .dc-card--weather { grid-column: 1 / -1; }
.dc-card--ticker { padding: 10px 12px 8px; }
.dc-ticker { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dc-ticker__label { flex: 0 0 auto; margin: 0; padding-left: 10px; border-left: 4px solid var(--dc-blue); font-size: 1.2rem; font-weight: 700; color: var(--dc-blue) !important; white-space: nowrap; }
.dc-ticker__viewport { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.dc-ticker__track { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0 24px; width: max-content; will-change: transform; }
.dc-tick { display: flex; flex-direction: column; align-items: center; white-space: nowrap; font-size: .86rem; line-height: 1.3; font-variant-numeric: tabular-nums; color: var(--np-text, #212529); }
.dc-tick strong { color: var(--np-ink, #111); }
.dc-tick__vol { color: var(--np-muted, #6b7280); font-size: .8rem; }
.dc-tick .dc-up, .dc-tick .dc-down, .dc-tick .dc-flat { font-size: inherit; vertical-align: baseline; }
.dc-tick .dc-flat { color: var(--np-muted, #6b7280); }
.dc-ticker__ctrl { flex: 0 0 auto; display: flex; }
.dc-ticker__ctrl button { width: 30px; height: 32px; border: 0; background: #6b7280; color: #fff; display: inline-grid; place-items: center; padding: 0; font-size: .95rem; }
.dc-ticker__ctrl button + button { margin-left: 1px; }
.dc-ticker__ctrl button.is-accent { background: #e8890c; }
.dc-ticker__ctrl button:hover { filter: brightness(1.1); }
.dc-ticker__ctrl button:focus-visible { outline: 2px solid var(--dc-blue); outline-offset: 2px; }
.dc-ticker__meta { margin-top: 6px; font-size: .74rem; color: var(--np-muted, #6b7280); }
.dc-card--ticker .dc-ticker__meta { padding-left: 14px; }
@container (max-width: 560px) {
	.dc-ticker { flex-wrap: wrap; row-gap: 8px; }
	.dc-ticker__label { order: 1; flex: 1; font-size: 1.05rem; }
	.dc-ticker__ctrl { order: 2; }
	.dc-ticker__viewport { order: 3; flex-basis: 100%; }
}

/* GSE most-active table (layout "table") */
.dc-card--stocks td.dc-up, .dc-card--stocks td.dc-down, .dc-card--stocks td.dc-flat { font-size: inherit; vertical-align: baseline; }
.dc-card--stocks td.dc-flat { color: var(--np-muted, #6b7280); }

/* Weather ---------------------------------------------------------------------- */
.dc-wx { display: flex; align-items: center; gap: 18px; margin-top: 12px; padding: 14px 10px; border-radius: 4px; background: linear-gradient(to bottom, rgba(0, 0, 0, .04), transparent 60%); }
.dc-wx__now { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; }
.dc-wx__city { display: flex; flex-direction: column; align-items: center; color: var(--np-muted, #6b7280); line-height: 1.25; }
.dc-wx__city strong { color: var(--np-ink, #333); font-size: 1rem; letter-spacing: .02em; }
.dc-wx__city span { font-size: .9rem; }
.dc-wx__icon { font-size: 3.2rem; line-height: 1; color: var(--np-muted, #5b6470); }
.dc-wx__temp { display: flex; flex-direction: column; align-items: center; line-height: 1.2; color: var(--np-muted, #6b7280); }
.dc-wx__temp strong { font-size: 2.2rem; font-weight: 500; color: var(--np-ink, #333); }
.dc-wx__temp span { font-size: .9rem; }
.dc-wx__temp small { font-size: .74rem; margin-top: 2px; }
.dc-wx__days { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; min-width: 0; }
.dc-wx__day { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.dc-wx__dname { font-size: .9rem; color: var(--np-muted, #6b7280); }
.dc-wx__dicon { font-size: 1.6rem; color: #4dabf7; line-height: 1; }
.dc-wx__range { display: flex; gap: 12px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.dc-wx__hi { color: #f76707; }
.dc-wx__lo { color: #4dabf7; }
@container (max-width: 640px) {
	.dc-wx { flex-direction: column; align-items: stretch; gap: 14px; }
	.dc-wx__now { justify-content: space-around; gap: 10px; }
	.dc-wx__icon { font-size: 2.6rem; }
	.dc-wx__temp strong { font-size: 1.9rem; }
	.dc-wx__days { border-top: 1px solid var(--np-line, #e5e7eb); padding-top: 12px; }
}
@container (max-width: 300px) {
	.dc-wx__now { flex-wrap: wrap; }
	.dc-wx__days { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.dc-wx__range { gap: 6px; font-size: .8rem; }
}
.dc-card--weather .dc-card__title, .dc-card--stocks .dc-card__title { padding-left: 10px; border-left: 4px solid var(--dc-blue); }

/* League tables ------------------------------------------------------------------ */
.dc-tabs { display: flex; gap: 4px; margin: 12px 0 0; overflow-x: auto; scrollbar-width: none; }
.dc-tab { border: 1px solid var(--np-line, #e5e7eb); background: transparent; color: var(--np-muted, #6b7280); font-weight: 600; font-size: .82rem; padding: 5px 12px; border-radius: 999px; white-space: nowrap; cursor: pointer; }
.dc-tab.is-active { background: var(--dc-blue); border-color: var(--dc-blue); color: #fff; }
.dc-table--standings { font-size: .9rem; }
.dc-table--standings thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .02em; padding: 7px 6px; }
.dc-table--standings td, .dc-table--standings th { padding: 7px 6px; }
.dc-table--standings tbody tr:nth-child(even) { background: rgba(0, 0, 0, .025); }
.dc-table--standings tbody tr { border-bottom: 1px solid var(--np-line, #eef0f2); }
.dc-pos { width: 30px; text-align: center; color: var(--np-muted, #6b7280); font-variant-numeric: tabular-nums; position: relative; }
.dc-pos.has-zone::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--dc-zone); }
.dc-team-cell { width: 100%; max-width: 0; font-weight: 500; } /* takes the free width; long names get an ellipsis */
.dc-team { display: flex; align-items: center; gap: 8px; min-width: 0; }

.dc-team__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-team__short { display: none; }
.dc-pts { font-weight: 800; color: var(--np-ink, #111); }
.dc-more-btn { display: block; width: 100%; margin-top: 8px; border: 1px solid var(--np-line, #e5e7eb); background: transparent; color: var(--dc-blue); font-weight: 600; font-size: .85rem; padding: 7px; border-radius: 4px; cursor: pointer; }
.dc-more-btn:hover { background: rgba(0, 0, 0, .03); }
.dc-zones { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 10px 0 0; padding: 0; font-size: .76rem; color: var(--np-muted, #6b7280); }
.dc-zones li { display: inline-flex; align-items: center; gap: 6px; }
.dc-zones span { width: 10px; height: 10px; border-radius: 2px; }
.dc-card--standings .dc-card__title { padding-left: 10px; border-left: 4px solid var(--dc-blue); }
.dc-card--standings .dc-card__foot { justify-content: space-between; }
/* Compact layout (and any narrow card): # Team P GD Pts */
.dc-card--standings.is-compact .dc-c3 { display: none; }
@container (max-width: 460px) {
	.dc-card--standings .dc-c3 { display: none; }
	.dc-table--standings { font-size: .86rem; }
}
@container (max-width: 300px) {
	.dc-card--standings .dc-c2:not(:last-child) { display: none; }
	.dc-team:has(.dc-team__short) .dc-team__name { display: none; }
	.dc-team__short { display: inline; text-decoration: none; }
}
.dc-badge { position: relative; width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; background: rgba(29, 63, 122, .1); display: inline-grid; place-items: center; overflow: hidden; }
.dc-badge__ini { font-size: 7px; font-weight: 800; letter-spacing: -.02em; color: var(--dc-blue); line-height: 1; }
.dc-badge img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--np-surface, #fff); }
.dc-team abbr.dc-team__short { text-decoration: none; cursor: default; border: 0; }
