/* ===== Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,500;0,600;1,500;1,600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono&display=swap');

/* ===== CSS Variables ===== */
:root {
  --bg: #ffffff;
  --text: #595959;
  --heading: #043361;
  --link: #39c;
  --link-hover: #069;
  --strong: #222;
  --border: #e5e5e5;
  --badge-bg: #00369f;
  --sidebar-width: 232px;
  --content-width: 650px;
  --wrapper-width: 960px;
  --callout-bg: #fff8f1;
  --callout-border: #e67e22;
  --accent: #c0392b;
  --btn-text: #000;
  --btn-border: #000;
  --social-icon: #043361;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #20212b;
    --text: #dadbdf;
    --heading: rgb(62, 183, 240);
    --link: rgb(62, 183, 240);
    --link-hover: #7ecbf5;
    --strong: #eeeff0;
    --border: #3a3b45;
    --callout-bg: #2a2520;
    --callout-border: #c78530;
    --accent: #e74c3c;
    --btn-text: #fff;
    --btn-border: #fff;
    --social-icon: #3eb7f0;
  }
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: var(--bg);
  color: var(--text);
  font: 16px/1.5 'Crimson Pro', serif;
  font-weight: 400;
  margin: 0;
  padding: 0;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  color: var(--heading);
  line-height: 1.1;
  margin: 0 0 20px;
}

h1 { font-size: 28px; font-weight: 500; }
h2 { font-size: 157%; font-weight: 500; margin: 2px 0 15px; }
h3, h4, h5, h6 { font-weight: 600; }

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

strong { color: var(--strong); font-weight: 500; }

p, ul, ol, table, pre, dl { margin: 0 0 20px; }

img { max-width: 100%; }

small { font-size: 11px; }

hr {
  border: 0;
  background: var(--border);
  height: 1px;
  margin: 0 0 20px;
}

blockquote {
  border-left: 1px solid var(--border);
  margin: 0;
  padding: 0 0 0 20px;
  font-style: italic;
}

email {
  font-size: 14px;
  font-family: 'Ubuntu Mono', monospace;
}

/* ===== Layout ===== */
.wrapper {
  width: var(--wrapper-width);
  margin: 0 auto;
  display: flex;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: fixed;
  padding-top: 4em;
  text-align: center;
  -webkit-font-smoothing: subpixel-antialiased;
}

.sidebar .avatar {
  border-radius: 100%;
  width: 80%;
  padding: 20px;
}

.sidebar h1 { margin-bottom: 8px; }

.sidebar .position {
  font-size: 1.10rem;
  display: block;
}

.sidebar .motto {
  font-style: italic;
  display: block;
  margin: 6px 0;
}

main {
  width: var(--content-width);
  margin-left: auto;
  padding-top: 4em;
  padding-bottom: 50px;
}

/* ===== Navigation ===== */
nav {
  margin-bottom: 20px;
  font-size: 1rem;
}

nav a { margin-right: 6px; }

/* ===== Social Icons ===== */
.social-icons { margin: 8px 0; }

.social-icons a {
  display: inline-block;
  height: 2.4rem;
  width: 2.4rem;
  background-color: transparent;
  color: var(--social-icon) !important;
  border-radius: 100%;
  text-align: center;
  font-size: 1.15rem;
  line-height: 2.5rem;
  margin-right: 1rem;
  transition: transform 0.2s;
}

.social-icons a:last-child { margin-right: 0; }

.social-icons a:hover {
  transform: scale(1.2);
}

/* ===== Visitor Counter ===== */
.visitor-counter {
  font-size: 12px;
  margin: 8px 0;
}

.visitor-counter img { vertical-align: middle; }

/* ===== Callout Box ===== */
.callout {
  border-left: 4px solid var(--callout-border);
  background: var(--callout-bg);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 10px 0 18px;
}

.callout a { color: var(--accent); font-weight: 600; }

/* ===== Product Box ===== */
.product-box {
  border: 2px solid var(--callout-border);
  background: var(--callout-bg);
  border-radius: 12px;
  padding: 18px 20px 16px;
  margin: 16px 0 28px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

.product-box h2 {
  margin-top: 4px;
  margin-bottom: 14px;
  color: var(--accent);
}

.product-box a { color: var(--accent); font-weight: 600; }

.product-box ul {
  margin: 0 0 4px 18px;
}

/* ===== Publications ===== */
.publications { margin-top: 2rem; }

.publications ol.bibliography {
  list-style: none;
  padding: 0;
  margin-top: 0;
}

.publications ol.bibliography li {
  min-height: 110px;
  margin-bottom: 0.5rem;
}

.pub-row {
  display: flex;
  align-items: center;
}

.pub-row .col-sm-3 {
  position: relative;
  padding-right: 15px;
  padding-left: 15px;
}

.pub-row .col-sm-9 {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 20px;
}

.pub-row .teaser {
  border-radius: 8px;
  box-shadow: 3px 3px 6px #888;
  height: 123px;
  width: 270px;
  margin: 5px;
  object-fit: cover;
}

.pub-row .abbr {
  height: 8rem;
  margin-bottom: 0.5rem;
}

.pub-row .badge {
  display: inline-block;
  padding: 0.25em 0.4em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.125rem;
  color: #fff !important;
  background-color: var(--badge-bg);
  box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);
  position: absolute;
  top: 8px;
  left: 16px;
  padding-left: 1rem;
  padding-right: 1rem;
}

.pub-row .title { font-weight: 600; }
.pub-row .author { margin: 2px 0; }
.pub-row .periodical { margin: 2px 0; }

.pub-row .links a.btn {
  color: var(--btn-text);
  border: 1px solid var(--btn-border);
  padding: 0.1rem 0.5rem;
  font-size: 12px;
  text-decoration: none;
  border-radius: 3px;
  display: inline-block;
  margin-right: 4px;
}

.pub-row .links a.btn:hover {
  color: var(--link);
  border-color: var(--link);
}

/* ===== Section Headers with Scholar Link ===== */
.section-header {
  margin: 2px 0 -15px;
}

.section-header a {
  font-size: 15px;
}

.section-header .bracket {
  font-size: 15px;
}

/* ===== Responsive: Tablet ===== */
@media screen and (max-width: 960px) {
  .wrapper {
    width: auto;
    margin: 0;
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: auto;
    padding: 20px 15px 0;
  }

  .sidebar .avatar {
    width: 117px;
    padding: 20px;
  }

  main {
    width: auto;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 20px 15px;
    margin: 0;
  }

  body { padding: 15px; word-wrap: break-word; }
}

/* ===== Responsive: Mobile ===== */
@media screen and (max-width: 480px) {
  .sidebar .avatar {
    width: 95px;
    padding: 20px;
  }

  .pub-row {
    display: block;
  }

  .pub-row .teaser {
    width: 100%;
    height: auto;
    margin-bottom: 10px;
  }

  body { padding: 15px; }
}

/* ===== Print ===== */
@media print {
  body {
    padding: 0.4in;
    font-size: 12pt;
    color: #444;
  }
}
