/* =============================================
   analgesia.net — Global Stylesheet
   Aesthetic: Clinical precision meets editorial refinement
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
  --navy:        #0B1F3A;
  --navy-mid:    #163154;
  --teal:        #0D7E6E;
  --teal-light:  #12A08D;
  --teal-pale:   #E6F5F3;
  --amber:       #D4870A;
  --amber-pale:  #FDF4E3;
  --red:         #C0392B;
  --red-pale:    #FDECEC;
  --slate:       #4A5568;
  --slate-light: #718096;
  --border:      #DDE3EC;
  --bg:          #F7F9FC;
  --white:       #FFFFFF;
  --text:        #1A2537;
  --text-muted:  #6B7A8D;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', monospace;
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   14px;
  --shadow-sm:   0 1px 3px rgba(11,31,58,0.08);
  --shadow-md:   0 4px 16px rgba(11,31,58,0.10);
  --shadow-lg:   0 8px 32px rgba(11,31,58,0.13);
  --transition:  0.18s ease;
}

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

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; color: var(--navy); }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; font-family: var(--font-body); font-weight: 600; }
p  { margin-bottom: 1rem; color: var(--slate); line-height: 1.75; }
a  { color: var(--teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--teal-light); }
strong { font-weight: 600; color: var(--text); }
code { font-family: var(--font-mono); font-size: 0.88em; background: #EEF2F7; padding: 2px 6px; border-radius: var(--radius-sm); color: var(--navy-mid); }

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: white;
  letter-spacing: -1px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-text .site-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: white;
  letter-spacing: -0.5px;
}

.logo-text .site-sub {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
}

/* ── NAV ── */
.main-nav { display: flex; align-items: center; gap: 0.25rem; flex: 1; justify-content: center; }

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: white;
  background: rgba(255,255,255,0.1);
}

.nav-link .chevron {
  font-size: 0.7rem;
  transition: transform var(--transition);
}

.nav-item:hover .chevron { transform: rotate(180deg); }

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 100;
}

.nav-item:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 0.6rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.dropdown a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: var(--slate);
  transition: all var(--transition);
}

.dropdown a:hover {
  background: var(--teal-pale);
  color: var(--teal);
  padding-left: 1.25rem;
}

.dropdown a .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-light);
  flex-shrink: 0;
}

.dropdown-divider { height: 1px; background: var(--border); margin: 0.25rem 0; }

/* Pro badge */
.hcp-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(13,126,110,0.2);
  border: 1px solid rgba(13,126,110,0.4);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #7ECFC5;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.hcp-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7ECFC5;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── MOBILE NAV ── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: white;
  font-size: 1.5rem;
  padding: 0.25rem;
}

/* Mobile menu: hidden by default at ALL viewport sizes.
   Only shown when .open is added via JS (mobile only). */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  background: var(--navy);
  overflow-y: auto;
  padding: 1.5rem;
  z-index: 999;
}
.mobile-menu.open { display: block; }

/* ── MAIN CONTENT ── */
main { min-height: unset; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── HERO ── */
.hero {
  background: var(--navy);
  padding: 4rem 2rem 3rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 80% at 70% 50%, rgba(13,126,110,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(13,126,110,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(13,126,110,0.2);
  border: 1px solid rgba(13,126,110,0.4);
  border-radius: 20px;
  padding: 0.35rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #7ECFC5;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  color: white;
  max-width: 700px;
  margin-bottom: 1.25rem;
}

.hero h1 em {
  font-style: italic;
  color: #7ECFC5;
}

.hero-lead {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.65);
  max-width: 600px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--teal-light);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(13,126,110,0.35);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.8);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.5);
  color: white;
}

/* ── SECTION ── */
.section { padding: 4rem 0; }
.section-sm { padding: 2rem 0; }
.section-title { margin-bottom: 0.75rem; }
.section-lead { font-size: 1.1rem; color: var(--slate); max-width: 600px; margin-bottom: 3rem; line-height: 1.8; }
.section-divider { height: 1px; background: var(--border); margin: 3rem 0; }

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--teal-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ── TAGS / BADGES ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-teal  { background: var(--teal-pale);  color: var(--teal); }
.tag-amber { background: var(--amber-pale); color: var(--amber); }
.tag-red   { background: var(--red-pale);   color: var(--red); }
.tag-navy  { background: #E8EDF5; color: var(--navy-mid); }

/* ── TABLE ── */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  background: var(--navy);
  color: rgba(255,255,255,0.85);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--teal-pale); }
tbody td { padding: 0.75rem 1rem; vertical-align: top; color: var(--slate); }
tbody td:first-child { font-weight: 500; color: var(--text); }

/* ── ALERT / CALLOUT ── */
.callout {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.callout-info    { background: #EBF4FF; border-color: #2B7FD4; }
.callout-warning { background: var(--amber-pale); border-color: var(--amber); }
.callout-danger  { background: var(--red-pale); border-color: var(--red); }
.callout-teal    { background: var(--teal-pale); border-color: var(--teal); }

.callout-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 2px; }
.callout p { margin: 0; font-size: 0.9rem; }
.callout strong { display: block; margin-bottom: 0.35rem; }

/* ── DRUG DOSAGE PILL ── */
.drug-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1rem 0;
}

.drug-box-header {
  background: var(--navy);
  color: white;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drug-box-body { padding: 1.25rem; }

/* ── TOC (Table of Contents sidebar) ── */
.toc {
  position: sticky;
  top: 80px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.toc ul { list-style: none; }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  color: var(--slate);
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all var(--transition);
}

.toc a:hover, .toc a.active {
  color: var(--teal);
  background: var(--teal-pale);
  border-left-color: var(--teal);
}

/* ── PAGE WITH SIDEBAR ── */
.page-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem;
  align-items: start;
}

.page-content { min-width: 0; }

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb span { color: var(--border); }

/* ── FOOTER ── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 3.5rem 2rem 2rem;
  margin-top: 0;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .site-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: white;
  margin-bottom: 0.75rem;
}

.footer-brand p { font-size: 0.85rem; color: rgba(255,255,255,0.5); max-width: 280px; }

.footer-col h5 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 1rem;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { font-size: 0.875rem; color: rgba(255,255,255,0.6); transition: color var(--transition); }
.footer-col a:hover { color: #7ECFC5; }

.footer-bottom {
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-copy { font-size: 0.8rem; color: rgba(255,255,255,0.35); }

/* ── LEGAL DISCLAIMER (footer) ── */
.legal-disclaimer {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.65;
  max-width: 700px;
}

.legal-disclaimer strong { color: rgba(255,255,255,0.6); font-weight: 600; }

/* ── INLINE LEGAL NOTICE ── */
.legal-notice-inline {
  background: #FFF8E7;
  border: 1px solid #F0D080;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.82rem;
  color: #6B5A1E;
  line-height: 1.65;
  margin: 2rem 0;
}

.legal-notice-inline strong { color: #4A3D10; }

/* ── REFERENCES ── */
.references {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-top: 3rem;
}

.references h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
}

.references ol {
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.8;
}

.references li { margin-bottom: 0.5rem; }
.references a { color: var(--teal); }

/* ── SOURCE BADGE ── */
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--teal-pale);
  border: 1px solid rgba(13,126,110,0.2);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}

.source-badge:hover { background: var(--teal); color: white; }

/* ── PROSPECT BOX ── */
.prospect-box {
  background: linear-gradient(135deg, var(--teal-pale), #F0FAF8);
  border: 1px solid rgba(13,126,110,0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2rem 0;
}

.prospect-box-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.prospect-logo {
  background: var(--teal);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .page-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
  .header-inner { padding: 0 1.25rem; }
  .main-nav { display: none; }
  .hcp-badge { display: none; }
  .menu-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .container { padding: 0 1.25rem; }
  .container-narrow { padding: 0 1.25rem; }
  .hero { padding: 3rem 1.25rem; }
  .section { padding: 2.5rem 0; }
  .card-grid { grid-template-columns: 1fr; }
  .page-layout { grid-template-columns: 1fr; padding: 2rem 1.25rem; gap: 2rem; }

  .mobile-menu a {
    display: block;
    padding: 0.75rem 0;
    color: rgba(255,255,255,0.75);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-size: 0.95rem;
    transition: color 0.15s, padding-left 0.15s;
  }
  .mobile-menu a:hover {
    color: #7ECFC5;
    padding-left: 0.4rem;
  }
  .mobile-menu .mobile-section {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: rgba(255,255,255,0.3);
    padding: 1.5rem 0 0.4rem;
    border-bottom: none;
  }

  /* Table: allow horizontal scroll on small screens */
  .table-wrapper { -webkit-overflow-scrolling: touch; }

  /* Prospect banner padding reduction */
  .prospect-banner { padding: 1.75rem 1.5rem; }

  /* Legal disclaimer full width */
  .footer-bottom { flex-direction: column; }
  .legal-disclaimer { max-width: 100%; }
}

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── PRINT ── */
@media print {
  .site-header, .site-footer, .toc, .hcp-badge { display: none; }
  body { background: white; }
  .container { max-width: 100%; }
}
