/* Manifold Bandits project-page overrides
   Place this after the Nerfies/Bulma CSS imports:
   <link rel="stylesheet" href="./static/css/project-overrides.css">
*/

:root {
  --bg: #faf9f6;
  --topbar: #fffefa;
  --card: #ffffff;
  --border: #e8e4dc;
  --text: #222222;
  --muted: #666666;
  --accent: #DD8452;
  --accent-soft: rgba(221, 132, 82, 0.14);
  --link: #4f78c4;
  --link-hover: #7AA5FF;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Noto Sans', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* Keep the project page visually tied to the homepage without importing the full homepage CSS. */
a {
  color: var(--link);
  text-decoration: none;
}

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

.hero,
.section,
.footer {
  background: var(--bg);
}

.hero.is-light,
.section.hero.is-light {
  background: var(--topbar) !important;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.container.is-max-desktop {
  max-width: 1050px !important;
}

.title,
.publication-title,
.publication-authors,
.subtitle,
.content {
  color: var(--text);
}

.publication-title {
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.publication-authors {
  color: var(--muted);
}

.publication-authors a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

.publication-authors a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-shadow:
    0 0 5px rgba(122, 165, 255, 0.18),
    0 0 12px rgba(122, 165, 255, 0.08);
}

.publication-links .button.is-disabled-button,
.publication-links .button.is-disabled-button:hover {
  cursor: not-allowed;
  opacity: 0.58;
  background-color: #444;
  border-color: #444;
  color: #fff;
  transform: none;
  box-shadow: none;
  text-decoration: none;
  pointer-events: none;
}

.coming-soon-label {
  font-size: 0.88em;
  font-weight: 500;
  opacity: 0.85;
}


/* Homepage-aligned top navigation. */
.project-navbar {
  top: 0;
  z-index: 100;
  min-height: 58px;
  padding: 0;
  background: var(--topbar);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.project-navbar-inner {
  width: 100%;
  max-width: 1050px;
  margin: 0 auto;
  padding: 0 32px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-navbar-brand {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.project-navbar-brand:hover {
  text-decoration: none;
  background-color: transparent;
  box-shadow:
    0 0 8px rgba(221, 132, 82, 0.14),
    0 0 18px rgba(221, 132, 82, 0.08);
}

.project-navbar-brand img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  transform: translateY(-2px);
}

.project-navbar-links {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.project-navbar-links a {
  color: #444;
  font-size: 0.95rem;
  text-decoration: none;
}

.project-navbar-links a:hover {
  color: #000;
  text-decoration: none;
}


/* Buttons: keep Nerfies rounded buttons, but make hover feel like the homepage. */
.publication-links .button.is-dark {
  background-color: #222;
  border-color: #222;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.publication-links .button.is-dark:hover {
  background-color: #111;
  border-color: #111;
  color: #fff;
  transform: translateY(-1px);
  box-shadow:
    0 0 6px rgba(221, 132, 82, 0.25),
    0 0 14px rgba(221, 132, 82, 0.12);
  text-decoration: none;
}

/* Cards and figures. */
.figure-card img,
.feature-card,
.tree-card img,
.takeaway-box,
pre {
  border-color: var(--border) !important;
}

.figure-card img,
.feature-card,
.tree-card img {
  background: var(--card) !important;
}

.figure-card figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.feature-card {
  box-shadow: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.feature-card:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 6px rgba(221, 132, 82, 0.16),
    0 0 14px rgba(221, 132, 82, 0.08);
}

.takeaway-box {
  border-left-color: var(--accent) !important;
  background: #fffefa !important;
}

hr {
  background-color: var(--border);
}

.tree-card img:hover {
  box-shadow:
    0 0 6px rgba(221, 132, 82, 0.25),
    0 0 18px rgba(221, 132, 82, 0.12) !important;
}

.tree-caption {
  color: var(--muted) !important;
}

/* Five-tree layout: three on the first row, two centered beneath. */
.tree-gallery.five-trees {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.tree-gallery.five-trees .tree-card {
  grid-column: span 2;
}

.tree-gallery.five-trees .tree-card-bottom-left {
  grid-column: 2 / span 2;
}

/* Footer: quieter and consistent with the homepage palette. */
.footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.footer a.icon-link {
  color: var(--text);
}

.footer a.icon-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Mobile behavior. */
@media screen and (max-width: 900px) {
  .project-navbar-inner {
    padding-left: 20px;
    padding-right: 20px;
  }

  .project-navbar-links {
    gap: 14px;
  }

  .tree-gallery.five-trees {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tree-gallery.five-trees .tree-card,
  .tree-gallery.five-trees .tree-card-bottom-left {
    grid-column: auto;
  }
}

@media screen and (max-width: 768px) {
  .project-navbar-links {
    display: none;
  }

  .publication-title {
    font-size: 2.25rem !important;
  }

  .tree-gallery.five-trees {
    grid-template-columns: 1fr;
  }
}


/* Refinements: quieter/minimal project page. */
.publication-title .title-main {
  display: inline-block;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.publication-title .title-subtitle {
  display: inline-block;
  margin-top: 0.15rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

/* Suppress orange/glowy treatment on interactive elements, except the navbar identity and author links. */
.publication-links .button.is-dark:hover,
.feature-card:hover,
.footer a.icon-link:hover {
  text-shadow: none;
  box-shadow: none;
}

.project-navbar-brand:hover {
  color: #111;
  text-decoration: none;
  text-shadow:
    0 0 6px rgba(221, 132, 82, 0.35),
    0 0 14px rgba(221, 132, 82, 0.18);
}

.publication-links .button.is-dark {
  box-shadow: none;
}

.publication-links .button.is-dark:hover {
  transform: none;
  background-color: #111;
  border-color: #111;
  color: #fff;
  text-decoration: none;
}

/* Keep cards grounded and minimal. */
.feature-card,
.takeaway-box,
.figure-card img,
pre {
  box-shadow: none !important;
}

.feature-card {
  transition: none;
}

.feature-card:hover {
  transform: none;
  box-shadow: none !important;
}

/* Tree gallery is the one place with a subtle hover lift, but no glow. */
.tree-card img {
  box-shadow: none !important;
}

.tree-card img:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10) !important;
}

.tree-caption {
  margin-top: 0.75rem;
  line-height: 1.35;
}

.tree-domain {
  display: block;
  color: var(--text);
  font-weight: 650;
  font-size: 1.02rem;
}

.tree-dataset {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

@media screen and (max-width: 768px) {
  .publication-title .title-main {
    font-size: 2.45rem;
  }

  .publication-title .title-subtitle {
    font-size: 1.65rem;
  }
}


/* Final nitpick pass. */
.publication-title .title-main {
  font-weight: 650;
}

.publication-authors a {
  color: var(--link) !important;
  text-decoration: none;
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

.publication-authors a:hover {
  color: var(--link-hover) !important;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-shadow:
    0 0 5px rgba(122, 165, 255, 0.18),
    0 0 12px rgba(122, 165, 255, 0.08);
}


/* Gallery/readability pass: uniform thumbnails, scrollable expanded trees, and cleaner figure/card backgrounds. */

/* Text/callout surfaces stay pure white. */
.feature-card,
.takeaway-box,
pre {
  background: #ffffff !important;
}

/* For split takeaway */
.takeaway-label {
  margin-bottom: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.split-takeaway {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.split-takeaway h4 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text);
}

.split-takeaway p {
  margin-bottom: 0;
}

@media screen and (max-width: 768px) {
  .split-takeaway {
    grid-template-columns: 1fr;
  }
}



/* Main paper figures should sit directly on the off-white page background. */
.figure-card,
.figure-card img {
  background: transparent !important;
}

.figure-card img {
  border: none !important;
  box-shadow: none !important;
}

/* Keep tree thumbnails visually contained and consistent, independent of source-image aspect ratios. */
.tree-thumb-frame {
  width: 100%;
  aspect-ratio: 1.25 / 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tree-thumb-frame img,
.tree-card .tree-thumb-frame img.expandable-tree {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: zoom-in;
  transition: transform 0.15s ease;
}

.tree-card .tree-thumb-frame:hover img.expandable-tree {
  transform: translateY(-3px);
  box-shadow: none !important;
}

.tree-card img:hover {
  box-shadow: none !important;
}

.tree-card:hover .tree-thumb-frame {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
}

.tree-full-link {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 0.84rem;
  color: var(--muted);
  text-decoration: none;
}

.tree-full-link:hover {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Expanded tree view: do not shrink dense diagrams to fit the viewport height. */
.tree-lightbox {
  display: none !important;
  position: fixed;
  z-index: 9999;
  inset: 0;
  padding: 3rem 2rem;
  background: rgba(0, 0, 0, 0.86);
  overflow: auto;
  align-items: initial !important;
  justify-content: initial !important;
}

.tree-lightbox.is-active {
  display: block !important;
}

.tree-lightbox img {
  display: block;
  width: min(2200px, max(95vw, 1700px));
  max-width: none !important;
  max-height: none !important;
  height: auto;
  margin: 0 auto;
  object-fit: initial !important;
  background: #ffffff;
  border-radius: 8px;
}

.tree-lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  z-index: 10000;
}

.card-leadin {
  margin-top: 4rem;
}


@media screen and (max-width: 768px) {
  .tree-lightbox {
    padding: 3rem 1rem 1rem;
  }

  .tree-lightbox img {
    width: 1400px;
  }
  
  .split-takeaway {
    grid-template-columns: 1fr;
  }
}


@media screen and (max-width: 900px) {
  .project-navbar-inner {
    padding-left: 24px;
    padding-right: 24px;
  }

  .project-navbar-links {
    gap: 14px;
  }
}

@media screen and (max-width: 768px) {
  .project-navbar-links {
    display: none;
  }
}


/* Responsive figure sizing pass.
   Keeps figures readable on large monitors while preventing them from dominating laptop screens. */
.figure-card {
  display: block;
  width: 100%;
  margin-left: auto !important;
  margin-right: auto !important;
}

.figure-card.figure-concept {
  max-width: min(100%, 820px) !important;
}

.figure-card.figure-result {
  max-width: min(100%, 860px) !important;
}

.figure-card img {
  width: 100%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

@media screen and (max-width: 1200px) {
  .figure-card.figure-concept {
    max-width: min(100%, 740px) !important;
  }

  .figure-card.figure-result {
    max-width: min(100%, 800px) !important;
  }
}

@media screen and (max-width: 900px) {
  .figure-card.figure-concept,
  .figure-card.figure-result {
    max-width: 100% !important;
  }
}


/* Eight-tree gallery layout. */
.tree-gallery.eight-trees {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
  margin-top: 1.5rem;
}

.tree-gallery.eight-trees .tree-card {
  grid-column: auto;
}

.tree-gallery.eight-trees .tree-thumb-frame {
  aspect-ratio: 1.18 / 1;
}

.tree-gallery.eight-trees .tree-domain {
  font-size: 0.98rem;
}

.tree-gallery.eight-trees .tree-dataset {
  font-size: 0.86rem;
}

@media screen and (max-width: 1050px) {
  .tree-gallery.eight-trees {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

@media screen and (max-width: 640px) {
  .tree-gallery.eight-trees {
    grid-template-columns: 1fr;
  }
}

/* BMC compatibility cards sit closer to the focus/dispersion cards than the main figure lead-ins. */
.card-leadin.card-leadin-compact {
  margin-top: 2rem;
}

.bmc-compatibility-cards {
  margin-top: 0.25rem;
}
