/* Yang Lab / Brandeis Biochemistry — Shared site stylesheet */

:root{
  --primary:#003478;
  --primary-dark:#022a5b;
  --secondary:#00B3E9;
  --text:#111827;
  --muted:#5a6b85;
  --bg:#f7f9fc;
  --card:#ffffff;
  --border:rgba(0,0,0,.10);
  --cyan-300:#8dd0ef;

  /* X-ray accent */
  --xray:#f59e0b;
  --xray-dark:#d97706;

  /* Type scale */
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  --radius:12px;
  --shadow:0 6px 18px rgba(0,0,0,.08);
}

/* Base */
html{scroll-behavior:smooth}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:var(--font-sans);line-height:1.65}
body{font-size:16px}
img{max-width:100%;height:auto}

.container{width:92%;max-width:1100px;margin:0 auto}

a{color:var(--primary);text-decoration:none}
a:hover{color:var(--secondary)}

.muted{color:var(--muted)}

/* Skip link (a11y) */
.skip-link{
  position:absolute;
  left:12px;
  top:12px;
  transform:translateY(-140%);
  background:#fff;
  color:var(--primary);
  padding:.6rem .9rem;
  border-radius:10px;
  box-shadow:var(--shadow);
  border:1px solid var(--border);
  z-index:9999;
}
.skip-link:focus{transform:translateY(0)}

/* Focus ring */
:focus-visible{outline:2px solid var(--secondary);outline-offset:2px}

/* Shared components */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:1rem;
  box-shadow:var(--shadow);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  padding:.6rem .95rem;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.12);
  font-weight:700;
  cursor:pointer;
  background:#fff;
  color:var(--primary);
}
.btn:hover{background:#f2f6ff}

.btn-primary{background:var(--primary);border-color:rgba(255,255,255,.25);color:#fff}
.btn-primary:hover{background:#022f6a}

.btn-xray{background:var(--xray);color:#061a3a;border-color:rgba(0,0,0,.08)}
.btn-xray:hover{background:var(--xray-dark);color:#fff}

.pill{
  display:inline-flex;
  align-items:center;
  padding:.2rem .55rem;
  border-radius:999px;
  background:rgba(0,0,0,.06);
  font-size:.92rem;
}

/* Page header component */
.page-header{
  margin:0 0 1.5rem;
  padding:1.15rem 1.25rem 1.05rem;
  border:1px solid rgba(255,255,255,.16);
  border-radius:var(--radius);
  background:linear-gradient(180deg,var(--primary),var(--primary-dark));
  color:#fff;
  box-shadow:var(--shadow);
}
.page-header h1{
  color:#fff;
  font-size:clamp(1.65rem, 3vw, 2.15rem);
  line-height:1.2;
  margin:0 0 .45rem;
  letter-spacing:-0.01em;
}
.page-header .lead{margin:0;max-width:60rem;color:rgba(255,255,255,.92)}

/* Header / Brand */
header{
  background:linear-gradient(180deg,var(--primary),var(--primary-dark));
  color:#fff;
  padding:1rem 0;
  box-shadow:0 2px 10px rgba(0,0,0,.15);
}
.brand{display:flex;align-items:center;gap:1rem}
.brand .logo{width:56px;height:56px;flex:0 0 56px}
.brand-titles{display:flex;flex-direction:column;min-width:0}
.lab-name{font-size:1.75rem;margin:0;font-weight:800;letter-spacing:-0.01em}
.lab-name a{color:#fff}
.inst-name{margin:0;font-size:.95rem;opacity:.92;letter-spacing:.2px;color:#eaf2ff}
.inst-name a{color:#eaf2ff}
.inst-name a:hover{color:var(--secondary)}
/* Desktop: add separator only between the two institutional links */
.inst-name a + a::before{content:"|"; margin:0 .4rem; color:#eaf2ff; opacity:.7}

/* Subnav */
.subnav{background:#0a3f8b;border-top:1px solid rgba(255,255,255,.15);border-bottom:1px solid rgba(0,0,0,.1)}
.subnav ul{list-style:none;margin:0;padding:.35rem 0;display:flex;flex-wrap:wrap;gap:1rem 1.25rem;align-items:center}
.subnav a{color:#eaf2ff;font-weight:700;letter-spacing:.2px}
.subnav a:hover{color:#fff}
.subnav a[aria-current="page"]{text-decoration:underline;text-underline-offset:4px}

/* Nav divider (requested: separate department-wide X-ray hub) */
.nav-divider{color:rgba(234,242,255,.75);font-weight:700;user-select:none}

/* X-ray tab (department-wide) — keep same styling as other tabs */
.subnav a.xray-link{
  background:transparent;
  color:#eaf2ff;
  border-radius:0;
  font-weight:700;
}

.peptidelinks-link{
  background:transparent;
  color:#eaf2ff;
  border-radius:0;
  font-weight:700;
}
.subnav a.xray-link:hover{background:transparent;color:#fff}
.subnav a.xray-link[aria-current="page"]{text-decoration:underline;text-underline-offset:4px;box-shadow:none}

/* Mobile nav */
.nav-toggle{display:none;margin-left:auto;background:transparent;border:0;padding:.5rem;cursor:pointer;border-radius:10px}
.nav-toggle-box{display:inline-flex;flex-direction:column;gap:4px}
.nav-toggle-bar{width:24px;height:2px;background:#fff;display:block;transition:transform .2s ease, opacity .2s ease}

/* Main */
main{padding:2rem 0 3rem}

/* Index: hero + figures grid */
.hero{padding-top:.25rem;margin-bottom:1.5rem}
.hero h2{margin:.2rem 0 .6rem;color:var(--primary);font-size:1.25rem}

.figures-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1.25rem;margin-top:1.5rem}
.figures-grid figure{margin:0;text-align:center;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:.6rem;box-shadow:var(--shadow)}
.figures-grid img{width:100%;aspect-ratio:16/8;object-fit:cover;display:block;border-radius:10px;background:var(--card)}
.figures-grid figcaption{margin-top:.9rem;font-size:.98rem;color:#0f172a;font-weight:600}

/* Research: project cards */
.projects{display:flex;flex-direction:column;gap:1rem}
.project{display:grid;grid-template-columns:1fr 280px;gap:1rem;align-items:start;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:1rem;box-shadow:var(--shadow)}
.project h3{margin:.1rem 0 .35rem;color:#0b2f67}
.project p{margin:.25rem 0}
.project .thumb{width:100%;height:auto;object-fit:contain;border-radius:10px;background:var(--card);display:block}

/* Publications */
.pub-card{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:1rem;align-items:start;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:1rem;box-shadow:var(--shadow);margin-bottom:1rem}
.pub-thumb{grid-column:2;width:100%;height:auto;object-fit:contain;border-radius:10px;background:#e9eef7}
.pub-title{margin:.1rem 0 .2rem;font-weight:800;color:#0b2f67;white-space:normal;overflow-wrap:break-word;word-break:break-word}
.pub-authors{color:#334155}
.pub-links a{font-size:.95rem}
.pipe{margin:0 .35rem;color:#9aa3b2}
.pub-journal{margin:.15rem 0 .2rem;font-size:.98rem;color:#344055;line-height:1.4}
.pub-journal .jnl{font-style:italic}
.pub-journal .year{font-weight:800}
.pub-journal .vol,.pub-journal .issue{font-style:italic}

/* People */
.group-photo{margin:0;text-align:center}
.group-photo img{width:100%;display:block;border-radius:var(--radius);box-shadow:var(--shadow)}
.group-photo .label{margin-top:.6rem;color:#0f172a;font-size:1.05rem;font-weight:700}

.people-list{display:flex;flex-direction:column;gap:1rem;margin-top:1rem}
.person{display:grid;gap:1rem;align-items:center;grid-template-columns:220px 1fr;padding:.75rem 0;border-bottom:1px solid rgba(0,0,0,.08)}
.person:last-child{border-bottom:none}
.person-photo{width:220px;height:220px;object-fit:cover;border-radius:10px;background:#e9eef7}
.person h3{margin:.1rem 0 .2rem;color:#0b2f67}
.person .title{font-size:.95rem;color:#334155;margin:0 0 .35rem}
.person .email a{word-break:break-all}
.person .links .pipe{opacity:.55}

/* News */
.news-list,
.news-wrap{display:flex;flex-direction:column;gap:1rem}
.news-item{display:grid;grid-template-columns:1fr 220px;gap:1rem;align-items:start;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:1rem;box-shadow:var(--shadow)}
.news-date{margin:0;color:#64748b;font-weight:700;font-size:.92rem}
.news-title{margin:.15rem 0 .35rem;color:#0b2f67;font-size:1.12rem}
.news-body{margin:0;color:#334155}
.news-photo img{width:100%;height:auto;border-radius:10px;object-fit:cover;background:#e9eef7}

/* Contact */
.contact-grid{display:grid;gap:1rem}
@media (min-width:820px){.contact-grid{grid-template-columns:1fr 1fr}}
.map-embed{border:0;width:100%;height:320px;border-radius:var(--radius)}

/* X-ray: Google Sites-like left nav */
.xray-shell{display:grid;gap:1.25rem}
@media (min-width:900px){.xray-shell{grid-template-columns:260px 1fr;align-items:start}}

.xray-side{
  background:#ffffff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:1rem;
  box-shadow:var(--shadow);
}
.xray-side-title{margin:0 0 .75rem;font-size:1.05rem;font-weight:900;color:var(--primary)}
.xray-side nav{display:flex;flex-direction:column;gap:.25rem}
.xray-side a{padding:.45rem .55rem;border-radius:10px;color:#0f172a;font-weight:700}
.xray-side a:hover{background:#f2f6ff;color:var(--primary)}
.xray-side a.active{background:#f2f6ff;border:1px solid rgba(0,52,120,.25);color:var(--primary)}

.xray-content section{margin-bottom:1.25rem}
.xray-content h2{margin:0 0 .35rem;color:var(--primary)}
.xray-content h3{margin:.1rem 0 .35rem;color:#0b2f67}

/* Footer */
footer{margin-top:3rem;background:linear-gradient(180deg,var(--primary-dark),#001e45);color:#e9eef7;position:relative}
footer::before{content:"";position:absolute;top:0;left:0;right:0;height:4px;background:var(--secondary)}

.desktop-footer{padding:1.25rem 0 .5rem}
.footer-top{display:flex;flex-wrap:wrap;gap:1rem;align-items:center;justify-content:space-between}
.footer-nav{display:flex;gap:1rem;flex-wrap:wrap;align-items:center}
.footer-bottom{border-top:1px solid rgba(255,255,255,.18);margin-top:.9rem;padding-top:1rem;font-size:.9rem;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center}
footer a{color:var(--cyan-300)}
footer a:hover{color:var(--secondary)}
footer strong{color:var(--secondary)}

/* Footer X-ray link — same styling as other footer links */

.mobile-footer{display:none;text-align:center;padding:1rem 0;background:#001e45;color:#e9eef7;font-size:.9rem}

/* Responsive */
@media (max-width:900px){
  .pub-card{grid-template-columns:1fr}
  .pub-thumb{grid-column:1}
  .news-item{grid-template-columns:1fr}
}

@media (max-width:768px){
  .brand{gap:.75rem}
  .brand .logo{width:48px;height:48px;flex-basis:48px}
  .lab-name{font-size:1.45rem}

  /* hamburger */
  .nav-toggle{display:inline-flex;align-items:center}

  /* Collapse nav by default; open via .open */
  .subnav ul{display:none;flex-direction:column;gap:0;padding:.25rem 0 .75rem;align-items:stretch}
  .subnav li a{display:flex;align-items:center;min-height:48px;padding:.75rem .9rem;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .subnav a.xray-link,
  .subnav a.peptidelinks-link{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

  .subnav.open ul{display:flex}
  .subnav li + li a{border-top:1px solid rgba(255,255,255,.15)}

  /* Hide requested divider in mobile stacked list */
  .nav-divider{display:none}

  /* Remove pipe in header institutional links on mobile */
  .inst-name a + a::before{content:""; margin:0}

  /* People: stack */
  .person{grid-template-columns:1fr}
  .person-photo{width:100%;height:auto;max-height:360px}

  /* Figures grid */
  .figures-grid{grid-template-columns:1fr}

  /* Footer switch */
  .desktop-footer{display:none}
  .mobile-footer{display:block}
}

/* Animated hamburger to X */
@media (max-width:768px){
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1){transform:translateY(6px) rotate(45deg);transform-origin:center}
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2){opacity:0}
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3){transform:translateY(-6px) rotate(-45deg);transform-origin:center}
}
/* =========================================================
   Photos page (gallery + thumbnail rail)
   ========================================================= */
.photo-card{padding:0}
.photo-shell{
  display:grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap:1rem;
  padding:1rem;
}

.photo-side{
  border-right:1px solid var(--border);
  padding-right:1rem;
}
.photo-side-head{display:flex; align-items:baseline; justify-content:space-between; gap:.75rem; margin-bottom:.75rem}
.photo-side-title{font-weight:800; letter-spacing:.2px}
.photo-side-sub{color:var(--muted); font-size:.9rem}

.photo-thumbs{
  display:flex;
  flex-direction:column;
  gap:.5rem;
  max-height: 70vh;
  overflow:auto;
  padding-right:.25rem;
}
.photo-empty{padding:.5rem; border:1px dashed rgba(0,0,0,.20); border-radius:12px; background:rgba(255,255,255,.6)}

.photo-thumb{
  appearance:none;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  border-radius:12px;
  padding:.45rem;
  cursor:pointer;
  display:grid;
  grid-template-columns: 72px 1fr;
  gap:.6rem;
  align-items:center;
  text-align:left;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.photo-thumb:hover{border-color:rgba(0,0,0,.22)}
.photo-thumb[aria-selected="true"]{
  border-color:rgba(0,0,0,.30);
  outline: 3px solid rgba(0,179,233,.22);
  outline-offset: 0;
}
.photo-thumb img{
  width:72px;
  height:54px;
  object-fit:cover;
  border-radius:10px;
}
.photo-thumb .t-title{font-weight:800; line-height:1.25}
.photo-thumb .t-sub{color:var(--muted); font-size:.88rem; margin-top:.1rem}

.photo-view{min-width:0}
.photo-stage{
  position:relative;
  border:1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
  background: linear-gradient(135deg, rgba(0,52,120,.85), rgba(2,42,91,.85));
  aspect-ratio: 16 / 9;
  display:flex;
  align-items:center;
  justify-content:center;
}
.photo-main{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}
.photo-nav{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  width:42px;
  height:42px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35);
  color:#fff;
  font-size:28px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.photo-nav:hover{background: rgba(0,0,0,.55)}
.photo-nav.prev{left:10px}
.photo-nav.next{right:10px}

.photo-meta{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  padding:.9rem .1rem .2rem;
}
.photo-title{font-weight:900; font-size:1.05rem}
.photo-sub{color:var(--muted); margin-top:.15rem}
.photo-actions{display:flex; gap:.5rem; flex-wrap:wrap}
.photo-help{margin:.6rem 0 0}

@media (max-width: 900px){
  .photo-shell{grid-template-columns: 1fr}
  .photo-side{
    border-right:none;
    border-top:1px solid var(--border);
    padding-right:0;
    padding-top:1rem;
    margin-top:1rem;
  }
  .photo-thumbs{
    flex-direction:row;
    max-height:none;
    overflow:auto;
    padding-bottom:.25rem;
  }
  .photo-thumb{
    grid-template-columns: 72px;
    width: 92px;
  }
  .photo-thumb .t-meta{display:none}
}
