/* History of Iceland — overrides loaded after core/css/style.css: the
   inline SVG logo, six rulers-tab icons, the heads of state and of
   government in "Who Was in Power", and the "Iceland Through Time" map
   layers (js/iceland-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 the lawspeakers (law scroll), Norwegian and
   Danish kings (crown), regent and presidents (flag), governors (document)
   and Allied commanders (crossed swords); site.php gives those tabs icon
   'none', so they are drawn here in the tab's text colour.
════════════════════════════════════════ */
.rp-tab[data-tab="lawspeakers"]::before,
.rp-tab[data-tab="norwegian"]::before,
.rp-tab[data-tab="danish"]::before,
.rp-tab[data-tab="presidents"]::before,
.rp-tab[data-tab="governors"]::before,
.rp-tab[data-tab="occupation"]::before {
  content:''; flex-shrink:0; width:14px; height:14px;
  background-color:currentColor;
  -webkit-mask:var(--is-tab-icon) center / contain no-repeat;
  mask:var(--is-tab-icon) center / contain no-repeat;
}
.rp-tab[data-tab="lawspeakers"] { --is-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 2.5h7.2v9.6a1.6 1.6 0 0 1-1.6 1.6H3.4a1.6 1.6 0 0 0 1.1-1.6zM4.5 2.5a1.6 1.6 0 0 0-1.6 1.6v1.4h1.6M6.6 5.6h3.4M6.6 8h3.4' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E"); }
.rp-tab[data-tab="norwegian"], .rp-tab[data-tab="danish"] { --is-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="presidents"] { --is-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="governors"] { --is-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="occupation"] { --is-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"); }

/* Bibliography in four columns. */
.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 (governor, minister, prime minister); 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 — "Iceland Through Time" (js/iceland-map.js), as in the prototype
   data/iceland-map.html: a dark sea, the island in 14 historical units
   shaded by the ruling power, the four medieval quarters as thin lines and
   the places named 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 taller stage than the world map, ten era buttons. */
.cm-stage { height:calc(100cqw * 9.4 / 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: iceland-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)); }
}
