/* amadeusbach.com. Colours follow the University of Mannheim / MISES web palette
   (dark blue #00325d, blue-grey #455d82, light #d1d7df). System fonts only:
   nothing is loaded from third parties. */

:root {
  --blue: #00325d;
  --blue-2: #455d82;
  --blue-light: #d1d7df;
  --blue-tint: #eef1f5;
  --text: #1f2933;
  --muted: #5b6573;
  --rule: #e2e6eb;
  --bg: #ffffff;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); -webkit-text-size-adjust: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
sub { font-size: 0.7em; line-height: 0; }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Top bar: white, like the university pages */
.topbar { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--rule); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { color: var(--blue); font: 600 1.15rem/1 var(--serif); letter-spacing: 0.01em; }
.topbar nav { display: flex; gap: 24px; flex-wrap: wrap; }
.topbar nav a { color: var(--blue); font-size: 0.93rem; font-weight: 500; }

/* Hero: palace photo under a dark-blue tint, name and portrait on top */
.hero {
  margin-top: 0; position: relative; color: #fff;
  background: url("banner-ehrenhof.jpg") center 55% / cover no-repeat;
}
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(0,50,93,0.94) 0%, rgba(0,50,93,0.86) 55%, rgba(0,50,93,0.70) 100%); }
.hero-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 40px; padding-top: 52px; padding-bottom: 52px; }
.hero h1 { margin: 0; font: 400 clamp(2.3rem, 5vw, 3.3rem)/1.1 var(--serif); }
.hero-position { margin: 14px 0 0; font-size: 1.15rem; font-weight: 500; }
.hero-affil { margin: 4px 0 0; font-size: 1rem; color: #d7dfea; max-width: 46ch; }
.portrait { width: 220px; height: auto; display: block; border: 4px solid #fff; border-radius: 2px; box-shadow: 0 6px 24px rgba(0,0,0,0.25); flex: none; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.pill { display: inline-block; padding: 6px 16px; border: 1px solid rgba(255,255,255,0.75); border-radius: 3px; color: #fff; font-size: 0.9rem; letter-spacing: 0.02em; }
.pill:hover { background: #fff; color: var(--blue); text-decoration: none; }

main { padding-bottom: 48px; }
section { margin-top: 48px; }
.bio { margin-top: 40px; max-width: 80ch; font-size: 1.05rem; }
.bio p { margin: 0 0 14px; }

h2 { font: 400 1.6rem/1.25 var(--serif); color: var(--blue); margin: 48px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--blue-light); }
#research > h2:first-child, #teaching > h2:first-child, #media > h2:first-child { margin-top: 0; }
h2 .lang { font-size: 1rem; color: var(--muted); }
.section-note { margin: -4px 0 8px; color: var(--muted); font-size: 0.95rem; }

/* Papers */
.papers { list-style: none; margin: 0; padding: 0; }
.paper { padding: 16px 0 16px 16px; border-left: 3px solid var(--blue-light); margin: 0 0 14px; }
.paper:hover { border-left-color: var(--blue); }
.paper p { margin: 0; }
.paper-title { font: 600 1.1rem/1.4 var(--serif); }
.paper-title a { color: var(--blue); }
.paper-meta { color: var(--muted); font-size: 0.95rem; margin-top: 2px !important; }
.paper-src { font-size: 0.95rem; }
.outlet { font-style: italic; }
.summary { margin-top: 8px !important; font-size: 0.97rem; color: #33404d; max-width: 82ch; }
.compact .paper { padding-top: 10px; padding-bottom: 10px; }
.paper.note { border-left-style: dashed; padding-top: 8px; padding-bottom: 8px; color: var(--muted); font-size: 0.95rem; font-style: italic; }

/* Lists */
table.list { border-collapse: collapse; width: 100%; }
table.list td { padding: 9px 0; vertical-align: top; border-bottom: 1px solid var(--rule); }
table.list tr:last-child td { border-bottom: 0; }
td.yr { width: 140px; color: var(--muted); font-size: 0.92rem; white-space: nowrap; padding-right: 18px; }
.course { display: block; }
.where { display: block; color: var(--muted); font-size: 0.92rem; }

/* Video (loads from YouTube only after a click) */
.video { margin: 0 0 24px; max-width: 800px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--blue); border-radius: 3px; overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-start {
  all: unset; box-sizing: border-box; cursor: pointer; position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px; text-align: center; color: #fff;
  background: linear-gradient(rgba(0,50,93,0.80), rgba(0,50,93,0.92)), url("banner-ehrenhof.jpg") center / cover;
}
.video-start:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.play { width: 72px; height: 72px; border-radius: 50%; background: #fff; position: relative; box-shadow: 0 4px 18px rgba(0,0,0,0.3); }
.play::after { content: ""; position: absolute; left: 29px; top: 22px; border-style: solid; border-width: 14px 0 14px 22px; border-color: transparent transparent transparent var(--blue); }
.video-start:hover .play { transform: scale(1.06); }
.video-title { font: 400 1.3rem/1.3 var(--serif); max-width: 30ch; }
.video-note { font-size: 0.8rem; color: #d7dfea; max-width: 52ch; }
.video-note a { color: #fff; text-decoration: underline; }
.video figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 8px; }

/* Footer: dark blue */
.footer { background: var(--blue); color: #e6ebf2; margin-top: 64px; }
.footer a { color: #fff; }
.footer-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding-top: 40px; padding-bottom: 8px; }
.footer h2 { font: 600 0.8rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.12em; color: #aebbd0; border: 0; margin: 0 0 12px; padding: 0; }
.footer p { margin: 0 0 12px; font-size: 0.95rem; }
.footer-legal { padding-top: 10px; padding-bottom: 30px; border-top: 1px solid rgba(255,255,255,0.18); }
.footer-legal p { margin: 10px 0 0; font-size: 0.82rem; color: #c3cedd; }
.footer-legal .credit { font-size: 0.75rem; }

/* Legal page */
main.legal { max-width: 780px; }
main.legal h1 { font: 400 2rem/1.2 var(--serif); color: var(--blue); margin: 40px 0 8px; }
main.legal h2 { font-size: 1.15rem; margin: 26px 0 8px; border-bottom-width: 1px; }
main.legal p { margin: 0 0 12px; }

/* Light/dark switch in the top bar */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-left: -6px; padding: 0;
  border: 1px solid var(--blue-light); border-radius: 50%;
  background: transparent; color: var(--blue); cursor: pointer;
}
.theme-toggle:hover { background: var(--blue-tint); }
.theme-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.topbar nav { align-items: center; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* Dark mode (MISES blue, darkened): follows the system setting unless the
   visitor picks a mode with the switch; set as data-theme on <html>. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1828;
  --text: #e1e7ef;
  --muted: #9fadbf;
  --rule: #22344b;
  --blue-light: #2c4362;
  --blue-tint: #15263b;
  --link: #9cc2ec;
}
:root[data-theme="dark"] a { color: var(--link); }
:root[data-theme="dark"] .topbar { background: #0b1828; border-bottom-color: #1d2f45; }
:root[data-theme="dark"] .brand,
:root[data-theme="dark"] .topbar nav a,
:root[data-theme="dark"] .theme-toggle { color: #e1e7ef; }
:root[data-theme="dark"] .theme-toggle { border-color: #3a5273; }
:root[data-theme="dark"] h2,
:root[data-theme="dark"] main.legal h1 { color: #b8cde8; }
:root[data-theme="dark"] .paper-title a { color: #cfe0f4; }
:root[data-theme="dark"] .paper:hover { border-left-color: #6f97c6; }
:root[data-theme="dark"] .summary { color: #c3cdd9; }
:root[data-theme="dark"] .hero::before { background: linear-gradient(100deg, rgba(3,22,42,0.95) 0%, rgba(3,22,42,0.88) 55%, rgba(3,22,42,0.74) 100%); }
:root[data-theme="dark"] .footer { background: #061322; }
:root[data-theme="dark"] .footer a,
:root[data-theme="dark"] .pill,
:root[data-theme="dark"] .video-note a { color: #fff; }
:root[data-theme="dark"] .pill:hover { color: #0b1828; }
:root[data-theme="dark"] .portrait { border-color: #e1e7ef; }

/* Without JavaScript, still follow a dark system setting */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { color-scheme: dark; --bg: #0b1828; --text: #e1e7ef; --muted: #9fadbf; --rule: #22344b; --blue-light: #2c4362; }
}

/* Phones and small tablets */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .topbar-inner { padding-top: 8px; padding-bottom: 8px; min-height: 0; }
  .topbar nav { gap: 16px; }
  .hero-inner { flex-direction: column-reverse; align-items: flex-start; gap: 24px; padding-top: 32px; padding-bottom: 36px; }
  .portrait { width: 150px; }
  .bio { font-size: 1rem; }
  .paper { padding-left: 12px; }
  td.yr { width: 100px; white-space: normal; }
  .video-title { font-size: 1.05rem; }
  .play { width: 56px; height: 56px; }
  .play::after { left: 22px; top: 16px; border-width: 12px 0 12px 18px; }
  .footer-inner { grid-template-columns: 1fr; gap: 8px; padding-top: 28px; }
}
