/*
Theme Name: Longevity Evidence Hub
Theme URI: https://www.longevity.fjanesth.com
Author: Longevity Evidence Hub
Author URI: https://www.longevity.fjanesth.com
Description: Evidence Architecture design theme for Longevity Evidence Hub. Medical-grade UI with teal and charcoal color scheme, evidence level badges, and clean typography.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: longevity-hub
*/

/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@400;600;700&family=Noto+Serif+JP:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ── CSS Variables ────────────────────────────────────────────────────────── */
:root {
  --bg-primary: #1C1C1E;
  --bg-secondary: #2C2C2E;
  --bg-card: #242426;
  --bg-surface: #1a1a1c;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-300: #5eead4;
  --teal-100: #ccfbf1;
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: rgba(255,255,255,0.1);
  --border-teal: rgba(13,148,136,0.3);
  --gold: #d4a853;
  --gold-bg: rgba(212,168,83,0.15);
  --radius: 2px;
  --font-serif: 'Fraunces', 'Noto Serif JP', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-400); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--teal-300); }

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

p { margin-bottom: 1rem; color: var(--text-secondary); }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.4rem; color: var(--text-secondary); }

hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header / Navigation ──────────────────────────────────────────────────── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(28, 28, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 2rem;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.site-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-400));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  font-family: var(--font-serif);
  flex-shrink: 0;
}

.site-title-group { display: flex; flex-direction: column; }

.site-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.site-tagline {
  font-size: 0.65rem;
  color: var(--teal-400);
  letter-spacing: 0.05em;
}

#primary-navigation ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

#primary-navigation a {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}

#primary-navigation a:hover,
#primary-navigation .current-menu-item a {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.nav-pubmed-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem !important;
  background: transparent !important;
  border: 1px solid var(--teal-600) !important;
  color: var(--teal-400) !important;
  font-size: 0.75rem !important;
  border-radius: var(--radius) !important;
  transition: background 0.2s !important;
}

.nav-pubmed-btn:hover {
  background: rgba(13,148,136,0.15) !important;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
}

/* ── Hero Section ─────────────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  background: var(--bg-primary);
  overflow: hidden;
  min-height: 520px;
  display: flex;
  align-items: center;
}

.hero-bg-image {
  position: absolute;
  inset: 0;
  left: 45%;
}

.hero-bg-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.hero-bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--bg-primary) 40%, rgba(28,28,30,0.7) 65%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 5rem 0;
  max-width: 560px;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-400);
  border: 1px solid var(--border-teal);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.hero-label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-400);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-family: var(--font-serif);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--teal-300);
  font-family: var(--font-serif);
  font-weight: 400;
  margin-bottom: 1.25rem;
}

.hero-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.hero-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.hero-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.hero-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--teal-600);
  color: white;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background 0.2s;
  text-decoration: none;
}

.btn-primary:hover { background: var(--teal-500); color: white; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-primary);
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background 0.2s;
  text-decoration: none;
}

.btn-secondary:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

/* ── Evidence Level Legend ────────────────────────────────────────────────── */
.evidence-legend {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.evidence-legend-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.evidence-legend-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
}

.evidence-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.evidence-legend-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Evidence Badges ──────────────────────────────────────────────────────── */
.ev-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ev-badge-S {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid rgba(212,168,83,0.3);
}

.ev-badge-A {
  background: rgba(13,148,136,0.15);
  color: var(--teal-400);
  border: 1px solid rgba(13,148,136,0.3);
}

.ev-badge-B {
  background: rgba(100,116,139,0.15);
  color: #94a3b8;
  border: 1px solid rgba(100,116,139,0.3);
}

.ev-badge-C {
  background: rgba(113,113,122,0.15);
  color: var(--text-muted);
  border: 1px solid rgba(113,113,122,0.3);
}

/* ── Article Cards ────────────────────────────────────────────────────────── */
.articles-section {
  padding: 4rem 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 1.5rem;
  font-family: var(--font-serif);
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.view-all-link {
  font-size: 0.8rem;
  color: var(--teal-600);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.view-all-link:hover { color: var(--teal-500); }

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  gap: 1.5rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
}

.article-card:hover {
  border-color: var(--border-teal);
  transform: translateX(3px);
}

.article-card-image {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.article-card-body { flex: 1; min-width: 0; }

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.article-card-category {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.article-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  font-family: var(--font-serif);
  line-height: 1.4;
}

.article-card-excerpt {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.article-card-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.article-card-stat { display: flex; align-items: center; gap: 0.3rem; }

/* ── Single Post ──────────────────────────────────────────────────────────── */
.post-header {
  background: var(--bg-primary);
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.post-header-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.post-category-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
}

.post-title {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-family: var(--font-serif);
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.post-subtitle {
  font-size: 1rem;
  color: var(--teal-300);
  font-family: var(--font-serif);
  font-weight: 400;
  margin-bottom: 1.25rem;
}

.post-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.post-stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-stat-value { color: var(--text-secondary); font-weight: 500; }

.post-featured-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 2rem 0;
}

/* ── Post Content ─────────────────────────────────────────────────────────── */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  padding: 3rem 0;
  align-items: start;
}

.post-content h2 {
  font-size: 1.2rem;
  font-family: var(--font-serif);
  color: var(--text-primary);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.post-content h3 {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem;
}

.post-content p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.post-content ul, .post-content ol {
  color: var(--text-secondary);
  line-height: 1.8;
}

.post-content li { margin-bottom: 0.5rem; }

.post-content strong { color: var(--text-primary); }

.post-content hr {
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.post-content small { font-size: 0.75rem; color: var(--text-muted); }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.post-sidebar { position: sticky; top: 80px; }

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.sidebar-card-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-family: var(--font-sans);
  font-weight: 600;
}

.evidence-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.evidence-summary-item {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 0.75rem;
  text-align: center;
}

.evidence-summary-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--teal-400);
  display: block;
}

.evidence-summary-label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ── CTA / Products ───────────────────────────────────────────────────────── */
.cta-section {
  background: rgba(13,148,136,0.05);
  border: 1px solid var(--border-teal);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2.5rem 0;
}

.cta-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-family: var(--font-serif);
}

.cta-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.cta-product-info { flex: 1; min-width: 0; }

.cta-product-category {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.cta-product-query {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.cta-product-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--teal-600);
  color: white;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
  text-decoration: none;
}

.cta-product-btn:hover { background: var(--teal-500); color: white; }

.cta-legal {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* ── Update Notice ────────────────────────────────────────────────────────── */
.update-notice {
  background: rgba(13,148,136,0.05);
  border-top: 1px solid var(--border-teal);
  border-bottom: 1px solid var(--border-teal);
  padding: 2.5rem 0;
}

.update-notice-title {
  font-size: 1rem;
  font-family: var(--font-serif);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.update-notice-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 640px;
}

.update-notice-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--teal-600);
  margin-top: 0.75rem;
}

.update-notice-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-500);
  animation: pulse 2s infinite;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
#site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-brand-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.footer-brand-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0;
}

.footer-col-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.footer-links { list-style: none; padding: 0; margin: 0; }

.footer-links li { margin-bottom: 0.4rem; }

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--teal-400); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-legal {
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 500px;
  text-align: right;
}

/* ── Archive / Blog Page ──────────────────────────────────────────────────── */
.archive-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 3rem 0 2rem;
}

.archive-title {
  font-size: 1.75rem;
  font-family: var(--font-serif);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.archive-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.archive-content { padding: 3rem 0; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.page-numbers:hover, .page-numbers.current {
  background: var(--teal-600);
  border-color: var(--teal-600);
  color: white;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-bg-image { left: 55%; }
}

@media (max-width: 640px) {
  .hero-bg-image { display: none; }
  .hero-bg-gradient { display: none; }
  .hero-section { background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%); }
  .article-card { flex-direction: column; }
  .article-card-image { width: 100%; height: 180px; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  #primary-navigation { display: none; }
  #primary-navigation.is-open { display: block; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 1rem; }
  #primary-navigation.is-open ul { flex-direction: column; }
  .menu-toggle { display: block; }
  .footer-legal { text-align: left; }
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
.text-teal { color: var(--teal-400); }
.text-muted { color: var(--text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
