/* History of Slovakia — overrides loaded after core/css/style.css: the
   inline SVG logo, six rulers-tab icons, eleven At a Glance ages in one
   row, the co-rulers, heads of government and Party leaders in "Who Was
   in Power", and the "Slovakia Through Time" map layers
   (js/slovakia-map.js), which reuse core's .cm-* map page. */

/* 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 — Great Moravia and early rulers (domed church), Árpád
   kings (sword), later medieval kings (open crown), Habsburg-era kings
   (imperial crown), presidents (flag) and Party Leaders (star) tab icons;
   site.php gives those
   tabs icon 'none', so they are drawn here in the tab's text colour.
════════════════════════════════════════ */
.rp-tab[data-tab="early"]::before,
.rp-tab[data-tab="arpad"]::before,
.rp-tab[data-tab="later-kings"]::before,
.rp-tab[data-tab="habsburg-kings"]::before,
.rp-tab[data-tab="presidents"]::before,
.rp-tab[data-tab="party"]::before {
  content:''; flex-shrink:0; width:14px; height:14px;
  background-color:currentColor;
  -webkit-mask:var(--by-tab-icon) center / contain no-repeat;
  mask:var(--by-tab-icon) center / contain no-repeat;
}
.rp-tab[data-tab="early"] {
  --by-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 14.5h11M4.2 14.5V8.6h7.6v5.9M8 8.6c-2.2 0-3-1.3-3-2.4 0-1.4 1.6-2.2 3-3.6 1.4 1.4 3 2.2 3 3.6 0 1.1-.8 2.4-3 2.4zM8 2.6V.9M7.1 1.6h1.8M7 14.5v-3h2v3' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="arpad"] {
  --by-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.4l1.1 1.6v8.2H6.9V3zM4.6 11.2h6.8M8 11.2v2.2M8 15a.9.9 0 1 0 0-.1' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="later-kings"] {
  --by-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 13h11M3 13l-.9-7.2 3.4 2.9L8 3.4l2.5 5.3 3.4-2.9L13 13' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="habsburg-kings"] {
  --by-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 12.5h10M3.4 12.5L2.6 7.2C4.2 4.4 6 3.4 8 3.4s3.8 1 5.4 3.8l-.8 5.3M8 3.4V1.6M7 2.3h2M5.4 8.4h5.2' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="presidents"] {
  --by-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 14.6V1.6M3.5 2.4h9.3l-2.2 3.1 2.2 3.1H3.5' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="party"] {
  --by-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.6l1.8 4.1 4.4.4-3.3 2.9 1 4.3L8 11 4.1 13.3l1-4.3-3.3-2.9 4.4-.4z' fill='%23000'/%3E%3C/svg%3E");
}

/* ════════════════════════════════════════
   At a Glance — eleven 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)); }
@media (max-width:1100px) {
  .bib-groups { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}

/* ════════════════════════════════════════
   "Who Was in Power" — the ruler beside co-rulers and the heads of
   government (prime minister, Party leader); 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; }
.em-power-party {
  display:flex; align-items:center; gap:6px;
  font-family:var(--f-ui); font-size:13px; line-height:1.3; color:var(--white-dim);
}
.em-power-party i { width:9px; height:9px; border-radius:50%; flex:none; }

/* ════════════════════════════════════════
   MAP — "Slovakia Through Time" (js/slovakia-map.js), as in the
   prototype data/slovakia-map.html: a dark background, the land behind
   the shapes, Slovakia's 79 districts and the neighbouring regions,
   independent Slovakia's outline (from 1993 on) and the district names,
   which show once the map is zoomed in.
════════════════════════════════════════ */
.cm-sphere { fill:#0b1420; }
.cm-grat { fill:none; stroke:rgba(201,168,68,0.22); stroke-width:1.1; stroke-dasharray:1 3; vector-effect:non-scaling-stroke; }
.cm-bgland { fill:#16141d; stroke:rgba(201,168,68,0.18); stroke-width:0.6; vector-effect:non-scaling-stroke; pointer-events:none; }
.cm-country { fill:#24212c; stroke:#0a0810; stroke-width:0.6; vector-effect:non-scaling-stroke; }
.cm-coast { fill:none; stroke:rgba(201,168,68,0.45); stroke-width:1; vector-effect:non-scaling-stroke; pointer-events:none; }
.cm-border {
  fill:none; stroke:#f4ecd6; stroke-width:2; vector-effect:non-scaling-stroke;
  pointer-events:none; opacity:0; transition:opacity 0.8s ease;
}
.cm-border.on { opacity:0.9; }
.cm-county-label {
  font-family:var(--f-ui); fill:rgba(255,255,255,0.55); text-anchor:middle; pointer-events:none;
  paint-order:stroke; stroke:rgba(5,3,8,0.6); transition:opacity 0.4s ease;
}
/* Ruling powers: only those on the map in the year shown are listed. */
.cm-lg--trad span { cursor:default; }
#cm-lg-trad span.off { display:none; }

/* A tall map: a taller stage than the world map, eight era buttons. */
.cm-stage { height:calc(100cqw * 8.6 / 16 + 50px); min-height:620px; max-height:max(620px, 88vh); }
.cm-eras { grid-template-columns:repeat(9, minmax(0, 1fr)); }
.cm-eras button { padding-left:4px; padding-right:4px; }
/* 30 chapters: slovakia-map.js marks the year labels that would
   collide (the current one always shows). */
.cm-tick-labels button.thin:not(.cur) { visibility:hidden; }
.cm-tick-labels button:first-child { transform:none; }
.cm-tick-labels button:last-child { transform:translateX(-100%); }
@media (max-width:900px) {
  .cm-stage svg { aspect-ratio:4 / 4.6; }
  .cm-eras { grid-template-columns:repeat(3, minmax(0, 1fr)); }
}
