/* History of Norway — overrides loaded after core/css/style.css: the inline
   SVG logo, four rulers-tab icons, ten At a Glance ages in one row, the
   heads of government in "Who Was in Power", and the "The Making of Norway"
   map layers (js/norway-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 — Viking Age (longship), Medieval Kingdom (stave church),
   Union Kings (two linked rings) and Since 1905 (Nordic-cross flag) tab
   icons; site.php gives those tabs icon 'none', so they are drawn here in
   the tab's text colour.
════════════════════════════════════════ */
.rp-tab[data-tab="viking"]::before,
.rp-tab[data-tab="medieval"]::before,
.rp-tab[data-tab="union"]::before,
.rp-tab[data-tab="modern"]::before {
  content:''; flex-shrink:0; width:14px; height:14px;
  background-color:currentColor;
  -webkit-mask:var(--no-tab-icon) center / contain no-repeat;
  mask:var(--no-tab-icon) center / contain no-repeat;
}
.rp-tab[data-tab="viking"] {
  --no-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.5h13c-1 2-3 3-6.5 3s-5.5-1-6.5-3zM2.2 10.5c-.6-1.4-.4-2.7.6-3.4M13.8 10.5c.6-1.4.4-2.7-.6-3.4M8 10.5V2M8 2.6l4 3.2H8M8 2.6L4 5.8h4' fill='none' stroke='%23000' stroke-width='1.2' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="medieval"] {
  --no-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.5 5h5zM4.5 5h7L13.5 9h-11zM3.5 9h9v5.5h-9zM6.6 14.5v-3a1.4 1.4 0 0 1 2.8 0v3' fill='none' stroke='%23000' stroke-width='1.2' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="union"] {
  --no-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='5.8' cy='8' r='3.9' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3Ccircle cx='10.2' cy='8' r='3.9' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="modern"] {
  --no-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.5V2M3.5 2.5h9.5v6.5H3.5M7 2.5v6.5M3.5 5.7h9.5' fill='none' stroke='%23000' stroke-width='1.3' 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)); }
@media (max-width:1100px) {
  .bib-groups { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}

/* ════════════════════════════════════════
   "Who Was in Power" — the king beside the head(s) of government: in the
   union with Sweden both the first minister in Christiania and the prime
   minister in Stockholm, under the occupation the exiled government and
   the occupation authorities. The coloured dot names the party. 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 — "The Making of Norway" (js/norway-map.js), as in the prototype
   data/norway-map.html: the sea, the graticule, the 46 zones coloured by
   who held them (Norwegian-crown lands drawn stronger and on top), the
   lakes over them and the places.
════════════════════════════════════════ */
.em-sea { fill:#0a1822; }
.fm-graticule { fill:none; stroke:rgba(255,255,255,0.06); stroke-width:0.6; vector-effect:non-scaling-stroke; pointer-events:none; }
.fm-lakes { fill:#0a1822; stroke:rgba(255,255,255,0.08); stroke-width:0.3; vector-effect:non-scaling-stroke; pointer-events:none; }
.cm-country { fill:#24222c; stroke:rgba(5,8,12,0.75); stroke-width:0.6; vector-effect:non-scaling-stroke; transition:fill 0.9s cubic-bezier(.4,0,.2,1); }
.cm-country.core { stroke:rgba(255,235,210,0.28); stroke-width:0.7; }
.cm-country.claim { stroke:#ffd0d8 !important; stroke-dasharray:4 3; stroke-width:1.2; }
.cm-country:hover { stroke:var(--gold) !important; stroke-width:1.4; }
/* Statuses: only those on the map in the year shown are listed. */
.cm-lg--trad { grid-template-columns:repeat(2, minmax(0, auto)); }
.cm-lg--trad span { cursor:default; }
.cm-lg--trad span b { font-weight:inherit; }
.cm-lg span { transition:opacity 0.4s; }
#cm-lg-trad span.off { display:none; }
.cm-lg i { border-radius:2px; }
.cm-lg i.fm-key-core { background:#c8102e; border:1px solid rgba(255,235,210,0.5); }
.cm-lg i.fm-key-lake { background:#0a1822; border:1px solid rgba(255,255,255,0.3); }
/* "Norway in YEAR" thumbnails (event modal, timeline corner card): the sea
   behind the zones, the lakes over them. */
.em-map-thumb svg { background:#0a1822; }
.em-map-thumb svg .fm-thumb-lakes { fill:#0a1822; stroke:none; }

/* Head of state and of government of the year shown, under the chapter
   text (as Finland's). */
.em-power.cm-power { display:block; margin-top:4px; }
.em-power.cm-power[hidden] { display:none; }
.em-power.cm-power > .em-power-heading { margin:22px 0 10px; }
.cm-power-cards { display:grid; grid-template-columns:minmax(0, 1fr); gap:10px; }
.cm-power .em-power-card { padding:6px 8px 6px 6px; border:1px solid rgba(255,255,255,0.1); border-radius:4px; gap:12px; }
.cm-power .em-power-portrait { width:42px; height:48px; }
.cm-power .em-power-name { font-size:16px; }
.cm-power .em-power-title,
.cm-power .em-power-reign,
.cm-power .em-power-party { margin-top:2px; }

/* Nine era buttons in one row on wide screens; 30 chapters (norway-map.js
   marks the year labels that would collide; the current one always shows). */
.cm-eras { grid-template-columns:repeat(9, minmax(0, 1fr)); }
.cm-eras button { padding-left:4px; padding-right:4px; }
.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:1200px) {
  .cm-eras { grid-template-columns:repeat(5, minmax(0, 1fr)); }
}
@media (max-width:900px) {
  .cm-eras { grid-template-columns:repeat(3, minmax(0, 1fr)); }
}
@media (max-width:600px) {
  .cm-lg--trad { grid-template-columns:minmax(0, 1fr); }
}
