/* ===================================
   FRENCH PEPTIDES - Peptide 101 Guide
   =================================== */

/* --- Dark Theme (Default) --- */
:root,
[data-theme="dark"] {
  --bg-primary: #0a161f;
  --bg-sidebar: #0d1b26;
  --bg-header: #0a161f;
  --bg-input: rgba(255, 255, 255, 0.05);
  --bg-input-border: rgba(255, 255, 255, 0.1);
  --accent: #4DA8C8;
  --accent-light: rgba(77, 168, 200, 0.2);
  --accent-hover: rgba(77, 168, 200, 0.15);
  --accent-active: rgba(77, 168, 200, 0.1);
  --accent-bright: #5CBDD9;
  --text-heading: #ffffff;
  --text-light: #e5e7eb;
  --text-body: #d1d5db;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --text-faint: #4b5563;
  --overlay-bg: rgba(0, 0, 0, 0.7);
  --modal-bg: linear-gradient(145deg, #0f2233, #0a161f);
  --sidebar-width: 260px;
  --header-height: 60px;
  --font-display: 'Syne', 'Arial', sans-serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
  --theme-transition: 0.3s ease;
}

/* --- Light Theme --- */
[data-theme="light"] {
  --bg-primary: #f7f8fc;
  --bg-sidebar: #ffffff;
  --bg-header: #ffffff;
  --bg-input: rgba(0, 0, 0, 0.04);
  --bg-input-border: rgba(0, 0, 0, 0.12);
  --accent: #3A95B8;
  --accent-light: rgba(58, 149, 184, 0.12);
  --accent-hover: rgba(58, 149, 184, 0.1);
  --accent-active: rgba(58, 149, 184, 0.08);
  --accent-bright: #2D87AA;
  --text-heading: #1a2332;
  --text-light: #2d3748;
  --text-body: #4a5568;
  --text-muted: #718096;
  --text-dim: #a0aec0;
  --text-faint: #cbd5e0;
  --overlay-bg: rgba(0, 0, 0, 0.4);
  --modal-bg: linear-gradient(145deg, #ffffff, #f0f4f8);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-body);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--theme-transition), color var(--theme-transition);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

ul {
  list-style: none;
}

input {
  font-family: inherit;
}

/* --- Utility Classes --- */
.accent-text { color: var(--accent); }
.text-heading { color: var(--text-heading); }
.text-lg { font-size: 1.125rem; }
.text-light { color: var(--text-light); }
.text-bold { font-weight: 600; color: var(--text-heading); }

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--accent-light);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 40;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, background-color var(--theme-transition), border-color var(--theme-transition);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--accent-light);
  border-radius: 2px;
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 16px;
  left: 16px;
  color: var(--text-muted);
  padding: 4px;
  z-index: 10;
}
.sidebar-close:hover {
  color: var(--text-heading);
}

/* Logo */
.sidebar-logo {
  margin-bottom: 20px;
}

.logo-img {
  width: 100%;
  max-width: 160px;
  height: auto;
  filter: drop-shadow(0 0 6px rgba(77, 168, 200, 0.2));
  transition: filter 0.3s ease;
}

.sidebar-logo:hover .logo-img {
  filter: drop-shadow(0 0 12px rgba(77, 168, 200, 0.5));
}

.sidebar-heading {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: 0.5px;
  line-height: 1.2;
  transition: color var(--theme-transition);
}

.sidebar-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Progress */
.sidebar-progress {
  margin-bottom: 20px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.progress-value {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--accent-light);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Search */
.sidebar-search {
  position: relative;
  margin-bottom: 16px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.sidebar-search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  background: var(--bg-input);
  border: 1px solid var(--bg-input-border);
  border-radius: 8px;
  color: var(--text-heading);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition), background-color var(--theme-transition);
}

.sidebar-search input::placeholder {
  color: var(--text-dim);
}

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

/* Chapter List */
.sidebar-nav {
  flex: 1;
}

.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chapter-item {
  border-radius: 8px;
  overflow: hidden;
}

.chapter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: 8px;
  transition: all var(--transition);
  text-align: left;
  gap: 8px;
}

.chapter-link:hover {
  color: var(--text-heading);
  background: var(--accent-hover);
}

.chapter-link-text {
  flex: 1;
  line-height: 1.4;
}

.chapter-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  opacity: 0.5;
}

.chapter-item.active .chapter-link {
  color: var(--text-heading);
  background: var(--accent-active);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.chapter-item.active .chapter-chevron {
  transform: rotate(0deg);
  opacity: 0.8;
}

/* Chapter sub-sections */
.chapter-sections {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.chapter-item.active .chapter-sections {
  max-height: 600px;
}

.section-link {
  display: block;
  padding: 6px 12px 6px 28px;
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: color var(--transition);
}

.section-link:hover {
  color: var(--accent);
}

/* --- Sidebar Overlay (mobile) --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 35;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  min-width: 0; /* allow the flex item to shrink below its content width (prevents mobile horizontal overflow) */
  max-width: 100%;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--theme-transition);
}

/* Header */
.main-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--header-height);
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--accent-light);
  transition: background-color var(--theme-transition), border-color var(--theme-transition);
}

.hamburger-btn {
  display: none;
  color: var(--text-heading);
  padding: 4px;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title-text {
  font-size: 0.95rem;
  color: var(--text-heading);
  font-weight: 500;
  transition: color var(--theme-transition);
}

/* --- Theme Toggle --- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent);
  background: var(--accent-hover);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

/* Default (no data-theme = dark) */
:root:not([data-theme]) .theme-toggle .icon-sun {
  display: block;
}
:root:not([data-theme]) .theme-toggle .icon-moon {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 4px;
}

.lang-option {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all var(--transition);
  letter-spacing: 0.5px;
}

.lang-option:hover {
  color: var(--accent);
  background: var(--accent-hover);
}

.lang-option.lang-active {
  color: var(--accent);
  font-weight: 600;
  pointer-events: none;
}

.lang-divider {
  color: var(--text-faint);
  font-size: 0.75rem;
  user-select: none;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent);
  color: #ffffff;
}

[data-theme="dark"] .btn-primary:hover,
:root:not([data-theme]) .btn-primary:hover {
  color: var(--bg-primary);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--accent-light);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-download {
  font-size: 0.85rem;
  padding: 8px 16px;
}

/* --- Content Area --- */
.content-wrapper {
  flex: 1;
  padding: 48px 48px;
  max-width: 896px;
  margin: 0 auto;
  width: 100%;
}

/* Chapter display */
.chapter {
  display: none;
}

.chapter.active {
  display: block;
}

/* Chapter Header */
.chapter-header {
  margin-bottom: 48px;
}

.chapter-label {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.chapter-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.15;
  margin-bottom: 16px;
  transition: color var(--theme-transition);
}

.chapter-divider {
  width: 80px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}

/* E-E-A-T byline (author + updated date under the chapter title) */
.chapter-byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--text-light);
}
.chapter-byline svg { color: var(--accent); flex-shrink: 0; }
.chapter-byline a { color: var(--accent); text-decoration: none; }
.chapter-byline a:hover { text-decoration: underline; }
.chapter-byline .byline-sep { opacity: 0.5; }
.chapter-byline .byline-date { opacity: 0.9; }

/* Scientific references (E-E-A-T) */
.ref-list {
  margin: 8px 0 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ref-list li {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-light);
}
.ref-list a {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.ref-list a:hover { text-decoration: underline; }

/* Chapter hero figure (didactic illustration under the chapter title) */
.chapter-figure {
  margin: 28px 0 8px;
}

.chapter-figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* FAQ */
.faq-item {
  padding: 20px 0;
  border-top: 1px solid var(--accent-light);
}

.faq-item:first-child {
  border-top: none;
  padding-top: 4px;
}

.faq-q {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
  transition: color var(--theme-transition);
}

.faq-a {
  line-height: 1.7;
  color: var(--text-light);
  margin: 0;
}

/* Chapter Intro */
.chapter-intro {
  margin-bottom: 40px;
}

.chapter-intro p {
  margin-bottom: 16px;
  line-height: 1.7;
}

.chapter-intro .text-lg {
  font-size: 1.1rem;
  color: var(--text-light);
}

/* Content Sections */
.content-section {
  padding-top: 32px;
  margin-top: 32px;
  border-top: 1px solid var(--accent-light);
}

.section-heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 24px;
  transition: color var(--theme-transition);
}

.content-section p {
  margin-bottom: 16px;
  line-height: 1.7;
}

/* Accent bullet list */
.gold-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gold-list li {
  padding-left: 1.2em;
  position: relative;
  line-height: 1.6;
}

.gold-list li::before {
  content: '\2022';
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1.5;
  position: absolute;
  left: 0;
}

.gold-list li strong {
  color: var(--text-heading);
}

/* Check list */
.check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-list li {
  padding-left: 1.2em;
  position: relative;
  line-height: 1.6;
}

.check-list li::before {
  content: '\2713';
  color: var(--accent);
  font-weight: 600;
  position: absolute;
  left: 0;
}

/* Glowing CTA Button */
.btn-glow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  margin-top: 20px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  text-decoration: none;
  position: relative;
  transition: all 0.3s ease;
  box-shadow:
    0 0 15px rgba(77, 168, 200, 0.4),
    0 0 30px rgba(77, 168, 200, 0.2),
    0 0 60px rgba(77, 168, 200, 0.1);
  animation: glow-pulse 2.5s ease-in-out infinite;
}

.btn-glow:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow:
    0 0 20px rgba(77, 168, 200, 0.5),
    0 0 40px rgba(77, 168, 200, 0.3),
    0 0 80px rgba(77, 168, 200, 0.15);
}

.btn-glow:active {
  transform: translateY(0);
}

[data-theme="light"] .btn-glow {
  box-shadow:
    0 0 15px rgba(58, 149, 184, 0.3),
    0 0 30px rgba(58, 149, 184, 0.15),
    0 0 60px rgba(58, 149, 184, 0.08);
}

[data-theme="light"] .btn-glow:hover {
  box-shadow:
    0 0 20px rgba(58, 149, 184, 0.4),
    0 0 40px rgba(58, 149, 184, 0.2),
    0 0 80px rgba(58, 149, 184, 0.1);
}

@keyframes glow-pulse {
  0%, 100% {
    box-shadow:
      0 0 15px rgba(77, 168, 200, 0.4),
      0 0 30px rgba(77, 168, 200, 0.2),
      0 0 60px rgba(77, 168, 200, 0.1);
  }
  50% {
    box-shadow:
      0 0 20px rgba(77, 168, 200, 0.6),
      0 0 40px rgba(77, 168, 200, 0.3),
      0 0 80px rgba(77, 168, 200, 0.15);
  }
}

/* Subsection Title */
.subsection-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-top: 24px;
  margin-bottom: 12px;
}

/* Info Box */
.info-box {
  margin-top: 24px;
  padding: 20px 24px;
  background: var(--accent-active);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.info-box-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 12px;
}

.info-box-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-box-list li {
  line-height: 1.6;
}

.info-box p {
  line-height: 1.6;
  margin: 0;
}

/* Partner callout (French Peptides) — visually separates commercial partner from editorial voice */
.partner-box { margin-top: 28px; }
.partner-box > p + p,
.partner-box .check-list,
.partner-box .btn-glow { margin-top: 14px; }
.partner-box .btn-glow { display: inline-flex; }
.affiliate-note {
  margin-top: 16px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-light);
  opacity: 0.85;
}

/* Benefits & Risks */
.benefits-risks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .benefits-risks-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.benefit-list, .risk-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.benefit-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
}

.benefit-list li::before {
  content: '\2713';
  color: #34d399;
  font-weight: 700;
  flex-shrink: 0;
}

.risk-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
}

.risk-list li::before {
  content: '\2022';
  color: #f87171;
  font-size: 1.2rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.risk-title {
  color: #f87171 !important;
}

/* Dark Cards (Myths) */
.myths-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-dark {
  padding: 20px 24px;
  margin-bottom: 20px;
  background: var(--accent-active);
  border: 1px solid var(--accent-light);
  border-radius: 10px;
  transition: background-color var(--theme-transition), border-color var(--theme-transition);
}

.card-dark-title {
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.card-dark-text {
  color: var(--text-body);
  line-height: 1.6;
  font-size: 0.9rem;
}

/* Step Cards */
.steps-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.step-card {
  padding: 20px 24px;
  background: var(--accent-active);
  border: 1px solid var(--accent-light);
  border-radius: 10px;
  transition: background-color var(--theme-transition), border-color var(--theme-transition);
}

.step-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.step-text {
  color: var(--text-body);
  line-height: 1.6;
  font-size: 0.9rem;
  margin: 0;
}

/* Sourcing Grid */
.sourcing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

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

/* Warning Box */
.warning-box {
  padding: 20px 24px;
  background: rgba(248, 113, 113, 0.06);
  border-left: 3px solid #f87171;
  border-radius: 0 8px 8px 0;
}

.warning-box-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: #f87171;
  margin-bottom: 12px;
}

.warning-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.warning-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
  font-size: 0.9rem;
}

.warning-list li::before {
  content: '\2717';
  color: #f87171;
  font-weight: 600;
  flex-shrink: 0;
}

/* Compact check-list variant */
.check-list.compact li {
  font-size: 0.9rem;
}

/* Data Table */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 16px;
  border-radius: 10px;
  border: 1px solid var(--accent-light);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead {
  background: var(--accent-active);
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--accent-light);
}

.data-table td {
  padding: 12px 16px;
  color: var(--text-body);
  border-bottom: 1px solid var(--accent-light);
  line-height: 1.5;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--accent-active);
}

/* Numbered List (ordered) */
.numbered-list {
  counter-reset: step-counter;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 0;
}

.numbered-list li {
  counter-increment: step-counter;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.6;
  list-style: none;
}

.numbered-list li::before {
  content: counter(step-counter) '.';
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 22px;
}

/* Italic Quote */
.italic-quote {
  font-style: italic;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.7;
}

/* Peptide Tags */
.peptide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.peptide-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  border: none;
  border-radius: 20px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow:
    0 0 10px rgba(77, 168, 200, 0.35),
    0 0 20px rgba(77, 168, 200, 0.15);
  animation: glow-pulse 2.5s ease-in-out infinite;
}

.peptide-tag:hover {
  background: var(--accent-bright);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow:
    0 0 15px rgba(77, 168, 200, 0.5),
    0 0 30px rgba(77, 168, 200, 0.25);
}

[data-theme="light"] .peptide-tag {
  box-shadow:
    0 0 10px rgba(58, 149, 184, 0.25),
    0 0 20px rgba(58, 149, 184, 0.1);
}

[data-theme="light"] .peptide-tag:hover {
  box-shadow:
    0 0 15px rgba(58, 149, 184, 0.4),
    0 0 30px rgba(58, 149, 184, 0.2);
}

/* Static (non-clickable) tags — products our partner doesn't carry */
.peptide-tag.is-static {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--bg-input-border);
  box-shadow: none;
  animation: none;
  cursor: default;
}
.peptide-tag.is-static:hover {
  background: transparent;
  color: var(--text-muted);
  transform: none;
  box-shadow: none;
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

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

/* Product Grid & Cards */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.product-card {
  display: block;
  padding: 20px;
  background: var(--accent-active);
  border: 1px solid var(--accent-light);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(77, 168, 200, 0.2);
}

/* Static product card — informational only, no link */
.product-card.is-static { cursor: default; }
.product-card.is-static:hover {
  border-color: var(--accent-light);
  transform: none;
  box-shadow: none;
}

.product-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.product-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.product-card-cta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

/* CTA Box */
.cta-box {
  margin-top: 32px;
  padding: 28px;
  background: var(--accent-active);
  border: 1px solid var(--accent-light);
  border-radius: 12px;
  text-align: center;
}

.cta-box-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.cta-box p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.cta-box .btn-glow {
  margin-top: 0;
}

/* text-muted utility */
.text-muted { color: var(--text-muted); }

/* Reconstitution Steps */
.recon-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.recon-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.recon-step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.recon-step-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.recon-step-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

/* Chapter Navigation */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--accent-light);
}

/* Chapter Placeholder */
.chapter-placeholder {
  padding: 80px 0;
  text-align: center;
}

.chapter-placeholder p {
  color: var(--text-dim);
  font-size: 1.1rem;
  font-style: italic;
}

/* --- Footer --- */
.main-footer {
  padding: 32px 48px;
  text-align: center;
  border-top: 1px solid var(--accent-light);
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.accent-link {
  color: var(--accent);
  transition: opacity var(--transition);
}

.accent-link:hover {
  text-decoration: underline;
}

.footer-disclaimer {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 8px;
}

/* --- Email Modal --- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--modal-bg);
  border: 1px solid var(--accent-light);
  border-radius: 16px;
  padding: 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  z-index: 1;
}

[data-theme="light"] .modal-content {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.5rem;
  color: var(--text-dim);
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--text-heading);
}

.modal-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.modal-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Honeypot — visually hidden, off-screen, but not display:none (bots skip those) */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Subscription status message */
.modal-status {
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 1.2em;
  line-height: 1.4;
}
.modal-status.is-pending { color: var(--text-muted); }
.modal-status.is-success { color: var(--accent-bright); font-weight: 600; }
.modal-status.is-error   { color: #e57373; }

.modal-form input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--bg-input-border);
  border-radius: 8px;
  color: var(--text-heading);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), background-color var(--theme-transition);
}

.modal-form input::placeholder {
  color: var(--text-dim);
}

.modal-form input:focus {
  border-color: var(--accent);
}

.btn-submit {
  width: 100%;
  justify-content: center;
  padding: 12px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  border: none;
}

.btn-submit:hover {
  background: var(--accent-bright);
}

.modal-privacy {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 16px;
}

/* --- Modal segmentation questions (chips + select) --- */
.modal-content { max-height: 90vh; overflow-y: auto; }

.modal-q {
  border: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.modal-q-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
  padding: 0;
  text-align: left;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-body);
  background: var(--bg-input);
  border: 1px solid var(--bg-input-border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}

.chip:hover {
  border-color: var(--accent);
}

.chip.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.modal-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--bg-input-border);
  border-radius: 8px;
  color: var(--text-heading);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.modal-select:focus { border-color: var(--accent); }
.modal-select option { color: initial; }

/* Hard-gate mode: hide the close affordance, block backdrop dismissal */
.modal.is-gate .modal-close { display: none; }
.modal.is-gate .modal-backdrop { cursor: default; }

/* --- Responsive --- */
/* --- Visual chapter map: "guide at a glance" grid on the landing --- */
.chapter-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.chapter-map-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  background: var(--accent-active);
  border: 1px solid var(--accent-light);
  border-radius: 14px;
  transition: transform var(--transition), border-color var(--transition),
              box-shadow var(--transition), background-color var(--theme-transition);
}
.chapter-map-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(77, 168, 200, 0.15);
}
.chapter-map-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent);
  margin-bottom: 4px;
  flex-shrink: 0;
}
.chapter-map-num {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
}
.chapter-map-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.25;
}
.chapter-map-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- Promo / discount coupon (tap-to-copy code) --- */
.promo-box {
  margin: 20px 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-active), var(--accent-light));
  border: 1px solid var(--accent);
  text-align: center;
}
.promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--bg-primary);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.promo-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.25;
  margin-bottom: 14px;
}
.promo-code {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px dashed var(--accent);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-primary);
  cursor: pointer;
  min-height: 46px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.promo-code:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(77, 168, 200, 0.22);
}
.promo-code-value {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 1.5px;
  color: var(--accent);
  padding: 0 16px;
}
.promo-code-copy {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent);
  padding: 0 16px;
  white-space: nowrap;
  transition: background-color var(--transition);
}
.promo-code.is-copied .promo-code-copy {
  background: #2e9e6b;
}

@media (max-width: 1024px) {
  .content-wrapper {
    padding: 40px 32px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 300px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger-btn {
    display: block;
  }

  .main-header {
    padding: 0 16px;
  }

  .content-wrapper {
    padding: 32px 20px;
  }

  .chapter-title {
    font-size: 2rem;
  }

  .section-heading {
    font-size: 1.2rem;
  }

  .main-footer {
    padding: 24px 20px;
  }

  .download-text {
    display: none;
  }

  .btn-download {
    padding: 8px 10px;
  }

  .chapter-nav {
    flex-direction: column;
    gap: 12px;
  }

  .chapter-nav .btn-primary,
  .chapter-nav .btn-outline {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .chapter-title {
    font-size: 1.6rem;
  }

  .content-wrapper {
    padding: 24px 16px;
  }

  .modal-content {
    padding: 28px 20px;
  }
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chapter.active {
  animation: fadeIn 0.3s ease;
}

/* --- Selection styling --- */
::selection {
  background: var(--accent);
  color: #ffffff;
}

[data-theme="dark"] ::selection,
:root:not([data-theme]) ::selection {
  color: var(--bg-primary);
}

/* ===================================================================
   MOBILE-FIRST / APP-LIKE PASS
   90%+ of traffic is mobile — this section makes the guide feel native.
   =================================================================== */

/* --- Always-on niceties --- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
.sidebar,
.modal-content,
.table-wrapper {
  -webkit-overflow-scrolling: touch; /* momentum scroll */
}

/* Belt-and-suspenders against horizontal overflow on phones */
.content-wrapper { min-width: 0; max-width: 100%; }
.content-wrapper p,
.content-wrapper li,
.content-wrapper h1,
.content-wrapper h2,
.content-wrapper h3,
.content-wrapper h4 {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Single-line, ellipsised header title so the top bar never wraps */
.header-center {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.header-title-text {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Safe-area insets (notch / home indicator) when added to home screen */
.main-header { padding-top: env(safe-area-inset-top); }
.sidebar { padding-top: max(24px, env(safe-area-inset-top)); }
.main-footer { padding-bottom: max(24px, env(safe-area-inset-bottom)); }

/* --- Touch & app-feel at phone widths --- */
@media (max-width: 768px) {
  /* Header: tighten, free up room for the title, kill the decorative icon */
  .main-header {
    padding-left: 14px;
    padding-right: 14px;
    gap: 6px;
  }
  .header-center { gap: 8px; }
  .header-center > svg { display: none; }
  .header-title-text { font-size: 0.9rem; }

  .header-actions { gap: 4px; }

  /* Comfortable, finger-sized tap targets */
  .hamburger-btn,
  .theme-toggle {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .lang-option { padding: 9px 8px; }
  .chapter-link { min-height: 44px; }
  .section-link { padding: 10px 0; }

  /* Inputs ≥16px so iOS Safari doesn't auto-zoom on focus */
  .modal-form input,
  .modal-select {
    font-size: 16px;
    min-height: 48px;
  }
  .chip { min-height: 40px; }

  /* Bottom-sheet modal — slides up from the bottom like a native sheet */
  .modal { align-items: flex-end; }
  .modal-content {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    padding: 28px 22px calc(24px + env(safe-area-inset-bottom));
  }
  .modal.active .modal-content {
    animation: sheetUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .modal-heading { font-size: 1.4rem; }
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* Very small phones: keep the big H1 readable, tighten gutters */
@media (max-width: 380px) {
  .content-wrapper { padding: 22px 14px; }
  .peptide-tag, .peptide-tag.is-static { padding: 8px 13px; }
}
