/* --------------------------------------------------------------------------
   Site-specific styling. Theme-agnostic: only additive rules, no overrides of
   theme internals, so it works under both Furo and Shibuya.
   -------------------------------------------------------------------------- */

:root {
  --site-rule: color-mix(in srgb, currentColor 12%, transparent);
}

/* Readable measure for long-form prose. */
article[role="main"] p,
article[role="main"] li {
  line-height: 1.7;
}

/* --- Landing page ------------------------------------------------------- */

.home-cards .sd-card {
  border: 1px solid var(--site-rule);
  border-radius: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-cards .sd-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.home-cards .sd-card-title {
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Profile + affiliation tables: strip the table chrome, keep the icons. */
table.profile-links,
table.affiliations {
  border: 0 !important;
  border-collapse: collapse !important;
  box-shadow: none !important;
  background: none !important;
  width: auto;
  display: table;
  margin: 0.5rem 0 1.5rem;
}

table.profile-links tbody,
table.affiliations tbody,
table.profile-links tr,
table.affiliations tr {
  border: 0 !important;
  background: none !important;
}

table.profile-links td,
table.affiliations td {
  border: 0 !important;
  background: none !important;
  padding: 0.3rem 1.1rem 0.3rem 0;
  vertical-align: middle;
  white-space: nowrap;
}

table.profile-links img,
table.affiliations img {
  vertical-align: -0.25em;
  margin-right: 0.35em;
}

/* Epigraph: a quiet pull-quote rather than a boxed block. */
blockquote.epigraph {
  border: 0;
  border-left: 3px solid var(--site-rule) !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  padding: 0.1rem 0 0.1rem 1.1rem;
  margin: 1.5rem 0 2rem 0;
  font-style: italic;
  text-align: left;
  opacity: 0.8;
}

blockquote.epigraph p {
  margin: 0.2rem 0;
}

blockquote.epigraph .attribution {
  font-style: normal;
  font-size: 0.9em;
  text-align: left;
  opacity: 0.75;
}

/* Affiliation / profile icons: give the small logos a consistent optical size. */
table.profile-links img,
table.affiliations img {
  height: 18px;
  width: auto;
  object-fit: contain;
}

/* --- Publications ------------------------------------------------------- */

.publist ul,
ul.publist {
  list-style: none;
  padding-left: 0;
}

.publist li {
  padding: 0.6rem 0 0.6rem 0;
  border-bottom: 1px solid var(--site-rule);
}

.publist li:last-child {
  border-bottom: 0;
}

/* --- Math --------------------------------------------------------------- */

/* Let long displayed equations scroll instead of overflowing the column. */
mjx-container[jax="CHTML"][display="true"] {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.2em 0;
}

/* --- Tables ------------------------------------------------------------- */

article[role="main"] table.docutils {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

/* --- Print -------------------------------------------------------------- */

@media print {
  .sidebar-drawer,
  .toc-drawer,
  .mobile-header,
  .related-pages {
    display: none !important;
  }
}

/* --- Theme-specific containers ------------------------------------------ */

/* Sphinx wraps tables in a .table-wrapper container that some themes border. */
.table-wrapper.profile-links,
.table-wrapper.affiliations {
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible;
}

/* docutils nests the epigraph body in a <div>; keep the quote left-aligned
   whatever the theme does to blockquotes. */
blockquote.epigraph > div,
blockquote.epigraph > div > p,
blockquote.epigraph p.attribution {
  text-align: left !important;
  margin-left: 0;
}

/* Small logos are auto-linked to themselves by Sphinx; kill the underline. */
table.profile-links a.reference.internal,
table.affiliations a.reference.internal {
  text-decoration: none !important;
  border: 0;
}
