/* Climate Emissions Data explorer (2026-12-02) — used by climate-data.php
   One data hue (site blue, darkened for contrast) for emissions; green for net absorption (sinks).
   Text stays in the text inks; marks carry the colour. */

.ct {
    --ct-ink: #222;
    --ct-ink-2: #555;
    --ct-ink-3: #888;
    --ct-line: #e6e8eb;
    --ct-surface: #fff;
    --ct-soft: #f5f7f9;
    --ct-accent: #009EE3;        /* site blue: tabs, links */
    --ct-accent-dk: #006FA6;
    --ct-mark: #0077B0;          /* bars and columns */
    --ct-mark-soft: #dcebf4;
    --ct-sink: #2F8F5B;          /* negative values: forests and land absorbing carbon */
    --ct-up: #B3261E;
    --ct-down: #1E7A46;
    max-width: 1000px;
    margin: 0 auto 50px;
    text-align: left;
    color: var(--ct-ink);
    font-size: 15px;
}

.ct-intro { max-width: 720px; margin: 0 auto 22px; text-align: center; font-size: 15px; line-height: 1.6; color: #555; }
.ct-intro a, .ct a { color: var(--ct-accent); }
.ct-intro a:hover, .ct a:hover { color: var(--ct-accent-dk); }

/* ---------------------------------------------------------------- tabs */
.ct-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 14px; border-bottom: 1px solid var(--ct-line); }
.ct-tab {
    appearance: none; background: none; border: 0; border-bottom: 3px solid transparent;
    padding: 9px 16px 8px; margin-bottom: -1px; font-size: 15px; font-weight: 600; color: var(--ct-ink-2); cursor: pointer;
}
.ct-tab:hover { color: var(--ct-accent-dk); }
.ct-tab[aria-selected="true"] { color: var(--ct-accent-dk); border-bottom-color: var(--ct-accent); }
.ct-tab:focus-visible { outline: 2px solid var(--ct-accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- filters */
.ct-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; justify-content: center; margin: 0 0 22px; }
.ct-f { display: flex; flex-direction: column; gap: 4px; margin: 0; font-weight: 400; min-width: 150px; }
.ct-f > span { font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ct-ink-3); }
.ct-f select {
    height: 38px; padding: 0 30px 0 10px; font-size: 14px; color: var(--ct-ink);
    border: 1px solid #cfd5db; border-radius: 6px; background-color: var(--ct-surface); max-width: 100%;
}
.ct-f select:focus { outline: 2px solid var(--ct-accent); outline-offset: 1px; border-color: var(--ct-accent); }
.ct-f--place { min-width: 220px; }
.ct-f--year { min-width: 90px; }
.ct-f.is-off { opacity: .45; }

/* ---------------------------------------------------------------- panel */
.ct-panel { min-height: 260px; }
.ct-head { margin: 26px 0 10px; }
.ct-head:first-child { margin-top: 0; }
.ct-head h2 { font-size: 20px; font-weight: 600; margin: 0 0 4px; color: var(--ct-ink); text-transform: none; letter-spacing: 0; }
.ct-head p { margin: 0; font-size: 13px; color: var(--ct-ink-3); }
.ct-note { font-size: 13px; color: var(--ct-ink-3); margin: 8px 0 0; }
.ct-msg { text-align: center; color: var(--ct-ink-2); padding: 40px 10px; }
.ct-msg--err p { color: var(--ct-up); margin-bottom: 12px; }

.ct-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px 10px; color: var(--ct-ink-2); }
.ct-spin {
    display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px;
    border: 2px solid var(--ct-mark-soft); border-top-color: var(--ct-mark); animation: ct-spin .8s linear infinite;
}
@keyframes ct-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ct-spin { animation-duration: 2.4s; } }

/* ---------------------------------------------------------------- stat tiles */
.ct-tiles { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 8px; }
.ct-tile { flex: 1 1 200px; background: var(--ct-soft); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.ct-tile__label { font-size: 13px; color: var(--ct-ink-2); }
.ct-tile__value { font-size: 30px; font-weight: 600; line-height: 1.2; color: var(--ct-ink); }
.ct-tile--hero .ct-tile__value { font-size: 44px; }
.ct-tile__value--sm { font-size: 19px; }
.ct-tile__unit { font-size: 13px; color: var(--ct-ink-3); }

/* ---------------------------------------------------------------- tables */
.ct-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ct-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ct-table th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--ct-ink-3); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--ct-line); white-space: nowrap; }
.ct-table td { padding: 7px 10px; border-bottom: 1px solid var(--ct-line); vertical-align: middle; }
.ct-table tbody tr:hover > td { background: #fafbfc; }
.ct-table tr.is-hl > td { background: #eef7fd; }
.ct-num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ct-muted { color: var(--ct-ink-3); }
.ct-wide { width: 46%; min-width: 220px; }
.ct-table--compact { max-width: 460px; margin-top: 10px; }

.ct-sort { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.ct-sort:hover, .ct-sort.is-on { color: var(--ct-accent-dk); }

.ct-link { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: var(--ct-accent-dk); text-align: left; cursor: pointer; }
.ct-link:hover { text-decoration: underline; }

.ct-src { display: block; font-weight: 600; }
.ct-src__kind { display: block; font-size: 12px; color: var(--ct-ink-3); }
.ct-tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 9px; background: var(--ct-soft); color: var(--ct-ink-2); border: 1px solid var(--ct-line); }

.ct-detail > td { background: var(--ct-soft); }
.ct-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 4px 0; font-size: 13px; }
.ct-dl dt { font-weight: 600; color: var(--ct-ink-2); }
.ct-dl dd { margin: 0; }

/* change arrows: colour plus arrow and sign, never colour alone */
.ct-chg { font-variant-numeric: tabular-nums; }
.ct-chg--up { color: var(--ct-up); }
.ct-chg--down { color: var(--ct-down); }
.ct-chg--flat { color: var(--ct-ink-3); }

/* ---------------------------------------------------------------- horizontal bars */
.ct-bar { position: relative; display: flex; align-items: center; gap: 8px; min-height: 22px; }
.ct-bar__fill { display: block; height: 14px; background: var(--ct-mark); border-radius: 0 4px 4px 0; flex: 0 0 auto; }
.ct-bar--neg .ct-bar__fill { background: var(--ct-sink); }
.ct-bar__val { font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ct-ink); }
.ct-bar__val em { font-style: normal; color: var(--ct-ink-3); font-size: 12px; }

/* ---------------------------------------------------------------- column chart */
.ct-chart { margin: 16px 0 4px; }
.ct-chart svg { width: 100%; height: auto; display: block; max-width: 720px; }
.ct-grid { stroke: var(--ct-line); stroke-width: 1; }
.ct-grid--zero { stroke: #b9c0c7; }
.ct-axis { font-size: 12px; fill: var(--ct-ink-3); }
.ct-cap { font-size: 12px; font-weight: 600; fill: var(--ct-ink); }
.ct-col path { fill: var(--ct-mark); }
.ct-col--neg path { fill: var(--ct-sink); }
.ct-col .ct-hit { fill: transparent; }
.ct-col:hover .ct-hit, .ct-col:focus .ct-hit { fill: rgba(0, 119, 176, .06); }
.ct-col:focus { outline: none; }

/* ---------------------------------------------------------------- buttons, paging */
.ct-btn {
    appearance: none; border: 1px solid #cfd5db; background: var(--ct-surface); color: var(--ct-ink);
    border-radius: 6px; padding: 7px 14px; font-size: 14px; cursor: pointer;
}
.ct-btn:hover { border-color: var(--ct-accent); color: var(--ct-accent-dk); }
.ct-btn--sm { padding: 3px 10px; font-size: 12px; }
.ct-btn[aria-expanded="true"] { background: var(--ct-soft); border-color: var(--ct-accent); }
.ct-more, .ct-pager { display: flex; justify-content: center; gap: 10px; margin: 16px 0 0; }

/* ---------------------------------------------------------------- tooltip */
.ct-tip {
    position: fixed; z-index: 2000; pointer-events: none; max-width: 300px;
    background: #222; color: #fff; font-size: 13px; line-height: 1.4; padding: 6px 10px; border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}

/* ---------------------------------------------------------------- context and credit */
.ct-context { margin: 36px 0 0; padding: 18px 22px; background: var(--ct-soft); border-radius: 10px; }
.ct-context h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; text-transform: none; letter-spacing: 0; }
.ct-context ul { margin: 0; padding-left: 18px; }
.ct-context li { margin: 0 0 8px; line-height: 1.55; font-size: 14px; color: var(--ct-ink-2); }
.ct-context li strong { color: var(--ct-ink); }
.ct-credit { margin: 14px 0 0; font-size: 12px; color: var(--ct-ink-3); text-align: center; }

/* screen-reader-only text (same as Bootstrap's .sr-only, repeated so the page doesn't depend on it) */
.ct .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* ---------------------------------------------------------------- phones */
@media (max-width: 767px) {
    .ct-f, .ct-f--place { flex: 1 1 100%; min-width: 0; }
    .ct-f--year { flex: 1 1 30%; }
    .ct-tab { padding: 8px 10px 7px; font-size: 14px; }
    .ct-wide { min-width: 120px; width: 40%; }
    .ct-table th, .ct-table td { padding: 6px 6px; }
    .ct-table { font-size: 13px; }
    .ct-bar__fill { height: 10px; }
    .ct-tile--hero .ct-tile__value { font-size: 34px; }
    .ct-table--rank th:nth-child(5), .ct-table--rank td:nth-child(5) { display: none; }   /* hide Share on small screens */
}
