/* ============================================================
   axeldoktorn.se — Stylesheet
   Evidensbaserat beslutsstöd vid axelbesvär
   ============================================================ */

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

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  color: #1a202c;
  background-color: #f0fff4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: #2f855a;
  text-decoration: none;
}

a:hover {
  color: #1a6340;
  text-decoration: underline;
}

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

/* --- Container --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background-color: #1a6340;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.logo:hover {
  color: #fff;
  text-decoration: none;
}

.logo span {
  font-weight: 400;
  opacity: 0.8;
}

/* --- Main Nav --- */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
}

/* --- Dropdown --- */
.nav-dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-toggle .arrow {
  font-size: 0.7rem;
  margin-left: 0.15rem;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  padding: 0.5rem 0;
  z-index: 1001;
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: #1a202c;
  font-size: 0.9rem;
}

.dropdown-menu a:hover {
  background-color: #f0fff4;
  color: #2f855a;
  text-decoration: none;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
}

/* --- Menu Toggle (mobile) --- */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
  font-size: 0.85rem;
  color: #718096;
  padding: 0.75rem 0;
}

.breadcrumbs a {
  color: #718096;
}

.breadcrumbs a:hover {
  color: #2f855a;
}

.breadcrumbs span {
  margin: 0 0.4rem;
}

/* ============================================================
   HERO & PAGE TITLE
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #1a6340, #2f855a);
  color: #fff;
  padding: 3rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero .subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.hero .subtext {
  font-size: 0.95rem;
  opacity: 0.75;
}

.page-title {
  background: linear-gradient(135deg, #1a6340, #2f855a);
  color: #fff;
  padding: 2rem 0;
}

.page-title h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.page-title p {
  font-size: 1rem;
  opacity: 0.85;
}

/* ============================================================
   CONTENT SECTIONS
   ============================================================ */
.content-section {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.content-section h2 {
  font-size: 1.5rem;
  color: #1a6340;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #c6f6d5;
}

.content-section h3 {
  font-size: 1.2rem;
  color: #2f855a;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.content-section p {
  margin-bottom: 1rem;
}

.content-section ul,
.content-section ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.content-section li {
  margin-bottom: 0.35rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  border-left: 4px solid #2f855a;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  color: inherit;
}

.card h3 {
  font-size: 1.15rem;
  color: #1a6340;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.95rem;
  color: #4a5568;
  margin: 0;
}

/* ============================================================
   INFO / WARNING / DANGER / EVIDENCE BOXES
   ============================================================ */
.info-box {
  border-left: 4px solid #3182ce;
  background: #ebf8ff;
  padding: 1.25rem 1.5rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1.25rem;
}

.warning-box {
  border-left: 4px solid #d69e2e;
  background: #fffff0;
  padding: 1.25rem 1.5rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1.25rem;
}

.danger-box {
  border-left: 4px solid #e53e3e;
  background: #fff5f5;
  padding: 1.25rem 1.5rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1.25rem;
}

.evidence-box {
  border-left: 4px solid #38a169;
  background: #f0fff4;
  padding: 1.25rem 1.5rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1.25rem;
}

.evidence-box .evidence-grade {
  display: inline-block;
  background: #38a169;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.evidence-box-warning {
  border-left: 4px solid #dd6b20;
  background: #fffaf0;
  padding: 1.25rem 1.5rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1.25rem;
}

.evidence-box-warning .evidence-grade {
  display: inline-block;
  background: #dd6b20;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ============================================================
   REFERENCE LIST
   ============================================================ */
.reference-list {
  list-style: none;
  counter-reset: ref-counter;
  padding-left: 0;
}

.reference-list li {
  counter-increment: ref-counter;
  padding-left: 2.5rem;
  position: relative;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  color: #4a5568;
}

.reference-list li::before {
  content: "[" counter(ref-counter) "]";
  position: absolute;
  left: 0;
  font-weight: 600;
  color: #2f855a;
}

/* ============================================================
   TABLES
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

thead th {
  background: #2f855a;
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
}

tbody td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

tbody tr:hover {
  background-color: #f0fff4;
}

/* --- Test Table --- */
.test-table .sens {
  color: #38a169;
  font-weight: 600;
}

.test-table .spec {
  color: #3182ce;
  font-weight: 600;
}

/* ============================================================
   TRAFFIC LIGHT DOT & LEGEND
   ============================================================ */
.tl-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 0.35rem;
}

.tl-dot.green  { background: #38a169; }
.tl-dot.yellow { background: #d69e2e; }
.tl-dot.red    { background: #e53e3e; }

.legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ============================================================
   CHECKLIST
   ============================================================ */
.checklist {
  list-style: none;
  padding-left: 0;
}

.checklist li {
  padding-left: 1.75rem;
  position: relative;
  margin-bottom: 0.5rem;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #38a169;
  font-weight: 700;
  font-size: 1rem;
}

/* ============================================================
   STEP NUMBER & STEP ROW
   ============================================================ */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: #2f855a;
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.step-row .step-content {
  flex: 1;
}

/* ============================================================
   FLOWCHART (HTML-based)
   ============================================================ */
.flowchart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 1.5rem 0;
}

.fc-node {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-align: center;
  font-size: 0.95rem;
  max-width: 360px;
  width: 100%;
}

.fc-start {
  background: #2f855a;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.6rem 2rem;
}

.fc-decision {
  background: #ebf8ff;
  border: 2px solid #3182ce;
  color: #1a202c;
  transform: none;
  clip-path: none;
  border-radius: 6px;
  font-weight: 600;
}

.fc-action {
  background: #f0fff4;
  border: 2px solid #38a169;
  color: #1a202c;
}

.fc-end-green {
  background: #38a169;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.6rem 2rem;
}

.fc-end-red {
  background: #e53e3e;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.6rem 2rem;
}

.fc-end-yellow {
  background: #d69e2e;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.6rem 2rem;
}

.fc-arrow {
  font-size: 1.5rem;
  color: #a0aec0;
  line-height: 1;
  padding: 0.25rem 0;
}

.fc-branch {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.fc-branch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 200px;
}

.fc-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   SEARCH
   ============================================================ */
.search-wrapper {
  position: relative;
  margin-left: 0.5rem;
}

.search-input {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #fff;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  width: 180px;
  transition: width 0.3s, background-color 0.2s;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.25);
  width: 240px;
}

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  max-height: 320px;
  overflow-y: auto;
  z-index: 1002;
}

.search-results.active {
  display: block;
}

.search-results a {
  display: block;
  padding: 0.6rem 1rem;
  color: #1a202c;
  font-size: 0.9rem;
  border-bottom: 1px solid #f7fafc;
}

.search-results a:hover,
.search-results a.highlighted {
  background: #f0fff4;
  color: #2f855a;
  text-decoration: none;
}

.search-results .no-results {
  padding: 0.75rem 1rem;
  color: #a0aec0;
  font-size: 0.9rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #1a202c;
  color: #cbd5e0;
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.footer-col p {
  font-size: 0.9rem;
  line-height: 1.6;
}

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

.footer-col ul li {
  margin-bottom: 0.35rem;
}

.footer-col ul a {
  color: #a0aec0;
  font-size: 0.9rem;
}

.footer-col ul a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-disclaimer {
  font-size: 0.8rem;
  color: #718096;
  border-top: 1px solid #2d3748;
  padding-top: 1.25rem;
  margin-bottom: 0.75rem;
  text-align: center;
}

.footer-bottom {
  font-size: 0.8rem;
  color: #718096;
  text-align: center;
}

/* ============================================================
   CONTACT BOX
   ============================================================ */
.contact-box {
  background: #fff;
  border: 2px solid #c6f6d5;
  border-radius: 8px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.contact-box h3 {
  color: #1a6340;
  margin-bottom: 0.75rem;
}

/* ============================================================
   FOOTER-INNER (alias for footer-grid layout)
   ============================================================ */
.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}

/* ============================================================
   DISCLAIMER (alias for footer-disclaimer)
   ============================================================ */
.disclaimer {
  font-size: 0.8rem;
  color: #718096;
  border-top: 1px solid #2d3748;
  padding-top: 1.25rem;
  margin: 0 auto 0.75rem;
  max-width: 1100px;
  text-align: center;
}

/* ============================================================
   FC-LINK (flowchart links)
   ============================================================ */
.fc-link {
  color: #2f855a;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.fc-link:hover {
  text-decoration: underline;
}

/* ============================================================
   STEP FLOW (utredning 4-step)
   ============================================================ */
.step-flow {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.step-item .step-content h3 {
  margin: 0 0 0.25rem;
  color: #2f855a;
  font-size: 1.05rem;
}

.step-item .step-content p {
  margin: 0;
  font-size: 0.95rem;
  color: #4a5568;
}

/* ============================================================
   CHECKLIST (remisschecklista)
   ============================================================ */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.checklist-item:last-child {
  border-bottom: none;
}

.check-icon {
  color: #38a169;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1.5;
}

.checklist-item strong {
  color: #1a365d;
}

.checklist-item p {
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
  color: #4a5568;
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px) {

  /* Header */
  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: fixed;
    top: 60px;
    right: 0;
    width: 280px;
    height: calc(100vh - 60px);
    background: #1a6340;
    flex-direction: column;
    padding: 1rem 0;
    overflow-y: auto;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
    gap: 0;
    z-index: 999;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    font-size: 1rem;
  }

  /* Dropdown in mobile */
  .nav-dropdown {
    position: static;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.15);
    display: none;
    padding: 0;
  }

  .nav-dropdown.open .dropdown-menu {
    display: block;
  }

  .dropdown-menu a {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.6rem 2.5rem;
  }

  .dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  /* Hero */
  .hero {
    padding: 2rem 0;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  /* Cards */
  .cards-grid {
    grid-template-columns: 1fr;
  }

  /* Content */
  .content-section {
    padding: 1.25rem;
  }

  /* Footer */
  .footer-grid,
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Search */
  .search-wrapper {
    display: none;
  }

  .search-wrapper.mobile {
    display: block;
    margin: 0.5rem 1rem;
  }

  .search-wrapper.mobile .search-input {
    width: 100%;
  }

  /* Tables */
  table {
    font-size: 0.85rem;
  }

  thead th,
  tbody td {
    padding: 0.5rem 0.65rem;
  }

  /* Flowchart branches */
  .fc-branch {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .fc-branch-item {
    min-width: unset;
    width: 100%;
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .site-header,
  .site-footer,
  .menu-toggle,
  .search-wrapper,
  button {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  .content-section {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .hero,
  .page-title {
    background: #eee !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
