/*
Theme Name: PeptideCensus
Theme URI: https://peptidecensus.com
Author: PeptideCensus
Description: Custom data-first theme for PeptideCensus — the independent index of public peptide lab results. Ported from the approved v1 mockup.
Version: 1.0.36
Requires at least: 6.0
Requires PHP: 7.4
License: Proprietary
Text Domain: peptidecensus
*/

:root {
  --ink: #101c26; --body: #3d4f5b; --muted: #55656f; --faint: #64747f;
  --bg: #f6f8f9; --surface: #ffffff; --border: #e2e8ec; --row: #eef2f4;
  --teal: #0d7a63; --teal-dark: #0a5f4d; --teal-tint: #e7f4f0; --teal-tint-border: #bfe0d7; --teal-wash: #f2faf7;
  --amber-bg: #faf3e3; --amber-fg: #8a5a08; --amber-border: #ead9b3;
  --red-bg: #f9ebe8; --red-fg: #9c3a2b;
  --navy: #0e1b25; --navy-fg: #c7d3da; --navy-muted: #68808d; --navy-accent: #3ec9a7;
  --font-display: 'Space Grotesk', 'Trebuchet MS', sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); } a:hover { color: var(--teal-dark); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.2; color: var(--ink); }
h1 { font-size: 2.4rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.2rem; }

.pc-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 900px) { .pc-container { padding: 0 48px; } }

/* Header */
.pc-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.pc-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; padding: 8px 0; }
.pc-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.pc-logo-text { font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--ink); }
.pc-logo-text span { color: var(--teal); }
.pc-nav ul { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; flex-wrap: wrap; }
.pc-nav a { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.pc-nav a:hover, .pc-nav .current-menu-item > a { color: var(--teal); }

/* Hero */
.pc-hero { background: linear-gradient(180deg, #eef4f3 0%, var(--bg) 100%); padding: 56px 0 48px; text-align: center; }
.pc-eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; color: var(--teal-dark); font-weight: 500; text-transform: uppercase; margin-bottom: 16px; }
.pc-hero h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); margin: 0 auto; max-width: 820px; }
.pc-hero-sub { font-size: 17px; color: var(--muted); max-width: 640px; margin: 18px auto 0; }
.pc-search { display: flex; max-width: 680px; margin: 32px auto 0; background: var(--surface); border: 1.5px solid #cfdad4; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(16,28,38,0.07); }
.pc-search input[type="search"] { flex: 1; border: 0; padding: 17px 20px; font-size: 16px; font-family: var(--font-body); outline: none; min-width: 0; }
.pc-search button { background: var(--teal); color: #fff; border: 0; font-size: 15px; font-weight: 600; padding: 17px 28px; cursor: pointer; font-family: var(--font-body); }
.pc-search button:hover { background: var(--teal-dark); }

/* Chips / category tabs */
.pc-chips { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.pc-chip { font-size: 13px; font-weight: 500; color: var(--body); background: var(--surface); border: 1px solid #dde5e8; border-radius: 999px; padding: 8px 16px; text-decoration: none; }
.pc-chip:hover { border-color: var(--teal); color: var(--teal); }
.pc-tabs { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.pc-tab { font-size: 14px; font-weight: 500; color: var(--body); background: var(--surface); border: 1.5px solid #dde5e8; border-radius: 999px; padding: 9px 20px; text-decoration: none; }
.pc-tab:hover { border-color: var(--teal); color: var(--teal); }
.pc-tab.is-active { color: #fff; background: var(--teal); border-color: var(--teal); font-weight: 600; }

/* Stats band */
.pc-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (min-width: 700px) { .pc-stats { grid-template-columns: repeat(4, 1fr); } }
.pc-stat { background: var(--surface); padding: 26px 20px; text-align: center; }
.pc-stat-num { font-family: var(--font-mono); font-size: 26px; font-weight: 500; }
.pc-stat-num.teal { color: var(--teal-dark); }
.pc-stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Sections & cards */
.pc-section { padding: 48px 0 0; }
.pc-section:last-of-type { padding-bottom: 56px; }
.pc-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.pc-section-head h2 { margin: 0; }
.pc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 1px 3px rgba(16,28,38,0.05); }
.pc-card-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .pc-card-grid { grid-template-columns: repeat(3, 1fr); } }
.pc-card-pad { padding: 26px; }

/* Data tables */
.pc-table-wrap { overflow-x: auto; }
.pc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pc-table th { text-align: left; font-size: 11px; letter-spacing: 0.1em; font-weight: 600; color: var(--muted); padding: 14px 16px; text-transform: uppercase; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pc-table td { padding: 15px 16px; border-bottom: 1px solid var(--row); }
.pc-table tr:last-child td { border-bottom: 0; }
.pc-table .num { font-family: var(--font-mono); }
.pc-vendor-name { font-weight: 600; }

/* Badges & chips */
.pc-score { font-family: var(--font-mono); font-size: 13px; font-weight: 500; border-radius: 999px; padding: 4px 12px; display: inline-block; }
.pc-score-high { background: var(--teal-tint); color: var(--teal-dark); border: 1px solid var(--teal-tint-border); }
.pc-score-mid { background: var(--amber-bg); color: var(--amber-fg); border: 1px solid var(--amber-border); }
.pc-score-low { background: var(--red-bg); color: var(--red-fg); border: 1px solid #ecc8c0; }
.pc-unscored { font-size: 12px; color: var(--muted); white-space: nowrap; border: 1px dashed var(--border); border-radius: 999px; padding: 3px 10px; display: inline-block; }
.pc-result { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 10px; display: inline-block; }
.pc-result-pass { background: var(--teal-tint); color: var(--teal-dark); }
.pc-result-under { background: var(--amber-bg); color: var(--amber-fg); }
.pc-result-fail { background: var(--red-bg); color: var(--red-fg); }

/* Buttons & coupon */
.pc-btn { display: inline-block; background: var(--teal); color: #fff !important; font-size: 15px; font-weight: 600; border-radius: 8px; padding: 13px 24px; text-decoration: none; border: 0; cursor: pointer; }
.pc-btn:hover { background: var(--teal-dark); }
.pc-coupon { display: inline-flex; align-items: center; gap: 8px; border: 1.5px dashed var(--teal-tint-border); background: var(--teal-wash); border-radius: 8px; padding: 12px 18px; font-size: 13px; color: var(--muted); }
.pc-coupon code { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--teal-dark); background: none; }
.pc-disclosure { font-size: 12px; color: var(--faint); margin-top: 12px; }

/* Content (posts & pages) */
.pc-content { max-width: 760px; margin: 0 auto; padding: 48px 20px 64px; }
.pc-content .pc-kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; color: var(--teal-dark); font-weight: 500; text-transform: uppercase; }
.pc-content h1 { font-size: clamp(1.7rem, 4vw, 2.35rem); margin: 12px 0 0; }
.pc-meta { font-size: 13px; color: var(--muted); margin: 16px 0 0; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.pc-meta:has(+ .pc-reviewed) { border-bottom: none; padding-bottom: 0; }
.pc-reviewed { margin-top: 6px; }
.pc-reviewed a { color: var(--teal-dark); }
.pc-entry { margin-top: 28px; }
.pc-entry h2 { margin-top: 2.2em; }
.pc-entry table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.pc-entry th { text-align: left; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); }
.pc-entry td { padding: 12px 14px; border-bottom: 1px solid var(--row); }
.pc-entry blockquote { border-top: 2px solid var(--teal); border-bottom: 1px solid var(--border); background: var(--surface); padding: 20px 26px; margin: 24px 0; font-style: italic; color: var(--body); }
.pc-callout { background: var(--teal-wash); border: 1px solid var(--teal-tint-border); border-radius: 10px; padding: 20px 26px; margin: 24px 0; }

/* Blog cards */
.pc-post-card { padding: 0; text-decoration: none; display: block; color: inherit; overflow: hidden; }
.pc-post-card:hover h3 { color: var(--teal); }
.pc-post-card h3 { margin: 10px 0 0; font-size: 18px; line-height: 1.35; }
.pc-post-card .pc-post-date { font-size: 13px; color: var(--muted); margin-top: 12px; }
.pc-post-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--navy); }
.pc-post-body { padding: 22px 26px 26px; }

/* Footer */
.pc-footer { background: var(--navy); color: var(--navy-fg); margin-top: 64px; padding: 48px 0 36px; }
.pc-footer a { color: var(--navy-fg); text-decoration: none; }
.pc-footer a:hover { color: #fff; }
.pc-footer-cols { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .pc-footer-cols { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
.pc-footer-logo .pc-logo-text { color: #fff; }
.pc-footer-logo .pc-logo-text span { color: var(--navy-accent); }
.pc-footer-tag { font-size: 13px; color: var(--navy-muted); margin-top: 12px; max-width: 320px; }
.pc-footer-col-title { font-size: 11px; letter-spacing: 0.12em; color: var(--navy-muted); font-weight: 600; text-transform: uppercase; margin-bottom: 12px; }
.pc-footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.pc-footer-disclaimer { border-top: 1px solid #22343f; margin-top: 36px; padding-top: 22px; font-size: 12px; line-height: 1.65; color: var(--navy-muted); }

/* Calculator */
.pc-calc { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 900px) { .pc-calc { grid-template-columns: 1.4fr 1fr; } }
.pc-calc-inputs { padding: 28px; }
.pc-field label { display: block; font-size: 13px; font-weight: 600; color: var(--body); margin-bottom: 6px; }
.pc-field input, .pc-field select { width: 100%; border: 1.5px solid #cfdad4; border-radius: 8px; padding: 12px 14px; font-family: var(--font-mono); font-size: 15px; background: var(--bg); }
.pc-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pc-calc-result { background: var(--navy); border-radius: 12px; padding: 28px; color: #fff; display: flex; flex-direction: column; justify-content: center; }
.pc-calc-units { font-family: var(--font-mono); font-size: 42px; font-weight: 500; color: var(--navy-accent); line-height: 1.15; }
.pc-calc-row { display: flex; justify-content: space-between; font-size: 14px; padding-top: 12px; }
.pc-calc-row span:first-child { color: #8fa2ad; }
.pc-calc-row span:last-child { font-family: var(--font-mono); }
.pc-calc-note { font-size: 12px; color: var(--faint); margin-top: 14px; }

/* Per-peptide mini leaderboards (homepage grid) */
.pc-lb-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .pc-lb-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .pc-lb-grid { grid-template-columns: repeat(3, 1fr); } }
.pc-lb-card { overflow: hidden; }
.pc-lb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 18px 20px 12px; }
.pc-lb-head h3 { margin: 0; font-size: 17px; }
.pc-lb-head a { font-size: 13px; font-weight: 500; white-space: nowrap; }
.pc-table-compact { table-layout: fixed; width: 100%; }
.pc-table-compact th, .pc-table-compact td { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
.pc-table-compact th:first-child, .pc-table-compact td:first-child { padding-left: 18px; width: 36px; }
.pc-table-compact th:last-child, .pc-table-compact td:last-child { padding-right: 16px; width: 78px; text-align: right; }
.pc-table-compact th:nth-child(3), .pc-table-compact td:nth-child(3) { width: 76px; text-align: right; }
.pc-table-compact td.pc-vendor-name { overflow: hidden; text-overflow: ellipsis; }
.pc-table-compact .pc-score { padding: 3px 9px; font-size: 12px; }
.pc-table-compact tbody tr:hover td { background: var(--teal-wash); }
.pc-table .pc-vendor-name { white-space: nowrap; }

/* Footer signup */
.pc-footer-signup { border-top: 1px solid rgba(199,211,218,0.15); margin-top: 28px; padding-top: 22px; }
.pc-footer-signup .pc-subscribe-form { align-items: center; }
.pc-footer-signup-label { font-size: 13px; color: var(--navy-fg); flex-basis: 100%; margin-bottom: 4px; }
.pc-footer-signup input[type="email"] { max-width: 300px; background: rgba(255,255,255,0.06); border-color: rgba(199,211,218,0.25); color: var(--navy-fg); }
.pc-footer-signup input[type="email"]::placeholder { color: var(--navy-muted); }

/* Clickable leaderboard names */
.pc-lb-head h3 a { color: inherit; text-decoration: none; }
.pc-lb-head h3 a:hover { color: var(--teal); }
.pc-vendor-name a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--teal-tint-border); }
.pc-vendor-name a:hover { color: var(--teal); border-bottom-color: var(--teal); }
.pc-hero-score-link { margin: 14px 0 0; font-size: 14px; }
.pc-head-links { display: inline-flex; gap: 18px; flex-wrap: wrap; }

/* Subscribe unit */
.pc-subscribe { margin-top: 28px; }
.pc-subscribe-inner { padding: 24px 26px; }
.pc-subscribe-inner h3 { margin: 0 0 4px; }
.pc-subscribe-inner > p { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.pc-subscribe-form { display: flex; gap: 10px; flex-wrap: wrap; }
.pc-subscribe-form input[type="email"] { flex: 1; min-width: 220px; border: 1.5px solid #cfdad4; border-radius: 8px; padding: 12px 14px; font-size: 15px; font-family: var(--font-body); }
.pc-subscribe-msg { font-size: 14px; color: var(--teal-dark); font-weight: 600; }

/* Freshness markers: score built on a 6+ month old test */
.pc-score.pc-stale { opacity: 0.55; position: relative; }
.pc-score.pc-stale::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--amber-fg); margin-left: 6px; vertical-align: 1px; }
.pc-stale-date { color: var(--amber-fg); }

/* Latest tests feed */
.pc-feed-date { font-family: var(--font-mono); font-size: 13px; white-space: nowrap; color: var(--muted); }
.pc-feed-lab { font-size: 12px; color: var(--faint); }

/* Vendor logo chips */
.pc-logo-chip { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; vertical-align: -5px; margin-right: 8px; display: inline-block; }
.pc-logo-fallback { background: var(--teal-tint); color: var(--teal-dark); border: 1px solid var(--teal-tint-border); font-family: var(--font-display); font-size: 12px; font-weight: 600; text-align: center; line-height: 20px; }

/* Utility */
.pc-empty { padding: 32px; text-align: center; color: var(--muted); font-size: 14px; }
.screen-reader-text { clip: rect(1px,1px,1px,1px); position: absolute !important; overflow: hidden; width: 1px; height: 1px; }

/* Unverified badge on compound leaderboards (1.0.29) */
.pc-badge-unverified { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.4; white-space: nowrap; vertical-align: middle; background: var(--amber-bg); color: var(--amber-fg); border: 1px solid var(--amber-border); text-decoration: none; }
.pc-badge-unverified:hover, .pc-badge-unverified:focus-visible { text-decoration: underline; }
.pc-table-compact .pc-badge-unverified { margin-left: 6px; padding: 1px 6px; font-size: 10px; }
