/*
Theme Name: Nucleus Peptides
Theme URI: https://example.com/nucleus-peptides
Author: Nucleus Peptides
Description: Fast, responsive, lightweight WordPress theme for a research peptide pen catalogue. Includes a "Peptide Pens" custom post type, filterable catalogue, product pages and a local-storage basket. No page builder, no jQuery.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nucleus-peptides
Tags: e-commerce, custom-colors, custom-menu, responsive-layout, block-styles
*/

/* ---------------------------------------------------------------
   Design tokens — "clean bench": porcelain surfaces, teal signal,
   copper accent.
---------------------------------------------------------------- */
:root {
  --bg: #f9fafc;
  --surface: #f1f4f7;
  --card: #ffffff;
  --fg: #1e202a;
  --muted: #656772;
  --border: rgba(30, 32, 42, 0.14);
  --primary: #339297;
  --primary-dark: #2a7b80;
  --primary-soft: #d9f3f3;
  --primary-ink: #2c6a72;
  --secondary: #eff1f4;
  --copper: #a27736;
  --radius: 8px;
  --gradient-signal: linear-gradient(135deg, #339297 0%, #a27736 100%);
  --shadow: 0 12px 28px -20px rgba(30, 40, 60, 0.3);
  --shadow-signal: 0 0 0 1px rgba(51, 146, 151, 0.25), 0 18px 44px -22px rgba(51, 146, 151, 0.35);
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --wrap: 1180px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.125rem); }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1rem; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }
.section { padding: 3.5rem 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--card); padding: 0.5rem 1rem; z-index: 200; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 0.65rem 1.15rem; font: 600 0.9375rem/1 var(--font-sans);
  cursor: pointer; transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn { transition: filter 0.15s, background-color 0.15s, color 0.15s, border-color 0.15s; }
.btn-primary { background-image: var(--gradient-signal); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { filter: brightness(1.1); color: #fff; }
.btn-secondary { background: var(--secondary); color: var(--fg); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface); }
.btn-hero { background: rgba(51, 146, 151, 0.1); border-color: rgba(51, 146, 151, 0.4); color: var(--primary-ink); }
.btn-hero:hover { background: rgba(51, 146, 151, 0.2); color: var(--primary-ink); }
.btn-copper { background: var(--copper); color: #fff; }
.btn-copper:hover { filter: brightness(1.1); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--fg); }
.btn-outline:hover { background: var(--primary-soft); color: var(--primary-ink); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--secondary); color: var(--fg); }
.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.8125rem; }
.btn-block { width: 100%; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(249, 250, 252, 0.88);
  backdrop-filter: blur(12px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1rem; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.65rem; color: var(--fg); }
.brand svg { width: 30px; height: 30px; color: var(--primary); flex: none; }
.brand-name { font: 700 1rem/1 var(--font-display); letter-spacing: -0.02em; }
.brand-sub { display: block; font: 400 0.5625rem/1.6 var(--font-mono); letter-spacing: 0.3em; color: var(--muted); }
.main-nav { margin-left: 1.5rem; display: none; gap: 0.25rem; }
.main-nav a { padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 0.9375rem; color: var(--muted); }
.main-nav a:hover, .main-nav .current-menu-item > a { background: var(--primary-soft); color: var(--primary); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.basket-btn { position: relative; }
.basket-count {
  position: absolute; top: -7px; right: -7px; min-width: 19px; height: 19px;
  border-radius: 999px; background: var(--copper); color: #fff;
  font: 700 0.625rem/19px var(--font-mono); text-align: center; padding: 0 4px;
}
.nav-toggle { display: inline-flex; }
.mobile-nav { display: none; border-top: 1px solid var(--border); background: var(--surface); padding: 0.5rem 0; }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 0.7rem 1rem; color: var(--muted); }

@media (min-width: 860px) {
  .main-nav { display: flex; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* Hero */
.hero {
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
  background-image:
    linear-gradient(to right, rgba(30, 32, 42, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 32, 42, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
}
.grid-lines {
  background-image:
    linear-gradient(to right, rgba(30, 32, 42, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 32, 42, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
}
.text-signal {
  background-image: var(--gradient-signal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-grid { display: grid; gap: 2.5rem; align-items: center; padding: 3.5rem 0; }
.hero p.lead { font-size: 1.0625rem; color: var(--muted); max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.hero-figure { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 1.5rem; }
.hero-figure img { margin: 0 auto; max-height: 320px; width: auto; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; } }

/* Stat strip */
.stats-band { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.stats { display: grid; gap: 0; }
.stats div { padding: 1.25rem 0; }
.stats div + div { border-top: 1px solid var(--border); }
.stats strong { display: block; font-family: var(--font-display); font-size: 1.25rem; }
.stats span { font-size: 0.8125rem; color: var(--muted); }
@media (min-width: 700px) {
	.stats { grid-template-columns: repeat(4, 1fr); }
	.stats div { padding: 1.25rem 1.5rem; }
	.stats div:first-child { padding-left: 0; }
	.stats div + div { border-top: 0; border-left: 1px solid var(--border); }
}


/* Product grid */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: rgba(13, 125, 140, 0.45); transform: translateY(-2px); }
.card-link { display: flex; flex-direction: column; flex: 1; padding: 1.15rem; color: inherit; }
.card-meta { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; margin-bottom: 0.9rem; }
.tag { border: 1px solid var(--border); border-radius: 999px; padding: 0.1rem 0.55rem; font-size: 0.6875rem; color: var(--muted); }
.card-img { background: var(--surface); border-radius: 8px; padding: 0.9rem; margin-bottom: 1rem; }
.card-img img { height: 96px; width: auto; margin: 0 auto; object-fit: contain; }
.card h3 { font-size: 1rem; margin: 0; }
.card .size { font-family: var(--font-mono); font-size: 0.75rem; color: var(--copper); margin: 0.25rem 0 0; }
.card .desc { font-size: 0.875rem; color: var(--muted); margin: 0.75rem 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .price { font: 600 1.25rem/1 var(--font-display); margin: 1.1rem 0 0; }
.card-foot { border-top: 1px solid var(--border); padding: 0.75rem; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.75rem; }
.chip {
  border: 1px solid var(--border); background: var(--card); border-radius: 999px;
  padding: 0.4rem 0.9rem; font-size: 0.8125rem; color: var(--muted);
}
.chip:hover { background: var(--surface); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.search-form { display: flex; gap: 0.5rem; margin: 0 0 1.25rem; max-width: 420px; }
.search-form input {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.6rem 0.8rem; font: inherit; font-size: 0.9375rem; background: var(--card); color: var(--fg);
}
.search-form input:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Single product */
.product { display: grid; gap: 2rem; padding: 2.5rem 0; }
.product-figure { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 2rem; box-shadow: var(--shadow); }
.product-figure img { max-height: 380px; width: auto; margin: 0 auto; }
.product .price-lg { font: 600 2rem/1 var(--font-display); }
.spec { border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; font-size: 0.9375rem; }
.spec span:first-child { color: var(--muted); }
.qty { display: inline-flex; align-items: center; gap: 0.5rem; }
.qty input { width: 56px; text-align: center; border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem; font: 600 0.9375rem var(--font-mono); background: var(--card); color: var(--fg); }
.notice { background: var(--primary-soft); border: 1px solid rgba(13,125,140,0.25); border-radius: var(--radius); padding: 1rem; font-size: 0.875rem; color: var(--fg); }
@media (min-width: 900px) { .product { grid-template-columns: 1fr 1fr; gap: 3rem; } }

/* Basket drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 30, 40, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 190; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(400px, 100%); background: var(--surface); border-left: 1px solid var(--border); transform: translateX(100%); transition: transform 0.25s ease; z-index: 200; display: flex; flex-direction: column; }
body.basket-open .drawer { transform: none; }
body.basket-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 1.125rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0.5rem 1.25rem; }
.drawer-foot { border-top: 1px solid var(--border); padding: 1.1rem 1.25rem; display: grid; gap: 0.65rem; }
.line { display: flex; gap: 0.75rem; justify-content: space-between; padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.line p { margin: 0; font-size: 0.875rem; }
.line .sub { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.line-controls { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.5rem; }
.line-controls button { width: 28px; height: 28px; border: 1px solid var(--border); background: var(--card); border-radius: 6px; cursor: pointer; color: var(--fg); }
.line-controls span { min-width: 28px; text-align: center; font-family: var(--font-mono); font-size: 0.875rem; }
.totals { display: flex; justify-content: space-between; align-items: center; }
.totals strong { font-family: var(--font-display); font-size: 1.125rem; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 150%); background: var(--fg); color: #fff; padding: 0.7rem 1.1rem; border-radius: var(--radius); font-size: 0.875rem; z-index: 210; transition: transform 0.25s; }
.toast.show { transform: translate(-50%, 0); }

/* Content pages */
.entry-content { max-width: 46rem; }
.entry-content ul { padding-left: 1.25rem; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.panel-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 2.5rem 0 1.5rem; margin-top: 3rem; font-size: 0.9375rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h4 { font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.legal { border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1.25rem; color: var(--muted); font-size: 0.8125rem; }

.pagination { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 2rem; }
.pagination .page-numbers { border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem 0.75rem; color: var(--muted); }
.pagination .page-numbers.current { background: var(--primary); border-color: var(--primary); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* UK NAP block */
.footer-nap{margin-top:1.5rem;display:flex;flex-direction:column;gap:.25rem;font-size:.875rem;font-style:normal;color:var(--muted)}
.footer-nap strong{color:var(--fg)}
.footer-nap a{color:inherit;text-decoration:none}
.footer-nap a:hover{color:var(--primary)}
.footer-nap .mono{font-family:var(--font-mono);font-size:.75rem;margin-top:.25rem}
