/* Kiel Institute overrides for Metropolis theme
   Brand colors: #194ABB (blue), #FF6A00 (orange) */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --kiel-blue: #194ABB;
  --kiel-blue-dark: #123580;
  --kiel-orange: #FF6A00;
  --kiel-orange-dark: #cc5500;
  --text-dark: #1a1a1a;
  --text-muted: #666;
}

/* ===== Global: white background, Source Sans Pro ===== */

html, body {
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
}

body.dark {
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
}

.reveal {
  font-family: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, sans-serif !important;
  color: var(--text-dark) !important;
  font-weight: 400;
}

.reveal .slides > section {
  background-color: transparent !important;
}

/* ===== Headings in Kiel blue ===== */

.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
  font-family: "Source Sans 3", "Source Sans Pro", -apple-system, sans-serif !important;
  color: var(--kiel-blue) !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  text-transform: none;
}

.reveal h2 {
  font-size: 1.6em;
  line-height: 1.15;
  margin-bottom: 0.7em;
}

.reveal h3 {
  font-size: 1.05em;
  color: var(--kiel-blue-dark) !important;
  font-weight: 600;
}

/* Vertical centering handled natively by reveal.js `center: true` option */

.reveal .slides > section {
  text-align: left;
}

/* ===== Section divider slides (dark background, centered) ===== */

section[data-background-color="#194ABB"],
section[data-background-color="#194abb"] {
  background-color: var(--kiel-blue) !important;
}

/* Black-background slides: keep the section transparent so the
   background-color attribute shows through without a blue box */
section[data-background-color="#000000"] {
  background-color: transparent !important;
}

section[data-background-color="#194ABB"] h1,
section[data-background-color="#194ABB"] h2,
section[data-background-color="#194ABB"] h3,
section[data-background-color="#194abb"] h1,
section[data-background-color="#194abb"] h2,
section[data-background-color="#194abb"] h3,
section.has-dark-background h1,
section.has-dark-background h2,
section.has-dark-background h3 {
  color: #FFFFFF !important;
  font-weight: 700 !important;
  font-size: 2.4em !important;
  text-align: center;
  letter-spacing: -0.02em;
}

section.has-dark-background p,
section.has-dark-background li,
section.has-dark-background strong {
  color: #FFFFFF !important;
}

/* ===== Title slide ===== */

.reveal #title-slide,
.reveal .title-slide {
  text-align: left !important;
}

.reveal #title-slide .title,
.reveal .title-slide .title {
  color: var(--kiel-blue) !important;
  font-weight: 700 !important;
  font-size: 2.2em !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 0.2em !important;
  font-variant: normal !important;
  text-transform: none !important;
}

.reveal #title-slide .subtitle,
.reveal .title-slide .subtitle {
  color: var(--kiel-orange) !important;
  font-weight: 400 !important;
  font-size: 1.15em !important;
  font-style: normal !important;
  margin-top: 0 !important;
}

.reveal #title-slide .quarto-title-author-name,
.reveal #title-slide .author {
  color: var(--text-dark) !important;
  font-weight: 500 !important;
}

.reveal #title-slide .institute,
.reveal #title-slide .quarto-title-affiliation,
.reveal .title-slide .quarto-title-affiliation {
  color: var(--text-muted) !important;
  font-weight: 400 !important;
  font-style: normal !important;
  font-size: 0.85em !important;
}

.reveal #title-slide .date,
.reveal #title-slide .quarto-title-date {
  color: #999 !important;
  font-weight: 400 !important;
  font-size: 0.8em !important;
}

/* ===== Progress bar in Kiel orange ===== */

.reveal .progress {
  color: var(--kiel-orange) !important;
  background-color: rgba(0, 0, 0, 0.08) !important;
  height: 5px !important;
}

.reveal .progress span {
  background: var(--kiel-orange) !important;
  background-color: var(--kiel-orange) !important;
}

/* ===== Slide number and footer ===== */

.reveal .slide-number,
.reveal.has-logo .slide-number {
  color: #999 !important;
  font-size: 0.55em !important;
  font-weight: 400 !important;
}

.reveal .footer {
  color: #999 !important;
  font-size: 0.5em !important;
  font-weight: 400 !important;
}

/* ===== Links ===== */

.reveal a {
  color: var(--kiel-blue) !important;
  text-decoration: underline;
  text-decoration-color: rgba(255, 106, 0, 0.4);
  text-underline-offset: 3px;
  transition: all 0.2s ease;
}

.reveal a:hover {
  color: var(--kiel-orange) !important;
  text-decoration-color: var(--kiel-orange);
}

/* Keep links inside dark-background sections readable */
section.has-dark-background a {
  color: #FFD099 !important;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

/* ===== Lists ===== */

.reveal ul {
  padding-left: 1.2em;
}

.reveal ul li::marker {
  color: var(--kiel-orange);
  font-weight: 600;
}

.reveal ol li::marker {
  color: var(--kiel-blue);
  font-weight: 600;
}

.reveal ul li,
.reveal ol li {
  margin-bottom: 0.4em;
  line-height: 1.45;
}

/* ===== Blockquote ===== */

.reveal blockquote {
  border-left: 4px solid var(--kiel-orange) !important;
  padding: 0.5em 1.2em;
  background: rgba(255, 106, 0, 0.05);
  font-style: italic;
  color: var(--text-dark);
  margin: 0.8em 0;
  font-weight: 400;
}

/* ===== Inline code ===== */

.reveal p code,
.reveal li code,
.reveal td code {
  background: rgba(25, 74, 187, 0.08) !important;
  color: var(--kiel-blue) !important;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.85em;
  font-family: "JetBrains Mono", monospace;
}

/* ===== Code blocks ===== */

.reveal pre {
  background: #1e1e2e !important;
  border: none !important;
  border-radius: 6px;
  padding: 0.8em 1em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Scrollable code blocks */
.reveal pre[style*="overflow-y"] {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,106,0,0.4) transparent;
}

.reveal pre[style*="overflow-y"]::-webkit-scrollbar {
  width: 6px;
}

.reveal pre[style*="overflow-y"]::-webkit-scrollbar-thumb {
  background: rgba(255,106,0,0.4);
  border-radius: 3px;
}

.reveal pre code {
  color: #e8e8e8 !important;
  font-family: "JetBrains Mono", monospace !important;
  font-size: 0.7em;
  line-height: 1.5;
  background: transparent !important;
}

/* ===== Tables ===== */

.reveal table {
  font-family: "Source Sans 3", "Source Sans Pro", sans-serif !important;
  font-size: 0.85em;
  margin: 0.8em auto;
  border-collapse: collapse;
}

.reveal table th {
  background: var(--kiel-blue) !important;
  color: white !important;
  padding: 0.55em 1em !important;
  font-weight: 500;
  text-align: left;
  border: none !important;
}

.reveal table td {
  padding: 0.45em 1em !important;
  border-bottom: 1px solid rgba(25, 74, 187, 0.1) !important;
  text-align: left;
}

.reveal table tbody tr:hover {
  background: rgba(255, 106, 0, 0.04);
}

/* ===== Callouts ===== */

.reveal .callout {
  border-radius: 4px;
  margin: 0.8em 0;
}

.reveal .callout-tip,
.reveal .callout-note {
  border-left: 4px solid var(--kiel-orange) !important;
  background-color: rgba(255, 106, 0, 0.05) !important;
}

.reveal .callout-important,
.reveal .callout-warning {
  border-left: 4px solid var(--kiel-orange) !important;
  background-color: rgba(255, 106, 0, 0.06) !important;
}

.reveal .callout-title {
  color: var(--kiel-blue) !important;
  font-weight: 600;
}

/* ===== Asides ===== */

.reveal aside.aside,
.reveal .aside {
  font-size: 0.55em !important;
  color: #888 !important;
  font-style: italic;
  margin-top: 1em;
  border: none;
}

/* ===== Columns: more vertical breathing room ===== */

.reveal .columns {
  display: flex;
  align-items: center;
}

/* ===== Figures — cap height so they don't overflow ===== */

.reveal .figure-img,
.reveal figure img,
.reveal section img {
  margin-top: 0.4em;
  margin-bottom: 0.4em;
  max-height: 500px;
  object-fit: contain;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* In a column layout, images can fill more space */
.reveal .columns img {
  max-height: 460px;
}

/* Fragments */
.reveal .fragment.highlight-current-orange.current-fragment {
  color: var(--kiel-orange);
}
