/* Shared site styling for all pages (including legacy Word-export HTML). */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --border: #e5e7eb;
  --link: #1d4ed8;
  --link-hover: #1e40af;
  --header-bg: #0b1220;
  --header-text: #f9fafb;
  --header-muted: rgba(249, 250, 251, 0.78);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 10px 20px rgba(0, 0, 0, 0.06);

  --container: 980px;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 16px;
  line-height: 1.6;
}

main .container > p,
main .container > ul,
main .container > ul li {
  font-size: inherit;
  font-family: inherit;
}

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

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-hover);
}

/* Layout helpers */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  background: #111827;
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 9999;
}
.skip-link:focus { left: 12px; }

/* Site header / nav */
.site-header {
  background: linear-gradient(180deg, rgba(11, 18, 32, 1), rgba(11, 18, 32, 0.92));
  color: var(--header-text);
  box-shadow: var(--shadow);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.site-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.site-title a {
  color: var(--header-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.site-tagline {
  color: var(--header-muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.nav a {
  color: var(--header-text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.12);
}

main {
  display: block;
  padding: 22px 0 40px;
}

/* Content typography (kept gentle to avoid fighting existing inline styles) */
h1, h2, h3 {
  line-height: 1.25;
  margin: 24px 0 12px;
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

ul { padding-left: 1.2rem; }
li { margin: 6px 0; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 20px 0 28px;
  font-size: 13px;
}

.profile-grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 24px 32px;
  align-items: center;
  background: #e8f7fc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
}

.profile-photo {
  width: 181px;
  max-width: 100%;
  display: block;
}

.profile-identity {
  align-self: center;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #000099;
  margin: 0 0 4px;
}

.profile-role {
  margin: 0 0 12px;
  color: var(--text);
}

.profile-contact {
  margin: 0;
  line-height: 1.7;
}

.profile-contact p {
  margin: 0 0 0.45em;
}

.profile-contact p:last-child {
  margin-bottom: 0;
}

.profile-address {
  margin: 0;
  line-height: 1.7;
}

.profile-address p {
  margin: 0;
}

.notice {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 28px 0;
}

.notice strong {
  color: #b91c1c;
}

.bio p {
  margin: 0 0 1em;
  max-width: 72ch;
}

.patent-note {
  color: #1d4ed8;
}

/* Publications page */
.publications-page {
  font-size: 16px;
  line-height: 1.6;
}

.publications-page .pub-page-title {
  margin: 0 0 16px;
  font-size: 28px;
  color: #000099;
}

.publications-page .pub-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.publications-page .pub-jump-nav a {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f9fafb;
}

.publications-page .pub-jump-nav a:hover {
  background: #eef2ff;
}

.publications-page .pub-section-heading {
  margin: 28px 0 12px;
  padding: 8px 14px;
  background: #993300;
  color: #fef08a !important;
  font-family: inherit !important;
  font-size: 18px !important;
  font-weight: 700;
  line-height: 1.2;
  border-radius: var(--radius);
}

.publications-page p,
.publications-page li,
.publications-page span,
.publications-page td,
.publications-page em,
.publications-page i {
  font-family: inherit !important;
  font-size: 16px !important;
  line-height: 1.6 !important;
  color: var(--text) !important;
}

.publications-page a {
  color: var(--link) !important;
}

.publications-page a:hover {
  color: var(--link-hover) !important;
}

.publications-page a[style*="color: red"],
.publications-page a span[style*="color: red"] {
  color: #b91c1c !important;
}

.publications-page ul {
  padding-left: 1.2rem;
  margin: 0 0 1.5em;
  list-style: disc;
}

.publications-page li {
  margin: 10px 0;
}

.publications-page li > p {
  margin: 0;
}

.publications-page img {
  vertical-align: middle;
}

/* Make legacy wide tables less painful on mobile */
table {
  max-width: 100%;
}

@media (max-width: 720px) {
  .site-title a { font-size: 15px; }
  .site-tagline { display: none; }
  .site-header-inner { align-items: flex-start; flex-direction: column; }
  .nav { justify-content: flex-start; }
  .profile-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .profile-photo {
    margin: 0 auto;
  }
  .profile-identity {
    text-align: center;
  }
}

