/* ==========================================================
   Sprang Lab (BioAI Group) — dark night-blue theme with neon accents
   Base colours (background, text, links, components) are set in
   theme.scss; this file styles the site's own elements.
   ========================================================== */

/* --- Palette variables --- */
:root {
  --sf-night:        #0b1430;   /* page background */
  --sf-night-deep:   #070d22;   /* navbar, footer, header band */
  --sf-surface:      rgba(255, 255, 255, 0.035);   /* cards, boxes */
  --sf-surface-line: rgba(255, 255, 255, 0.09);
  --sf-text:         #d5dcef;
  --sf-heading:      #f2f5fc;
  --sf-muted:        #93a1c3;
  --sf-link:         #4fdcff;
  --sf-violet:       #8f7cff;

  /* Neon accents taken from the home-page banner */
  --sf-neon-magenta: #ff2bd6;
  --sf-neon-cyan:    #19e3ff;
  --sf-neon-yellow:  #f2ff1f;
  --sf-neon-line:    linear-gradient(90deg, var(--sf-neon-magenta) 0%, var(--sf-violet) 50%, var(--sf-neon-cyan) 100%);
}

/* --- One large DNA helix behind the pages, falling from top left to bottom right ---
   images/helix.svg is drawn horizontally (scripts/make-helix.awk); here it is
   stretched longer than the screen diagonal and tilted 68 degrees. It sits left
   of centre, mostly in the empty left margin, so long text doesn't cover it.
   It stays fixed while the page scrolls over it. */
body::before {
  content: "";
  position: fixed;
  left: 24%;
  top: 50%;
  width: 200vmax;
  height: 26.7vmax;            /* keeps the SVG's 4800:640 proportions */
  transform: translate(-50%, -50%) rotate(68deg);
  background: url("images/helix.svg") center / 100% 100% no-repeat;
  opacity: 0.3;
  z-index: -1;
  pointer-events: none;
}

/* On phones the text covers most of the screen, so keep the helix fainter */
@media (max-width: 767.98px) {
  body::before { opacity: 0.18; }
}

/* --- Navbar --- */
.navbar {
  background: linear-gradient(135deg, #060b1d 0%, #0e1a42 100%) !important;
  border-bottom: 3px solid var(--sf-violet);
  border-image: var(--sf-neon-line) 1;
}

.navbar .navbar-brand,
.navbar .nav-link {
  color: rgba(230, 236, 250, 0.9) !important;
  transition: color 0.2s;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--sf-link) !important;
}

/* --- Headings --- */
h1, h2, h3, h4 {
  color: var(--sf-heading);
}

h2 {
  border-bottom: 2px solid rgba(79, 220, 255, 0.25);
  border-image: linear-gradient(90deg, rgba(255, 43, 214, 0.7) 0%, rgba(25, 227, 255, 0.35) 45%, rgba(25, 227, 255, 0) 100%) 1;
  padding-bottom: 0.3rem;
}

.quarto-title .subtitle,
p.subtitle {
  color: var(--sf-muted);
}

/* --- Links --- */
a {
  color: var(--sf-link);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #ff6be6;
}

/* --- Neon banner hero (home page) --- */
.hero-neon {
  background: var(--sf-night-deep);
  margin-bottom: 2rem;
  text-align: center;
  border-bottom: 3px solid var(--sf-violet);
  border-image: var(--sf-neon-line) 1;
}

/* "screen" blending turns the banner's black into the band's night blue,
   so the image has no visible edges while the neon stays bright */
.hero-neon-img {
  display: block;
  width: 100%;
  max-width: 2172px;           /* the banner's natural width */
  height: auto;
  margin: 0 auto;
  mix-blend-mode: screen;
}

/* On screens wider than the banner, fade its left and right edges into the band */
@media (min-width: 2173px) {
  .hero-neon-img {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  }
}

.hero-neon-text {
  padding: 0.4rem 1rem 1.6rem;
}

.hero-neon .hero-neon-tagline {
  display: inline-block;
  margin: 0 0 0.5rem;
  color: var(--sf-neon-cyan);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(25, 227, 255, 0.55);
}

.hero-neon .hero-neon-lede {
  margin: 0 auto;
  max-width: 46rem;
  color: rgba(230, 236, 250, 0.85);
  font-size: 1.1rem;
}

/* On phones the full-width strip would be tiny: show it taller and crop the
   sides, keeping the "Sprang Lab" lettering in the middle */
@media (max-width: 575.98px) {
  .hero-neon-img {
    height: 88px;
    object-fit: cover;
    object-position: 49% center;
  }
}

@media (max-width: 575.98px) {
  .hero-neon .hero-neon-tagline { font-size: 0.78rem; letter-spacing: 0.05em; }
  .hero-neon .hero-neon-lede { font-size: 0.98rem; }
}

/* --- Home page: slideshow and cards stay at a readable width --- */
.home-cards {
  max-width: 1200px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 1rem;
}

.card-section {
  background: var(--sf-surface);
  border: 1px solid var(--sf-surface-line);
  border-top: 4px solid var(--sf-link);
  border-radius: 8px;
  padding: 1.8rem;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
}

.card-section:hover {
  transform: translateY(-3px);
}

/* Whole card is clickable when it contains a .stretched-link (Bootstrap) */
.card-section:has(.stretched-link) {
  position: relative;
}

/* Link cards inside normal pages (e.g. Research overview) */
.link-cards {
  margin: 2rem 0;
}

.link-cards .card-section p:last-child {
  margin-bottom: 0;
}

.card-section h3 {
  margin-bottom: 0.8rem;
}

/* Home-page cards pick up the banner colours */
.card-section.neon-cyan    { border-top-color: var(--sf-neon-cyan); }
.card-section.neon-magenta { border-top-color: var(--sf-neon-magenta); }
.card-section.neon-yellow  { border-top-color: var(--sf-neon-yellow); }

.card-section.neon-cyan:hover    { box-shadow: 0 6px 24px rgba(25, 227, 255, 0.18); }
.card-section.neon-magenta:hover { box-shadow: 0 6px 24px rgba(255, 43, 214, 0.18); }
.card-section.neon-yellow:hover  { box-shadow: 0 6px 24px rgba(242, 255, 31, 0.14); }

/* --- Profile images --- */
.profile-photo {
  border-radius: 50%;
  border: 3px solid var(--sf-link);
  box-shadow: 0 0 14px rgba(79, 220, 255, 0.25);
  object-fit: cover;
}

/* --- Person card (people listing) --- */
.person-card {
  text-align: center;
  padding: 1.5rem 1rem;
}

.person-card img {
  width: 150px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin-bottom: 1rem;
}

.person-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
}

.person-card p {
  color: var(--sf-muted);
  font-size: 0.9rem;
}

/* --- Alumni page entries --- */
.alumni-entry {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--sf-surface-line);
}

.alumni-entry img {
  width: 140px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.alumni-entry h3 {
  margin-top: 0.5rem;
}

.alumni-role {
  color: var(--sf-muted);
  font-size: 0.9rem;
}

.alumni-now {
  display: inline-block;
  background-color: rgba(25, 227, 255, 0.12);
  color: #bdf3ff;
  font-size: 0.85rem;
  padding: 0.2rem 0.7rem;
  border-radius: 12px;
}

@media (max-width: 575.98px) {
  .alumni-entry .g-col-12:first-child {
    text-align: center;
  }
}

/* --- Joint papers list (profiles and alumni) --- */
.joint-papers {
  background: var(--sf-surface);
  border-left: 3px solid var(--sf-neon-magenta);
  border-radius: 0 6px 6px 0;
  padding: 0.8rem 1rem 0.2rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.joint-papers ul {
  padding-left: 1.1rem;
}

.joint-papers li {
  margin-bottom: 0.5rem;
}

/* --- Full photo on individual profile pages --- */
.profile-portrait {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  border-bottom: 4px solid var(--sf-neon-magenta);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

/* --- Project photos (Projects page) --- */
img.project-photo {
  width: 100%;
  border-radius: 10px;
  border-bottom: 4px solid var(--sf-neon-magenta);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

/* Photo pairs share one shape, so the two sit level; the lightbox shows the full photo */
.project-photo-pair img.project-photo {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Diagrams on the Projects page sit on their own white card */
img.project-figure {
  display: block;
  width: 100%;
  max-width: 520px;            /* smaller than the text column; full width on phones */
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.photo-credit.project-credit {
  text-align: right;
  margin: -0.6rem 0 1rem;
}

main .quarto-figure figcaption {
  color: var(--sf-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* --- Tables --- */
table {
  border-collapse: collapse;
  width: 100%;
}

th {
  background-color: #16244a;
  color: var(--sf-heading);
}

/* On phones, wide tables (e.g. funding on the CV page) scroll inside their own box */
@media (max-width: 575.98px) {
  main table {
    display: block;
    overflow-x: auto;
    font-size: 0.85rem;
  }
}

/* --- Footer --- */
.nav-footer {
  background-color: var(--sf-night-deep) !important;
  color: rgba(230, 236, 250, 0.7);
  border-top: 3px solid var(--sf-violet);
  border-image: var(--sf-neon-line) 1;
}

.nav-footer a {
  color: var(--sf-link) !important;
}

/* --- Badges / tags --- */
.quarto-listing-category .category {
  background-color: rgba(143, 124, 255, 0.18);
  color: #cfc6ff;
  border-radius: 12px;
  padding: 0.2rem 0.8rem;
  font-size: 0.85rem;
}

/* --- Blog listing --- */
.quarto-listing .listing-title {
  color: var(--sf-heading);
}

.quarto-listing .listing-title:hover {
  color: var(--sf-link);
}

/* --- Sidebar TOC active item --- */
.sidebar nav[role="doc-toc"] a.active,
nav#TOC a.active {
  border-left-color: var(--sf-neon-magenta);
  color: var(--sf-link);
}

/* --- Code blocks --- */
pre.sourceCode {
  border-left: 3px solid var(--sf-link);
}

/* --- Carousel / Slideshow --- */
#heroCarousel {
  max-width: 1000px;
  margin: 0 auto 2rem auto;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--sf-surface-line);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}

#heroCarousel .carousel-inner {
  border-radius: 10px;
}

#heroCarousel .carousel-item {
  background-color: var(--sf-night-deep);
}

#heroCarousel .carousel-item img {
  width: 100%;
  height: min(50vw, 480px);
  object-fit: contain;
  object-position: center center;
}

#heroCarousel .carousel-caption {
  background: linear-gradient(0deg, rgba(7, 13, 34, 0.9) 0%, transparent 100%);
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 1.5rem 1.2rem;
  border-radius: 0 0 10px 10px;
}

#heroCarousel .carousel-caption h5 {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
  border-bottom: none;
  padding-bottom: 0;
}

#heroCarousel .carousel-caption p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  margin-bottom: 0;
}

#heroCarousel .carousel-indicators button {
  background-color: var(--sf-link);
  border-radius: 50%;
  width: 10px;
  height: 10px;
  border: none;
  opacity: 0.45;
}

#heroCarousel .carousel-indicators button.active {
  background-color: var(--sf-neon-magenta);
  opacity: 1;
}

#heroCarousel .carousel-control-prev-icon,
#heroCarousel .carousel-control-next-icon {
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

.photo-credit {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.3rem;
  font-style: italic;
}

/* --- Publication role badges --- */
.badge-role {
  display: inline-block;
  background-color: rgba(143, 124, 255, 0.18);
  color: #cfc6ff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  vertical-align: middle;
}
