/* ISEF Analysis — charts & data sections.
   Inherits the Tian2 palette from ../../css/tian2.css. */

.a-hero { padding-block: 2.2rem 0; }

.a-section { padding-block: 2.4rem; }
.a-eyebrow {
  font-family: var(--font-label, 'Bebas Neue', sans-serif);
  letter-spacing: .2em; font-size: .78rem; color: var(--coral, #E8614C);
  margin: 0 0 .35rem;
}
.a-title {
  font-family: var(--font-serif-zh, 'Noto Serif SC', serif);
  font-weight: 700; font-size: 1.42rem; margin: 0 0 .5rem; line-height: 1.3;
}
.a-caption {
  font-size: .86rem; color: var(--ink-3, #7A6B53); line-height: 1.75;
  margin: .45rem 0 0; max-width: 62ch;
}
.a-note {
  font-size: .8rem; color: var(--ink-3, #7A6B53); line-height: 1.7;
  margin-top: .8rem; padding-left: .9rem;
  border-left: 2.5px solid var(--coral, #E8614C);
}

/* --- lens / region switches ------------------------------------------- */
.a-switch { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin: 1rem 0 .4rem; }
.a-switch .lbl { font-size: .8rem; color: var(--ink-3, #7A6B53); margin-right: 2px; }
.a-switch button {
  font: inherit; font-size: .8rem; padding: 5px 12px;
  border: 1px solid var(--ink, #2C2416); background: transparent;
  color: var(--ink-2, #4A3E2A); cursor: pointer; border-radius: 2px;
}
.a-switch button[aria-pressed="true"] {
  background: var(--ink, #2C2416); color: var(--cream, #F5EDDC);
}
.a-tabs { display: flex; border-bottom: 2.5px solid var(--ink, #2C2416); margin: 1.6rem 0 0; }
.a-tabs button {
  font: inherit; font-family: var(--font-serif-zh, 'Noto Serif SC', serif);
  font-weight: 700; font-size: 1rem; padding: 8px 18px; border: 0;
  background: transparent; color: var(--ink-3, #7A6B53); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2.5px;
}
.a-tabs button[aria-selected="true"] {
  color: var(--ink, #2C2416); border-bottom-color: var(--coral, #E8614C);
}

/* --- KPI row ----------------------------------------------------------- */
.a-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px; margin: 1.2rem 0 0;
}
.a-kpi { border: 1px solid var(--ink, #2C2416); padding: 12px 14px; background: var(--cream-2, #EFE4CD); }
.a-kpi .v {
  font-family: var(--font-display-en, 'Playfair Display', Georgia, serif);
  font-weight: 800; font-size: 1.85rem; line-height: 1.05; color: var(--ink, #2C2416);
}
.a-kpi .v.hot { color: var(--coral, #E8614C); }
.a-kpi .k { font-size: .72rem; color: var(--ink-3, #7A6B53); margin-top: 4px; line-height: 1.45; }

/* --- charts ------------------------------------------------------------ */
.chart { margin-top: .9rem; overflow-x: auto; }
.chart svg { display: block; overflow: visible; }
.gl { stroke: #D8CCB2; stroke-width: 1; }
.axt { font-size: 11px; fill: var(--ink-3, #7A6B53); }
.axt.b { fill: var(--ink-2, #4A3E2A); font-weight: 500; }
.vlab { font-size: 11px; fill: var(--ink-2, #4A3E2A); font-weight: 500; }

.legend {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  font-size: .8rem; color: var(--ink-2, #4A3E2A); margin-top: .7rem;
}
.legend .sw { width: 11px; height: 11px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.legend .sw.dot { border-radius: 50%; }

/* --- data tables (the "show the data" view) ---------------------------- */
.data-toggle {
  font: inherit; font-size: .78rem; margin-top: .9rem; padding: 5px 12px;
  border: 1px solid var(--ink, #2C2416); background: transparent;
  color: var(--ink-2, #4A3E2A); cursor: pointer; border-radius: 2px;
}
.data-toggle:hover { background: var(--cream-2, #EFE4CD); }
.a-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--ink, #2C2416); margin-top: .8rem; }
table.data-table { border-collapse: collapse; width: 100%; font-size: .78rem; }
table.data-table th, table.data-table td {
  padding: 5px 8px; text-align: right; border-bottom: 1px solid #D8CCB2; white-space: nowrap;
}
table.data-table th {
  font-weight: 600; color: var(--ink-2, #4A3E2A); border-bottom: 1.5px solid var(--ink, #2C2416);
  position: sticky; top: 0; background: var(--cream, #F5EDDC); cursor: pointer; user-select: none;
}
table.data-table th.l, table.data-table td.l { text-align: left; }
table.data-table td.nm { max-width: 290px; overflow: hidden; text-overflow: ellipsis; }
table.data-table tbody tr:hover { background: var(--cream-2, #EFE4CD); }

.a-search {
  font: inherit; font-size: .8rem; padding: 5px 10px;
  border: 1px solid var(--ink, #2C2416); background: var(--cream, #F5EDDC);
  color: var(--ink, #2C2416); border-radius: 2px; min-width: 190px;
}

/* --- small multiples --------------------------------------------------- */
.a-sm { display: grid; grid-template-columns: repeat(auto-fit, minmax(226px, 1fr)); gap: 18px; margin-top: .9rem; }
.a-sm figure { margin: 0; }
.a-sm svg { width: 100%; height: auto; }
.a-sm figcaption { font-size: .78rem; color: var(--ink-2, #4A3E2A); margin-bottom: 4px; font-weight: 500; }

/* --- callout ----------------------------------------------------------- */
.a-callout {
  border-left: 3px solid var(--coral, #E8614C); padding: 12px 16px;
  background: var(--cream-2, #EFE4CD); font-size: .88rem; line-height: 1.75; margin: 1.1rem 0;
}

/* --- tooltip ----------------------------------------------------------- */
.a-tip {
  position: fixed; pointer-events: none; background: var(--ink, #2C2416);
  color: var(--cream, #F5EDDC); padding: 8px 11px; font-size: .78rem;
  line-height: 1.55; border-radius: 3px; opacity: 0; transition: opacity .08s;
  z-index: 60; max-width: 290px;
}
.a-tip b { color: #F5A893; font-weight: 600; }

@media (max-width: 640px) {
  .a-tabs button { font-size: .9rem; padding: 7px 12px; }
  .a-kpi .v { font-size: 1.55rem; }
}
