/* ============================================================
   Fasting Benefits — style.css
   Design: Clean, science-forward, trustworthy
   Fonts: Merriweather (headlines) + Inter (body)
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* ── Variables ── */
:root {
  --white: #FFFFFF;
  --bg: #FFFFFF;
  --bg-light: #F8F9FA;
  --bg-warm: #FFF9F0;
  --text: #1A1A2E;
  --text-muted: #5A5A6E;
  --text-light: #8A8A9E;
  --green: #2E7D52;
  --green-light: #E8F5EE;
  --green-dark: #1B5E3A;
  --amber: #E67E22;
  --amber-light: #FFF3E0;
  --border: #E2E4E8;
  --divider: #ECECF0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Category colors */
  --cat-if: #0D7377;
  --cat-health: #2E7D52;
  --cat-protocols: #1565C0;
  --cat-science: #6A0572;
  --cat-lifestyle: #E67E22;

  /* Typography */
  --font-head: 'Merriweather', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Layout */
  --max-width: 1200px;
  --max-article: 780px;
  --nav-height: 64px;
}

/* ── Base Typography ── */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; font-weight: 600; }

p { margin-bottom: 1rem; }

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

.container-sm {
  max-width: var(--max-article);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand svg {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--green);
  background: var(--green-light);
}

.nav-link.active {
  color: var(--green);
  font-weight: 600;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.25s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  display: none;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  flex-direction: column;
  z-index: 99;
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  padding: 14px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--divider);
  transition: color 0.2s, background 0.2s;
}

.mobile-nav a:hover {
  color: var(--green);
  background: var(--green-light);
}

.mobile-nav a.active { color: var(--green); font-weight: 600; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--green-light) 0%, var(--bg-warm) 50%, var(--white) 100%);
  padding: 80px 0;
  text-align: center;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 20px;
  color: var(--text);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.btn-primary {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--green);
  color: var(--white);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green);
  padding: 12px 24px;
  border: 2px solid var(--green);
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover {
  background: var(--green);
  color: var(--white);
}

/* ── Section ── */
.section {
  padding: 64px 0;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
}

.section-heading {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 560px;
}

/* ── Category Cards ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.category-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.category-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-card-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--white);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.category-card h3 {
  font-size: 1.1rem;
}

.category-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.category-card-count {
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 500;
}

.cat-if .category-card-icon { background: var(--cat-if); }
.cat-health .category-card-icon { background: var(--cat-health); }
.cat-protocols .category-card-icon { background: var(--cat-protocols); }
.cat-science .category-card-icon { background: var(--cat-science); }
.cat-lifestyle .category-card-icon { background: var(--cat-lifestyle); }

/* ── Article Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.article-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-light);
}

.article-card-body {
  padding: 20px;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  color: var(--white);
}

.tag-if { background: var(--cat-if); }
.tag-health { background: var(--cat-health); }
.tag-protocols { background: var(--cat-protocols); }
.tag-science { background: var(--cat-science); }
.tag-lifestyle { background: var(--cat-lifestyle); }

.reading-time {
  font-size: 0.8rem;
  color: var(--text-light);
}

.article-card-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}

.article-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.article-card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.article-card-link:hover { text-decoration: underline; }

/* ── Featured Article ── */
.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.featured-card-img {
  aspect-ratio: 4/3;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-light);
}

.featured-card-body {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-card-body .tag { align-self: flex-start; margin-bottom: 12px; }
.featured-card-body h3 { font-size: 1.5rem; margin-bottom: 12px; }
.featured-card-body p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 16px; }

/* ── Category Hub Pages ── */
.category-header {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
}

.category-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.category-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  color: var(--white);
  margin-bottom: 16px;
}

.category-header h1 {
  margin-bottom: 12px;
}

.category-header-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.category-header-count {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Filter bar */
.filter-bar {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.filter-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-btn {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-light);
}

/* ── All Articles Page ── */
.search-bar {
  max-width: 480px;
  margin-bottom: 32px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--green); }

.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

/* ── Article Page ── */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 24px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--green);
  font-weight: 500;
}

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--text-light); }

.article-header {
  margin-bottom: 32px;
}

.article-header .tag { margin-bottom: 12px; display: inline-block; }

.article-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-meta-divider {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-light);
}

.article-hero-img {
  width: 100%;
  aspect-ratio: 2/1;
  border-radius: var(--radius-md);
  object-fit: cover;
  margin-bottom: 36px;
}

.article-hero-placeholder {
  width: 100%;
  aspect-ratio: 2/1;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Article body prose */
.article-body {
  max-width: var(--max-article);
  margin: 0 auto;
}

.article-body h2 {
  font-size: 1.5rem;
  margin: 40px 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
}

.article-body h3 {
  font-size: 1.2rem;
  margin: 28px 0 12px;
}

.article-body p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.article-body ul, .article-body ol {
  margin: 0 0 1.25rem 1.5rem;
  list-style: disc;
}

.article-body ol { list-style: decimal; }

.article-body li {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.article-body a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover { color: var(--green-dark); }

.article-body blockquote {
  border-left: 3px solid var(--green);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--green-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-muted);
}

/* ── Key Takeaways Box ── */
.key-takeaways {
  background: var(--green-light);
  border: 1px solid rgba(46, 125, 82, 0.2);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin: 32px 0;
}

.key-takeaways h4 {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--green-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-takeaways ul {
  list-style: none;
  margin: 0;
}

.key-takeaways li {
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 6px 0 6px 20px;
  position: relative;
  color: var(--text);
}

.key-takeaways li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

/* ── Disclaimer Box ── */
.disclaimer-box {
  background: var(--amber-light);
  border: 1px solid rgba(230, 126, 34, 0.2);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 32px 0;
}

.disclaimer-box h4 {
  font-size: 0.9rem;
  color: var(--amber);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.disclaimer-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ── Sources ── */
.sources-section {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--divider);
}

.sources-section h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.sources-section ol {
  list-style: decimal;
  margin-left: 1.5rem;
}

.sources-section li {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.sources-section a {
  color: var(--green);
  word-break: break-word;
}

/* ── Related Articles ── */
.related-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--divider);
}

.related-section h3 {
  font-size: 1.25rem;
  margin-bottom: 24px;
}

/* ── Sidebar ── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.sidebar {
  padding-top: 8px;
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-heading {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--green);
  margin-bottom: 16px;
}

.sidebar-link {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
  transition: color 0.2s;
}

.sidebar-link:hover { color: var(--green); }

/* ── About Page ── */
.about-content {
  max-width: var(--max-article);
  margin: 0 auto;
  padding: 48px 24px;
}

.about-content h1 { margin-bottom: 24px; }
.about-content h2 { margin-top: 40px; margin-bottom: 16px; font-size: 1.4rem; }
.about-content p { font-size: 1.05rem; line-height: 1.8; color: var(--text); }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ── Footer ── */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 24px;
  margin-top: 64px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}

.footer-tagline {
  font-size: 0.85rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.5);
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
}

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

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 24px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}

.footer-legal {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.25);
  text-align: right;
  max-width: 400px;
}

/* ── Responsive: Tablet ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .hero { padding: 56px 0; }
  .hero h1 { font-size: 1.75rem; }

  .category-grid { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: 1fr 1fr; }

  .featured-card { grid-template-columns: 1fr; }
  .featured-card-body { padding: 24px; }

  .article-layout {
    grid-template-columns: 1fr;
  }
  .sidebar { order: -1; }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-inner > :first-child { grid-column: 1 / -1; }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  .footer-legal { text-align: center; max-width: 100%; }
}

/* ── Responsive: Mobile ── */
@media (max-width: 480px) {
  .category-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }

  .section { padding: 40px 0; }
  .hero { padding: 40px 0; }

  .filter-bar-inner { flex-wrap: wrap; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-inner > :first-child { grid-column: auto; }

  .category-tabs { gap: 6px; }
}
