/* ============================================
   ROOT & RESTORE NUTRITION — Global Styles
   ============================================ */

/* Design Tokens */
:root {
  --cream: #FAF6F0;
  --bark: #8B5E3C;
  --sage: #7A9E7E;
  --clay: #C4704F;
  --moss: #4A6741;
  --linen: #EDE8DF;
  --charcoal: #2E2E2E;
  --white: #FFFFFF;
  --shadow: rgba(139, 94, 60, 0.12);
  --shadow-md: rgba(139, 94, 60, 0.2);

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', 'Lato', sans-serif;
  --font-accent: 'Cormorant Garamond', Georgia, serif;

  --radius: 12px;
  --radius-sm: 6px;
  --radius-lg: 20px;
  --transition: 0.3s ease;
  --max-width: 1200px;
}

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

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

body {
  background-color: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--bark);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--moss);
}

ul {
  list-style: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--bark);
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.05rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #555;
}

blockquote, .pull-quote {
  font-family: var(--font-accent);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--bark);
  border-left: 4px solid var(--sage);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--linen);
  border-radius: 0 var(--radius) var(--radius) 0;
}

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

.section {
  padding: 5rem 0;
}

.section--alt {
  background-color: var(--linen);
}

.section--dark {
  background-color: var(--moss);
  color: var(--cream);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--cream);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header p {
  color: #666;
  max-width: 640px;
  margin: 1rem auto 0;
  font-size: 1.05rem;
}

.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.5rem;
}

/* Grid */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Flex utils */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--bark);
  color: var(--white);
  border-color: var(--bark);
}

.btn-primary:hover {
  background: var(--moss);
  border-color: var(--moss);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--bark);
  border-color: var(--bark);
}

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

.btn-sage {
  background: var(--sage);
  color: var(--white);
  border-color: var(--sage);
}

.btn-sage:hover {
  background: var(--moss);
  border-color: var(--moss);
  color: var(--white);
}

.btn-lg { padding: 1rem 2.5rem; font-size: 1.05rem; }
.btn-sm { padding: 0.6rem 1.25rem; font-size: 0.85rem; }

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(250, 246, 240, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(139, 94, 60, 0.1);
  transition: box-shadow var(--transition);
}

.nav.scrolled {
  box-shadow: 0 2px 20px var(--shadow);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bark);
  line-height: 1.2;
}

.nav-logo span {
  display: block;
  font-size: 0.7rem;
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--charcoal);
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--bark);
}

.nav-links .dropdown {
  position: relative;
}

.nav-links .dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px var(--shadow-md);
  padding: 0.5rem;
  min-width: 200px;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

.nav-links .dropdown:hover .dropdown-menu {
  display: flex;
}

.nav-links .dropdown-menu a {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.nav-links .dropdown-menu a:hover {
  background: var(--linen);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.25rem;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--bark);
  border-radius: 2px;
  transition: all var(--transition);
}

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

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

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

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 0;
  background: var(--white);
  border-top: 1px solid var(--linen);
  padding: 1rem 1.5rem;
}

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

.nav-mobile a {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--linen);
  font-weight: 500;
  color: var(--charcoal);
}

.nav-mobile a:last-child {
  border-bottom: none;
}

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

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.75rem;
}

.lang-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--charcoal);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.03em;
  line-height: 1;
}

.lang-btn:hover {
  color: var(--bark);
  border-color: var(--bark);
  background: var(--linen);
}

.lang-btn.active {
  color: var(--white);
  background: var(--bark);
  border-color: var(--bark);
}

/* Push the Google Translate widget off-screen — must NOT be display:none or the select won't work */
#google_translate_element {
  position: fixed;
  bottom: -9999px;
  left: -9999px;
  z-index: -1;
}

/* Hide the top translation banner Google injects */
.goog-te-banner-frame,
.goog-te-balloon-frame { display: none !important; }

/* Keep the widget gadget itself rendered (do NOT hide .skiptranslate — it wraps the select) */
body { top: 0 !important; }

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(74, 103, 65, 0.75) 0%,
    rgba(139, 94, 60, 0.5) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  max-width: 700px;
}

.hero-content h1 {
  color: var(--white);
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  line-height: 1.8;
}

.hero-badges {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.hero-badge {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Page hero (smaller) */
.page-hero {
  padding-top: 80px;
  min-height: 60vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.page-hero .hero-content {
  max-width: 800px;
}

/* Stats bar */
.stats-bar {
  background: var(--bark);
  color: var(--white);
  padding: 2.5rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item .stat-num {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-item .stat-label {
  font-size: 0.85rem;
  opacity: 0.85;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* Chart containers */
.chart-container {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 4px 20px var(--shadow);
}

.chart-container canvas {
  max-height: 300px;
}

.chart-title {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--charcoal);
  text-align: center;
  margin-bottom: 1rem;
}

/* Section divider */
.divider {
  text-align: center;
  padding: 1rem 0;
  overflow: hidden;
}

.divider svg {
  color: var(--sage);
  opacity: 0.4;
}

/* Food grid */
.food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.food-item {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow);
  text-align: center;
  transition: transform var(--transition);
}

.food-item:hover {
  transform: translateY(-3px);
}

.food-item img {
  width: 100%;
  height: 90px;
  object-fit: cover;
}

.food-item span {
  display: block;
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--charcoal);
}

.food-section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.food-section-label.avoid { color: var(--clay); }
.food-section-label.eat { color: var(--sage); }

/* Symptom icon grid */
.symptom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.25rem;
}

.symptom-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: 0 2px 12px var(--shadow);
}

.symptom-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.symptom-item p {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--charcoal);
  margin: 0;
}

/* Protocol timeline */
.protocol-timeline {
  position: relative;
  padding-left: 2rem;
}

.protocol-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--sage), var(--bark), var(--clay));
  border-radius: 3px;
}

.timeline-block {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 2rem;
}

.timeline-block::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 0.5rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sage);
  border: 3px solid var(--cream);
  box-shadow: 0 0 0 2px var(--sage);
}

.timeline-time {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--bark);
  margin-bottom: 1rem;
}

.supplement-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.supplement-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--white);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 6px var(--shadow);
}

.supplement-item .supp-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.supplement-item .supp-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--bark);
}

.supplement-item .supp-info span {
  font-size: 0.8rem;
  color: #777;
}

/* Meal card */
.meal-card {
  background: var(--linen);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  align-items: flex-start;
}

.meal-card img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.meal-card-body h5 {
  color: var(--moss);
  margin-bottom: 0.25rem;
}

.meal-card-body p {
  font-size: 0.875rem;
  color: #666;
  margin: 0;
}

/* 4R Protocol infographic */
.four-r-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 40px var(--shadow-md);
}

.four-r-step {
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.four-r-step:nth-child(1) { background: #E8F0E8; }
.four-r-step:nth-child(2) { background: #F0EAE0; }
.four-r-step:nth-child(3) { background: #E8F0E8; }
.four-r-step:nth-child(4) { background: #F0EAE0; }

.four-r-num {
  font-family: var(--font-heading);
  font-size: 3rem;
  color: var(--sage);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.four-r-step h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.four-r-step p {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
}

@media (max-width: 768px) {
  .four-r-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .four-r-grid { grid-template-columns: 1fr; }
}

/* Footer */
.footer {
  background: var(--moss);
  color: rgba(255,255,255,0.85);
  padding: 4rem 0 2rem;
}

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

.footer-brand h3 {
  color: var(--cream);
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.7;
  margin: 0;
}

.footer-col h4 {
  color: var(--cream);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-body);
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  padding: 0.3rem 0;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--cream);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}

.footer-disclaimer {
  background: rgba(0,0,0,0.15);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 2rem;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* Utility */
.text-center { text-align: center; }
.text-sage { color: var(--sage); }
.text-bark { color: var(--bark); }
.text-clay { color: var(--clay); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.hidden { display: none !important; }

/* Page padding for fixed nav */
.page-body {
  padding-top: 72px;
}

/* =============================================
   MOBILE IMPROVEMENTS
   ============================================= */

/* Reduce section vertical padding on mobile */
@media (max-width: 768px) {
  .section { padding: 3rem 0; }
  .section-header { margin-bottom: 2rem; }

  /* Bigger touch targets for language buttons */
  .lang-btn {
    min-height: 36px;
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
  }

  /* Reduce hero padding so content isn't cramped under nav */
  .hero { padding-top: 80px; }
  .hero-content p { font-size: 1.05rem; }
}

@media (max-width: 480px) {
  /* Tighter container on very small screens */
  .container { padding: 0 1rem; }
  .section { padding: 2.5rem 0; }

  /* Fix oversized vertical gap when grid-2 collapses to single column */
  .grid.grid-2 { gap: 2rem !important; }

  /* Slightly reduce hero text */
  .hero-content p { font-size: 1rem; }
  .hero-badges { gap: 0.5rem; }
  .hero-badge { font-size: 0.78rem; padding: 0.4rem 0.8rem; }

  /* CTA buttons stack cleanly */
  .cta-buttons { flex-direction: column; align-items: center; }
  .cta-buttons .btn { width: 100%; max-width: 320px; justify-content: center; }

  /* Condition card image shorter on small screens */
  .condition-card-img { height: 160px; }

  /* Stats numbers slightly smaller */
  .stat-item .stat-num { font-size: 1.8rem; }
}

/* Lang switcher in mobile nav menu */
.nav-mobile-lang {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 0 0.25rem;
  border-top: 1px solid var(--linen);
  margin-top: 0.25rem;
}

.nav-mobile-lang .lang-btn {
  flex: 1;
  text-align: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--linen);
  border-radius: var(--radius-sm);
}
