/* ============================================
   Mesothelioma Research Info - Main Stylesheet
   ============================================ */

/* CSS Variables */
:root {
  --color-primary: #1a5f7a;
  --color-primary-dark: #134a5e;
  --color-secondary: #2c3e50;
  --color-accent: #e67e22;
  --color-accent-hover: #d35400;
  --color-bg: #ffffff;
  --color-bg-alt: #f8f9fa;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-border: #e0e0e0;
  --color-footer: #1a252f;
  
  --font-heading: 'Nunito Sans', sans-serif;
  --font-body: 'Merriweather', serif;
  
  --max-width: 1200px;
  --sidebar-width: 300px;
  --header-height: 70px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  
  --transition: all 0.3s ease;
}

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

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

body {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.7;
  background-color: var(--color-bg);
}

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

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

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-secondary);
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1.25rem;
}

ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Header */
.header {
  background-color: var(--color-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--color-border);
}

.header-top {
  background-color: var(--color-primary);
  color: white;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

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

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

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: var(--color-primary-dark);
}

.logo span {
  color: var(--color-accent);
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 0;
  padding: 0;
  margin: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9rem;
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover,
.nav-item.active > .nav-link {
  color: var(--color-primary);
  text-decoration: none;
  border-bottom-color: var(--color-primary);
}

.nav-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
}

.nav-item:hover > .nav-link .nav-chevron,
.nav-item.mega-open > .nav-link .nav-chevron {
  transform: rotate(180deg);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-primary);
}

/* ==========================================
   Mega Menu
   ========================================== */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 750px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  transform: translateX(-50%) translateY(6px);
  z-index: 2000;
  pointer-events: none;
}

.mega-menu.mega-sm {
  min-width: 500px;
}

/* Show mega on hover (desktop) */
.nav-item.has-mega:hover > .mega-menu,
.nav-item.mega-open > .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Keep mega visible while moving mouse into it */
.mega-menu:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mega-inner {
  display: flex;
  gap: 0;
  padding: 1.5rem 0;
}

.mega-col {
  flex: 1;
  padding: 0 1.5rem;
  border-right: 1px solid var(--color-border);
}

.mega-col:last-child {
  border-right: none;
}

.mega-heading {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin-bottom: 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--color-accent);
}

.mega-col ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem 0;
}

.mega-col li {
  margin-bottom: 0;
}

.mega-col a {
  display: block;
  padding: 0.3rem 0;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.15s, padding-left 0.15s;
}

.mega-col a:hover {
  color: var(--color-primary);
  padding-left: 4px;
  text-decoration: none;
}

.mega-state-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.mega-see-all {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent) !important;
}

.mega-see-all:hover {
  color: var(--color-accent-hover) !important;
}

/* Prevent mega menu from going off-screen on right */
.nav-item:nth-last-child(-n+2).has-mega .mega-menu {
  left: auto;
  right: 0;
  transform: translateY(6px);
}

.nav-item:nth-last-child(-n+2).has-mega:hover > .mega-menu,
.nav-item:nth-last-child(-n+2).mega-open > .mega-menu {
  transform: translateY(0);
}

/* ==========================================
   Mobile Menu
   ========================================== */
@media (max-width: 1024px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-bg);
    box-shadow: var(--shadow-lg);
    display: none;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 2000;
  }

  .nav.active {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }

  .nav-link {
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    border-bottom: none;
    justify-content: space-between;
  }

  .nav-link:hover {
    background: var(--color-bg-alt);
    border-bottom-color: transparent;
  }

  .nav-item.has-mega > .nav-link {
    cursor: pointer;
  }

  /* Mega menu becomes accordion on mobile */
  .mega-menu {
    position: static;
    transform: none;
    min-width: 0;
    border: none;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, visibility 0.3s;
    pointer-events: auto;
    background: var(--color-bg-alt);
  }

  .mega-menu.mega-sm {
    min-width: 0;
  }

  .nav-item.has-mega:hover > .mega-menu {
    opacity: 1;
    visibility: hidden;
    max-height: 0;
    transform: none;
  }

  .nav-item.mega-open > .mega-menu {
    visibility: visible;
    max-height: 2000px;
    opacity: 1;
    transform: none;
  }

  .mega-inner {
    flex-direction: column;
    padding: 0.5rem 0;
  }

  .mega-col {
    padding: 0.5rem 1.5rem;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .mega-col:last-child {
    border-bottom: none;
  }

  .mega-heading {
    font-size: 0.75rem;
    margin-top: 0.5rem;
  }

  .mega-state-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .nav-chevron {
    transition: transform 0.3s;
  }

  .nav-item.mega-open > .nav-link .nav-chevron {
    transform: rotate(180deg);
  }
}

/* Ad Slots - Removed for cleaner UX */

/* Breadcrumbs */
.breadcrumbs {
  background-color: var(--color-bg-alt);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.breadcrumbs-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  font-size: 0.875rem;
}

.breadcrumbs a {
  color: var(--color-text-light);
}

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

.breadcrumbs .separator {
  margin: 0 0.5rem;
  color: var(--color-border);
}

.breadcrumbs .current {
  color: var(--color-text);
}

/* Main Layout */
.main-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 2rem;
}

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

/* Main Content */
.main-content {
  min-width: 0;
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
}

.article-header h1 {
  margin-bottom: 1rem;
}

.article-intro {
  font-size: 1.125rem;
  color: var(--color-text-light);
  line-height: 1.8;
}

/* Table of Contents */
.toc {
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.toc-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-secondary);
}

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

.toc-list li {
  margin-bottom: 0.5rem;
}

.toc-list a {
  display: block;
  padding: 0.25rem 0;
}

.toc-list a:hover {
  padding-left: 0.5rem;
}

/* Article Content */
.article-content h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.article-content h3 {
  margin-top: 2rem;
  color: var(--color-primary);
}

.article-content p {
  text-align: left;
}

/* Hero Images */
.hero-image {
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-image figcaption {
  background-color: var(--color-bg-alt);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text-light);
  font-style: italic;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

/* Content Images */
.content-image {
  margin: 1.5rem 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  max-width: 800px;
}

.content-image img {
  width: 100%;
  height: auto;
  display: block;
}

.content-image figcaption {
  background-color: var(--color-bg-alt);
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-light);
  font-style: italic;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

/* FAQ Section */
.faq-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--color-border);
}

.faq-item {
  margin-bottom: 1.5rem;
}

.faq-question {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-secondary);
  margin-bottom: 0.5rem;
}

.faq-answer {
  color: var(--color-text-light);
}

/* Related Pages */
.related-section {
  margin-top: 3rem;
  padding: 1.5rem;
  background-color: var(--color-bg-alt);
  border-radius: 8px;
}

.related-section h3 {
  margin-top: 0;
}

.related-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
}

.related-list a {
  display: block;
  padding: 0.5rem 0;
}

.related-list a::before {
  content: "→ ";
  color: var(--color-primary);
}

/* CTA Box */
.cta-box {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  padding: 2rem;
  border-radius: 8px;
  margin: 3rem 0;
  text-align: center;
}

.cta-box h3 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.cta-box p {
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.cta-button {
  display: inline-block;
  background-color: var(--color-accent);
  color: white;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.125rem;
  padding: 1rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  transition: var(--transition);
}

.cta-button:hover {
  background-color: var(--color-accent-hover);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Sidebar */
.sidebar {
  min-width: 0;
}

.sidebar-sticky {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
}

.sidebar-widget {
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sidebar-widget h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
}

.sidebar-nav li {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-nav li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sidebar-nav a {
  font-weight: 600;
}

/* Footer */
.footer {
  background-color: var(--color-footer);
  color: #bdc3c7;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h4 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

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

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #bdc3c7;
}

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

.footer-disclaimer {
  max-width: var(--max-width);
  margin: 2rem auto 0;
  padding: 1.5rem 1rem 0;
  border-top: 1px solid #34495e;
  font-size: 0.875rem;
  text-align: center;
}

.footer-disclaimer p {
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .article-intro {
    font-size: 1rem;
  }
  
  .main-container {
    padding: 1rem;
  }
  
  .toc {
    padding: 1rem;
  }
  
  .cta-box {
    padding: 1.5rem;
  }
  
  .cta-button {
    display: block;
    text-align: center;
  }
}

/* Utility Classes */
.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;
}

.text-center {
  text-align: center;
}

.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

/* ============================================
   Related Content Widgets - Internal Linking
   ============================================ */

.related-widget {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  border-left: 4px solid #667eea;
}

.related-widget h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #1a5f7a;
  font-size: 1.1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  text-decoration: none;
  color: #495057;
  font-size: 0.9rem;
  transition: all 0.2s;
  border: 1px solid #e9ecef;
}

.related-item:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
  transform: translateY(-2px);
}

/* Category-specific colors */
.related-widget.medical { border-left-color: #e74c3c; }
.related-widget.medical h4 { color: #c0392b; }
.related-widget.medical .related-item:hover { background: #e74c3c; border-color: #e74c3c; }

.related-widget.legal { border-left-color: #f39c12; }
.related-widget.legal h4 { color: #d35400; }
.related-widget.legal .related-item:hover { background: #f39c12; border-color: #f39c12; }

.related-widget.types { border-left-color: #9b59b6; }
.related-widget.types h4 { color: #8e44ad; }
.related-widget.types .related-item:hover { background: #9b59b6; border-color: #9b59b6; }

.related-widget.state { border-left-color: #3498db; }
.related-widget.state h4 { color: #2980b9; }
.related-widget.state .related-item:hover { background: #3498db; border-color: #3498db; }

.related-widget.industry { border-left-color: #1abc9c; }
.related-widget.industry h4 { color: #16a085; }
.related-widget.industry .related-item:hover { background: #1abc9c; border-color: #1abc9c; }

.related-widget.veterans { border-left-color: #27ae60; }
.related-widget.veterans h4 { color: #1e8449; }
.related-widget.veterans .related-item:hover { background: #27ae60; border-color: #27ae60; }

.related-widget.support { border-left-color: #e91e63; }
.related-widget.support h4 { color: #c2185b; }
.related-widget.support .related-item:hover { background: #e91e63; border-color: #e91e63; }

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

  /* Ad slots removed */
}

/* ============================================
   Accessibility Improvements
   ============================================ */

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #1a5f7a;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 10000;
  font-weight: 600;
}

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

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* Remove focus outline for mouse users, keep for keyboard */
.js-focus-visible :focus:not(.focus-visible) {
  outline: none;
}

/* Ensure sufficient color contrast */
.nav-link:focus,
.logo:focus {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* Related item focus styles */
.related-item:focus {
  outline: 3px solid #667eea;
  outline-offset: 2px;
  background: #667eea;
  color: white;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #003366;
    --color-text: #000000;
    --color-border: #000000;
  }
  
  a:focus,
  button:focus {
    outline: 3px solid #000000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   E-E-A-T Medical Review Badges
   ============================================ */

.medical-review-box {
  margin-top: 3rem;
  padding: 1.5rem;
  background: #e8f5e9;
  border-radius: 8px;
  border-left: 4px solid #27ae60;
}

.medical-review-box .review-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.medical-review-box .review-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.medical-review-box h4 {
  margin: 0 0 0.5rem 0;
  color: #2e7d32;
}

.medical-review-box .reviewer-name {
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
}

.medical-review-box .reviewer-title {
  color: #666;
  margin: 0;
  font-size: 0.9rem;
}

.medical-review-box .review-date {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.legal-review-box {
  margin-top: 3rem;
  padding: 1.5rem;
  background: #fff8e1;
  border-radius: 8px;
  border-left: 4px solid #f39c12;
}

.legal-review-box h4 {
  margin: 0 0 0.5rem 0;
  color: #e65100;
}

.legal-review-box .reviewer-name {
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
}

.legal-review-box .reviewer-title {
  color: #666;
  margin: 0;
  font-size: 0.9rem;
}

/* Blog ad slots - Removed for cleaner UX */

/* Cross-category link boxes */
.cross-category-box {
  margin: 2rem 0;
  padding: 1.5rem;
  border-radius: 8px;
  border: 2px solid;
}

.cross-category-box.legal-cta {
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border-color: #f39c12;
}

.cross-category-box.medical-cta {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-color: #27ae60;
}

.cross-category-box h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.cross-category-box p {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.cross-category-box .cta-link {
  display: inline-block;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  color: white;
}

.cross-category-box.legal-cta .cta-link {
  background: #f39c12;
}

.cross-category-box.legal-cta .cta-link:hover {
  background: #d35400;
  text-decoration: none;
  color: white;
}

.cross-category-box.medical-cta .cta-link {
  background: #27ae60;
}

.cross-category-box.medical-cta .cta-link:hover {
  background: #1e8449;
  text-decoration: none;
  color: white;
}
