/* Material Electrodynamics and Quantum Technologies — site stylesheet
   Plain CSS, no framework. Colors are defined once here. */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&display=swap');

:root {
  --blue: #0a3d7a;          /* Federico II blue */
  --blue-soft: #e8eef6;
  --text: #1c2430;
  --muted: #5b6573;
  --rule: #dde2e8;
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --figure-bg: #ffffff;     /* research figures have white backgrounds */
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'Source Sans 3', -apple-system, 'Segoe UI', sans-serif;
  --width: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #8db4e8;
    --blue-soft: #1a2636;
    --text: #e4e7eb;
    --muted: #9aa3ae;
    --rule: #2c333d;
    --bg: #12161c;
    --bg-alt: #171c23;
  }
}
:root[data-theme="dark"] {
  --blue: #8db4e8;
  --blue-soft: #1a2636;
  --text: #e4e7eb;
  --muted: #9aa3ae;
  --rule: #2c333d;
  --bg: #12161c;
  --bg-alt: #171c23;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

.wrap {
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.brand img { width: 44px; height: 44px; }

.brand-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
}
.brand-name small {
  display: block;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: .02em;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 26px;
}

.site-nav a {
  color: var(--muted);
  font-size: 16px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--blue);
}

/* ---------- Sections ---------- */

section { padding: 64px 0; }
section + section { border-top: 1px solid var(--rule); }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 12px;
}

.section-title {
  font-size: 30px;
  margin-bottom: 32px;
}

/* ---------- Home: intro ---------- */

.intro { padding: 80px 0 64px; }

.intro h1 {
  font-size: clamp(34px, 5vw, 50px);
  letter-spacing: -0.01em;
  max-width: 16ch;
  margin-bottom: 24px;
}

.lede {
  font-size: 21px;
  color: var(--muted);
  max-width: 62ch;
  margin: 0;
}
.lede a { color: var(--text); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.lede a:hover { text-decoration-color: var(--blue); }

.affiliation {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 36px;
}
.affiliation img { height: 56px; width: auto; }
.affiliation span { font-size: 14px; color: var(--muted); line-height: 1.4; }

/* ---------- Home: research ---------- */

.topics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.topic figure {
  margin: 0 0 20px;
  aspect-ratio: 16 / 10;
  background: var(--figure-bg);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.topic figure img {
  max-height: 100%;
  object-fit: contain;
}

.topic h3 { font-size: 21px; margin-bottom: 10px; }
.topic p { margin: 0; color: var(--muted); font-size: 16.5px; }

/* ---------- Home: news ---------- */

.news {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 760px;
}
.news li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.news li:first-child { border-top: 1px solid var(--rule); }
.news time { color: var(--muted); font-size: 15px; padding-top: 2px; }

/* ---------- Home: openings callout ---------- */

.callout {
  background: var(--blue-soft);
  padding: 36px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
  flex-wrap: wrap;
}
.callout h2 { font-size: 24px; margin-bottom: 6px; }
.callout p { margin: 0; color: var(--muted); }

.button {
  display: inline-block;
  background: var(--blue);
  color: var(--bg);
  padding: 10px 22px;
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
}
.button:hover { text-decoration: none; opacity: .9; }

/* ---------- Members ---------- */

.page-head { padding: 64px 0 8px; }
.page-head h1 { font-size: clamp(32px, 4.5vw, 44px); margin-bottom: 12px; }
.page-head p { color: var(--muted); margin: 0; max-width: 60ch; }

.people {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.person img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 20%;
  background: var(--bg-alt);
  margin-bottom: 14px;
}

.person h3 { font-size: 19px; margin-bottom: 2px; }
.person h3 a { color: var(--text); }
.person h3 a:hover { color: var(--blue); }
.person p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* Alumni: compact list, no photos */
.alumni {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 760px;
}
.alumni li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.alumni li:first-child { border-top: 1px solid var(--rule); }
.alumni .name { font-family: var(--serif); font-weight: 600; }
.alumni .detail { color: var(--muted); font-size: 16px; text-align: right; }

/* ---------- Text pages (Lab, Openings) ---------- */

.prose { max-width: 72ch; }
.prose h3 { font-size: 22px; margin: 36px 0 10px; }
.prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 16px; }
.prose ul { margin: 0 0 20px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--blue); }
.prose .meta { color: var(--muted); font-size: 16px; }

/* ---------- Teaching: course cards ---------- */

.courses {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.course figure {
  margin: 0 0 16px;
  aspect-ratio: 16 / 10;
  background: var(--figure-bg);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.course figure img { max-height: 100%; object-fit: contain; }
.course h3 { font-size: 20px; margin-bottom: 6px; }
.course h3 a { color: var(--text); }
.course h3 a:hover { color: var(--blue); }
.course p { margin: 0; color: var(--muted); font-size: 16px; }
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 6px;
}

/* ---------- Openings: PhD programmes ---------- */

.programs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-top: 8px;
}
.program {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--rule);
  padding: 24px;
  color: var(--text);
}
.program:hover { border-color: var(--blue); text-decoration: none; }
.program .logo {
  background: #fff;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.program .logo img { max-height: 100%; width: auto; object-fit: contain; }
.program strong { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.program span { color: var(--muted); font-size: 15px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.video {
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 0;
  background: var(--bg-alt);
}

/* ---------- Publications (BibBase output) ---------- */

.bibbase-wrap { max-width: 860px; }
.bibbase-wrap a { word-break: break-word; }
.bibbase-wrap h1, .bibbase-wrap h2, .bibbase-wrap h3, .bibbase-wrap h4 {
  font-family: var(--serif);
  color: var(--text);
}
.bibbase-wrap .bibbase_group,
.bibbase-wrap .bibbase_group_head {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
  margin: 40px 0 16px;
}
.bibbase-wrap .bibbase_paper { margin-bottom: 18px; font-size: 16.5px; }
.bibbase-wrap .bibbase_paper_title { font-weight: 600; }
.bibbase-wrap img { display: inline-block; }

/* BibBase menu: CSS-only dropdowns (BibBase expects Bootstrap, which we don't load) */
.bibbase-wrap #bibbase_header .nav {
  list-style: none;
  margin: 0 0 8px !important;
  padding: 0;
  display: flex;
  gap: 10px;
}
.bibbase-wrap .dropdown { position: relative; }
.bibbase-wrap .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--rule);
  padding: 6px 14px !important;
  font-size: 15px;
  line-height: 1.3 !important;
  white-space: nowrap;
  color: var(--text);
  cursor: pointer;
}
.bibbase-wrap .dropdown-toggle:hover { border-color: var(--blue); text-decoration: none; }
.bibbase-wrap #menu_dropdown .dropdown-toggle::before { content: "More"; }
.bibbase-wrap .caret {
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}
.bibbase-wrap .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  min-width: 200px;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: var(--bg);
  border: 1px solid var(--rule);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
}
.bibbase-wrap .dropdown:hover .dropdown-menu,
.bibbase-wrap .dropdown:focus-within .dropdown-menu { display: block; }
.bibbase-wrap .dropdown-menu a {
  display: block;
  padding: 7px 16px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
}
.bibbase-wrap .dropdown-menu a:hover { background: var(--bg-alt); text-decoration: none; }
.bibbase-wrap .fa { display: none; } /* icon font not loaded */
.bibbase-wrap .bibbase_group_whole { margin-top: 8px; }
/* override BibBase's grey italic year bars */
.bibbase-wrap .bibbase_group {
  background: none !important;
  font-style: normal !important;
  padding: 0 0 6px !important;
  border-radius: 0 !important;
  cursor: pointer;
}
.bibbase-wrap .bibbase_group * { font-style: normal !important; }
.bibbase-wrap .bibbase_group_count { color: var(--muted); font-size: 18px; font-weight: 400; }
.bibbase-wrap .bibbase_group_body { padding-left: 0 !important; }
.bibbase-wrap .bibbase_paper { padding-left: 0 !important; }

/* ---------- Publications (static list) ---------- */

.pub-years {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 16px;
  font-weight: 600;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  max-width: 860px;
}
.pub-year {
  font-size: 26px;
  margin: 48px 0 8px;
  scroll-margin-top: 24px;
}
.pubs { list-style: none; margin: 0; padding: 0; max-width: 860px; }
.pubs li { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.pubs p { margin: 0; }
.pub-title { font-family: var(--serif); font-weight: 600; font-size: 18.5px; line-height: 1.35; }
.pub-authors { font-size: 16px; margin-top: 4px !important; }
.pub-venue { font-size: 15.5px; color: var(--muted); }
.pub-venue em { font-style: italic; }

/* ---------- CV page ---------- */

.cv-head {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  align-items: start;
}
.cv-photo { width: 180px; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.cv-head .eyebrow a { color: inherit; }
.cv-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding-top: 20px;
  padding-bottom: 20px;
  font-size: 16px;
  font-weight: 600;
}
.cv-sub { font-size: 20px; margin: 40px 0 12px; }
.section-title + .cv-sub { margin-top: 0; }
.cv-list { list-style: none; margin: 0; padding: 0; max-width: 900px; font-size: 16.5px; }
.cv-list li {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 4px 24px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}
.cv-list li:last-child { border-bottom: 1px solid var(--rule); }
.cv-list .when { color: var(--muted); font-size: 15px; padding-top: 1px; }
.cv-list strong { font-weight: 600; }
.cv-journals {
  columns: 2;
  column-gap: 40px;
  max-width: 900px;
  margin: 0;
  padding-left: 20px;
  font-size: 16.5px;
}
.cv-journals li::marker { color: var(--blue); }
.cv-more { max-width: 860px; }
.cv-more + .cv-more { margin-top: 12px; }
.cv-more summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--blue);
  padding: 10px 0;
}
.cv-numbered { list-style: decimal; padding-left: 34px; }
.cv-numbered li::marker { color: var(--muted); font-size: 15px; }
.pub-authors strong { font-weight: 600; }
.tag-inline { font-family: var(--sans); vertical-align: 2px; margin: 0 4px 0 0; }

/* ---------- Course page ---------- */

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 36px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
}
.facts li { color: var(--muted); }
.facts strong { display: block; color: var(--text); font-weight: 600; }

.page-head .button { margin-top: 28px; }

.parts {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 860px;
}
.parts > li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 4px 24px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}
.parts > li:last-child { border-bottom: 1px solid var(--rule); }
.parts .hours { color: var(--blue); font-weight: 600; font-size: 15px; padding-top: 3px; }
.parts h3 { font-size: 20px; margin-bottom: 8px; }
.parts ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 16.5px; }
.parts ul li { margin-bottom: 4px; }
.parts ul li::marker { color: var(--blue); }

.table-wrap { overflow-x: auto; max-width: 900px; }
.schedule {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
.schedule th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--text);
}
.schedule td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.schedule td:first-child { white-space: nowrap; }
.schedule .time { display: block; color: var(--muted); font-size: 14px; }
.schedule td.num { color: var(--muted); text-align: center; }

.refs { margin: 0; padding-left: 26px; max-width: 860px; font-size: 16.5px; }
.refs li { margin-bottom: 12px; padding-left: 4px; }
.refs li::marker { color: var(--muted); }
.refs em { font-style: italic; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-alt);
  padding: 36px 0;
  font-size: 15px;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px 40px;
  flex-wrap: wrap;
}
.site-footer p { margin: 0; }
.site-footer strong { color: var(--text); font-weight: 600; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .topics { grid-template-columns: 1fr; gap: 40px; }
  /* tablet portrait: figure beside the text */
  .topic { display: grid; grid-template-columns: 2fr 3fr; grid-template-rows: auto 1fr; column-gap: 28px; align-items: start; }
  .topic figure { margin: 0; grid-row: 1 / 3; }
  .topic h3, .topic p { grid-column: 2; }
  .people { grid-template-columns: repeat(3, 1fr); }
  .courses { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  section { padding: 48px 0; }
  .intro { padding: 48px 0; }
  .lede { font-size: 19px; }
  .topic { display: block; }
  .topic figure { margin: 0 0 20px; }
  .people { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
  .news li { grid-template-columns: 1fr; gap: 2px; }
  .callout { padding: 28px 24px; }
  .alumni li { flex-direction: column; gap: 0; }
  .courses { grid-template-columns: 1fr; }
  .programs { grid-template-columns: 1fr; }
  .parts > li { grid-template-columns: 1fr; }
  .schedule { font-size: 15px; }
  .alumni .detail { text-align: left; }
  .cv-head { grid-template-columns: 1fr; gap: 20px; }
  .cv-photo { width: 120px; }
  .cv-list li { grid-template-columns: 1fr; gap: 0; }
  .cv-journals { columns: 1; }
}
