/* Main CSS - Loaded after critical CSS */

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: var(--spacing-sm);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.1rem; }

p {
  margin-bottom: var(--spacing-sm);
  color: var(--text-medium);
}

a {
  color: var(--primary);
  text-decoration-skip-ink: auto;
}

a:hover {
  color: var(--primary-light);
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-xl) 0;
}

.section-title {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  max-width: 600px;
  margin: -1rem auto var(--spacing-lg);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--spacing-md);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

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

/* Cards */
.card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  height: 100%;
}

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

.card-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
  color: white;
}

.card h3 {
  color: var(--primary);
  margin-bottom: var(--spacing-xs);
}

.card p {
  font-size: 0.95rem;
  line-height: 1.7;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  margin-top: var(--spacing-sm);
  font-size: 0.95rem;
}

.card-link:hover {
  gap: 0.75rem;
}

.card-link::after {
  content: "→";
  transition: transform 0.2s;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 139, 106, 0.3);
}

.btn-primary:hover {
  background: #ff7556;
  box-shadow: 0 6px 16px rgba(255, 139, 106, 0.4);
  transform: translateY(-2px);
  color: white;
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

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

/* Hero CTA */
.hero-cta {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* Content Sections */
.content {
  max-width: 800px;
  margin: 0 auto;
}

.content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: var(--spacing-md) 0;
}

.content ul, .content ol {
  margin: var(--spacing-sm) 0;
  padding-left: var(--spacing-md);
}

.content li {
  margin-bottom: var(--spacing-xs);
  color: var(--text-medium);
  line-height: 1.7;
}

.content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: var(--spacing-md);
  margin: var(--spacing-md) 0;
  font-style: italic;
  color: var(--text-light);
}

/* Table of Contents */
.toc {
  background: var(--bg-gray);
  border-radius: 8px;
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
  border: 1px solid var(--border);
}

.toc h2, .toc h3 {
  font-size: 1.1rem;
  margin-bottom: var(--spacing-sm);
  color: var(--primary);
}

.toc ul {
  list-style: none;
  padding-left: 0;
}

.toc li {
  margin-bottom: var(--spacing-xs);
}

.toc a {
  color: var(--text-medium);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0;
  transition: color 0.2s;
}

.toc a:hover {
  color: var(--primary);
}

/* Breadcrumbs */
.breadcrumbs {
  padding: var(--spacing-sm) 0;
  font-size: 0.9rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.breadcrumbs li:not(:last-child)::after {
  content: "›";
  color: var(--text-light);
}

.breadcrumbs a {
  color: var(--text-medium);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* FAQ Accordion */
.faq-item {
  background: var(--bg-white);
  border-radius: 8px;
  margin-bottom: var(--spacing-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: var(--spacing-md);
  background: none;
  border: none;
  text-align: left;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.faq-question:hover {
  background: var(--bg-light);
}

.faq-question::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--primary);
  transition: transform 0.3s;
}

.faq-question.active::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer-content {
  padding: 0 var(--spacing-md) var(--spacing-md);
  color: var(--text-medium);
  line-height: 1.7;
}

/* Footer */
.footer {
  background: var(--text-dark);
  color: white;
  padding: var(--spacing-xl) 0 var(--spacing-md);
  margin-top: var(--spacing-xl);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.footer-section h3 {
  color: white;
  margin-bottom: var(--spacing-sm);
  font-size: 1.1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: var(--spacing-xs);
}

.footer-section a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--spacing-md);
  text-align: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
}

/* Medical Disclaimer */
.disclaimer {
  background: #fff8e1;
  border-left: 4px solid #ffc107;
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
  border-radius: 4px;
  font-size: 0.9rem;
}

.disclaimer strong {
  color: #f57c00;
}

/* Image lazy loading */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Skip to content */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .header, .footer, .nav, .hero-cta, .toc {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: black;
  }
}
