/* Botacin's Lab: layout components.
   Palette comes from the Material theme (indigo/teal, light and dark), so
   everything below uses theme variables and works in both schemes. */

:root {
  --lab-rule: var(--md-default-fg-color--lightest);
  --lab-mono: var(--md-code-font-family, "JetBrains Mono", monospace);
}

.md-typeset pre > code,
.md-typeset .admonition {
  border-radius: 0.4rem;
}

/* Small uppercase monospace label used above headings and inside cells. */
.mono-label {
  display: block;
  font-family: var(--lab-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}

/* Section header: label, title, hairline, optional "see all" link on the right. */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin: 3.2rem 0 0.4rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--lab-rule);
}

.section-head h2 {
  margin: 0.2rem 0 0;
}

.section-head .more {
  font-size: 0.78rem;
  white-space: nowrap;
}

.md-typeset .mono-label + h1 {
  margin-top: 0.2rem;
}

/* ---- Header call-to-action (replaces the GitHub repo widget) ---- */
.md-header__join {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  margin-left: 0.6rem;
  border: 1px solid currentColor;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}

.md-header__join:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Outlined buttons default to the (dark) primary colour, hard to read on
   the dark scheme. */
[data-md-color-scheme="slate"] .md-typeset .md-button:not(.md-button--primary) {
  color: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
}

/* ---- Landing hero ---- */
.lab-hero {
  position: relative;
  text-align: center;
  padding: 3.4rem 1rem 2.6rem;
}

.lab-hero h1 {
  margin: 0 0 0.4rem;
  font-size: 3.4rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--md-default-fg-color);
}

.lab-hero .hero-headline {
  margin: 1.6rem auto 0.4rem;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--md-default-fg-color);
}

.lab-hero .hero-text {
  max-width: 40rem;
  margin: 0.4rem auto 1.5rem;
  color: var(--md-default-fg-color--light);
}

.lab-hero .md-button {
  margin: 0.2rem 0.3rem;
}

/* ---- Key facts row ---- */
.info-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--lab-rule);
  border-bottom: 1px solid var(--lab-rule);
  font-size: 0.85rem;
}

.info-row .mono-label {
  margin-bottom: 0.2rem;
}

/* ---- Principal investigator block ---- */
.pi-block {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 2.2rem;
  margin: 1.6rem 0 0;
}

.pi-block img.pi-photo {
  width: 210px;
  height: 280px;
  object-fit: cover;
  border-radius: 0.25rem;
  display: block;
}

.pi-block .link-row {
  margin-top: 0.7rem;
  font-family: var(--lab-mono);
  font-size: 0.68rem;
  line-height: 1.9;
}

.pi-block h3 {
  margin: 0;
}

.pi-block .pi-main .mono-label {
  margin-bottom: 1rem;
}

/* ---- Research areas ---- */
.area-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 1.4rem 0 0;
  border-top: 1px solid var(--lab-rule);
  border-left: 1px solid var(--lab-rule);
}

.area-grid > div {
  padding: 1.1rem 1.2rem 1.3rem;
  border-right: 1px solid var(--lab-rule);
  border-bottom: 1px solid var(--lab-rule);
  font-size: 0.85rem;
}

.area-grid h3 {
  margin: 0.3rem 0 0.4rem;
  font-size: 1.02rem;
}

.area-grid p {
  margin: 0;
}

/* ---- Publication rows ---- */
.pub-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1.4rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--lab-rule);
}

.pub-year {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
}

.pub-main p {
  margin: 0.15rem 0;
}

.pub-main p:first-child {
  margin-top: 0;
  line-height: 1.35;
}

.pub-main p:nth-child(2) {
  font-size: 0.78rem;
  color: var(--md-default-fg-color--light);
}

.tag {
  display: inline-block;
  margin: 0.25rem 0.4rem 0 0;
  font-family: var(--lab-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-content: flex-start;
  justify-content: flex-end;
  max-width: 13rem;
}

.pub-links p {
  margin: 0;
}

.md-typeset a.chip {
  display: inline-block;
  padding: 0 0.5rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 0.2rem;
  font-family: var(--lab-mono);
  font-size: 0.66rem;
  line-height: 1.7;
  color: var(--md-default-fg-color--light);
}

.md-typeset a.chip:hover {
  border-color: var(--md-accent-fg-color);
  color: var(--md-accent-fg-color);
}

/* ---- News rows ---- */
.news-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.4rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--lab-rule);
  font-size: 0.88rem;
}

.news-row p {
  margin: 0;
}

.news-date {
  font-family: var(--lab-mono);
  font-size: 0.72rem;
  color: var(--md-default-fg-color--light);
  padding-top: 0.1rem;
}

/* ---- Members ---- */
.md-typeset h2 .count {
  margin-left: 0.6rem;
  font-family: var(--lab-mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--md-default-fg-color--light);
  vertical-align: middle;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.4rem;
  margin: 1.2rem 0 2rem;
}

.member-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.member-card img.member-photo {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 0.25rem;
  margin: 0 0 0.4rem;
}

.member-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.member-card p {
  margin: 0;
  font-size: 0.8rem;
}

.member-card .member-role,
.pi-block .member-role {
  font-family: var(--lab-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
}

.member-card .member-links {
  margin-top: 0.3rem;
  font-size: 0.72rem;
}

/* Links still pointing at "#" (placeholders for the student to fill in) are
   dimmed and inert. */
.member-card .member-links a[href="#"],
.project-slot a[href="#"] {
  opacity: 0.4;
  pointer-events: none;
}

/* ---- Projects ---- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.feature-grid > div {
  border: 1px solid var(--lab-rule);
  border-radius: 0.4rem;
  padding: 1rem 1.1rem;
}

.feature-grid h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

.project-slot {
  border-left: 3px solid var(--md-accent-fg-color);
  padding: 0.1rem 0 0.1rem 1rem;
  margin: 1.2rem 0;
}

.project-slot h3 {
  margin-top: 0;
}

.pill {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.05rem 0.5rem;
  border-radius: 1rem;
  border: 1px solid var(--md-accent-fg-color);
  color: var(--md-accent-fg-color);
  vertical-align: middle;
}

/* ---- Narrow screens ---- */
@media (max-width: 60em) {
  .info-row { grid-template-columns: repeat(2, 1fr); }
  .area-grid { grid-template-columns: repeat(2, 1fr); }
  .pub-row { grid-template-columns: 90px 1fr; }
  .pub-links { grid-column: 2; justify-content: flex-start; max-width: none; }
}

@media (max-width: 40em) {
  .lab-hero { padding: 1.4rem 0 0.6rem; }
  .lab-hero h1 { font-size: 2.1rem; }
  .lab-hero .hero-headline { font-size: 1.2rem; margin-top: 1.1rem; }
  .lab-hero .hero-text { font-size: 0.85rem; }
  .lab-hero .md-button { display: block; margin: 0.4rem auto; max-width: 16rem; }
  .info-row { grid-template-columns: 1fr 1fr; gap: 0.9rem; }
  .pi-block { grid-template-columns: 1fr; }
  .pi-block img.pi-photo { width: 100%; max-width: 240px; height: auto; aspect-ratio: 3 / 4; }
  .area-grid { grid-template-columns: 1fr; }
  .section-head { flex-wrap: wrap; margin-top: 2.2rem; }
  .pub-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .pub-meta { display: flex; gap: 0.7rem; align-items: baseline; }
  .pub-meta .pub-year, .pub-meta .mono-label { display: inline-block; }
  .pub-links { grid-column: auto; justify-content: flex-start; max-width: none; }
  .news-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .member-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .member-card img.member-photo { max-width: none; }
}
