/* ============================================================
   Surface Water Environmental Monitoring Design Guide
   Shared Stylesheet
   ============================================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  color: #212529;
  background: #fff;
  line-height: 1.6;
}

/* ── Left Sidebar ──────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 280px;
  height: 100vh;
  background: #fff;
  border-right: 1px solid #DEE2E6;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

.sidebar-logo {
  padding: 12px 16px;
  background: #F8F9FA;
  border-bottom: 1px solid #DEE2E6;
  flex-shrink: 0;
  text-align: center;
}

.sidebar-logo img {
  max-width: 160px;
  height: auto;
  display: block;
  margin: 0 auto 6px;
}

.sidebar-logo a {
  color: #0D6EFD;
  font-size: 0.8rem;
  text-decoration: none;
}
.sidebar-logo a:hover { text-decoration: underline; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  height: 80px;
  padding: 12px 16px;
  text-decoration: none;
  color: #212529;
  font-size: 0.9rem;
  border-left: 4px solid transparent;
  transition: background 0.15s;
  gap: 16px;
}

.sidebar-nav a:hover { background: #F8F9FA; cursor: pointer; }
.sidebar-nav a.active {
  border-left-color: #0D6EFD;
  background: #F8F9FA;
  font-weight: 600;
  color: #0D6EFD;
}

.sidebar-nav a svg {
  width: 24px; height: 24px;
  flex-shrink: 0;
  stroke: #0D6EFD;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-text { flex: 1; line-height: 1.3; }

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  margin-left: 280px;
  min-height: 100vh;
  background: #fff;
}

.content-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 48px 60px;
}

/* ── Hero Section ──────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0D6EFD 0%, #5DADE2 100%);
  border-radius: 16px;
  padding: 60px 50px;
  margin-bottom: 48px;
  max-width: 1000px;
}

.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 0.875rem;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero h1 {
  color: #fff;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.hero p {
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 680px;
}

.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-primary {
  background: #fff;
  color: #0D6EFD;
  border: none;
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: box-shadow 0.2s;
}
.btn-primary:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.btn-secondary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.7);
  padding: 10px 28px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.15); }

/* ── Chapter Nav Cards ─────────────────────────────────────── */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.chapter-card {
  background: #fff;
  border: 1px solid #DEE2E6;
  border-radius: 8px;
  padding: 15px;
  height: 130px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: #333;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
  overflow: hidden;
}
.chapter-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.chapter-card svg {
  width: 40px; height: 40px;
  stroke: #0D6EFD;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.chapter-card-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chapter-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: #0D6EFD;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Typography ────────────────────────────────────────────── */
h1 { font-size: 2.5rem; font-weight: 700; color: #0D6EFD; margin-bottom: 24px; }
h2 { font-size: 2rem; font-weight: 700; color: #0D6EFD; margin: 40px 0 20px; padding-bottom: 10px; border-bottom: 2px solid #DEE2E6; }
h3 { font-size: 1.5rem; font-weight: 600; color: #0D6EFD; margin: 32px 0 16px; }
h4 { font-size: 1.25rem; font-weight: 600; color: #0D6EFD; margin: 24px 0 12px; }

p { margin-bottom: 1.5rem; line-height: 1.6; color: #212529; }

/* ── Images ────────────────────────────────────────────────── */
.figure-wrap {
  margin: 32px 0;
  text-align: center;
}
.figure-wrap img {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 3/2;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #DEE2E6;
  display: block;
  margin: 0 auto;
}
.figure-caption {
  margin-top: 10px;
  font-size: 0.875rem;
  color: #6C757D;
  font-style: italic;
}

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 24px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #DEE2E6;
  font-size: 0.875rem;
}
thead th {
  background: #F8F9FA;
  color: #212529;
  font-weight: 700;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid #DEE2E6;
}
tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid #DEE2E6;
  color: #212529;
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #F8F9FA; }

/* ── Info/Note Boxes ───────────────────────────────────────── */
.info-box {
  background: #EFF6FF;
  border-left: 4px solid #0D6EFD;
  border-radius: 4px;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.95rem;
}

.warning-box {
  background: #FFF8E1;
  border-left: 4px solid #F59E0B;
  border-radius: 4px;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.95rem;
}

/* ── Lists ─────────────────────────────────────────────────── */
ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
li { margin-bottom: 6px; }

/* ── Section Overview ──────────────────────────────────────── */
.section-overview {
  background: #F8F9FA;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 32px;
}
.section-overview p { margin-bottom: 0; color: #6C757D; }

/* ── Scrollbar ─────────────────────────────────────────────── */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #DEE2E6; border-radius: 2px; }
