/* Custom site styles. Loaded after main.css via _includes/head.html. */

/* --- Academic font pairing: Crimson Pro (body) + Inter (UI/headings) --- */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* Inter for navigation, sidebar, and UI elements */
.sidebar,
.masthead,
.author__name,
.author__bio,
.author__urls,
.greedy-nav,
.greedy-nav .visible-links,
.greedy-nav__toggle,
input,
button,
select,
textarea {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Crimson Pro for page body content */
body,
.page,
.page__content,
.page__title,
.page__content p,
.page__content li {
  font-family: 'Crimson Pro', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Inter for in-page headings — gives a clean modern accent against the serif body */
.page__content h1,
.page__content h2,
.page__content h3,
.page__content h4,
.page__title {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Page body type scale: smaller, looser line height for clean breathing room */
body {
  font-size: 17px;
}

.page__content {
  font-size: 0.93em;
  line-height: 1.72;
}

.page__content p {
  margin-bottom: 1em;
}

.page__content li {
  line-height: 1.62;
}


/* --- Publication list containers --- */

ol.pub-list,
ul.pub-list {
  padding-left: 1.4em;
  margin: 0.5em 0 1.5em 0;
}

ul.pub-list.pub-list-unnumbered {
  list-style: none;
  padding-left: 0;
}

ul.pub-list.pub-list-unnumbered .pub-entry::before {
  content: "– ";
  color: #aaa;
  margin-right: 0.2em;
}

ol.pub-list li::marker {
  color: #888;
  font-size: 0.9em;
}

.pub-entry {
  margin: 0 0 0.55em 0;
  line-height: 1.55;
}

.pub-line {
  font-size: 0.95em;
  color: #333;
}

/* Title rendered as plain (non-bold) hyperlink — no underline at rest. */
.page__content .pub-entry .pub-title-link,
.pub-title-link {
  color: #1a4f8b;
  text-decoration: none;
  border-bottom: none !important;
  font-weight: 500;
}

.page__content .pub-entry .pub-title-link:hover,
.pub-title-link:hover {
  color: #0969da;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.pub-title-plain {
  color: #333;
  font-weight: 500;
}

/* Formal Chinese title for articles published in Chinese */
.pub-title-cn {
  color: #555;
}

/* Always-visible extras (replication, registry, media, etc.) */
.pub-hover-links {
  display: inline-flex;
  gap: 0.4em;
  margin-left: 0.5em;
  font-size: 0.82em;
  vertical-align: baseline;
}

.pub-hover-links a {
  color: #555;
  text-decoration: none;
  padding: 1px 6px;
  border: 1px solid #d0d7de;
  border-radius: 3px;
  background: #f6f8fa;
}

.pub-hover-links a:hover {
  color: #0969da;
  border-color: #0969da;
  background: #eef2f7;
}

/* --- Inline more/less toggle --- */

details.pub-details {
  display: inline;
  margin-left: 0.5em;
}

details.pub-details summary {
  display: inline;
  list-style: none;
  cursor: pointer;
  font-size: 0.82em;
  color: #888;
  user-select: none;
}

details.pub-details summary::-webkit-details-marker,
details.pub-details summary::marker {
  display: none;
}

details.pub-details summary:hover {
  color: #0969da;
}

details.pub-details summary .pub-less {
  display: none;
}

details.pub-details[open] summary .pub-more {
  display: none;
}

details.pub-details[open] summary .pub-less {
  display: inline;
}

.pub-expanded {
  display: block;
  margin-top: 0.5em;
  padding: 0.7em 0.9em;
  background: #f9f9f9;
  border-left: 3px solid #d0d7de;
}

.pub-expanded-inner {
  display: flex;
  gap: 1.2em;
  align-items: flex-start;
}

.pub-image-wrap {
  flex: 0 0 176px;
  width: 176px;
  overflow: hidden;
  border-radius: 3px;
}

.pub-image {
  width: 176px;
  height: 176px;
  object-fit: contain;
  display: block;
  background: #f4f4f4;
  transition: transform 0.3s ease;
}

.pub-image:hover {
  transform: scale(1.8);
  cursor: zoom-in;
}

.pub-description-wrap {
  flex: 1;
}

.pub-description {
  font-size: 0.92em;
  line-height: 1.55;
  color: #333;
  margin: 0;
}

@media (max-width: 600px) {
  .pub-expanded-inner {
    flex-direction: column;
  }
  .pub-image-wrap {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 0.7em;
  }
}

/* --- Page headers --- */

.page__content h2 {
  margin-top: 1.8em;
  padding-bottom: 0.25em;
  border-bottom: 2px solid #333;
  font-size: 1.3em;
}

.page__content h3 {
  margin-top: 1.2em;
  padding-bottom: 0.15em;
  border-bottom: 1px solid #ccc;
  font-size: 1.05em;
  color: #555;
}

/* --- Teaching page: tight course blocks --- */

.course-block {
  margin: 0 0 0.9em 0;
}

.course-block .course-level {
  font-weight: 600;
  margin: 0 0 0.15em 0;
  color: #333;
  font-size: 0.95em;
}

ul.course-list {
  list-style: disc;
  padding-left: 1.4em;
  margin: 0;
}

ul.course-list li {
  margin: 0;
  padding: 0;
  line-height: 1.35;
  font-size: 0.93em;
}

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

.cv-actions {
  display: flex;
  gap: 0.6em;
  margin: 0.8em 0 0.4em 0;
}

.cv-btn {
  display: inline-block;
  padding: 0.45em 1em;
  background: #0a2540;
  color: #fff !important;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.92em;
  border: 1px solid #0a2540;
}

.cv-btn:hover {
  background: #0969da;
  border-color: #0969da;
}

.cv-btn.cv-btn-secondary {
  background: #fff;
  color: #0a2540 !important;
}

.cv-btn.cv-btn-secondary:hover {
  background: #f6f8fa;
  color: #0969da !important;
}

.cv-note {
  font-size: 0.82em;
  color: #888;
  margin: 0.4em 0 0.8em 0;
}

.cv-embed-wrap {
  width: 100%;
  margin-bottom: 1em;
}

.cv-embed {
  width: 100%;
  height: 1100px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  display: block;
}

@media (max-width: 768px) {
  .cv-embed { height: 700px; }
}

/* --- Gallery --- */

.gallery-section-title {
  margin-top: 1.8em;
  padding-bottom: 0.25em;
  border-bottom: 2px solid #333;
  font-size: 1.3em;
}

.gallery-section-desc {
  color: #555;
  font-size: 0.95em;
  margin-bottom: 1em;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1em;
  margin-bottom: 2em;
}

@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

.gallery-item {
  margin: 0;
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border-radius: 3px;
  background: #eee;
}

.gallery-item figcaption {
  font-size: 0.82em;
  color: #555;
  margin-top: 0.4em;
  line-height: 1.4;
}

/* --- Dark mode overrides --- */

html[data-theme="dark"] .pub-description {
  color: #e0e0e0;
}

html[data-theme="dark"] .pub-expanded {
  background: #3a3a3a;
  border-left-color: #666;
}

html[data-theme="dark"] .pub-image {
  background: #3a3a3a;
}

html[data-theme="dark"] .pub-title-link,
html[data-theme="dark"] .page__content .pub-entry .pub-title-link {
  color: #5ba3d9;
}

html[data-theme="dark"] .pub-title-link:hover,
html[data-theme="dark"] .page__content .pub-entry .pub-title-link:hover {
  color: #7fbfee;
}

html[data-theme="dark"] .pub-hover-links a {
  color: #aaa;
}

html[data-theme="dark"] .pub-title-cn {
  color: #bbb;
}

html[data-theme="dark"] .cv-btn.cv-btn-secondary {
  background: #2a2a2a;
  color: #d0d7de !important;
  border-color: #555;
}

html[data-theme="dark"] .cv-btn.cv-btn-secondary:hover {
  background: #333;
  color: #7fbfee !important;
  border-color: #7fbfee;
}

html[data-theme="dark"] .pub-more,
html[data-theme="dark"] .pub-less {
  color: #aaa;
}

html[data-theme="dark"] .page__content h2 {
  border-bottom-color: #888;
}

html[data-theme="dark"] .gallery-item figcaption {
  color: #ccc;
}

/* --- Long-form report pages (e.g. /reports/ai-perception/) --- */

.page__content .report-subtitle {
  font-size: 1.12em;
  color: #555;
  line-height: 1.45;
  margin: -0.4em 0 0.5em 0;
}

.page__content .report-byline {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 0.82em;
  color: #888;
  letter-spacing: 0.01em;
  margin: 0 0 1.1em 0;
}

.page__content .report-downloads {
  margin: 0 0 0.7em 0;
}

.page__content .report-downloads .cv-btn {
  margin-right: 0.5em;
}

.page__content .report-note {
  font-size: 0.82em;
  color: #888;
  line-height: 1.5;
  margin: 0 0 2em 0;
  padding-bottom: 1.4em;
  border-bottom: 1px solid #e2e6ea;
}

/* Exhibits: full-width figure on a white plate so charts read the same in both themes */
.page__content .report-figure {
  margin: 2em 0 0.7em 0;
  text-align: center;
}

.page__content .report-figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 3px;
  padding: 0.6em;
  box-sizing: border-box;
}

.page__content .report-caption {
  font-size: 0.8em;
  line-height: 1.55;
  color: #555;
  margin: 0 0 2.2em 0;
}

.page__content .report-caption strong {
  color: #333;
}

/* Respondent pull quotes */
.page__content blockquote {
  border-left: 3px solid #d0d7de;
  margin: 1.4em 0;
  padding: 0.1em 0 0.1em 1.1em;
  font-style: italic;
  color: #444;
}

.page__content blockquote p {
  margin-bottom: 0.35em;
}

.page__content blockquote p:last-child {
  font-style: normal;
  font-size: 0.85em;
  color: #888;
  margin-bottom: 0;
}

/* Kramdown endnotes. Kramdown always appends the notes list at the very end of the
   document, so the "Notes" label is a plain paragraph placed just above it. */
.page__content .report-notes-label {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 0.82em;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
  margin: 2.2em 0 0 0;
}

.page__content .footnotes {
  margin-top: 0.6em;
  font-size: 0.82em;
  line-height: 1.55;
  color: #555;
}

.page__content .footnotes ol {
  padding-left: 1.3em;
}

.page__content .footnotes li {
  margin-bottom: 0.5em;
  line-height: 1.55;
}

.page__content sup[role="doc-noteref"] a,
.page__content a.footnote {
  text-decoration: none;
  border-bottom: none;
}

.page__content .report-cite {
  font-size: 0.8em;
  color: #888;
  line-height: 1.55;
}

/* Dark mode */
html[data-theme="dark"] .page__content .report-subtitle { color: #ccc; }
html[data-theme="dark"] .page__content .report-byline,
html[data-theme="dark"] .page__content .report-note,
html[data-theme="dark"] .page__content .report-cite { color: #aaa; }
html[data-theme="dark"] .page__content .report-note { border-bottom-color: #555; }
html[data-theme="dark"] .page__content .report-figure img { border-color: #555; }
html[data-theme="dark"] .page__content .report-caption { color: #ccc; }
html[data-theme="dark"] .page__content .report-caption strong { color: #e8e8e8; }
html[data-theme="dark"] .page__content blockquote {
  border-left-color: #666;
  color: #ddd;
}
html[data-theme="dark"] .page__content blockquote p:last-child { color: #aaa; }
html[data-theme="dark"] .page__content .report-notes-label { color: #aaa; }
html[data-theme="dark"] .page__content .footnotes { color: #ccc; }

/* Report pages read long-form, so they get slightly larger type than the rest of
   the site, and no rules under the section headings. The first heading ("Key
   findings") keeps its rule, where it closes off the title/download block. */

.report-page .page__content {
  font-size: 1em;
  line-height: 1.75;
}

.report-page .page__content h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 2em;
}

.report-page .page__content h2:first-of-type {
  border-bottom: 2px solid #333;
  padding-bottom: 0.25em;
}

html[data-theme="dark"] .report-page .page__content h2:first-of-type {
  border-bottom-color: #888;
}

/* Full-width research figures retain their aspect ratio. */
.pub-figure {
  display: block;
  margin: 1em 0 0;
}
.pub-figure a {
  display: block;
  width: 100%;
}
.pub-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
