/* History of Estonia — 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 and other rulers in "Who Was in Power", and the
   "Estonia Through Time" map layers (js/estonia-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 — Medieval Livonia (cross of the orders), Kings & Emperors
   (castle), Republic of Estonia (flag) and Occupations (barbed wire) tab
   icons; site.php gives those tabs icon 'none', so they are drawn here in
   the tab's text colour.
════════════════════════════════════════ */
.rp-tab[data-tab="medieval"]::before,
.rp-tab[data-tab="crowns"]::before,
.rp-tab[data-tab="republic"]::before,
.rp-tab[data-tab="occupation"]::before {
  content:''; flex-shrink:0; width:14px; height:14px;
  background-color:currentColor;
  -webkit-mask:var(--ee-tab-icon) center / contain no-repeat;
  mask:var(--ee-tab-icon) center / contain no-repeat;
}
.rp-tab[data-tab="medieval"] {
  --ee-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.5v13M3 5.5h10M8 1.5l-1.4 1.8M8 1.5l1.4 1.8M8 14.5l-1.4-1.8M8 14.5l1.4-1.8M3 5.5l1.8-1.4M3 5.5l1.8 1.4M13 5.5l-1.8-1.4M13 5.5l-1.8 1.4' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="crowns"] {
  --ee-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 14.2V5.5h2V7h1.5V5.5h3V7H11V5.5h2v8.7zM6.4 14.2v-2.6a1.6 1.6 0 0 1 3.2 0v2.6M1.8 14.2h12.4' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="republic"] {
  --ee-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.5M3.5 4.7h9.5M3.5 6.8h9.5' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="occupation"] {
  --ee-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 6c2.2 0 2.2 4 4.3 4s2.1-4 4.3-4 2.2 4 4.4 4M4.2 6.6l1.6 2.8M5.8 6.6L4.2 9.4M10.2 6.6l1.6 2.8M11.8 6.6l-1.6 2.8M1.5 2v12M14.5 2v12' 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 head of state beside the head of government and
   the rulers of other parts of Estonia (Danish kings, Order masters,
   prince-bishops, occupiers); the coloured line under each side card names
   the party, or the territory a ruler held. 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 — "Estonia Through Time" (js/estonia-map.js), as in the prototype
   data/estonia-map.html: the sea, the land, the counties and neighbouring
   lands coloured by their ruler, the dashed outline of the Estonian lands
   (with Petserimaa and Narvataguse), the lakes and the places.
════════════════════════════════════════ */
.em-sea { fill:#0b1a26; }
.cm-sphere { fill:#1b1a22; stroke:#2a2834; stroke-width:0.6; vector-effect:non-scaling-stroke; }
.cm-grat { fill:#0f2130; stroke:rgba(120,170,210,0.25); stroke-width:0.5; vector-effect:non-scaling-stroke; pointer-events:none; }
.cm-country { fill:#24222c; stroke:#0a0910; stroke-width:0.7; }
.cm-country.core { stroke:#0a0910; stroke-width:0.9; }
.em-outline {
  fill:none; stroke:rgba(255,255,255,0.75); stroke-width:1.6; stroke-dasharray:5 3;
  vector-effect:non-scaling-stroke; pointer-events:none;
}
/* Rulers: 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 span { transition:opacity 0.4s; }
#cm-lg-trad span.off { display:none; }
.cm-lg i { border-radius:2px; }
.cm-lg i.em-key-outline { background:none; border:1.5px dashed rgba(255,255,255,0.8); }
.cm-lg i.em-key-lake { background:#0f2130; border:1px solid rgba(120,170,210,0.4); }
/* "Estonia in YEAR" thumbnail in the event modal: the land under the regions. */
.em-map-thumb svg .em-thumb-land { fill:#1b1a22; stroke:none; }

/* Nine era buttons; 32 chapters (estonia-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:900px) {
  .cm-eras { grid-template-columns:repeat(3, minmax(0, 1fr)); }
}
@media (max-width:600px) {
  .cm-lg--trad { grid-template-columns:minmax(0, 1fr); }
}
