/* History of Ireland — overrides loaded after core/css/style.css: the inline
   SVG logo, four rulers-tab icons, twelve At a Glance ages in one row, the
   heads of government in "Who Was in Power", and the "Ireland Through Time"
   map layers (js/ireland-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 — High Kings (harp), Lords & Monarchs (castle), Presidents
   (Áras an Uachtaráin), Dáil & Taoisigh (flag) and Northern Ireland
   (Stormont) tab icons; site.php gives those tabs icon 'none', so they are
   drawn here in the tab's text colour.
════════════════════════════════════════ */
.rp-tab[data-tab="high-kings"]::before,
.rp-tab[data-tab="crown"]::before,
.rp-tab[data-tab="presidents"]::before,
.rp-tab[data-tab="independent"]::before,
.rp-tab[data-tab="northern-ireland"]::before {
  content:''; flex-shrink:0; width:14px; height:14px;
  background-color:currentColor;
  -webkit-mask:var(--ie-tab-icon) center / contain no-repeat;
  mask:var(--ie-tab-icon) center / contain no-repeat;
}
.rp-tab[data-tab="high-kings"] {
  --ie-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 2.5l7 11.5M3 2.5c2-.6 3 1.6 5 1.4s3.2-1.3 5.2.2c.6 3.6-.6 7.4-2.7 9.9M6 5v3.5M8.3 4.8v6.4' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="crown"] {
  --ie-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="presidents"] {
  --ie-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="independent"] {
  --ie-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.5M6.7 2.5V9M9.8 2.5V9' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}
.rp-tab[data-tab="northern-ireland"] {
  --ie-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.4M2.5 14.2V8.5h11v5.7M2 8.5L8 5.5l6 3M4.5 8.5v5.7M7 8.5v5.7M9 8.5v5.7M11.5 8.5v5.7M8 5.5V2.5' fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ════════════════════════════════════════
   At a Glance — twelve 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 heads of government in
   London, Dublin and Belfast; 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 — "Ireland Through Time" (js/ireland-map.js), as in the prototype
   data/ireland-map.html: a sea background, the province lines, the 32
   counties, the coastline, the 1921 border (from partition on) and the
   county 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-country { fill:#24212c; stroke:#0a0810; stroke-width:0.7; }
.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.2; stroke-dasharray:6 4; 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 island: a taller stage than the world map, nine 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(9, minmax(0, 1fr)); }
.cm-eras button { padding-left:4px; padding-right:4px; }
/* 37 chapters: ireland-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)); }
}
