/*
 * CICERO styling for the METEOR explorer at pages.cicero.oslo.no/meteor/.
 *
 * The deploy workflow links this file after Ben's own stylesheet, so these
 * rules win. It works by overriding the colour variables in Ben's
 * src/app/style.css (--accent, --fg, --surface, ...), which the charts also
 * read, plus the font and the CICERO header (header.html). Scenario line
 * colours come from Ben's code and are left alone.
 *
 * If an update from Ben makes the page look wrong, check whether he renamed
 * these variables or classes. See meteor/UPDATING.md.
 */

@font-face {
  font-family: 'Averta';
  src: url('/fonts/AvertaPE/regular.woff2') format('woff2'),
       url('/fonts/AvertaPE/regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Averta';
  src: url('/fonts/AvertaPE/regular-italic.woff2') format('woff2'),
       url('/fonts/AvertaPE/regular-italic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Averta';
  src: url('/fonts/AvertaPE/semi-bold.woff2') format('woff2'),
       url('/fonts/AvertaPE/semi-bold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Averta';
  src: url('/fonts/AvertaPE/bold.woff2') format('woff2'),
       url('/fonts/AvertaPE/bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Colours: CICERO blue as the accent, warm greys for surfaces. */
:root {
  --cicero-blue: #1d3461;
  --cicero-blue-mid: #2a4a8a;

  --bg: #ffffff;
  --surface: #f7f6f3;
  --border: #e8e8e4;
  --grid: #ecebe6;
  --fg: #1a1a2e;
  --muted: #666666;
  --accent: var(--cicero-blue);
  --warm: #c0392b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1626;
    --surface: #152036;
    --border: #23314d;
    --grid: #1f2b44;
    --fg: #e6e9ef;
    --muted: #a3acbb;
    --accent: #8fb0e6;
    --warm: #f08070;
  }
}

body {
  font-family: 'Averta', Arial, sans-serif;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

h1 {
  color: var(--cicero-blue);
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  h1 {
    color: var(--fg);
  }
}

/* The header is now above the title, so the title needs less room on top. */
.masthead {
  padding-top: 32px;
}

/* CICERO header (header.html) */
.cicero-bar {
  /* full width: cancel the body's 16px side padding */
  margin: 0 -16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.cicero-bar__inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cicero-bar__logo {
  display: flex;
  align-items: center;
}

.cicero-bar__logo img {
  display: block;
  height: 48px;
  width: auto;
}

.cicero-bar__link {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.cicero-bar__link:hover {
  color: var(--accent);
}

@media (max-width: 600px) {
  .cicero-bar__logo img {
    height: 34px;
  }
}

/* CICERO footer (footer.html): the developers and a citation. */
body {
  /* Ben's body has 64px of bottom padding; the footer takes that place. */
  padding-bottom: 0;
}

.cicero-footer {
  margin: 56px -16px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.cicero-footer__inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  display: grid;
  gap: 32px;
}

.cicero-footer h2 {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.cicero-people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px 20px;
}

.cicero-person {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fg);
  text-decoration: none;
}

.cicero-person:hover .cicero-person__name {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cicero-person__photo {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.95rem;
}

/* The portrait covers the initials; if it is missing, the initials show. */
.cicero-person__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cicero-person__name {
  font-weight: 600;
}

.cicero-citation {
  margin: 0 0 12px;
  max-width: 78ch;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.cicero-copy {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 7px 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
}

.cicero-copy:hover {
  filter: brightness(1.15);
}

.cicero-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cicero-copy__status {
  margin-left: 10px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* One reference with its copy button; several stack in "Publications". */
.cicero-ref + .cicero-ref {
  margin-top: 18px;
}

.cicero-footer__lead {
  margin: 0 0 12px;
  max-width: 78ch;
  font-size: 0.92rem;
  color: var(--muted);
}

.cicero-citation a {
  color: var(--accent);
  text-underline-offset: 3px;
}
