/* ==========================================================================
   Vital Energy After 50 — Editorial & Research Stylesheet
   Established Authority & Research Portal | R.A.S. NETTOYAGE
   Clean Human Code Footprint
   ========================================================================== */

:root {
  --primary: #0f2b48;
  --primary-light: #1e3a5f;
  --primary-dark: #0a1c30;
  --accent: #c25e1a;
  --accent-hover: #a34e15;
  --accent-light: #fef3eb;
  --accent-teal: #0d6e6e;
  --bg-main: #fcfdfd;
  --bg-alt: #f4f7f9;
  --bg-card: #ffffff;
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --text-light: #6b7280;
  --border-light: #e2e8f0;
  --border-accent: #cbd5e1;
  --font-serif: "Charter", "Bitstream Charter", "Sitka Text", "Cambria", "Georgia", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.25s ease-in-out;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Overrides */
h1, h2, h3, .font-heading {
  font-family: var(--font-serif);
  color: var(--primary-dark);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

h1 { font-size: clamp(2rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }

p {
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent);
}

/* Header & Navigation */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.top-bar {
  background-color: var(--primary-dark);
  color: #cbd5e1;
  font-size: 0.78rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-link {
  font-weight: 500;
  color: #334155;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--bg-alt);
}

/* Badges & Trust Elements */
.badge-editorial {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-tag {
  display: inline-block;
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.editorial-notice-bar {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.8rem;
  padding: 7px 16px;
  text-align: center;
  line-height: 1.4;
}

.editorial-notice-bar a {
  color: #78350f;
  text-decoration: underline;
  font-weight: 600;
}

/* Card Components */
.card-editorial {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.card-editorial:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-feature {
  border-top: 4px solid var(--accent);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--accent);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  box-shadow: 0 2px 4px rgba(194, 94, 26, 0.2);
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 4px 10px rgba(194, 94, 26, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #ffffff;
  color: var(--primary) !important;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-accent);
  transition: var(--transition);
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: var(--bg-alt);
  border-color: var(--primary);
}

/* Interactive Energy Calculator Widget */
.assessment-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.assessment-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--accent-teal) 100%);
}

.score-meter {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--score-deg, 270deg), #e2e8f0 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  position: relative;
}

.score-inner {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary-dark);
}

.slider-custom {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: #e2e8f0;
  outline: none;
  transition: opacity .2s;
}

.slider-custom::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.15s;
}

.slider-custom::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Interactive Habit Checklist */
.habit-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  transition: var(--transition);
  cursor: pointer;
}

.habit-item:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.habit-item.completed {
  background: #f0fdf4;
  border-color: #86efac;
}

.habit-item.completed .habit-text {
  color: #166534;
  text-decoration: line-through;
  opacity: 0.85;
}

.habit-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  accent-color: #16a34a;
  cursor: pointer;
  margin-top: 2px;
}

/* Accordion FAQ */
.faq-accordion-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: #ffffff;
  overflow: hidden;
  transition: var(--transition);
}

.faq-accordion-item:hover {
  border-color: var(--border-accent);
}

.faq-header {
  padding: 18px 22px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--primary-dark);
  user-select: none;
  background: #ffffff;
  transition: background-color 0.2s;
}

.faq-header:hover {
  background: #f8fafc;
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out, padding 0.3s ease;
  padding: 0 22px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-accordion-item.active .faq-content {
  padding: 0 22px 18px 22px;
}

.faq-accordion-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-icon {
  transition: transform 0.3s ease;
  color: #64748b;
}

/* Reading Progress Bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s;
}

/* Back to Top */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 900;
  border: none;
  cursor: pointer;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  background: var(--accent);
  transform: translateY(-3px);
}

/* Footer & Legal */
.site-footer {
  background-color: #0b1727;
  color: #94a3b8;
  font-size: 0.88rem;
  border-top: 3px solid var(--accent);
}

.footer-heading {
  color: #f8fafc;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-link {
  color: #94a3b8;
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.footer-link:hover {
  color: #ffffff;
  padding-left: 4px;
}

.medical-disclaimer-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #94a3b8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .assessment-box {
    padding: 20px 16px;
  }
  .nav-link {
    display: block;
    padding: 10px 14px;
  }
}
