/* ==========================================================================
   Glyco-Enzyme Repository — site stylesheet
   Single stylesheet for all page types: landing, family directory, family
   index, gene record and narrative pages.

   Structure and conventions follow the GT-CORE stylesheet so the two sites
   read as a pair; the palette is shifted to a teal/green primary so that a
   reader can tell at a glance which resource they are in.
   ========================================================================== */

:root {
  --brand-dark:    #123b36;
  --brand:         #1b6b5f;
  --brand-light:   #237868;
  --brand-pale:    #e6f2ef;
  --accent:        #a8501b;
  --accent-pale:   #fdf1e8;
  /* Masthead accent for the wordmark. The body --accent is tuned for
     dark-on-white body text and has far too little contrast against the
     masthead gradient. Ratios for this amber, measured against each gradient
     stop: 7.66:1 on --brand-dark, 3.94:1 on --brand, 3.30:1 on --brand-light.
     The light end is the worst case and it clears the WCAG AA large-text
     threshold of 3:1 (the wordmark is 2.7rem/800, so large-text applies) but
     NOT the 4.5:1 normal-text threshold — do not reuse this colour for body
     copy. --brand-light was darkened from #2a8d7c to #237868 to buy that
     margin; lightening it again drops the wordmark below AA. */
  --brand-mark:    #ffc247;
  --ink:           #1c2733;
  --ink-soft:      #4a5866;
  --ink-faint:     #7b8794;
  --rule:          #d3dbe3;
  --bg:            #ffffff;
  --bg-alt:        #f6f8fa;

  /* Construct-availability colours. The legacy site signalled availability by
     highlighting gene names in green; these carry the same meaning as explicit
     row tints plus a text badge, so the status survives greyscale printing and
     is not conveyed by colour alone. */
  --cat-dnasu:     #d8ece4;   /* clone ordered from DNASU                    */
  --cat-jarvis:    #fdf1e8;   /* baculovirus stock from the Jarvis lab       */
  --cat-pending:   #eceff2;   /* construct designed, clone ID not yet issued */
  --cat-flag:      #b03a2e;

  --maxw: 1240px;
  --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg-alt);
}

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

/* ---------- Masthead ---------------------------------------------------- */

.masthead {
  background: linear-gradient(100deg, var(--brand-dark) 0%, var(--brand) 62%, var(--brand-light) 100%);
  color: #fff;
  padding: 16px 24px 16px;
}
.masthead-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
/* The supplied logo is artwork on an opaque white background, so it sits on a
   white plate rather than directly on the gradient. */
.masthead .logo { flex: 0 0 auto; }
.masthead .logo a {
  display: block;
  background: #fff;
  padding: 7px 11px;
  border-radius: 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,.28);
}
.masthead .logo a:hover { box-shadow: 0 2px 7px rgba(0,0,0,.4); }
/* 96px is the smallest height at which the logo's third line ("Research,
   Education and Training") and the biofgreat.org URL stay legible. */
.masthead .logo img { display: block; height: 96px; width: auto; }
@media (max-width: 780px) {
  .masthead .logo img { height: 72px; }
}
/* Masthead type sits in three tiers: the GT-CORE wordmark, the expanded name,
   then the descriptor line. Sizes are deliberately far apart so the hierarchy
   survives being scanned rather than read. */
.masthead h1 {
  margin: 0;
  font-size: 2.7rem;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: .015em;
}
.masthead h1 a {
  color: var(--brand-mark);
  /* The gradient's light end is the low-contrast case; a soft dark shadow keeps
     the wordmark crisp there without reading as a drop shadow on the dark end. */
  text-shadow: 0 1px 3px rgba(0,0,0,.38);
}
.masthead h1 a:hover { color: #ffc65c; }
.masthead .expansion {
  margin: 5px 0 0;
  font-size: 1.16rem;
  line-height: 1.25;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: .005em;
  max-width: 820px;
}
/* The tagline is normal-size text (.92rem), so it needs 4.5:1 rather than the
   3:1 the wordmark and expansion get. GT-CORE's #cfe2f2 reaches only 4.00:1 on
   this gradient's light end and so fails here. Ratios for #e6f2ef against each
   gradient stop: 4.63:1 on --brand-light, 5.52:1 on --brand, 10.74:1 on
   --brand-dark. tagline-ratios: 4.63, 5.52, 10.74 */
.masthead .tagline {
  margin: 5px 0 0;
  font-size: .92rem;
  color: #e6f2ef;
  max-width: 780px;
}
/* Below the logo/text flex wrap the wordmark would otherwise crowd the viewport. */
@media (max-width: 780px) {
  .masthead h1 { font-size: 2.1rem; }
  .masthead .expansion { font-size: 1.04rem; }
}

/* ---------- Primary navigation ------------------------------------------ */

.navbar { background: var(--brand-dark); border-bottom: 3px solid var(--accent); }
.navbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  padding: 0 12px;
}
.navbar a {
  display: block;
  color: #e8f1f8;
  padding: 11px 16px;
  font-size: .93rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
}
.navbar a:hover { background: rgba(255,255,255,.10); text-decoration: none; }
.navbar a[aria-current="page"] {
  background: rgba(255,255,255,.14);
  border-bottom-color: #fff;
}

/* ---------- Layout ------------------------------------------------------ */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 24px 60px;
}
.page {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 26px 30px 34px;
}
.breadcrumb {
  font-size: .85rem;
  color: var(--ink-faint);
  margin: 0 0 14px;
}
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb span.sep { padding: 0 6px; color: var(--rule); }

h2.page-title {
  margin: 0 0 6px;
  font-size: 1.62rem;
  color: var(--brand-dark);
  line-height: 1.25;
}
h3.section {
  margin: 30px 0 10px;
  font-size: 1.12rem;
  color: var(--brand-dark);
  border-bottom: 2px solid var(--brand-pale);
  padding-bottom: 5px;
}
h4 { margin: 18px 0 6px; font-size: 1rem; color: var(--ink); }
p.lede { font-size: 1.02rem; color: var(--ink-soft); margin-top: 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Landing page cards ------------------------------------------ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
  margin: 18px 0 6px;
}
.card {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--brand-light);
  border-radius: 5px;
  padding: 14px 16px 16px;
  background: var(--bg);
}
.card h4 { margin: 0 0 6px; font-size: 1.02rem; color: var(--brand-dark); }
.card p { margin: 0; font-size: .9rem; color: var(--ink-soft); }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 20px 0 8px;
}
.stat {
  background: var(--brand-pale);
  border: 1px solid #cfe0ee;
  border-radius: 5px;
  padding: 12px 14px;
  text-align: center;
}
.stat .num { display: block; font-size: 1.7rem; font-weight: 700; color: var(--brand-dark); line-height: 1.1; }
.stat .lbl { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }

/* ---------- Family chip grid -------------------------------------------- */

.family-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.fam-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 76px;
  padding: 7px 10px 6px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--bg);
  font-size: .92rem;
  font-weight: 600;
  color: var(--brand);
}
.fam-chip .n { font-size: .72rem; font-weight: 400; color: var(--ink-faint); }
.fam-chip:hover { background: var(--brand-pale); text-decoration: none; }
.fam-chip.built { border-left: 4px solid var(--brand); }

/* ---------- Tables ------------------------------------------------------- */

.table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0 10px;
  padding: 12px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: 5px;
}
.table-tools input[type="search"], .table-tools select {
  font-family: var(--sans);
  font-size: .9rem;
  padding: 6px 9px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
.table-tools input[type="search"] { min-width: 260px; flex: 1 1 260px; }
.table-tools label { font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.table-tools .count { font-size: .85rem; color: var(--ink-soft); margin-left: auto; }

.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 5px; }

table.records {
  border-collapse: collapse;
  width: 100%;
  font-size: .875rem;
  background: #fff;
}
table.records thead th {
  background: var(--brand-dark);
  color: #fff;
  text-align: left;
  padding: 9px 10px;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
table.records thead th.sortable { cursor: pointer; user-select: none; }
table.records thead th.sortable:hover { background: var(--brand); }
table.records thead th .arrow { opacity: .45; font-size: .7rem; margin-left: 4px; }
table.records thead th[data-dir="asc"] .arrow,
table.records thead th[data-dir="desc"] .arrow { opacity: 1; }
table.records td { padding: 7px 10px; border-top: 1px solid var(--rule); vertical-align: top; }
table.records tbody tr:hover td { background: rgba(29,91,143,.06); }
table.records td.gene { font-weight: 700; white-space: nowrap; }
table.records td.species { font-style: italic; white-space: nowrap; }
/* Shown when a family index labelled a gene differently from its own record;
   both labels are kept so neither reading is lost. */
.alt-symbol { font-size: .78rem; font-weight: 400; color: var(--ink-faint); }
table.records td.mono { font-family: var(--mono); font-size: .82rem; white-space: nowrap; }
table.records td.wrapcell { min-width: 260px; }

/* Leading-edge availability bars. Availability is also stated in words in its
   own column, so these only reinforce; even so each clears 3:1 against the
   white cell (5.31:1, 3.51:1, 3.66:1) rather than relying on hue alone. */
tr.cat-dnasu   td:first-child { box-shadow: inset 4px 0 0 #237868; }
tr.cat-jarvis  td:first-child { box-shadow: inset 4px 0 0 #c4762f; }
tr.cat-pending td:first-child { box-shadow: inset 4px 0 0 #7b8794; }

/* Detail table on record pages */
table.detail { border-collapse: collapse; width: 100%; font-size: .92rem; margin: 4px 0 8px; }
table.detail th {
  text-align: left;
  width: 220px;
  padding: 8px 12px;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  font-weight: 600;
  vertical-align: top;
}
table.detail td { padding: 8px 12px; border: 1px solid var(--rule); vertical-align: top; }
table.detail td .empty { color: var(--ink-faint); font-style: italic; }

/* ---------- Badges ------------------------------------------------------- */

.badges { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 14px; }
.badge {
  display: inline-block;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 11px;
  border: 1px solid var(--rule);
  background: var(--bg-alt);
  color: var(--ink-soft);
  white-space: nowrap;
}
.badge.fam     { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.badge.dnasu   { background: var(--cat-dnasu); border-color: #a4cfc2; color: #10453a; }
.badge.jarvis  { background: var(--cat-jarvis); border-color: #edc19b; color: #7a3d13; }
.badge.pending { background: var(--cat-pending); border-color: #c2cad2; color: #46525e; }
.badge.flag    { background: var(--cat-flag); border-color: var(--cat-flag); color: #fff; }
.badge.klass   { background: var(--brand-pale); border-color: #a8ccc3; color: var(--brand-dark); }

/* ---------- Sequences --------------------------------------------------- */

.seq-block { margin: 10px 0 18px; }
.seq-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.seq-head .len { font-size: .82rem; color: var(--ink-faint); }
.seq-head .btn-row { margin-left: auto; display: flex; gap: 7px; }
.seq {
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.65;
  letter-spacing: .055em;
  word-break: break-all;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--brand-light);
  border-radius: 4px;
  padding: 11px 13px;
  margin: 0;
  white-space: pre-wrap;
  max-height: 320px;
  overflow-y: auto;
}
.btn {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 11px;
  border: 1px solid var(--brand-light);
  border-radius: 4px;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
}
.btn:hover { background: var(--brand-pale); text-decoration: none; }

/* ---------- Link pills, lists, misc ------------------------------------- */

.link-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.pill {
  display: inline-block;
  font-size: .85rem;
  font-weight: 600;
  padding: 6px 13px;
  border: 1px solid var(--brand-light);
  border-radius: 15px;
  background: #fff;
  color: var(--brand);
}
.pill:hover { background: var(--brand-pale); text-decoration: none; }
.pill.ext::after { content: " \2197"; font-weight: 400; }

ul.tight { margin: 6px 0 6px 20px; padding: 0; }
ul.tight li { margin-bottom: 5px; }
ul.plain { list-style: none; margin: 6px 0; padding: 0; }
ul.plain li { margin-bottom: 4px; }

.note {
  background: var(--accent-pale);
  border-left: 4px solid var(--accent);
  padding: 11px 14px;
  border-radius: 4px;
  font-size: .9rem;
  color: #5d3316;
  margin: 16px 0;
}
/* Scope caveat on the landing page. Weightier than .note: it carries the
   "not comprehensive" statement, which a reader must not skim past. */
.callout-strong {
  background: var(--accent-pale);
  border: 1px solid #f0c9a8;
  border-left: 5px solid var(--accent);
  border-radius: 5px;
  padding: 14px 18px;
  margin: 18px 0;
}
.callout-strong .callout-head {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 700;
  color: #8f3d12;
  line-height: 1.35;
}
.callout-strong p { margin: 0 0 8px; }
.callout-strong ol { margin: 8px 0 0; padding-left: 22px; }
.callout-strong ol li { margin: 0 0 5px; }
.callout-strong ol li:last-child { margin-bottom: 0; }

/* ---------- Construct tables on record pages ----------------------------
   A record's constructs are grouped by expression host. Each group is a table
   whose caption names the host, so the host is not repeated on every row the
   way the legacy page did with blank leading cells.
   --------------------------------------------------------------------- */

.host-group { margin: 4px 0 20px; }
.host-group > h4 {
  margin: 0 0 6px;
  font-size: .98rem;
  color: var(--brand-dark);
}
.host-group .host-note {
  margin: 0 0 8px;
  font-size: .85rem;
  color: var(--ink-soft);
}

table.constructs { border-collapse: collapse; width: 100%; font-size: .875rem; background: #fff; }
table.constructs thead th {
  background: var(--brand);
  color: #fff;
  text-align: left;
  padding: 7px 10px;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
table.constructs td { padding: 7px 10px; border-top: 1px solid var(--rule); vertical-align: top; }
table.constructs tbody tr:hover td { background: rgba(27,107,95,.06); }
table.constructs td.vector { font-weight: 600; white-space: nowrap; }
table.constructs td.clone  { font-family: var(--mono); font-size: .82rem; white-space: nowrap; }
table.constructs td.files  { min-width: 210px; }
/* Rows for a construct that exists as a design but has no distributable clone
   are dimmed rather than omitted: the legacy site listed them and their absence
   is information the reader needs. */
table.constructs tr.no-clone td { color: var(--ink-soft); background: var(--bg-alt); }

/* File links inside a construct row */
.file-links { display: flex; flex-wrap: wrap; gap: 5px; }
.file-link {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  padding: 2px 8px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg-alt);
  color: var(--brand);
  white-space: nowrap;
}
.file-link:hover { background: var(--brand-pale); text-decoration: none; }
/* Referenced by the legacy pages but absent from its file tree: shown as a
   dead-looking chip rather than a link that 404s. */
.file-link.missing {
  color: var(--ink-faint);
  background: var(--bg-alt);
  border-style: dashed;
  font-weight: 400;
  cursor: help;
}
.file-link.gbk::before { content: "GB "; color: var(--ink-faint); font-weight: 400; }
.file-link.pdf::before { content: "PDF "; color: var(--ink-faint); font-weight: 400; }

/* A clone ID is the string a user pastes into the DNASU search box, so it is
   selectable monospace text with the search link kept separate from it. */
.clone-id {
  font-family: var(--mono);
  font-size: .84rem;
  background: var(--cat-dnasu);
  border: 1px solid #a4cfc2;
  border-radius: 3px;
  padding: 1px 6px;
}
.clone-none { color: var(--ink-faint); font-style: italic; font-size: .82rem; }

/* ---------- Figure blocks on narrative pages ---------------------------- */

figure.diagram {
  margin: 18px 0;
  padding: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: 5px;
  text-align: center;
}
figure.diagram img { max-width: 100%; height: auto; border-radius: 3px; }
figure.diagram figcaption {
  margin-top: 9px;
  font-size: .85rem;
  color: var(--ink-soft);
  text-align: left;
}
/* Screenshots in the tutorial are wide; cap them so the page keeps its rhythm. */
figure.diagram.screenshot img { max-height: 620px; width: auto; }

/* ---------- Vector reference tables ------------------------------------ */

table.vectors { border-collapse: collapse; width: 100%; font-size: .88rem; background: #fff; }
table.vectors thead th {
  background: var(--brand-dark);
  color: #fff;
  text-align: left;
  padding: 8px 10px;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
table.vectors td { padding: 8px 10px; border-top: 1px solid var(--rule); vertical-align: top; }
table.vectors td.vname { font-weight: 700; white-space: nowrap; }
table.vectors .tags { font-size: .84rem; color: var(--ink-soft); }

/* ---------- Publication list ------------------------------------------- */

.pub-group { margin: 16px 0 4px; }
.pub-group h4 {
  margin: 0 0 8px;
  font-size: .98rem;
  color: var(--brand-dark);
  border-bottom: 1px solid var(--brand-pale);
  padding-bottom: 4px;
}
ol.pubs { margin: 0 0 4px; padding-left: 24px; }
ol.pubs li { margin-bottom: 9px; font-size: .89rem; line-height: 1.5; }
ol.pubs .pmid { font-family: var(--mono); font-size: .82em; color: var(--ink-faint); }

/* ---------- Step lists (tutorial) --------------------------------------- */

ol.steps { margin: 10px 0; padding-left: 0; list-style: none; counter-reset: step; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 6px 42px;
  margin-bottom: 18px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
ol.steps > li > h4 { margin: 3px 0 6px; font-size: .98rem; color: var(--brand-dark); }
ol.steps > li > p { margin: 0 0 8px; }

.legend-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; margin: 12px 0; }
.legend-item { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; }
.swatch { flex: 0 0 auto; width: 26px; height: 18px; border: 1px solid #9aa5b1; border-radius: 3px; margin-top: 2px; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: .9rem; }
.pager .spacer { flex: 1; }

.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 24px 44px;
  font-size: .82rem;
  color: var(--ink-faint);
}
.footer a { color: var(--ink-soft); }
.footer hr { border: 0; border-top: 1px solid var(--rule); margin: 0 0 16px; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-bottom: 14px;
}
.footer-links a {
  font-size: .88rem;
  font-weight: 600;
  color: var(--brand);
}
.footer-links a[target="_blank"]::after { content: " \2197"; font-weight: 400; }

.footer-contact {
  margin: 0 0 12px;
  font-size: .9rem;
  color: var(--ink-soft);
}
.footer-contact a { color: var(--brand); font-weight: 600; }

.footer-address {
  margin: 0 0 14px;
  font-size: .78rem;
  letter-spacing: .045em;
  line-height: 1.75;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.footer-meta { margin: 0; font-size: .78rem; color: var(--ink-faint); }

code.inline { font-family: var(--mono); font-size: .85em; background: var(--bg-alt); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--rule); }

@media print {
  .navbar, .table-tools, .btn, .pager { display: none; }
  .seq { max-height: none; overflow: visible; }
  table.constructs thead th, table.vectors thead th {
    background: #fff; color: var(--ink); border-bottom: 2px solid var(--ink);
  }
  body { background: #fff; }
  .page { border: 0; }
  /* Browsers drop the masthead gradient when printing, so the light-on-dark
     masthead text has to be re-inked for white paper. */
  .masthead { background: #fff; color: var(--ink); padding-bottom: 8px; }
  .masthead h1 a { color: var(--brand-dark); text-shadow: none; }
  .masthead .expansion { color: var(--brand-dark); }
  .masthead .tagline { color: var(--ink-soft); }
}
