/* Minimalist academic website stylesheet for Thomas Wimmer */
:root {
  --bg: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #eef2f6;
  --text: #111827;
  --text-muted: #4b5563;
  --text-light: #6b7280;
  --accent: #21638a;
  --accent-hover: #184a68;
  --border: #dce4ee;
  --border-subtle: #e8eef5;
  --max-width: 860px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

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

.hero,
.section,
.pub-item,
[id^="fn"] {
  scroll-margin-top: 32px;
}

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

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Desktop-Only Left Margin Outline (No Top Header) */
.side-outline {
  display: none;
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .container {
    margin-left: 168px;
    margin-right: auto;
    max-width: min(var(--max-width), calc(100% - 184px));
  }
}

@media (min-width: 1024px) {
  .side-outline {
    display: block;
    position: fixed;
    top: 56px;
    left: max(20px, calc(50% - var(--max-width) / 2 - 156px));
    width: 132px;
    z-index: 40;
  }

  .outline-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .outline-link {
    display: block;
    font-size: 0.83rem;
    line-height: 1.4;
    color: var(--text-light);
    padding: 2px 0 2px 10px;
    border-left: 1.5px solid transparent;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
  }

  .outline-link:hover {
    color: var(--text);
    text-decoration: none;
  }

  .outline-link.active {
    color: var(--text);
    font-weight: 600;
    border-left-color: var(--text);
  }
}

/* Hero Section */
.hero {
  padding: 48px 0 8px;
}

.hero-main {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.hero-content {
  flex: 1 1 0;
  min-width: 0;
}

.hero-name {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 6px;
  color: var(--text);
}

.hero-subtitle {
  font-size: 1.02rem;
  color: var(--text-muted);
  margin: 0 0 18px;
  font-weight: 400;
  line-height: 1.45;
}

.hero-bio p {
  margin: 0 0 12px;
  color: var(--text);
}

.hero-bio p:last-child {
  margin-bottom: 0;
}

.hero-photo {
  flex: 0 0 205px;
  width: 205px;
}

.hero-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: 6px;
  display: block;
}

/* Full-Width Social & Profile Links Row */
.hero-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 28px;
  padding: 12px 2px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.93rem;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.hero-link i {
  color: var(--text-muted);
  font-size: 0.96em;
  transition: color 0.15s ease;
}

.hero-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.hero-link:hover i {
  color: var(--accent);
}

.hero-link-sep {
  color: var(--border);
  user-select: none;
}

/* Larger Full-Width Institutions / Affiliations Row */
.affiliations-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
  padding: 20px 2px 22px;
  border-bottom: 1px solid var(--border);
}

.affiliation-logo-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.affiliation-logo-link:hover {
  text-decoration: none;
}

.affiliation-logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
}

.affiliations-strip img {
  height: 50px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
  opacity: 0.88;
  mix-blend-mode: multiply;
  transition: opacity 0.18s ease;
}

.affiliation-logo-link:hover img {
  opacity: 1;
}

.affiliations-strip .logo-wide img {
  height: 34px;
  max-width: 155px;
}

.affiliations-strip .logo-tum img {
  height: 44px;
  max-width: 120px;
}

.affiliations-strip .logo-crest img {
  height: 54px;
}

.affiliations-divider {
  width: 1px;
  height: 50px;
  background-color: var(--border);
  flex-shrink: 0;
}

/* Sections */
.section {
  padding: 36px 0 4px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--text);
}

.section-all-link {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.section-all-link:hover {
  color: var(--accent);
}

/* Borderless Inline Filter Controls */
.toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
}

.toggle-sep {
  color: var(--border);
  user-select: none;
}

.toggle-btn {
  appearance: none;
  border: none;
  background: none;
  color: var(--text-light);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 400;
  padding: 2px 0;
  cursor: pointer;
  transition: color 0.15s ease;
}

.toggle-btn:hover {
  color: var(--text);
}

.toggle-btn.active {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent);
}

/* News List Timeline */
.news-list {
  list-style: none;
  margin: 0 0 0 4px;
  padding: 0 0 0 14px;
  border-left: 1.5px solid var(--border);
}

.news-item {
  position: relative;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  padding: 6px 0 6px 20px;
  margin-left: -14px;
  font-size: 0.94rem;
  line-height: 1.55;
  align-items: baseline;
}

.news-item::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 13.5px;
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--text-light);
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.news-item:hover::before {
  border-color: var(--accent);
  background: var(--accent);
  transform: scale(1.25);
}

.news-item.hidden-item {
  display: none;
}

.news-date {
  color: var(--text-light);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.news-text p {
  margin: 0;
  display: inline;
}

.news-more-btn {
  display: inline-block;
  margin-top: 8px;
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease;
}

.news-more-btn:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Publications List */
.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pub-item {
  display: flex;
  gap: 22px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: flex-start;
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-item.hidden-item {
  display: none;
}

.pub-thumb {
  position: relative;
  flex: 0 0 176px;
  width: 176px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #ffffff;
}

.pub-thumb a {
  display: block;
  position: relative;
}

.pub-thumb img {
  width: 100%;
  height: auto;
  max-height: 116px;
  min-height: 88px;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s ease;
}

.pub-thumb-hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}

.pub-item:hover .pub-thumb.has-hover-media .pub-thumb-hover {
  opacity: 1;
}

.pub-zoom-btn {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  background: rgba(17, 24, 39, 0.68);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.pub-thumb:hover .pub-zoom-btn {
  opacity: 1;
}

.pub-body {
  flex: 1 1 0;
  min-width: 0;
}

.pub-venue-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
  font-size: 0.83rem;
}

.pub-venue {
  font-weight: 600;
  color: var(--text-muted);
}

.pub-venue-sep {
  color: var(--text-muted);
}

.pub-award-badge {
  color: #8a2121;
  font-weight: 600;
}

.pub-title {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.38;
  margin: 0 0 4px;
  color: var(--text);
}

.pub-title a {
  color: var(--text);
}

.pub-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.48;
  margin-bottom: 6px;
}

.pub-authors a {
  color: var(--text-muted);
}

.pub-authors a:hover {
  color: var(--accent);
}

.pub-authors .self-author {
  color: var(--text);
  font-weight: 600;
}

.pub-note {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

/* Borderless Inline Publication Action Links & Metrics */
.pub-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.pub-chip,
.paper-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  line-height: 1.3;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: color 0.15s ease;
}

.pub-chip i,
.paper-metric i {
  font-size: 0.88em;
  opacity: 0.85;
}

.pub-chip:hover,
.paper-metric:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pub-chip.active {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.paper-metric {
  color: var(--text-light);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.paper-metric .paper-metric-value {
  font-weight: 500;
  color: var(--text-muted);
}

/* Smooth Expandable Abstract / BibTeX Drawers */
.pub-drawer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.2s ease, opacity 0.18s ease, margin-top 0.2s ease;
  margin-top: 0;
}

.pub-drawer.open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 8px;
}

.pub-drawer-inner {
  overflow: hidden;
}

.pub-drawer.open .pub-drawer-inner {
  padding: 10px 14px;
  background: var(--bg-subtle);
  border-left: 2px solid var(--border);
  border-radius: 3px;
  font-size: 0.87rem;
  line-height: 1.58;
  color: var(--text);
}

.pub-drawer p {
  margin: 0;
}

.bib-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.76rem;
  color: var(--text-light);
  font-weight: 500;
}

.bib-copy-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
}

.bib-copy-btn:hover,
.bib-copy-btn.copied {
  color: var(--accent);
  border-color: var(--accent);
}

.pub-drawer pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-sans);
  font-size: 0.79rem;
  line-height: 1.48;
  color: var(--text);
}

/* Blog / Writing List */
.blog-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.blog-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: baseline;
  font-size: 0.95rem;
}

.blog-item:last-child {
  border-bottom: none;
}

.blog-date {
  color: var(--text-light);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.blog-title {
  font-weight: 500;
  color: var(--text);
}

.blog-title:hover {
  color: var(--accent);
}

.blog-tags {
  font-size: 0.8rem;
  color: var(--text-light);
}

.blog-tag {
  color: var(--text-light);
}

.blog-tag:hover {
  color: var(--accent);
}

/* Lightbox Modal */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(17, 24, 39, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.lightbox-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-dialog {
  position: relative;
  max-width: 820px;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 4px;
  object-fit: contain;
}

.lightbox-caption {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

/* Subpage / Post Article */
.page-main {
  padding: 36px 0 48px;
}

.page-title {
  font-size: 1.5rem;
}

.page-lead {
  color: var(--text-muted);
  margin: 0 0 20px;
}

.footnotes {
  font-size: 0.85rem;
  color: var(--text-light);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.post-header {
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.post-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 8px;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-light);
}

.post-content h2,
.post-content h3 {
  margin-top: 26px;
  margin-bottom: 8px;
  line-height: 1.3;
}

.post-content ul,
.post-content ol {
  margin: 10px 0 14px;
  padding-left: 22px;
}

.post-content li {
  margin-bottom: 5px;
}

.post-content pre {
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow-x: auto;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}

.post-content th,
.post-content td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.post-content th {
  font-weight: 600;
  background: var(--bg-subtle);
}

.post-content blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  border-left: 2px solid var(--border);
  color: var(--text-muted);
}

.post-content blockquote p {
  margin: 4px 0;
}

.post-figure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0 8px;
}

.post-figure-grid img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.post-caption {
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 16px;
}

.post-content code {
  font-family: var(--font-sans);
  font-size: 0.86em;
  background: var(--bg-subtle);
  padding: 2px 5px;
  border-radius: 3px;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 22px 24px 40px;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text-light);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

/* Responsive */
@media (max-width: 840px) {
  .affiliations-strip {
    gap: 10px;
  }

  .affiliations-strip img {
    height: 42px;
    max-width: 112px;
  }

  .affiliations-strip .logo-wide img {
    height: 28px;
    max-width: 124px;
  }

  .affiliations-strip .logo-tum img {
    height: 36px;
    max-width: 96px;
  }

  .affiliations-strip .logo-crest img {
    height: 46px;
  }
}

@media (max-width: 720px) {
  .hero {
    padding-top: 28px;
  }

  .hero-main {
    flex-direction: column;
    align-items: center;
    gap: 22px;
  }

  .hero-content {
    width: 100%;
  }

  .hero-photo {
    width: 155px;
    flex: 0 0 auto;
  }

  .hero-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 12px;
  }

  .affiliations-strip {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: clamp(6px, 2vw, 14px);
    padding: 16px 0 18px;
  }

  .affiliation-logo-box {
    height: auto;
  }

  .affiliations-strip img {
    height: clamp(24px, 6.2vw, 42px);
    max-width: none;
  }

  .affiliations-strip .logo-wide img {
    height: clamp(15px, 4.1vw, 28px);
    max-width: none;
  }

  .affiliations-strip .logo-tum img {
    height: clamp(20px, 5.2vw, 36px);
    max-width: none;
  }

  .affiliations-strip .logo-crest img {
    height: clamp(26px, 6.6vw, 46px);
    max-width: none;
  }

  .affiliations-divider {
    height: clamp(24px, 6vw, 40px);
  }

  .pub-item {
    flex-direction: column;
    gap: 12px;
  }

  .pub-thumb {
    width: 100%;
    max-width: 220px;
    flex: 0 0 auto;
  }

  .news-item,
  .blog-item {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .news-item::before {
    top: 12.5px;
  }

  .blog-tags {
    display: none;
  }

  .post-figure-grid {
    grid-template-columns: 1fr;
  }
}
