/* Atlas de Maestrías SUNEDU — v3: países clicables, tooltips con costos, ranking online en el mapa, foros, modalidad. */

/* Países clicables en la vista mundial */
.pais-hit { stroke: transparent; fill: transparent; cursor: pointer; transition: fill var(--dur) var(--ease), stroke var(--dur) var(--ease); }
.pais-hit.on { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.pais-hit:hover { fill: color-mix(in srgb, var(--support) 22%, transparent); stroke: var(--support); }
.pais-hit.on:hover { fill: color-mix(in srgb, var(--accent) 26%, transparent); stroke: var(--accent); }

/* Tooltips compactos */
.leaflet-tooltip.tip { background: var(--surface-2); color: var(--ink); border: var(--border) solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--sp-2) var(--sp-3); font-family: var(--font-body); min-width: 220px; max-width: 300px; white-space: normal; }
.leaflet-tooltip.tip::before { display: none; }
.tt { display: grid; gap: 3px; font-size: var(--fs-label); line-height: 1.35; }
.tt b { font: 700 var(--fs-ui)/1.25 var(--font-display); }
.tt-via { color: var(--ok); font-weight: 600; }
.tt-on { color: var(--accent-strong); font-weight: 700; }
.tt-pr { font-family: var(--font-mono); color: var(--ink); }
.tt-ej { color: var(--ink-mute); font-style: italic; }
.tt-off { color: var(--ink-mute); }
.tt-cta { color: var(--support); font-weight: 600; margin-top: 2px; }
.cbub.sm { font-size: 11px; }

/* Ranking online flotante (vista mundial) */
.rank-mapa { position: absolute; right: var(--sp-3); top: var(--sp-3); z-index: 520; width: 320px; max-height: calc(100% - 2 * var(--sp-3) - 40px); display: flex; flex-direction: column; background: var(--surface-2); border: var(--border) solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
body.panel-closed .rank-mapa { right: calc(var(--sp-3) + 40px); }
#map ~ .rank-mapa { right: calc(var(--panel-w) + var(--sp-3)); }
body.panel-closed #map ~ .rank-mapa { right: var(--sp-3); }
.rm-h { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-2) var(--sp-3); border-bottom: var(--border) solid var(--line); font-family: var(--font-display); }
.rm-h i { color: var(--accent); }
.rm-tabs { display: flex; gap: 2px; padding: var(--sp-2) var(--sp-3) 0; }
.rm-tabs button { flex: 1; height: 28px; border: var(--border) solid var(--line); background: var(--surface); border-radius: var(--radius); font-size: var(--fs-label); font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: all var(--dur) var(--ease); }
.rm-tabs button:hover { color: var(--ink); border-color: var(--line-strong); }
.rm-tabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rm-list { list-style: none; margin: 0; padding: var(--sp-2) 0; overflow: auto; flex: 1; }
.rm-list button { display: grid; grid-template-columns: 22px 22px 1fr auto; gap: var(--sp-2); align-items: center; width: 100%; padding: 5px var(--sp-3); border: 0; background: none; text-align: left; cursor: pointer; font-size: var(--fs-label); border-left: 3px solid transparent; transition: background var(--dur) var(--ease); }
.rm-list button:hover { background: var(--accent-soft); border-left-color: var(--accent); }
.rm-list .r { font: 700 var(--fs-label) var(--font-mono); color: var(--ink-mute); text-align: right; }
.rm-list .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-list .v { font: 700 11px var(--font-mono); color: var(--accent-strong); white-space: nowrap; }
.rank-mapa .src { padding: 0 var(--sp-3) var(--sp-2); margin: 0; }

/* Etiqueta de modalidad */
.tag.mod.on { background: var(--accent); color: var(--accent-ink); }
.tag.mod.mix { background: var(--warn-soft); color: var(--warn); }
.tag.mod.semi { background: var(--surface-3); color: var(--ink-soft); }

/* Foros: cada entrada por separado */
ul.foros { list-style: none; margin: 0; padding: 0; }
ul.foros li { padding: var(--sp-2) 0; border-bottom: var(--border) solid var(--line); font-size: var(--fs-ui); }
ul.foros li:last-child { border-bottom: 0; }
ul.foros a { font-weight: 600; }
ul.foros q { display: block; margin-top: 2px; color: var(--ink-soft); font-size: var(--fs-label); font-style: italic; }

/* Scroll interno en rankings largos */
.chart.scrollbox { max-height: 62vh; overflow: auto; padding-right: var(--sp-2); border-top: var(--border) solid var(--line); border-bottom: var(--border) solid var(--line); }

@media (max-width: 900px) {
  .rank-mapa, #map ~ .rank-mapa { left: var(--sp-3); right: auto; top: 56px; width: min(300px, calc(100% - 24px)); max-height: 38vh; }
}
@media (max-width: 480px) { .rank-mapa .rm-list .v { display: none; } }
