/* History of Montenegro — overrides loaded after core/css/style.css: the
   inline SVG logo, ten rulers-tab icons, eleven At a Glance ages in one
   row, the heads of state, heads of government and Party leaders in "Who Was
   in Power", and the "Montenegro Through Time" map layers
   (js/montenegro-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 — tab icons for antiquity (temple), Duklja and Zeta
   (fortress tower), Ottoman and Venetian rule (crescent), the Petrović-Njegoš
   line (Orthodox cross), kings (imperial crown), occupations (crossed
   swords), the Yugoslav heads of state (star outline), the socialist republic
   (shield and mountain), presidents (flag), bans and Yugoslav governments
   (document) and Party leaders (star in a circle); site.php gives those tabs
   icon 'none', so they are drawn here in the tab's text colour.
════════════════════════════════════════ */
.rp-tab[data-tab="antiquity"]::before,
.rp-tab[data-tab="medieval"]::before,
.rp-tab[data-tab="ottoman"]::before,
.rp-tab[data-tab="petrovic"]::before,
.rp-tab[data-tab="kings"]::before,
.rp-tab[data-tab="occupation"]::before,
.rp-tab[data-tab="yugoslav"]::before,
.rp-tab[data-tab="socialist"]::before,
.rp-tab[data-tab="presidents"]::before,
.rp-tab[data-tab="federal"]::before,
.rp-tab[data-tab="party"]::before {
  content:''; flex-shrink:0; width:14px; height:14px;
  background-color:currentColor;
  -webkit-mask:var(--mn-tab-icon) center / contain no-repeat;
  mask:var(--mn-tab-icon) center / contain no-repeat;
}
.rp-tab[data-tab="antiquity"] {
  --mn-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 6.4L8 2.4l6 4zM3 14h10M4.6 8v4.6M8 8v4.6M11.4 8v4.6' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="medieval"] {
  --mn-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.5h9M4.5 14.5V6h7v8.5M3.5 6V2.6h1.8V4h1.8V2.6h1.8V4h1.8V2.6h1.8V6M7 14.5v-2.8a1 1 0 0 1 2 0v2.8' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="ottoman"] {
  --mn-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10.2 2.2a6 6 0 1 0 3.4 8.6 4.8 4.8 0 0 1-3.4-8.6z' fill='%23000'/%3E%3Cpath d='M11.20 4.70L11.61 5.83L12.82 5.87L11.87 6.62L12.20 7.78L11.20 7.10L10.20 7.78L10.53 6.62L9.58 5.87L10.79 5.83Z' fill='%23000'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="petrovic"] {
  --mn-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.4v13.2M5.6 3.8h4.8M4.2 6.9h7.6M5.8 12.2l4.4 1.3' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="kings"] {
  --mn-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.2h11M3 13.2l-.9-7 3.4 2.8L8 3.8l2.5 5.2 3.4-2.8-.9 7M8 3.8V2.4M2.1 6.2V5M13.9 6.2V5' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="occupation"] {
  --mn-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 2.5L11.2 11.2M9.3 13.1l3.8-3.8M11.2 11.2l2.6 2.6M13.5 2.5L4.8 11.2M6.7 13.1L2.9 9.3M4.8 11.2l-2.6 2.6' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="yugoslav"] {
  --mn-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8.00 2.00L9.59 6.42L14.28 6.56L10.57 9.43L11.88 13.94L8.00 11.30L4.12 13.94L5.43 9.43L1.72 6.56L6.41 6.42Z' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="socialist"] {
  --mn-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.5l5.2 1.8v4.4c0 3.1-2.2 5.2-5.2 6.8-3-1.6-5.2-3.7-5.2-6.8V3.3zM4.9 9.9L7.1 6.6l1.4 1.9 1.1-1.3 1.6 2.7' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="presidents"] {
  --mn-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="federal"] {
  --mn-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 1.8h6l2.5 2.5v9.9H4zM6 6.5h4.5M6 9h4.5M6 11.5h2.5' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="party"] {
  --mn-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.6a6.4 6.4 0 1 0 0 12.8A6.4 6.4 0 0 0 8 1.6z' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3Cpath d='M8.00 4.50L8.88 6.99L11.52 7.06L9.43 8.66L10.17 11.19L8.00 9.70L5.83 11.19L6.57 8.66L4.48 7.06L7.12 6.99Z' 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 — "Montenegro Through Time" (js/montenegro-map.js), as in the
   prototype data/montenegro-map.html: a dark background, the land behind
   the shapes, Montenegro's 21 municipalities and the eight neighbouring regions,
   independent Montenegro's outline (from 2006 on) and the municipality 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, ten 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(10, minmax(0, 1fr)); }
.cm-eras button { padding-left:4px; padding-right:4px; }
/* 16 chapters: montenegro-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)); }
}
