/* Small, shared overrides: retain the original academic grid and typography. */
:root {
  color-scheme: light;
  --site-background: #ffffff;
  --site-hover: #743711;
  --site-button-border: #cbb4a3;
  --site-button-hover: #faf6f2;
  --site-text: #252525;
  --site-muted: #626262;
  --site-line: #e4e4e4;
  --site-soft: #f7f7f7;
  --site-accent: #c96f2d;
  --site-link: #9a4d1c;
  --site-navbar-height: 71px;
  --site-year-height: 61px;
  --site-body-size: 16px;
  --site-list-line-height: 1.6;
  --site-list-gap: 8px;
}
html { scroll-behavior: smooth; }
.academic-site { color: var(--site-text); background: var(--site-background); font-size: var(--site-body-size); }
.academic-site h1, .academic-site h2, .academic-site h3, .academic-site h4 { color: var(--site-text); }
.academic-site .home-section { background: var(--site-background); }
.academic-site a { color: var(--site-link); }
.academic-site a:hover { color: var(--site-hover); text-decoration: underline; }
.academic-site a:focus-visible, .academic-site button:focus-visible { outline: 2px solid var(--site-link); outline-offset: 4px; }
.academic-site .home-section { padding: 64px 0; animation: none; }
.academic-site .home-section:first-of-type { padding-top: 48px; }
/* Adjacent homepage sections share a 72px content gap instead of 128px. */
.academic-site.homepage .home-section { padding: 36px 0; }
.academic-site.homepage .home-section:first-of-type { padding-top: 36px; }
.homepage #profile { padding-top: 16px; padding-bottom: 0; }
.homepage #profile .social-links { margin-bottom: 0; }
.academic-site .home-section:nth-of-type(even) { background: var(--site-soft); }
.academic-site .section-heading h1 { font-size: 32px; }
.academic-site h2 { font-size: 27px; }
.academic-site p { line-height: 1.75; }
.academic-site .navbar-default { background: var(--site-background); box-shadow: none; border-bottom: 1px solid var(--site-line); }
.academic-site .navbar-brand { text-transform: none; }
.academic-site .navbar-nav > li > a { color: var(--site-text); font-weight: 400; }
.academic-site .navbar-nav > .active > a, .academic-site .navbar-nav > .active > a:hover,
.academic-site .navbar-nav > .active > a:focus { color: var(--site-link); font-weight: 700; }
.academic-site .navbar-nav > li > a:hover { color: var(--site-link); }
#navbar-main > .container { display: flex; align-items: center; }
#navbar-main > .container::before, #navbar-main > .container::after { display: none; }
#navbar-main .navbar-header { flex: 0 0 auto; }
#primary-menu { margin-left: auto; }
.skip-link { position: fixed; top: -100px; left: 15px; z-index: 1200; padding: 12px; background: var(--site-background); }
.skip-link:focus { top: 10px; }
.biography-copy { padding-top: 25px; }
.academic-site .btn-primary.btn-outline { color: var(--site-link); border-color: var(--site-button-border); background: transparent; box-shadow: none; }
.academic-site .btn-primary.btn-outline:hover, .academic-site .btn-primary.btn-outline:focus { color: var(--site-hover); background: var(--site-button-hover); border-color: var(--site-link); text-decoration: none; }
.section-heading-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px 25px; margin-bottom: 22px; }
.section-heading-row h2 { margin: 0; }
.section-action { font-family: 'Lato', sans-serif; font-size: 15px; }
.research-themes { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; margin: 32px 0 0; }
.research-direction { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--site-line); border-radius: 12px; background: var(--site-background); }
.research-direction:hover { border-color: var(--site-button-border); }
.direction-image { padding: 18px; background: #fff; border-bottom: 1px solid var(--site-line); }
.direction-image img { display: block; width: 100%; height: 220px; object-fit: contain; }
.direction-copy { display: flex; flex: 1; flex-direction: column; padding: 24px; }
.research-themes h3 { font-size: 20px; font-weight: 700; margin: 0 0 14px; line-height: 1.4; }
.research-themes p { font-size: var(--site-body-size); color: var(--site-muted); margin-bottom: 0; }
.direction-keywords { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 0; list-style: none; font: 14px/1.5 'Lato', sans-serif; color: var(--site-muted); }
.publication-note, .academic-site .section-heading .publication-note { font-size: 13px; color: var(--site-muted); font-family: 'Lato', sans-serif; margin: 15px 0 22px; }
.year-navigation { position: sticky; top: var(--site-navbar-height); z-index: 900; display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; padding: 8px 0; margin-bottom: 28px; background: var(--site-background); border-bottom: 1px solid var(--site-line); }
.year-navigation a { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 60px; min-height: 44px; padding: 8px 13px; border-bottom: 2px solid transparent; color: var(--site-muted); font: 16px 'Lato', sans-serif; }
.year-navigation a[aria-current="location"] { border-bottom-color: var(--site-accent); color: var(--site-link); font-weight: 700; }
.year-navigation a:hover { color: var(--site-link); text-decoration: none; }
.publication-year { scroll-margin-top: calc(var(--site-navbar-height) + var(--site-year-height) + 18px); }
.academic-site .year-heading { margin: 32px 0 28px; font-size: 25px; }
.publication-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 30px; align-items: start; margin-bottom: 26px; padding-bottom: 26px; border-bottom: 1px solid var(--site-line); }
.publication-row[id] { scroll-margin-top: calc(var(--site-navbar-height) + var(--site-year-height) + 18px); }
.publication-image, .publication-copy { min-width: 0; }
.publication-placeholder { aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--site-soft); color: var(--site-muted); border: 1px solid var(--site-line); border-radius: 3px; font: 13px 'Lato', sans-serif; }
.publication-image img { display: block; width: 100%; height: auto; max-height: 210px; object-fit: contain; border: 1px solid var(--site-line); border-radius: 3px; }
.academic-site .publication-title { margin: 0 0 8px; font-size: 18px; line-height: 1.5; color: var(--site-text); font-weight: 700; }
.publication-authors { font-size: 14px; margin-bottom: 6px; color: var(--site-muted); }
.publication-venue { font-size: 14px; margin-bottom: 9px; }
.publication-venue span[style] { color: var(--site-link) !important; }
.publication-links { display: flex; flex-wrap: wrap; gap: 7px; }
.publication-links .btn { min-height: 28px; display: inline-flex; align-items: center; }
.section-rule { border: 0; border-top: 1px solid var(--site-line); margin: 24px 0; }
.section-intro { color: var(--site-muted); font-size: var(--site-body-size); }
.academic-site .activities-heading { padding-bottom: 20px; }
.update-list { list-style: none; padding: 0; margin: 0; font-family: 'Merriweather', serif; font-size: var(--site-body-size); font-weight: 400; line-height: var(--site-list-line-height); }
.update-list > li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; margin: 0 0 var(--site-list-gap); padding: 0; font: inherit; }
.update-list .update-date { color: var(--site-muted); font-family: 'Lato', sans-serif; font-size: inherit; font-weight: 400; line-height: inherit; }
.update-list .update-content { min-width: 0; font: inherit; }
.update-list > li:last-child { margin-bottom: 0; }
.news-archive summary { display: list-item; width: fit-content; cursor: pointer; color: var(--site-link); font: 14px/1.7 'Lato', sans-serif; margin: 18px 0; }
.news-archive summary:hover { color: var(--site-hover); }
.news-archive summary:focus-visible { outline: 2px solid var(--site-link); outline-offset: 4px; }
.news-archive .news-collapse, .news-archive[open] .news-expand { display: none; }
.news-archive[open] .news-collapse { display: inline; }
.team-photo { width: 100%; margin: 28px 0; }
.team-photo img { display: block; width: 100%; height: auto; border-radius: 4px; }
.team-photo figcaption { margin-top: 10px; text-align: center; color: var(--site-muted); font: 13px/1.6 'Lato', sans-serif; }
.team-photo figcaption::before { content: none; }
.background-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.background-block { display: flex; flex-direction: column; min-width: 0; }
.background-block h3 { margin: 0 0 12px; }
.background-details .background-list { display: flex; flex: 1; flex-direction: column; justify-content: flex-start; gap: 6px; margin: 0; padding-left: 22px; }
.background-list > li, .background-list small { font-size: 14px; line-height: 1.45; }
.background-list > li { margin: 0; padding: 0; }
.degree-honors { color: var(--site-muted); font-style: italic; font-size: 13px; }
@media (max-width: 991px) {
  .background-details { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .background-details .background-list { flex: none; }
}
.logo-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; gap: 16px; padding-top: 15px; }
.logo-list img { width: 100%; max-width: 120px; max-height: 70px; object-fit: contain; justify-self: center; }
.academic-list > li { padding-bottom: 0; margin-bottom: var(--site-list-gap); }
.academic-list > li:last-child, .student-entry:last-child { margin-bottom: 0; }
.academic-list, #Teaching ul { font-size: var(--site-body-size); line-height: var(--site-list-line-height); }
.talk-host { display: block; color: var(--site-muted); font: inherit; }
.student-entry { display: flex; align-items: baseline; gap: 16px; margin-bottom: var(--site-list-gap); line-height: var(--site-list-line-height); }
.student-date { flex: 0 0 120px; color: var(--site-muted); font-size: 14px; }
.student-detail { flex: 1; min-width: 0; }
.student-detail a { overflow-wrap: anywhere; }
.student-detail .btn { margin: 3px 0; }
.academic-site .site-footer { padding: 22px 0; margin: 0; border-top: 1px solid var(--site-line); background: var(--site-soft); }
.footer-main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: start; gap: 24px 40px; }
.footer-main::before, .footer-main::after { display: none; content: none; }
.footer-contact { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.footer-brand { flex: 0 0 40px; padding-top: 2px; }
.footer-brand img { display: block; width: 40px; height: auto; }
:root[data-theme="dark"] .footer-brand img { filter: brightness(0) invert(1); }
.academic-site .site-footer .footer-lab { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 6px; font: 14px/1.5 'Lato', sans-serif; }
.footer-lab a { font-weight: 700; }
.footer-lab span { color: var(--site-muted); }
.footer-contact-line { display: flex; align-items: flex-start; gap: 7px; }
.footer-contact-line > span { min-width: 0; }
.footer-contact-icon { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 3px; }
.footer-email { font: 14px/1.5 'Lato', sans-serif; overflow-wrap: anywhere; }
.footer-details address { margin: 7px 0 0; color: var(--site-muted); font: normal 12px/1.6 'Lato', sans-serif; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; color: var(--site-muted); font: 11px/1.5 'Lato', sans-serif; }
.footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; font: 13px/1.5 'Lato', sans-serif; }
.academic-site .site-footer .footer-title { margin: 0 0 5px; color: var(--site-text); font: 700 14px/1.5 'Lato', sans-serif; }
.footer-channels { display: flex; flex: 0 0 auto; align-items: flex-start; gap: 20px; }
.footer-channels figure { margin: 0; width: 96px; }
.footer-qr { display: block; }
.footer-qr img { display: block; width: 96px; height: 96px; padding: 6px; object-fit: contain; background: #fff; border: 1px solid var(--site-line); border-radius: 5px; }
.footer-channels figcaption { margin-top: 5px; text-align: center; color: var(--site-muted); font: 11px/1.4 'Lato', sans-serif; }
.footer-channels figcaption::before { content: none; }
section[id] { scroll-margin-top: calc(var(--site-navbar-height) + 18px); }
section.publication-year { scroll-margin-top: calc(var(--site-navbar-height) + var(--site-year-height) + 18px); }
#contact img, #contact iframe { max-width: 100%; }
#Teaching li { margin-bottom: var(--site-list-gap); }
#Teaching li:last-child { margin-bottom: 0; }
#Teaching li > ul { margin-top: 6px; margin-bottom: 0; }
#profile .portrait-title h1 { font-size: 28px; margin: 20px 0 10px; }
#profile .portrait-title h3 { color: var(--site-muted); }
#profile .social-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; }
#profile .social-links a { color: var(--site-link); display: inline-flex; align-items: center; }
#profile .social-links a:hover { color: var(--site-hover); text-decoration: none; }
#profile .social-links .social-icon { width: 30px; height: 30px; fill: currentColor; }
@media (min-width: 1201px) {
  #primary-menu { display: block; }
}
@media (max-width: 1200px) {
  :root { --site-navbar-height: 51px; }
  #navbar-main > .container { flex-wrap: wrap; }
  #navbar-main .navbar-header { flex: 1; }
  #primary-menu { order: 3; flex: 0 0 100%; margin-left: 0; }
  #primary-menu { display: none; }
  #primary-menu.is-open { display: block; max-height: calc(100dvh - 51px); overflow-y: auto; }
  .academic-site .navbar-header { display: flex; align-items: center; justify-content: space-between; }
  .academic-site .navbar-header::before, .academic-site .navbar-header::after { display: none; }
  .academic-site .navbar-toggle { margin-left: auto; }
}
@media (max-width: 767px) {
  .research-themes { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .research-direction { position: relative; overflow: visible; }
  .direction-image { border-radius: 12px 12px 0 0; overflow: hidden; }
  .direction-copy { padding: 22px; }
  .direction-image img { height: 190px; }
  .academic-site .home-section { padding: 40px 0; }
  .academic-site.homepage .home-section { padding: 28px 0; }
  .academic-site.homepage .home-section:first-of-type { padding-top: 30px; }
  .academic-site .home-section:first-of-type { padding-top: 30px; }
  .academic-site h2 { font-size: 24px; }
  .academic-site p { text-align: left; }
  .publication-row { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .publication-image img { width: auto; max-width: 100%; max-height: 190px; }
  .publication-links .btn { min-height: 38px; padding: 6px 12px; }
  .year-navigation { gap: 5px; }
  .year-navigation a { min-width: 55px; }
  .student-entry { flex-direction: column; gap: 4px; }
  .student-date { flex-basis: auto; }
  .update-list > li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .academic-site #Team ul { padding-left: 20px; }
  .logo-list { gap: 8px; }
  .logo-list img { max-width: 100%; max-height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Dark mode keeps the orange accents and preserves figure colors. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --site-background: #191b1e;
  --site-text: #e5e5e5;
  --site-muted: #b3b5b9;
  --site-line: #393c41;
  --site-soft: #22252a;
  --site-link: #f0ab75;
  --site-accent: #dc8b4e;
  --site-hover: #ffd2af;
  --site-button-border: #886346;
  --site-button-hover: #302a25;
}
.academic-site .navbar-default .navbar-brand { color: var(--site-text); }
.theme-toggle { flex: 0 0 42px; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; margin: 0 0 0 12px; padding: 0; background: transparent; color: var(--site-muted); border: 0; border-radius: 4px; font-size: 22px; cursor: pointer; }
.theme-toggle:hover { color: var(--site-link); background: var(--site-soft); }
.academic-site .navbar-toggle { border-color: var(--site-line); }
.academic-site .navbar-toggle .icon-bar { background: var(--site-muted); }
.academic-site .navbar-toggle:hover, .academic-site .navbar-toggle:focus { background: var(--site-soft); }
.academic-site .navbar-collapse { border-color: var(--site-line); }
.publication-image img { background: #fff; }
.logo-list img { background: transparent; }
:root[data-theme="dark"] .logo-list img { background: transparent; }
:root[data-theme="dark"] .logo-list .logo-wordmark,
:root[data-theme="dark"] .logo-list .logo-seal { filter: brightness(0) invert(1); }
@media (max-width:1200px) {
  .theme-toggle { flex: 0 0 38px; width: 38px; height: 38px; margin: 0 0 0 8px; }
  .academic-site .navbar-toggle { margin-left: 8px; }
}
@media (max-width:767px) {
  .footer-main { grid-template-columns: minmax(0, 1fr) auto; gap: 20px; }
  .footer-channels { grid-column: 1 / -1; margin-left: 56px; }
}
@media (max-width:420px) {
  .footer-contact { gap: 12px; }
  .footer-brand { flex-basis: 32px; }
  .footer-brand img { width: 32px; }
  .footer-channels { margin-left: 44px; }
}

/* Keep display geometry while serving smaller images and font-free social icons. */
#profile .portrait { display: block; object-fit: cover; background-image: none; }
#profile .profile-role { color: var(--site-muted); font-family: 'Lato', sans-serif; font-size: 1.13em; font-weight: 300; line-height: 1.3; margin: 0 0 10px; text-align: center; }
.logo-list img { width: auto; }
.logo-list .logo-hnu { height: 88px; }
.logo-list .logo-kit, .logo-list .logo-ox { height: 58px; }
.logo-list .logo-eth { height: 48px; }
.logo-list .logo-szu { height: 78px; }
.publication-distinction { color: var(--site-link); }
.service-role { font-size: 1.1em; }
@media (max-width: 767px) {
  .logo-list img { min-width: 0; max-width: 100%; height: auto; max-height: 40px; }
  .logo-list .logo-hnu, .logo-list .logo-szu { max-height: 50px; }
}
