/* History of Malta — overrides loaded after core/css/style.css: the
   inline SVG logo, six rulers-tab icons, ten At a Glance ages in one
   row, the co-rulers and heads of government in "Who Was in Power", and the
   "Malta Through Time" map layers (js/malta-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 — Ancient Powers (public building), Kings of Sicily
   (crown), Grand Masters (Maltese cross), British Monarchs (crown),
   Presidents (flag), Governors (key) tab icons; site.php gives those tabs
   icon 'none', so they are drawn here in the tab's text colour.
════════════════════════════════════════ */
.rp-tab[data-tab="powers"]::before,
.rp-tab[data-tab="kings"]::before,
.rp-tab[data-tab="grand-masters"]::before,
.rp-tab[data-tab="monarchs"]::before,
.rp-tab[data-tab="presidents"]::before,
.rp-tab[data-tab="governors"]::before {
  content:''; flex-shrink:0; width:14px; height:14px;
  background-color:currentColor;
  -webkit-mask:var(--mt-tab-icon) center / contain no-repeat;
  mask:var(--mt-tab-icon) center / contain no-repeat;
}
.rp-tab[data-tab="powers"] {
  --mt-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1.8 14.2h12.4M1.5 6.2L8 3l6.5 3.2zM3 6.2h10M4 7.5v5M6.7 7.5v5M9.3 7.5v5M12 7.5v5M2.5 12.6h11' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="kings"] {
  --mt-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="grand-masters"] {
  --mt-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 7.2L5.6 1.6 8 3 10.4 1.6zM8.8 8l5.6-2.4L13 8l1.4 2.4zM8 8.8l2.4 5.6L8 13l-2.4 1.4zM7.2 8L1.6 10.4 3 8 1.6 5.6z' fill='%23000'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="monarchs"] {
  --mt-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%3Ccircle cx='8' cy='2.2' r='.9' fill='%23000'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="presidents"] {
  --mt-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"] {
  --mt-tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='5' cy='8' r='3' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3Cpath d='M8 8h6.2M11.8 8v2.4M13.6 8v1.8' fill='none' stroke='%23000' stroke-width='1.3' 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 ruler beside co-rulers and the heads of
   government (governor and head of ministry or 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 — "Malta Through Time" (js/malta-map.js), as in the
   prototype data/malta-map.html: a dark background, the land behind
   the shapes, the 68 local councils of Malta, Gozo and Comino,
   independent Malta's outline (from 1964 on) and the council 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(8, minmax(0, 1fr)); }
.cm-eras button { padding-left:4px; padding-right:4px; }
/* 18 chapters: malta-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(4, minmax(0, 1fr)); }
}
