/* ═══════════════════════════════════════════════════════════════
   Windrose EU Owner's Manual — Service Portal Stylesheet v2
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --hdr-bg: #1a2332;
  --hdr-fg: #f0f4f8;
  --nav-bg: #f5f7fa;
  --nav-border: #dde3ea;
  --nav-active: #0b5ed7;
  --main-bg: #ffffff;
  --text: #222831;
  --text-muted: #5a6577;
  --accent: #0b5ed7;
  --accent-light: #e8f0fe;
  --warning-bg: #fff3cd;
  --warning-border: #e6a817;
  --warning-text: #664d03;
  --notice-bg: #fff3e0;
  --notice-border: #f57c00;
  --notice-text: #7a4100;
  --note-bg: #e3f2fd;
  --note-border: #1976d2;
  --note-text: #0d47a1;
  --env-bg: #e8f5e9;
  --env-border: #43a047;
  --env-text: #1b5e20;
  --table-header: #eef2f7;
  --table-border: #d0d7e0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,.12);
  --radius: 6px;
  --sidebar-w: 300px;
  --header-h: 56px;
  --font-sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: #eef1f5;
}

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--header-h);
  background: var(--hdr-bg);
  color: var(--hdr-fg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  box-shadow: var(--shadow-md);
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-left h1 { font-size: 17px; font-weight: 600; white-space: nowrap; }
.nav-toggle {
  background: transparent; border: 1px solid rgba(255,255,255,.25);
  color: var(--hdr-fg); font-size: 20px; padding: 4px 10px;
  border-radius: 4px; cursor: pointer; display: none;
}
.nav-toggle:hover { background: rgba(255,255,255,.1); }

/* ── Search ────────────────────────────────────────────────── */
.header-search { position: relative; flex: 0 1 440px; }
.header-search input {
  width: 100%; padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  background: rgba(255,255,255,.1);
  color: #fff; font-size: 14px;
  transition: all .2s;
}
.header-search input::placeholder { color: rgba(255,255,255,.5); }
.header-search input:focus {
  outline: none; background: rgba(255,255,255,.15);
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11,94,215,.3);
}
.search-results {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; color: var(--text); border-radius: var(--radius);
  box-shadow: var(--shadow-md); max-height: 420px; overflow-y: auto;
  margin-top: 6px; border: 1px solid var(--nav-border);
}
.sr-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 10px 14px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid #f0f0f0; transition: background .15s;
}
.sr-item:hover { background: var(--accent-light); }
.sr-title { font-weight: 600; flex: 1 1 100%; }
.sr-section { font-size: 12px; color: var(--text-muted); }
.sr-cat {
  font-size: 11px; padding: 1px 8px; border-radius: 10px;
  font-weight: 500; text-transform: uppercase; letter-spacing: .3px;
}
.badge-safety        { background: #fce4ec; color: #b71c1c; }
.badge-procedure     { background: #e3f2fd; color: #0d47a1; }
.badge-charging      { background: #e8f5e9; color: #1b5e20; }
.badge-warning-lamps { background: #fff8e1; color: #e65100; }
.badge-maintenance   { background: #f3e5f5; color: #6a1b9a; }
.badge-technical-data{ background: #e0f2f1; color: #004d40; }
.badge-emergency     { background: #fbe9e7; color: #bf360c; }
.badge-driving-assistance{background:#e8eaf6;color:#283593;}
.badge-controls      { background: #eceff1; color: #37474f; }
.badge-overview      { background: #f5f5f5; color: #424242; }
.badge-troubleshooting{background:#fff3e0;color:#e65100;}
.sr-empty { padding: 20px; text-align: center; color: var(--text-muted); }

/* ── Sidebar / Nav ────────────────────────────────────────── */
.sidebar {
  position: fixed; top: var(--header-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-border);
  overflow-y: auto; overflow-x: hidden;
  z-index: 900;
  transition: transform .25s ease;
}
.sidebar-inner { padding: 12px 0 40px; }

.nav-toc-link {
  padding: 8px 14px; border-bottom: 1px solid var(--nav-border);
}
.nav-toc-link a {
  display: block; padding: 6px 10px;
  background: var(--accent-light); color: var(--accent);
  border-radius: 4px; text-decoration: none;
  font-size: 13px; font-weight: 600; text-align: center;
  transition: background .15s;
}
.nav-toc-link a:hover { background: #d0e3ff; }

.nav-filter { padding: 8px 14px; }
.nav-filter input {
  width: 100%; padding: 6px 10px; border: 1px solid var(--nav-border);
  border-radius: 4px; font-size: 13px; background: #fff;
}
.nav-filter input:focus { outline: none; border-color: var(--accent); }

.nav-chapters { list-style: none; }
.nav-chapter { border-bottom: 1px solid var(--nav-border); }
.nav-chapter-title {
  display: block; padding: 10px 14px; font-weight: 600;
  font-size: 13px; color: var(--text); text-decoration: none;
  text-transform: uppercase; letter-spacing: .4px;
  background: transparent; transition: background .15s;
  cursor: pointer;
}
.nav-chapter-title:hover { background: rgba(11,94,215,.06); }
.nav-chapter-title::before {
  content: "▸"; display: inline-block; margin-right: 6px;
  transition: transform .2s; font-size: 11px;
}
.nav-sections.expanded + .nav-chapter-title::before,
.nav-chapter-title:has(+ .nav-sections.expanded)::before {
  transform: rotate(90deg);
}

.nav-sections {
  list-style: none; max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
}
.nav-sections.expanded { max-height: 4000px; }
.nav-sections li a {
  display: block; padding: 5px 14px 5px 28px;
  font-size: 13px; color: var(--text-muted); text-decoration: none;
  border-left: 3px solid transparent; transition: all .15s;
}
.nav-sections li a:hover { color: var(--accent); background: rgba(11,94,215,.04); }
.nav-sections li a.active {
  color: var(--accent); font-weight: 600;
  border-left-color: var(--accent); background: var(--accent-light);
}
.nav-l3 a { padding-left: 40px !important; font-size: 12.5px !important; }
.nav-l4 a { padding-left: 52px !important; font-size: 12px !important; }

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 24px 32px 60px;
  max-width: 960px;
  background: var(--main-bg);
  min-height: calc(100vh - var(--header-h));
}

/* ── Sections ──────────────────────────────────────────────── */
.manual-section {
  padding: 20px 0 12px;
  border-bottom: 1px solid #eee;
}
.manual-section:target {
  animation: highlight 1.5s ease;
}
@keyframes highlight {
  0%   { background: var(--accent-light); }
  100% { background: transparent; }
}

/* ── Preamble ──────────────────────────────────────────────── */
.preamble-section blockquote {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  border-radius: var(--radius);
  margin: 12px 0;
}

/* ── TOC Page Images ───────────────────────────────────────── */
.toc-section {
  text-align: center;
  padding-bottom: 24px;
}
.toc-section h1 { text-align: left; }
.toc-page-img {
  max-width: 100% !important;
  max-height: none !important;
  width: 100%;
  border: 1px solid var(--table-border);
  border-radius: var(--radius);
  margin: 8px 0;
  box-shadow: var(--shadow-sm);
}

/* ── Typography ──────────────────────────────────────────── */
h1 { font-size: 24px; font-weight: 700; color: var(--hdr-bg); margin: 8px 0 12px; padding-bottom: 8px; border-bottom: 3px solid var(--accent); }
h2 { font-size: 20px; font-weight: 600; color: #2c3e50; margin: 6px 0 10px; }
h3 { font-size: 17px; font-weight: 600; color: #34495e; margin: 4px 0 8px; }
h4 { font-size: 15px; font-weight: 600; color: #4a5568; margin: 4px 0 6px; }
p  { margin: 6px 0; }
blockquote {
  margin: 6px 0; padding: 0;
  border: none;
}

/* ── Lists ─────────────────────────────────────────────── */
ul, ol { margin: 8px 0; padding-left: 28px; }
li { margin: 4px 0; }
li > p { margin: 2px 0; }

/* ── Tables ────────────────────────────────────────────────── */
table {
  width: 100%; border-collapse: collapse;
  margin: 12px 0; font-size: 14px;
  box-shadow: var(--shadow-sm); border-radius: var(--radius);
  overflow: hidden;
}
thead th, thead td {
  background: var(--table-header); padding: 10px 12px;
  text-align: left; font-weight: 600; font-size: 13px;
  border-bottom: 2px solid var(--accent);
  white-space: nowrap;
}
td, th {
  padding: 8px 12px; border-bottom: 1px solid var(--table-border);
  vertical-align: top;
}
tr:nth-child(even) > td { background: #fafbfc; }
tr:hover > td { background: var(--accent-light); }

/* Gradeability tables — keep text wrapping for long cell content */
table td[rowspan], table th[rowspan] {
  vertical-align: middle;
  font-weight: 600;
}

/* ── Images & Figures ──────────────────────────────────────── */
.manual-img {
  max-width: 100%; height: auto;
  border-radius: 4px;
}
figure { margin: 12px 0; text-align: center; }
figcaption {
  font-size: 13px; color: var(--text-muted);
  margin-top: 6px; font-style: italic;
}

/* Icons (small inline indicator images) */
img[src*="image5.png"],
img[src*="image6.png"],
img[src*="image7.png"],
img[src*="image8.png"] {
  width: 16px; height: 16px;
  vertical-align: middle; display: inline;
  margin-right: 4px;
}
img[src*="image9."],
img[src*="image10."],
img[src*="image11."],
img[src*="image12."] {
  width: 20px; height: 20px;
  vertical-align: middle; display: inline;
}
p > img:only-child:not(.toc-page-img) {
  display: block; margin: 10px auto;
  max-width: 680px;
}
img:not(.toc-page-img) { max-height: 600px; }

/* ── Callout Boxes ─────────────────────────────────────────── */
.callout {
  margin: 12px 0; padding: 12px 16px;
  border-left: 4px solid; border-radius: var(--radius);
  font-size: 14px;
}
.callout-title {
  font-weight: 700; font-size: 13px; text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 4px;
}
.callout-body { margin: 0; }
.callout.warning {
  background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text);
}
.callout.notice {
  background: var(--notice-bg); border-color: var(--notice-border); color: var(--notice-text);
}
.callout.note {
  background: var(--note-bg); border-color: var(--note-border); color: var(--note-text);
}
.callout.env-protection {
  background: var(--env-bg); border-color: var(--env-border); color: var(--env-text);
}

/* ── Back to Top ───────────────────────────────────────────── */
.back-to-top {
  display: inline-block; margin-top: 8px;
  font-size: 12px; color: var(--text-muted);
  text-decoration: none; opacity: .5;
  transition: opacity .2s;
}
.back-to-top:hover { opacity: 1; color: var(--accent); }

/* ── Links ─────────────────────────────────────────────────── */
a { color: var(--accent); }
a:hover { text-decoration: underline; }

/* ── Underline utility (chapter breadcrumbs from Word) ─────── */
u { text-decoration: none; font-weight: 600; color: var(--text-muted); font-size: 12px; letter-spacing: .3px; text-transform: uppercase; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-md); }
  .main-content { margin-left: 0; padding: 16px 18px 40px; }
  .header-left h1 { font-size: 14px; }
  .header-search { flex: 0 1 240px; }
  table { font-size: 13px; display: block; overflow-x: auto; }
}
@media (max-width: 600px) {
  .header-search { flex: 0 1 160px; }
  .header-search input { font-size: 13px; padding: 6px 10px; }
  .main-content { padding: 12px 12px 30px; }
  h1 { font-size: 20px; }
  h2 { font-size: 17px; }
}

/* ── Print ─────────────────────────────────────────────────── */
@media print {
  .site-header, .sidebar, .back-to-top, .nav-toggle { display: none !important; }
  .main-content { margin: 0; padding: 0; max-width: 100%; }
  .manual-section { page-break-inside: avoid; border: none; }
  table { page-break-inside: avoid; }
  img { max-width: 100% !important; max-height: none !important; }
  body { font-size: 11pt; background: #fff; }
  .toc-page-img { page-break-after: always; }
}

/* ── RTL overrides for Hebrew ── */
body { direction: rtl; }
.sidebar { right: auto; left: 0; border-right: none; border-left: 1px solid var(--border, #ddd); }
.main-content { margin-left: 0; margin-right: var(--sidebar-width, 280px); }
.nav-chapters { padding-right: 0; padding-left: 1rem; }
.chapter-body { direction: rtl; text-align: right; }
@media (max-width: 768px) {
  .main-content { margin-right: 0; }
}


/* ===== ADAS / self-driving functions — hidden ===== */
/* Sections */
section#adaptive-cruise-control-acc,
section#automatic-emergency-braking-aeb,
section#lane-departure-warning-ldw,
section#blind-spot-information-system-bsis,
section#addw,
section#intelligent-speed-assistance-isa { display: none !important; }

/* Sidebar nav items */
li.nav-chapter:has(> a[href="#adaptive-cruise-control-acc"]),
li.nav-chapter:has(> a[href="#automatic-emergency-braking-aeb"]),
li.nav-chapter:has(> a[href="#lane-departure-warning-ldw"]),
li.nav-chapter:has(> a[href="#blind-spot-information-system-bsis"]),
li.nav-chapter:has(> a[href="#addw"]),
li.nav-chapter:has(> a[href="#intelligent-speed-assistance-isa"]) { display: none !important; }
/* ================================================== */

/* ===== Nav group headers ===== */
li.nav-group-header {
  list-style: none;
  padding: 14px 16px 3px;
  margin-top: 6px;
  border-top: 1px solid var(--border, #ddd);
  pointer-events: none;
}
li.nav-group-header:first-of-type { border-top: none; margin-top: 0; }
li.nav-group-header span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #888);
}
/* ============================== */
