@import url('fonts.css');

/* ==========================================================================
   Lab Rats — labs-rats.com replica
   All metrics measured from the live Google Sites original at viewport 1470px.
   ========================================================================== */

:root {
  --container: 1155px;        /* measured content width */
  --header-h: 56px;
  --gold: #f1c232;           /* page-title gold  (Background / About / Resources) */
  --blue: #1a3d99;           /* page-title + section-heading blue */
  --header-dark: #212121;    /* solid header background once scrolled */
  --brand: rgba(0, 0, 0, .8);
  --nav: rgba(0, 0, 0, .64);
  --nav-active: rgba(0, 0, 0, .82);
  --body-text: #000;
  --link: #1155cc;
  --sans: 'PT Sans', sans-serif;
  --serif: Merriweather, serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: #fff;
  color: var(--body-text);
  font: 400 16px/normal var(--sans);
  overflow-x: hidden;         /* page body must never scroll horizontally */
}

img { max-width: 100%; }

/* 1155px is the measured *content* width — no gutters at desktop. Narrow
   viewports get a 16px gutter instead (see the max-width query below). */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
}

@media (max-width: 1186px) {
  .container { padding-inline: 16px; }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 8px 16px;
  background: #fff;
  color: #1155cc;
  font: 400 14px var(--sans);
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------------------------------------------------------------- header  */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: transparent;
  transition: background-color .2s ease;
}

.site-header__inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding-left: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;               /* logo right edge 72px -> brand text 84px */
  text-decoration: none;
  flex: 0 0 auto;
}

.brand__logo {
  width: 56px;
  height: 56px;
  display: block;
  object-fit: contain;
}

.brand__name {
  font: 700 20px/1.3 var(--sans);
  color: var(--brand);
  white-space: nowrap;
  transition: color .2s ease;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 26px;               /* measured gap between nav text boxes */
}

.site-nav a {
  font: 400 16px/21px var(--sans);
  color: var(--nav);
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease;
}

.site-nav a:hover { color: rgba(0, 0, 0, .87); }

.site-nav a[aria-current='page'] {
  font-weight: 700;
  color: var(--nav-active);
}

.search-btn {
  width: 48px;
  height: 48px;
  margin-left: 12px;       /* 12px after last nav item, then flush right */
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  color: rgba(0, 0, 0, .7);
  transition: color .2s ease, background-color .2s ease;
  flex: 0 0 auto;
}
.search-btn:hover { background: rgba(0, 0, 0, .06); }
.search-btn svg { width: 24px; height: 24px; fill: currentColor; display: block; }

.nav-toggle { display: none; }

/* scrolled state: solid dark bar, everything reversed to white */
.site-header.is-scrolled { background: var(--header-dark); }
.site-header.is-scrolled .brand__name,
.site-header.is-scrolled .site-nav a,
.site-header.is-scrolled .search-btn { color: #fff; }
.site-header.is-scrolled .site-nav a[aria-current='page'] { color: #fff; }
.site-header.is-scrolled .search-btn:hover,
.site-header.is-scrolled .nav-toggle:hover { background: rgba(255, 255, 255, .12); }

/* ----------------------------------------------------------------- titles */

.page-title {
  margin: 36px 0 0;        /* header 56 + 36 => title top at y=92 */
  font: 700 60px/66px var(--sans);
  letter-spacing: -1px;
  text-align: center;
}
.page-title--gold { color: var(--gold); }
.page-title--blue { color: var(--blue); }

.section-title {
  margin: 0;
  font: 700 45.3333px/1.2 var(--sans);
  letter-spacing: -1px;
  color: var(--blue);
}

/* ------------------------------------------------------------------- body */

/* Line spacing is set per text box in the original: every page uses 24.4449px
   except Background, which uses Merriweather's natural 21.12px. */
.prose p {
  margin: 0 0 12px;
  font: 400 14.6667px/24.4449px var(--serif);
  color: var(--body-text);
  text-align: justify;
}

.content--bg .prose p {
  line-height: 21.12px;
  margin-bottom: 18.7px;
}
.prose p:last-child { margin-bottom: 0; }
.prose--left p { text-align: left; }

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

/* content block sits 88px below the title block (title bottom 158 -> 246) */
.content {
  margin-top: 88px;
  padding-bottom: 96px;
}

/* Google Sites text blocks carry their own 8px inset inside the grid cell. */
.text-inset { padding: 8px 8px 0; }

/* The full-width Background prose block sits 6px lower than the split columns. */
.content--bg .prose.text-inset { padding-top: 14px; }

/* two-column splits — column widths measured per page; each row totals 1155 */
.split {
  display: grid;
  align-items: start;
}
.split--about     { grid-template-columns: 761fr 365.5fr; gap: 28.5px; } /* text | logo  */
.split--resources { grid-template-columns: 562fr 555fr;   gap: 38px; }   /* pdf | text   */
.split--founder   { grid-template-columns: 464fr 653fr;   gap: 38px; }   /* photo | text */

.split__media img { width: 100%; height: auto; display: block; }

/* Resources / Founder right-hand column: title 14px down, 28px to the copy.
   The inner max-widths are the original text-box widths — they decide where
   the copy wraps, so they must not be left to fill the grid cell. */
.split__body { padding-top: 14px; }
.split__body .section-title { margin: 0 0 28px; }
.split__body .prose { margin: 0; padding: 0; }
.split--resources .split__body { max-width: 546px; }
.split--founder .split__body { max-width: 645px; }

/* ------------------------------------------------- background page image  */

.full-figure {
  margin: 14px 0 0;
}
.full-figure img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------------------------------------------------------- work gallery  */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;              /* 365*3 + 30*2 = 1155 exactly */
}

.gallery img,
.gallery__row img {
  width: 100%;
  height: auto;
  display: block;
}

/* left column holds two stacked shots; the wide shot spans columns 2-3 */
.gallery__col {
  display: grid;
  gap: 28px;
  align-content: start;
}
.gallery__wide { grid-column: span 2; }

.gallery__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 48px;
}

.work-note { margin-top: 56px; padding-inline: 8px; }
.work-note .section-title { margin: 0 0 65px; }
.work-note .prose { margin: 0; padding: 0; }

/* ------------------------------------------------------------ pdf viewer  */

/* Scrollable document viewer, matching the Drive preview the original embeds:
   grey gutter, white page sheets, scroll through all 24 pages in place. The
   pages are pre-rendered images, so this scrolls identically on every browser
   (an inline <iframe> PDF will not scroll on iOS Safari). */
.pdf {
  position: relative;
  aspect-ratio: 562 / 676;   /* measured embed box */
  background: #f1f3f4;
  overflow: hidden;
}

.pdf__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;   /* don't chain scroll to the page */
  -webkit-overflow-scrolling: touch;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdf__scroll:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.pdf__scroll img {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
}

.pdf__open {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border-radius: 2px;
  text-decoration: none;
  transition: background-color .2s ease;
}
.pdf__open:hover { background: rgba(0, 0, 0, .75); }
.pdf__open svg { width: 20px; height: 20px; fill: currentColor; }

/* --------------------------------------------------------- partners page  */

.coming-soon {
  /* padding, not margin — a top margin would collapse through .content */
  margin: 0;
  padding: 8px 8px 0;
  font: italic 400 14.6667px/24.4449px var(--serif);
  text-align: center;
  color: var(--body-text);
}

.page-partners .content { min-height: 340px; }

/* ------------------------------------------------------------------- 404  */

.page-notfound .content { min-height: 340px; }

.notfound {
  margin: 0;
  padding: 8px 8px 0;
  font: 400 14.6667px/24.4449px var(--serif);
  text-align: center;
  color: var(--body-text);
}
.notfound a { color: var(--link); text-decoration: underline; }

/* ------------------------------------------------------------- search UI  */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, .5);
  display: none;
  padding: 12vh 16px 16px;
  overflow-y: auto;
}
.search-overlay[open],
.search-overlay.is-open { display: block; }

.search-panel {
  max-width: 640px;
  margin-inline: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
  overflow: hidden;
}

.search-panel__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
}
.search-panel__bar svg { width: 22px; height: 22px; fill: #5f6368; flex: 0 0 auto; }

.search-panel input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  font: 400 16px var(--sans);
  color: #202124;
  background: none;
  appearance: none;
}
/* hide the UA's own clear affordance — the panel has its own close button */
.search-panel input::-webkit-search-cancel-button,
.search-panel input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.search-close {
  border: 0;
  background: none;
  cursor: pointer;
  font: 400 22px/1 var(--sans);
  color: #5f6368;
  padding: 4px 6px;
}

.search-results { margin: 0; padding: 0; list-style: none; max-height: 60vh; overflow-y: auto; }
.search-results li { border-bottom: 1px solid #f1f1f1; }
.search-results li:last-child { border-bottom: 0; }
.search-results a { display: block; padding: 12px 16px; text-decoration: none; color: inherit; }
.search-results a:hover { background: #f5f7fa; }
.search-results .r-title { font: 700 15px var(--sans); color: var(--blue); }
.search-results .r-snippet {
  display: block;
  margin-top: 3px;
  font: 400 13px/20px var(--serif);
  color: #444;
}
.search-results mark { background: #fff2ba; color: inherit; }
.search-empty { padding: 16px; font: 400 14px var(--sans); color: #5f6368; }

/* --------------------------------------------------------------- responsive */

@media (max-width: 1200px) {
  .page-title { font-size: 52px; line-height: 58px; }
  .section-title { font-size: 38px; }
}

@media (max-width: 1000px) {
  .content { margin-top: 56px; }
  .split--about,
  .split--resources,
  .split--founder { grid-template-columns: 1fr; gap: 28px; }

  /* keep the media below the copy on About, above it elsewhere, as the
     original reads on a narrow screen */
  .split--about .split__media { order: 2; max-width: 420px; margin-inline: auto; }
  .split--founder .split__media { max-width: 480px; }

  .gallery { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .gallery__wide { grid-column: span 2; }
  .gallery__row { grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 20px; }
  .work-note { margin-top: 40px; }
  .work-note .prose { margin-top: 24px; }
}

@media (max-width: 720px) {
  .page-title { font-size: 38px; line-height: 44px; letter-spacing: -.5px; }
  .section-title { font-size: 30px; letter-spacing: -.5px; }
  .content { margin-top: 40px; padding-bottom: 64px; }

  .prose p { text-align: left; }        /* justify looks poor at narrow widths */

  .brand__logo { width: 44px; height: 44px; }
  .brand__name { font-size: 18px; }

  /* nav collapses behind a hamburger */
  .nav-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    border: 0;
    padding: 0;
    background: none;
    color: rgba(0, 0, 0, .7);
    cursor: pointer;
    border-radius: 50%;
  }
  .nav-toggle svg { width: 24px; height: 24px; fill: currentColor; }
  .site-header.is-scrolled .nav-toggle { color: #fff; }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    padding: 14px 20px;
    color: rgba(0, 0, 0, .78);
    border-bottom: 1px solid #eee;
  }
  .site-header.is-scrolled .site-nav a { color: rgba(0, 0, 0, .78); }
  .site-header.is-scrolled .site-nav a[aria-current='page'] { color: var(--blue); }
  .site-nav a[aria-current='page'] { color: var(--blue); }

  .search-btn { margin-left: 0; width: 44px; height: 44px; }

  .gallery,
  .gallery__row { grid-template-columns: 1fr; }
  .gallery__wide { grid-column: span 1; }

  .pdf { aspect-ratio: 3 / 4; }
}
