/* Biotoxin.com — clean static rebuild
   Fonts and palette pulled from live biotoxin.com (May 2026):
     Headings + body: Garamond  →  using EB Garamond as the web fallback
     Navigation:      Mulish 200 (Google Fonts)
     Links:           navy (#00008B / darkblue)
     Text:            pure black on white
*/

/* ---------- Fonts (loaded from Google Fonts CDN) ---------- */
@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;500;700&family=Mulish:wght@200;300;400;500;600&display=swap");

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

:root {
  --bg: #ffffff;
  --bg-alt: #f7f6f2;
  --text: #000000;          /* matches live site */
  --text-soft: #444444;
  --muted: #6a6a6a;
  --border: #e6e4dc;
  --accent: #00008B;        /* navy — matches in-content link color on live site */
  --accent-soft: #2727a8;
  --link: #00008B;          /* darkblue */
  --link-hover: #4040c8;
  --max-width: 760px;
  --max-width-wide: 1180px;
  /* Garamond stack — uses system Garamond when present, falls back to EB Garamond from Google Fonts */
  --font-serif: Garamond, "EB Garamond", "Adobe Garamond Pro", "Apple Garamond", "ITC Garamond", "Times New Roman", serif;
  --font-sans: "Mulish", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: var(--font-serif);
  --font-light: var(--font-serif);
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 20px;            /* matches live site body */
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 1.4em 0 0.5em;
  line-height: 1.15;
  color: var(--text);
}
h1 { font-size: 3.2rem; letter-spacing: -1px; margin-top: 0.4em; }
h2 { font-size: 3rem; letter-spacing: -0.5px; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.35rem; }
@media (max-width: 720px) {
  h1 { font-size: 2.4rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.4rem; }
}

p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.4em; margin: 0 0 1.1em; }
li { margin-bottom: 0.35em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: 0.2em 1em;
  color: var(--text-soft);
  background: var(--bg-alt);
}

/* ---------- Layout container ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide { max-width: var(--max-width-wide); }

/* ---------- Header (matches live biotoxin.com .bar) ---------- */
.site-header { position: relative; }
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 63px;
  background: #ffffff;
  border-bottom: 0.5px solid #000;
  z-index: 50;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* Push page content down to clear the fixed bar */
body { padding-top: 63px; }

.main-logo {
  display: inline-block;
  flex-shrink: 0;
}
.main-logo a {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
  color: #000;
  text-decoration: none;
  letter-spacing: 0;
  line-height: 1;
}
.main-logo a:hover { color: var(--accent); }

.nav-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.nav-wrap a,
.nav-wrap a:link,
.nav-wrap a:visited,
.nav-wrap a:focus,
.nav-wrap a:active,
.nav-wrap a:hover {
  color: #000;
  font-family: var(--font-sans);
  font-weight: 200;
  font-size: 16px;
  letter-spacing: 0;
  white-space: nowrap;
}
.nav-wrap a {
  text-decoration: none;
  padding: 6px 16px;
  text-underline-offset: 4px;
  text-decoration-thickness: 0.5px;
  transition: text-decoration-color 0.15s;
}
.nav-wrap a:hover,
.nav-wrap a:focus,
.nav-wrap a.active,
.nav-wrap a.current {
  text-decoration: underline;
  text-decoration-color: #000;
}
.nav-wrap a:focus { outline: none; }

.search-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 8px 6px 14px;
}
.icon-search { width: 18px; height: 18px; opacity: 0.75; }
.search-link:hover .icon-search { opacity: 1; }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid #000;
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0.06em;
  font-size: 14px;
  cursor: pointer;
  color: #000;
  border-radius: 2px;
}
.menu-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Mobile: full-screen overlay menu, MENU/CLOSE toggle, inline social icons */
@media (max-width: 960px) {
  .menu-toggle { display: inline-block; }
  .nav-wrap {
    display: none;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 100;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 24px 40px;
    gap: 28px;
    overflow-y: auto;
  }
  .nav-wrap.open { display: flex; }
  .nav-wrap a {
    padding: 6px 12px;
    text-align: center;
    font-size: 22px;
  }
  .search-link { padding: 6px 12px; }
  /* When menu is open, show CLOSE button instead of MENU */
  .menu-toggle.is-open { position: fixed; top: 20px; right: 20px; z-index: 101; border-color: transparent; }
  .menu-toggle.is-open::before { content: "CLOSE"; }
  .menu-toggle.is-open .menu-label { display: none; }
}

/* Inline social icons in the mobile header */
@media (max-width: 720px) {
  .social-media-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 12px;
  }
  .social-media-inline a {
    display: inline-flex;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1a1a1a;
    align-items: center;
    justify-content: center;
  }
  .social-media-inline img {
    width: 16px;
    height: 16px;
    filter: invert(1) brightness(2);
  }
}
@media (min-width: 721px) {
  .social-media-inline { display: none; }
}

/* ---------- Social media sidebar (fixed right edge) ---------- */
.social-media {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 40;
}
.social-media a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.social-media a:hover { opacity: 1; }
.social-media img { width: 22px; height: 22px; }

@media (max-width: 720px) {
  .social-media { display: none; }
}

/* ---------- Main content ---------- */
.site-main { padding: 60px 0 80px; }
.page-title { margin-top: 0; text-align: center; }
.entry-meta { color: var(--muted); font-size: 0.92rem; margin: 0 0 1.5em; text-align: center; }

.entry-content :is(h2, h3, h4):first-child { margin-top: 0.2em; }
.entry-content img { margin: 1.4em auto; border-radius: 4px; }
.entry-content figure { margin: 1.4em 0; }
.entry-content figure img { margin: 0 auto; }

.entry-content a { color: var(--link); }
.entry-content a:hover { color: var(--link-hover); }

.featured-image {
  margin: 0 auto 30px;
  max-width: 100%;
}
.featured-image img { border-radius: 4px; }

/* ---------- Home (splash) ---------- */
.home-intro {
  text-align: left;
  padding-bottom: 20px;
}
.home-intro h1 { text-align: center; margin-bottom: 1em; }
.start-here {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding: 22px 28px;
  margin: 30px 0;
  border-radius: 4px;
}
.start-here h2 { margin-top: 0; }

/* ---------- Blog index (magazine grid) ---------- */
body.blog-page .site-main > .container { max-width: 1220px; }
.blog-index { max-width: 1180px; margin: 0 auto; }
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 32px;
  margin-top: 40px;
}
.post-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s;
}
.post-card .thumb {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-alt);
  margin-bottom: 16px;
}
.post-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.post-card:hover .thumb img { transform: scale(1.04); }
.post-card .date {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.post-card h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1.2;
  margin: 0 0 10px;
  color: var(--text);
  letter-spacing: 0;
}
.post-card:hover h3 { color: var(--accent); }
.post-card .lede {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--text-soft);
  margin: 0;
}

@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 24px; }
}
@media (max-width: 600px) {
  .post-grid { grid-template-columns: 1fr; gap: 36px; }
  .post-card h3 { font-size: 1.5rem; }
}

/* ---------- Single post ---------- */
.single-post .entry-meta { margin-bottom: 1.8em; }
.single-post hr { margin: 3em 0 1.5em; }
.back-to-blog { display: inline-block; margin-top: 30px; font-size: 0.95rem; }

/* ---------- Contact form (Media Requests page) ---------- */
.contact-form {
  margin: 36px 0 24px;
  max-width: 640px;
}
.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contact-form .field { margin-bottom: 22px; }
.contact-form .field-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: #000;
}
.contact-form .req { color: #d11; font-weight: 700; margin-left: 2px; }
.contact-form input[type=text],
.contact-form input[type=email],
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #888;
  border-radius: 3px;
  font-family: var(--font-serif);
  font-size: 17px;
  color: #000;
  background: #fff;
  box-sizing: border-box;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form .name-row {
  display: flex;
  gap: 18px;
}
.contact-form .name-cell { flex: 1; }
.contact-form .hint {
  display: block;
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--muted);
}
.contact-form .contact-submit {
  background: #000;
  color: #fff;
  border: 0;
  padding: 12px 32px;
  border-radius: 3px;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0;
}
.contact-form .contact-submit:hover { background: #333; }
.form-thanks {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  margin: 30px 0;
  border-radius: 3px;
  font-family: var(--font-serif);
}
@media (max-width: 540px) {
  .contact-form .name-row { flex-direction: column; gap: 22px; }
}

/* ---------- Newsletter signup (matches live biotoxin.com #signup.email-signup) ---------- */
.email-signup {
  background: #f9f9f9;
  padding: 32px 0 48px;
  margin-top: 60px;
}
.email-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 32px;
  flex-wrap: wrap;
}
.email-message {
  flex: 0 1 480px;
  text-align: center;
}
.email-message h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 25.6px;
  color: #000;
  margin: 0;
  letter-spacing: 0;
}
.email-message h4 strong { font-weight: 700; }
.email-signup .form {
  flex: 0 1 520px;
  text-align: center;
}
.email-signup form {
  display: flex;
  gap: 0;
  justify-content: center;
}
.email-signup input[type=email] {
  width: 320px;
  max-width: 100%;
  height: 43px;
  padding: 0 16px;
  border: 0.5px solid #000;
  border-right: 0;
  border-radius: 0;
  background: #fff;
  font-family: var(--font-serif);
  font-size: 16px;
  color: #000;
}
.email-signup input[type=email]:focus { outline: 2px solid #000; outline-offset: -2px; border-color: #000; }
.email-signup button {
  background: #000;
  color: #fff;
  border: 0;
  height: 43px;
  padding: 0 28px;
  border-radius: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  letter-spacing: 0;
}
.email-signup button:hover { background: #333; }
.email-note {
  flex: 1 1 100%;
  max-width: 720px;
  margin: 28px auto 0;
  text-align: center;
  padding: 0 32px;
}
.email-note p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  color: #000;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .email-row { flex-direction: column; gap: 18px; }
  .email-message { flex: 1 1 auto; }
  .email-signup form { flex-direction: column; align-items: stretch; }
  .email-signup input[type=email] { width: 100%; border-right: 0.5px solid #000; }
  .email-signup button { width: 100%; margin-top: 8px; }
}

/* ---------- Footer (matches live biotoxin.com dark bar) ---------- */
.site-footer {
  background: #222;
  color: #fff;
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 32px;
}
.site-footer p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  text-align: left;
}

/* ---------- WordPress-content compatibility ---------- */
.entry-content .wp-block-image { margin: 1.4em 0; }
.entry-content .wp-block-image img { margin: 0 auto; }
.entry-content .wp-block-image figcaption { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: 6px; }
.entry-content .wp-block-quote { border-left: 3px solid var(--accent); padding: 0.2em 1em; color: var(--text-soft); background: var(--bg-alt); }
.entry-content .has-text-align-center { text-align: center; }
.entry-content .has-text-align-right { text-align: right; }
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
}
.entry-content table th, .entry-content table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.entry-content table th { background: var(--bg-alt); font-weight: 600; }

/* Anchor offset — set dynamically via JS in the layout based on actual header height.
   The values below are fallbacks for the first paint, before JS runs. */
html { scroll-padding-top: 140px; }
@media (max-width: 720px) { html { scroll-padding-top: 110px; } }

/* "Table of Contents" — fixed left sidebar, matching live biotoxin.com */
.table-of-contents {
  position: fixed;
  left: 0;
  top: 160px;
  width: 240px;
  padding: 0 16px 0 24px;
  z-index: 5;
  font-family: var(--font-sans);
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  /* Hide scrollbar but allow scrolling */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.table-of-contents::-webkit-scrollbar { width: 6px; }
.table-of-contents::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.table-of-contents ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.table-of-contents li {
  font-weight: 200;
  font-size: 16px;
  margin: 0 0 16px;
  line-height: 1.3;
}
.table-of-contents li.inner-list {
  font-size: 14px;
  padding-left: 24px;
  margin-bottom: 9px;
}
.table-of-contents a,
.table-of-contents a:link,
.table-of-contents a:visited,
.table-of-contents a:focus,
.table-of-contents a:active,
.table-of-contents a:hover {
  color: #000;
  font-weight: 200;
}
.table-of-contents a {
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 0.5px;
  transition: text-decoration-color 0.15s;
}
.table-of-contents a:hover,
.table-of-contents a:focus,
.table-of-contents a.current {
  text-decoration: underline;
  text-decoration-color: #000;
}
.table-of-contents a:focus { outline: none; }

/* ===== Tablet (no room for left sidebar but no need for collapse): just inline ===== */
@media (max-width: 1240px) and (min-width: 721px) {
  .table-of-contents {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    margin: 24px 0 32px;
    padding: 18px 22px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
  }
  .table-of-contents li { margin-bottom: 8px; }
  .table-of-contents li.inner-list { margin-bottom: 5px; padding-left: 18px; }
}

/* ===== Mobile: collapsible TOC with sticky-bottom toggle bar ===== */
@media (max-width: 720px) {
  .table-of-contents {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    margin: 0 -16px 24px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }
  /* Toggle bar injected by JS; styled to match live site */
  .toc-toggle {
    display: block;
    width: 100%;
    padding: 16px 20px;
    background: #f5f5f5;
    border-top: 0.5px solid #000;
    border-bottom: 0.5px solid #000;
    border-left: 0;
    border-right: 0;
    font-family: var(--font-serif);
    font-size: 16px;
    font-variant: small-caps;
    letter-spacing: 0.06em;
    color: #000;
    text-align: center;
    cursor: pointer;
  }
  /* Toggle bar can become sticky to the bottom of the viewport on long pages */
  .toc-toggle.is-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  }
  .table-of-contents ul {
    display: none;
    padding: 14px 20px 18px;
    background: #fff;
    border-bottom: 0.5px solid var(--border);
  }
  .table-of-contents.is-open ul { display: block; }
  .table-of-contents li {
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 17px;
    margin-bottom: 12px;
  }
  .table-of-contents li.inner-list {
    font-size: 16px;
    padding-left: 18px;
    margin-bottom: 10px;
  }
}
