/* ==========================================================================
   The Peptide Almanac — Shared Stylesheet
   Clean, trustworthy, medical/scientific aesthetic. Mobile-first responsive.
   ========================================================================== */

:root {
  --teal-900: #0b3d40;
  --teal-700: #11696e;
  --teal-600: #138a91;
  --teal-500: #16a3ab;
  --teal-100: #e3f4f5;
  --teal-50:  #f2fafb;
  --ink:      #14202b;
  --slate:    #46586a;
  --slate-300:#5f7384;
  --line:     #e2e8ee;
  --bg:       #ffffff;
  --bg-soft:  #f6f9fb;
  --amber:    #c77700;
  --amber-bg: #fff6e6;
  --green:    #1c8a4a;
  --red:      #b3331f;
  --radius:   12px;
  --radius-sm:8px;
  --shadow:   0 1px 3px rgba(20,32,43,.06), 0 6px 24px rgba(20,32,43,.05);
  --shadow-lg:0 8px 40px rgba(20,32,43,.12);
  --maxw:     1140px;
  --font:     -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }

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

p { margin: 0 0 1rem; }

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.section { padding: 56px 0; }
.section--soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 36px; }
.section-head p { color: var(--slate); font-size: 1.05rem; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .08em; font-size: .78rem;
  font-weight: 700; color: var(--teal-600); margin-bottom: .4rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .98rem; cursor: pointer; border: 1px solid transparent;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-700); }
.btn-ghost { background: #fff; color: var(--teal-700); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal-500); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--ink); }
.nav-logo:hover { text-decoration: none; }
.nav-logo .mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--teal-500), var(--teal-700)); color: #fff; font-weight: 800;
}
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--slate); font-weight: 600; font-size: .96rem; }
.nav-links a:hover { color: var(--teal-700); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; transition: .25s; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column;
    background: #fff; border-bottom: 1px solid var(--line); padding: 14px 20px; gap: 14px;
    display: none;
  }
  .nav-links.open { display: flex; }
}

/* ---------- Skip link (a11y) ---------- */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  background: var(--teal-700); color: #fff; padding: 10px 16px; border-radius: 8px;
  font-weight: 600; transition: top .15s ease;
}
.skip-link:focus { top: 8px; text-decoration: none; outline: 2px solid #fff; outline-offset: 2px; }
:target { scroll-margin-top: 80px; }
[id="main"]:focus { outline: none; }

/* ---------- "Also known as" (alias capture) ---------- */
.aka { font-size: .95rem; color: var(--slate); margin: 0 0 10px; }
.aka strong { color: var(--ink); }

/* ---------- Byline (E-E-A-T) ---------- */
.byline { font-size: .88rem; color: var(--slate); margin: 14px 0 0; }
.byline a { color: var(--teal-700); font-weight: 600; }
.byline time { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, var(--teal-100), transparent),
    linear-gradient(180deg, var(--teal-50), #fff);
  padding: 72px 0 60px; text-align: center;
}
.hero h1 { margin: 0 0 16px; letter-spacing: -.02em; }
.hero p { font-size: 1.15rem; color: var(--slate); max-width: 680px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-search { max-width: 540px; margin: 26px auto 0; }

/* ---------- Search ---------- */
.search-wrap { position: relative; }
.search-input {
  width: 100%; padding: 14px 16px 14px 44px; font-size: 1rem; border: 1px solid var(--line);
  border-radius: 10px; background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%235f7384' stroke-width='2' viewBox='0 0 24 24'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>") 14px center no-repeat;
}
.search-input:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px var(--teal-100); }
.search-results { margin-top: 14px; }

/* ---------- Category grid ---------- */
.category-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px;
}
.category-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .2s ease;
}
.category-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.category-card .ico { font-size: 1.7rem; margin-bottom: 10px; }
.category-card h3 { margin: 0 0 6px; color: var(--ink); }
.category-card p { margin: 0; color: var(--slate); font-size: .95rem; }
.category-card .count { display: inline-block; margin-top: 12px; font-size: .82rem; font-weight: 700; color: var(--teal-600); }

/* ---------- Peptide grid / cards ---------- */
.peptide-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px;
}
.peptide-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .2s ease;
}
.peptide-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.peptide-card h3 { margin: 0 0 4px; color: var(--ink); }
.peptide-card .alias { font-size: .85rem; color: var(--slate-300); margin-bottom: 10px; }
.peptide-card p { margin: 0 0 14px; color: var(--slate); font-size: .94rem; flex-grow: 1; }
.peptide-card .read { font-weight: 700; color: var(--teal-600); font-size: .9rem; }

/* ---------- Badges / tags ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem;
  font-weight: 700; background: var(--teal-100); color: var(--teal-700); white-space: nowrap;
}
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* ---------- Disclaimer banner ---------- */
.disclaimer-banner {
  background: var(--amber-bg); border: 1px solid #f0d9a8; border-radius: var(--radius-sm);
  padding: 14px 18px; font-size: .9rem; color: #7a4d00; display: flex; gap: 12px; align-items: flex-start;
}
.disclaimer-banner strong { color: #5e3b00; }

/* ---------- Article (peptide page) ---------- */
.article-hero { background: linear-gradient(180deg, var(--teal-50), #fff); padding: 40px 0 24px; border-bottom: 1px solid var(--line); }
.breadcrumb { font-size: .85rem; color: var(--slate-300); margin-bottom: 14px; }
.breadcrumb a { color: var(--slate); }
.article-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; padding: 40px 0; }
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } }

.toc { position: sticky; top: 84px; align-self: start; font-size: .92rem; }
.toc h4 { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; color: var(--slate-300); margin: 0 0 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 14px; color: var(--slate); margin-left: -2px; border-left: 2px solid transparent; }
.toc li a:hover, .toc li a.active { color: var(--teal-700); border-left-color: var(--teal-500); text-decoration: none; }
@media (max-width: 900px) { .toc { position: static; } }

.prose { max-width: 720px; }
.prose h2 { margin: 38px 0 14px; padding-top: 8px; scroll-margin-top: 80px; }
.prose h3 { margin: 26px 0 10px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .94rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--bg-soft); font-weight: 700; }

/* Quick facts box */
.quick-facts {
  background: var(--teal-50); border: 1px solid var(--teal-100); border-radius: var(--radius);
  padding: 20px 22px; margin: 0 0 28px;
}
.box-title { font-weight: 700; color: var(--ink); }
.quick-facts .box-title { margin: 0 0 14px; font-size: 1rem; }
.quick-facts dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 0; font-size: .93rem; }
.quick-facts dt { color: var(--slate); font-weight: 600; }
.quick-facts dd { margin: 0; color: var(--ink); }

/* Research references */
.research-list { list-style: none; padding: 0; margin: 0; counter-reset: ref; }
.research-list li {
  counter-increment: ref; position: relative; padding: 14px 0 14px 38px; border-bottom: 1px solid var(--line);
  font-size: .93rem; color: var(--slate);
}
.research-list li::before {
  content: counter(ref); position: absolute; left: 0; top: 14px; width: 24px; height: 24px;
  background: var(--teal-100); color: var(--teal-700); border-radius: 6px; display: grid;
  place-items: center; font-size: .78rem; font-weight: 700;
}
.research-list a { font-weight: 600; }

.callout {
  border-left: 4px solid var(--teal-500); background: var(--bg-soft);
  padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 20px 0;
}
.callout-warn { border-left-color: var(--amber); background: var(--amber-bg); }

/* ---------- Key takeaways box ---------- */
.key-takeaways {
  background: linear-gradient(180deg, var(--teal-50), #fff);
  border: 1px solid var(--teal-100); border-left: 4px solid var(--teal-500);
  border-radius: var(--radius); padding: 20px 24px; margin: 0 0 28px;
}
.key-takeaways .box-title { margin: 0 0 12px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.key-takeaways ul { list-style: none; margin: 0; padding: 0; }
.key-takeaways li { position: relative; padding: 5px 0 5px 28px; font-size: .96rem; }
.key-takeaways li::before {
  content: "✓"; position: absolute; left: 0; top: 5px; color: var(--teal-600);
  font-weight: 800; font-size: .9rem;
}

/* ---------- FAQ ---------- */
.faq { margin-top: 8px; }
.faq-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-item:first-child { border-top: 1px solid var(--line); }
.faq-item h3 { font-size: 1.05rem; margin: 0 0 7px; color: var(--ink); }
.faq-item p { margin: 0; color: var(--slate); }

/* ---------- Comparison table ---------- */
.compare-wrap { overflow-x: auto; margin: 18px 0; }
.compare-table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 460px; }
.compare-table th, .compare-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare-table thead th { background: var(--teal-600); color: #fff; font-weight: 700; border-bottom: 0; }
.compare-table thead th:first-child { background: var(--teal-700); }
.compare-table thead th a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.compare-table thead th a:hover { color: var(--teal-100); }
.compare-table tbody th { background: var(--bg-soft); font-weight: 700; white-space: nowrap; }
.compare-table tbody tr:nth-child(even) td { background: var(--bg-soft); }

/* ---------- Ad slots ---------- */
.ad-slot {
  margin: 28px auto; max-width: 100%; min-height: 90px; display: grid; place-items: center;
  background: var(--bg-soft); border: 1px dashed var(--line); border-radius: var(--radius-sm);
  color: var(--slate-300); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--teal-900); color: #c6dadc; padding: 48px 0 28px; margin-top: 40px; }
.site-footer a { color: #c6dadc; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 32px; }
.footer-grid h4 { color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 9px; font-size: .92rem; }
.footer-brand p { font-size: .9rem; color: #9fbcbe; max-width: 320px; }
.footer-bottom { border-top: 1px solid #1c5256; padding-top: 20px; font-size: .82rem; color: #8fb0b2; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Directory / A-Z ---------- */
.az-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 30px; }
.az-nav a {
  width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: 7px; font-weight: 700; font-size: .9rem; color: var(--teal-700); background: #fff;
}
.az-nav a:hover { background: var(--teal-100); text-decoration: none; }
.directory-group { margin-bottom: 28px; }
.directory-group h2 { border-bottom: 2px solid var(--teal-100); padding-bottom: 6px; scroll-margin-top: 80px; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.muted { color: var(--slate); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Prev / next navigation ---------- */
.prevnext { display: flex; justify-content: space-between; gap: 14px; margin-top: 30px; }
.prevnext .pn {
  flex: 1; max-width: 48%; display: flex; flex-direction: column; gap: 3px;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; transition: border-color .15s ease, box-shadow .2s ease;
}
.prevnext .pn:hover { text-decoration: none; border-color: var(--teal-500); box-shadow: var(--shadow); }
.prevnext .pn span { font-size: .8rem; color: var(--slate-300); font-weight: 600; }
.prevnext .pn strong { color: var(--teal-700); }
.prevnext .pn-next { text-align: right; align-items: flex-end; }

/* ---------- Visible keyboard focus ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible,
.peptide-card:focus-visible, .category-card:focus-visible, .pn:focus-visible {
  outline: 3px solid var(--teal-500); outline-offset: 2px; border-radius: 4px;
}

/* ---------- Updates / changelog ---------- */
.update-list { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.update-item { position: relative; padding: 0 0 28px 26px; border-left: 2px solid var(--line); }
.update-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.update-item::before {
  content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--teal-500); border: 2px solid #fff; box-shadow: var(--shadow);
}
.update-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.update-meta time { font-size: .82rem; font-weight: 700; color: var(--slate-300); }
.update-item h2 { font-size: 1.2rem; margin: 0 0 6px; }
.update-item p { margin: 0; color: var(--slate); }

/* ---------- Learn hub ---------- */
.learn-strip { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.learn-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; background: #fff;
  border: 1px solid var(--line); border-radius: 999px; font-weight: 600; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .2s ease, border-color .15s ease;
}
.learn-chip:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--teal-500); box-shadow: var(--shadow-lg); }

/* ---------- Glossary ---------- */
.glossary { margin: 0; }
.glossary dt { font-weight: 700; color: var(--ink); margin-top: 20px; font-size: 1.08rem; scroll-margin-top: 80px; }
.glossary dt:first-child { margin-top: 0; }
.glossary dd { margin: 4px 0 0; color: var(--slate); padding-left: 0; border-left: 3px solid var(--teal-100); padding: 2px 0 2px 14px; }

/* ---------- Trust bar (per-page T-in-E-E-A-T signals) ---------- */
.trust-bar {
  display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 18px 0 0; max-width: 760px;
}
.trust-item {
  display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600;
  color: var(--slate); background: #fff; border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px;
}
.trust-item.trust-ok { color: var(--green); border-color: #b9e2c8; background: #f1faf4; }
.trust-item.trust-warn { color: var(--amber); border-color: #f0d9a8; background: var(--amber-bg); }
.trust-item.trust-link { background: transparent; border-color: transparent; padding-left: 4px; }
.trust-item.trust-link a { color: var(--teal-700); }

/* ---------- Citation source-type tag ---------- */
.src-tag {
  display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--teal-700); background: var(--teal-100);
  padding: 1px 8px; border-radius: 999px; vertical-align: middle; margin-left: 4px;
  white-space: nowrap;
}

/* ---------- Newsletter capture ---------- */
.newsletter { padding: 48px 0; background: linear-gradient(135deg, var(--teal-700), var(--teal-900)); color: #fff; }
.newsletter--soft { background: var(--bg-soft); color: var(--ink); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.newsletter-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.newsletter--soft .newsletter-inner { }
.newsletter .eyebrow { color: var(--teal-100); }
.newsletter--soft .eyebrow { color: var(--teal-600); }
.newsletter h2 { color: inherit; margin: 0 0 8px; }
.newsletter-copy p { margin: 0; color: rgba(255,255,255,.85); }
.newsletter--soft .newsletter-copy p { color: var(--slate); }
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.nl-input { flex: 1; min-width: 200px; padding: 13px 16px; font-size: 1rem; border: 1px solid transparent; border-radius: var(--radius-sm); }
.nl-input:focus { outline: none; box-shadow: 0 0 0 3px var(--teal-500); }
.newsletter-form .btn { flex-shrink: 0; }
.nl-fine { margin: 16px 0 0; font-size: .8rem; color: rgba(255,255,255,.7); }
.newsletter--soft .nl-fine { color: var(--slate-300); }
.nl-fine a { color: inherit; text-decoration: underline; }
.nl-hp { position: absolute; left: -9999px; }
@media (max-width: 760px) { .newsletter-inner { grid-template-columns: 1fr; } }

/* ---------- Mechanism diagram (category pages) ---------- */
.mechanism-figure { margin: 0 0 34px; max-width: 820px; }
.mechanism-figure svg { width: 100%; height: auto; }
.mechanism-figure .dg-step { font: 700 9px var(--font); fill: var(--teal-600); text-transform: uppercase; letter-spacing: .04em; }
.mechanism-figure .dg-label { font: 600 11px var(--font); fill: var(--ink); }
.mechanism-figure figcaption { font-size: .82rem; color: var(--slate-300); margin-top: 8px; }

/* ---------- Compare callout ---------- */
.callout-compare { border-left-color: var(--teal-600); }
.callout-compare a { font-weight: 600; }

/* ---------- Finder ---------- */
.finder-controls { margin-bottom: 20px; }
.finder-controls .search-wrap { max-width: 480px; margin-bottom: 16px; }
.finder-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip {
  padding: 7px 14px; border: 1px solid var(--line); background: #fff; color: var(--slate);
  border-radius: 999px; font-size: .86rem; font-weight: 600; cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--teal-500); color: var(--teal-700); }
.chip--active { background: var(--teal-600); border-color: var(--teal-600); color: #fff; }
.finder-count { font-size: .88rem; color: var(--slate-300); font-weight: 600; margin: 6px 0 16px; }
.finder-empty { text-align: center; padding: 30px; }

/* ---------- Thank-you page ---------- */
.ty-mark {
  width: 64px; height: 64px; margin: 10px auto 18px; border-radius: 50%;
  background: var(--teal-100); color: var(--teal-700); display: grid; place-items: center;
  font-size: 2rem; font-weight: 800;
}

/* ---------- Reduced-motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}
