/* History of Chile — overrides loaded after core/css/style.css: the
   inline SVG logo, three rulers-tab icons, ten At a Glance ages in one row,
   the governor / viceroy, junta-member and rival-government cards in "Who
   Was in Power", and the map's live legend. The map itself uses core's .cm-*
   styles (js/chile-map.js is the christianity map engine). */

/* Inline SVG logo (partials/logo.php, site.php logo_partial) — sized like
   the image logo of the other sites. */
#app-logo.app-logo-svg { height:auto; overflow:visible; }

/* ════════════════════════════════════════
   Rulers page — Sapa Incas (Inca sun disc), Kings of Spain (crown) and
   Governors & Viceroys (caravel) tab icons; site.php gives those tabs icon
   'none', so they are drawn here in the tab's text colour.
════════════════════════════════════════ */
.rp-tab[data-tab="incas"]::before,
.rp-tab[data-tab="crown"]::before,
.rp-tab[data-tab="colonial"]::before {
  content:''; flex-shrink:0; width:14px; height:14px;
  background-color:currentColor;
  -webkit-mask:var(--cl-tab-icon) center / contain no-repeat;
  mask:var(--cl-tab-icon) center / contain no-repeat;
}
.rp-tab[data-tab="incas"] {
  --cl-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3.3' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3Cpath d='M8 1v2.2M8 12.8V15M1 8h2.2M12.8 8H15M3 3l1.6 1.6M11.4 11.4L13 13M13 3l-1.6 1.6M4.6 11.4L3 13' fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="crown"] {
  --cl-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 13.5h11M3.2 11.2L2 4.6l3.5 2.6L8 2.6l2.5 4.6L14 4.6l-1.2 6.6z' fill='none' stroke='%23000' stroke-width='1.4' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="colonial"] {
  --cl-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 10.5h13l-2 3.2h-9zM8 10.5V1.8M8 2.5c2.6 1 3.8 3.4 3.8 6.6H8M8 3.6c-1.9.9-2.9 2.8-2.9 5.5H8' fill='none' stroke='%23000' stroke-width='1.25' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ════════════════════════════════════════
   At a Glance — ten ages: one column per age, all in a single row (core
   lays out eight); bibliography in four columns.
════════════════════════════════════════ */
@media (min-width:901px) {
  .ag-era-list { grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:minmax(0, 1fr); }
}
.bib-groups { grid-template-columns:repeat(4, minmax(0, 1fr)); }

/* ════════════════════════════════════════
   "Who Was in Power" — the ruler (Sapa Inca, King of Spain or head of
   state) beside the governor of Chile and the viceroy of Peru (to 1810 and
   in the Reconquista of 1814–1817), the other members of the juntas of 1811
   and 1924 and rival governments: the event's `primeMinister` card(s); the columns stack once
   each would drop below ~200px.
════════════════════════════════════════ */
.em-power {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap:12px 20px;
  align-items:start;
}
.em-power > .em-power-heading { grid-column:1 / -1; margin-bottom:1px; }
a.em-power-card--pm { color:inherit; text-decoration:none; }

/* ════════════════════════════════════════
   MAP — "Chile Through Time": the legend lists only the powers shown in
   the year on screen (js/chile-map.js sets .is-off).
════════════════════════════════════════ */
.cm-lg span.is-off { display:none; }
