/* ============================================================
   Franco Lab — shared stylesheet
   Edit this one file to restyle every page of the site.
   ------------------------------------------------------------
   Quick reference for the values you're most likely to change:
     --accent      : the orange used for links / highlights
     --ink         : main gray body text
     --sidebar-w   : width of the left menu on desktop
     --photo-ratio : aspect ratio of every people photo (1/1 = square)
   ============================================================ */

:root {
  --accent:      #f0a020;   /* orange accent (links, highlights)   */
  --accent-dark: #d98a00;   /* darker orange for hover             */
  --ink:         #555;      /* body text gray                      */
  --ink-soft:    #777;      /* secondary text (captions)           */
  --heading:     #666;      /* section headings                    */
  --sidebar-bg:  #eee;      /* left menu background                 */
  --line:        #e2e2e2;   /* hairline dividers                   */
  --sidebar-w:   210px;     /* left menu width on desktop          */
  --maxwidth:    1100px;    /* max content width                   */
  --photo-ratio: 1 / 1;     /* people photo shape (try 4 / 5 too)  */
  --gap:         24px;      /* base spacing unit                   */
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--ink);
  background: #fff;
}

img { max-width: 100%; height: auto; vertical-align: middle; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

/* Visible keyboard focus for accessibility */
a:focus-visible,
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3, h4 { color: var(--heading); font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.7rem; margin: 0 0 0.6em; }
h2 { font-size: 1.35rem; margin: 1.8em 0 0.5em; }
h3 { font-size: 1.1rem;  margin: 1.4em 0 0.4em; }
h4 { font-size: 1rem;    margin: 1.2em 0 0.4em; color: var(--ink-soft); }

/* ---------- page shell ---------- */
.layout {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

/* left menu (desktop) */
.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  padding: 22px 18px;
  position: sticky;
  top: 0;
  align-self: stretch;
  min-height: 100vh;
}
.sidebar .brand { display: block; margin-bottom: 18px; }
.sidebar nav a {
  display: block;
  color: var(--heading);
  font-size: 1.05rem;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.sidebar nav a:hover { color: var(--accent); text-decoration: none; }
.sidebar nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.sidebar .ucla { margin-top: 24px; }
.sidebar .ucla img { width: 120px; }

/* main content */
.content {
  flex: 1 1 auto;
  min-width: 0;                /* lets long words/links wrap instead of overflow */
  padding: 26px 32px 60px;
  max-width: var(--maxwidth);
}

/* mobile menu toggle — hidden on desktop */
.menu-toggle { display: none; }

/* ---------- people grid ---------- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--gap);
  margin: 0.5em 0 1.5em;
}

.person {
  display: flex;
  flex-direction: column;
}
.person .photo {
  width: 100%;
  aspect-ratio: var(--photo-ratio);
  object-fit: cover;         /* crops any image to a uniform tile   */
  object-position: center 25%;/* bias toward faces (upper portion)  */
  border-radius: 6px;
  background: #f3f3f3;
  display: block;
}
.person .name { color: var(--ink); font-weight: 600; margin: 10px 0 2px; }
.person .meta { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.45; }
.person .meta a { color: var(--accent); }

/* the PI card at the top of the People page */
.pi {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 1em;
}
.pi .photo {
  flex: 0 0 200px;
  width: 200px;
  aspect-ratio: var(--photo-ratio);
  object-fit: cover;
  object-position: center 25%;
  border-radius: 8px;
}
.pi .bio { flex: 1 1 320px; min-width: 260px; }
.pi .bio p { margin: 0.25em 0; color: var(--ink-soft); }
.pi .bio .role { color: var(--accent); font-weight: 600; font-size: 1.2rem; margin-bottom: 0.3em; }

/* group photo */
.group-photo { display: block; width: 100%; max-width: 720px; margin: 0 auto 1.5em; border-radius: 8px; }

/* simple text lists (alumni, collaborators) */
.people-list { color: var(--ink-soft); padding-left: 1.2em; }
.people-list li { margin: 0.35em 0; }

.callout { background: #faf6ef; border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 4px; margin: 1em 0; color: var(--ink); }

/* ---------- research thrusts (text + media, alternating) ---------- */
.lab-intro { font-size: 1.1rem; color: var(--ink); max-width: 60ch; margin: 0.3em 0 1.6em; }

.overview-figure {
  width: 100%;
  max-width: 720px;
  margin: 0 0 2em;
  padding: 20px 22px;
  background: #fafafa;
  border-radius: 10px;
}
.overview-figure img { width: 100%; display: block; }
.overview-figure figcaption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 10px;
  text-align: center;
}

.thrust {
  display: flex;
  gap: 30px;
  align-items: center;
  margin: 2.2em 0;
  flex-wrap: wrap;
}
.thrust.reverse { flex-direction: row-reverse; }
.thrust-text { flex: 1 1 340px; min-width: 280px; }
.thrust-text h2 { margin-top: 0; }
.thrust-media { flex: 0 1 380px; min-width: 260px; margin: 0; }
.thrust-media img,
.thrust-media video {
  width: 100%;
  border-radius: 8px;
  display: block;
  background: #000;
}
.thrust-media figcaption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 8px;
  line-height: 1.4;
}
.repwork { font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.6em; }
.repwork a { color: var(--accent); }

.media-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 2px dashed #d5d5d5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #b3b3b3;
  font-size: 0.85rem;
  padding: 12px;
}

@media (max-width: 720px) {
  .thrust, .thrust.reverse { flex-direction: column; }
  .thrust-media { flex-basis: auto; width: 100%; }
}

/* ---------- funding titles ---------- */
.funding-list { list-style: none; padding-left: 0; color: var(--ink-soft); }
.funding-list li { margin: 0.6em 0; line-height: 1.45; }
.funding-list .sponsor { color: var(--ink); font-weight: 600; }

/* ---------- funding logos row ---------- */
.logos { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin: 1em 0; }
.logos img { max-height: 70px; width: auto; }

/* ---------- publications ---------- */
.pub-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0.5em 0 1.5em; }
.pub-nav a { font-weight: 600; }
.pub-list { color: var(--ink-soft); padding-left: 0; list-style: none; }
.pub-list li { margin: 0.7em 0; line-height: 1.5; }
.pub-list a { color: var(--ink); }
.pub-list a:hover { color: var(--accent); }
.year { color: var(--heading); font-weight: 600; margin: 1.4em 0 0.3em; }

/* ---------- homepage (hero + image-tile nav) ---------- */
.home-hero { margin: 0.3em 0 1.4em; }
.home-hero h1 { font-size: 1.9rem; margin: 0 0 0.35em; }
.home-hero .mission {
  font-size: 1.2rem; line-height: 1.5; color: var(--ink);
  max-width: 60ch; margin: 0 0 1.1em;
}
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 7px; font-weight: 600; font-size: 0.98rem; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-ghost { border: 1.5px solid var(--accent); color: var(--accent); }
.btn-ghost:hover { background: #faf6ef; text-decoration: none; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin: 1.5em 0;
}
.tile {
  position: relative; display: block; border-radius: 10px;
  overflow: hidden; aspect-ratio: 4 / 3; background: #eee;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.tile:hover img { transform: scale(1.05); }
.tile-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 30px 16px 14px; color: #fff; font-size: 1.15rem; font-weight: 600;
  background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0));
}
.tile:hover { text-decoration: none; }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.home-section { margin: 2.4em 0; }
.home-section > h2 { margin-bottom: 0.4em; }
.highlight-list { list-style: none; padding: 0; margin: 0.4em 0 0.6em; }
.highlight-list li { padding: 0.6em 0; border-bottom: 1px solid var(--line); line-height: 1.45; }
.highlight-list .venue { color: var(--ink-soft); font-size: 0.9rem; }

.home-contact {
  border-top: 1px solid var(--line); margin-top: 2.2em; padding-top: 1.2em;
  color: var(--ink-soft); font-size: 0.95rem; line-height: 1.65;
}
.home-contact strong { color: var(--ink); }

@media (max-width: 720px) {
  .home-hero h1 { font-size: 1.55rem; }
  .home-hero .mission { font-size: 1.08rem; }
}

/* ---------- homepage slideshow ---------- */
.hero-title { text-align: center; color: var(--heading); margin: 0.2em 0 0.8em; }
.slideshow { max-width: 1000px; margin: 0 auto; position: relative; }
.slide { display: none; }
.slide img { width: 100%; border-radius: 8px; }
.slide.fade { animation: fade 1.5s; }
@keyframes fade { from { opacity: .4 } to { opacity: 1 } }
.dots { text-align: center; margin-top: 14px; }
.dot {
  height: 12px; width: 12px; margin: 0 4px; background: #bbb;
  border-radius: 50%; display: inline-block; transition: background-color .5s ease;
}
.dot.active { background: var(--heading); }

/* ============================================================
   Responsive — tablets and phones
   ============================================================ */
@media (max-width: 820px) {
  .layout { flex-direction: column; }

  .sidebar {
    position: static;
    width: 100%;
    flex-basis: auto;
    min-height: 0;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 4px;
  }
  .sidebar .brand { margin: 0 auto 0 0; }

  /* menu collapses behind a button */
  .menu-toggle {
    display: inline-block;
    margin-left: auto;
    background: none;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 1rem;
    color: var(--heading);
    cursor: pointer;
  }
  .sidebar nav {
    flex-basis: 100%;
    display: none;          /* hidden until toggled */
  }
  .sidebar nav.open { display: block; }
  .sidebar nav a { border-bottom: 1px solid rgba(0,0,0,0.08); }
  .sidebar .ucla { margin: 8px 0 0 auto; }
  .sidebar .ucla img { width: 90px; }

  .content { padding: 20px 18px 48px; max-width: 100%; }

  .people-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px; }

  .pi .photo { flex-basis: 150px; width: 150px; }
}

@media (max-width: 460px) {
  h1 { font-size: 1.4rem; }
  .people-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .content { padding: 16px 14px 40px; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .slide.fade { animation: none; }
  * { scroll-behavior: auto; }
}
