@charset "UTF-8";
:root {
  /* Light theme colors - refined palette */
  --bg-primary: #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-tertiary: #f6f8fa;
  --bg-hover: #eef0f3;
  --bg-active: rgba(9, 105, 218, 0.08);
  --bg-hover-active: rgba(9, 105, 218, 0.05);
  --text-primary: #1f2328;
  --text-secondary: #656d76;
  --text-tertiary: #8c959f;
  --text-muted: #6e7781;
  --border-primary: #d8dee4;
  --border-secondary: #d0d7de;
  --border-tertiary: #e8ecef;
  --accent-primary: #0969da;
  --accent-hover: rgba(9, 105, 218, 0.7);
  --shadow-sm: 0 1px 3px rgba(31, 35, 40, 0.12);
  --shadow-md: 0 2px 8px rgba(31, 35, 40, 0.12);
  --shadow-lg: 0 4px 12px rgba(31, 35, 40, 0.15);
  --shadow-xl: 0 6px 20px rgba(31, 35, 40, 0.1);
  --shadow-card: 0 8px 24px rgba(31, 35, 40, 0.2);
  --code-bg: #f6f8fa;
  --code-text: #d73a49;
  --search-bg: #f6f8fa;
  --search-border-focus: rgba(9, 105, 218, 0.15);
  --content-match-bg: rgba(34, 139, 34, 0.08);
  --content-match-hover: rgba(34, 139, 34, 0.12);
  --content-match-text: #1a7f37;
}

[data-theme=dark] {
  /* Dark theme colors - refined palette with better contrast */
  --bg-primary: #1c2128;
  --bg-secondary: #161b22;
  --bg-tertiary: #262c36;
  --bg-hover: #2f3540;
  --bg-active: rgba(88, 166, 255, 0.15);
  --bg-hover-active: rgba(88, 166, 255, 0.08);
  --text-primary: #e6edf3;
  --text-secondary: #b1bac4;
  --text-tertiary: #7d8590;
  --text-muted: #6e7681;
  --border-primary: #373e47;
  --border-secondary: #444c56;
  --border-tertiary: #3d444d;
  --accent-primary: #539bf5;
  --accent-hover: rgba(83, 155, 245, 0.7);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 6px 20px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.7);
  --code-bg: #262c36;
  --code-text: #ff7b72;
  --search-bg: #0d1117;
  --search-border-focus: rgba(83, 155, 245, 0.3);
  --content-match-bg: rgba(70, 149, 74, 0.18);
  --content-match-hover: rgba(70, 149, 74, 0.28);
  --content-match-text: #6bc46d;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Paragraph spacing */
p {
  margin: 0 0 1em 0;
  line-height: 1.6;
}

p:last-child {
  margin-bottom: 0;
}

/* Paragraph spacing */
p {
  margin: 0 0 1em 0;
  line-height: 1.6;
}

p:last-child {
  margin-bottom: 0;
}

/* Layout */
.container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  height: 100vh;
  position: fixed;
  overflow-y: auto;
  overflow-x: visible;
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-header {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border-primary);
  overflow: visible;
  position: relative;
  transition: border-color 0.3s ease;
}

.logo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.logo {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s ease;
}

.logo-arrow {
  color: var(--text-secondary);
  font-size: 10px;
  transition: color 0.3s ease;
}

.version-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 8px 0px;
  background: var(--bg-tertiary);
  border: 0px solid var(--border-primary);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.version-selector:hover {
  background: var(--bg-hover);
  border-color: var(--border-secondary);
}

.version-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.version-label span {
  color: var(--text-tertiary);
}

.version-label strong {
  color: var(--text-primary);
  font-weight: 500;
}

.version-arrow {
  color: var(--text-tertiary);
  font-size: 10px;
}

.version-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 200px;
  background: var(--bg-primary);
  border: 2px solid var(--accent-primary);
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  z-index: 9999;
}

.version-option {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.version-option:hover {
  background: var(--bg-tertiary);
}

.version-option:first-child {
  border-radius: 6px 6px 0 0;
}

.version-option:last-child {
  border-radius: 0 0 6px 6px;
}

.version-option:only-child {
  border-radius: 6px;
}

.sidebar-content {
  padding: 20px 0;
}

.search-box {
  margin: 0 20px 20px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 8px 60px 8px 32px;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  font-size: 13px;
  background: var(--search-bg);
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px var(--search-border-focus);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 14px;
}

.search-shortcut {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--code-bg);
  border: 1px solid var(--border-secondary);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Mono", Monaco, Inconsolata, "Roboto Mono", Consolas, "Courier New", monospace;
  color: var(--text-secondary);
  line-height: 1;
  font-weight: 500;
  opacity: 0.7;
  transition: opacity 0.15s ease;
  user-select: none;
  pointer-events: none;
}

.search-input:focus + .search-shortcut {
  opacity: 0;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 24px;
  margin-top: 12px;
}

.sidebar-item {
  padding: 6px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  font-size: 14px;
  transition: all 0.15s ease;
  position: relative;
}

.sidebar-item:hover {
  color: var(--accent-primary);
  background: var(--bg-hover-active);
}

.sidebar-item.active {
  color: var(--accent-primary);
  background: var(--bg-active);
  font-weight: 500;
}

.sidebar-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-primary);
}

.sidebar-item.content-match {
  position: relative;
  background: var(--content-match-bg);
  color: var(--content-match-text);
}

.sidebar-item.content-match:hover {
  background: var(--content-match-hover);
  color: var(--content-match-text);
}

.sidebar-item.content-match::after {
  content: "📄";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.7;
}

/* Main Content */
.main-content {
  margin-left: 240px;
  align-items: center;
  flex: 1;
  padding: 64px 120px 120px 120px;
  max-width: 1200px;
}

.content-wrapper {
  position: relative;
}

.content-wrapper img:not(.region-card-image) {
  max-width: 100% !important;
}

h1 {
  font-size: 48px;
  font-weight: 400;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

h2 {
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 0px;
  margin-top: 24px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

h3 {
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 0px;
  margin-top: 18px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

h4 {
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 0px;
  margin-top: 12px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.intro-text {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.6;
  font-weight: 400;
}

.sub-text {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 48px;
  line-height: 1.6;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
}

.section-title {
  color: var(--text-primary);
}

.view-all {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-all:hover {
  opacity: 0.7;
}

/* Region Cards */
.regions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 56px;
}

.region-card {
  position: relative;
  height: 320px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  display: block;
  text-decoration: none;
  color: inherit;
}

.region-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
  border-color: var(--border-secondary);
}

.region-card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.region-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
  padding: 24px;
  padding-top: 60px;
}

.region-card-title {
  color: white;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.region-card-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.region-card-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.4;
}

/* Model Cards */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 56px;
}

.model-card {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 32px;
  border: 1px solid var(--border-primary);
  transition: all 0.25s ease;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
}

[data-theme=dark] .model-card {
  background: var(--bg-tertiary);
  border-color: var(--border-secondary);
}

.model-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
  border-color: var(--border-secondary);
}

[data-theme=dark] .model-card:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

.model-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  position: relative;
}

.model-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Dark mode icon switching for PCM */
.pcm-icon-dark {
  display: none;
}

[data-theme=dark] .pcm-icon-light {
  display: none;
}

[data-theme=dark] .pcm-icon-dark {
  display: block;
}

/* Dark mode icon switching for Dispatch */
.dispatch-icon-dark {
  display: none;
}

[data-theme=dark] .dispatch-icon-light {
  display: none;
}

[data-theme=dark] .dispatch-icon-dark {
  display: block;
}

/* Dark mode icon switching for CEM */
.cem-icon-dark {
  display: none;
}

[data-theme=dark] .cem-icon-light {
  display: none;
}

[data-theme=dark] .cem-icon-dark {
  display: block;
}

/* 3D cube icon for Production Cost Model */
.icon-cube {
  width: 100%;
  height: 100%;
  position: relative;
}

.cube-face {
  position: absolute;
  width: 28px;
  height: 28px;
  background: #ff9500;
  opacity: 0.9;
}

.cube-top {
  transform: rotate(45deg) skewX(-15deg) skewY(-15deg);
  top: 8px;
  left: 18px;
  background: #ffb143;
}

.cube-left {
  transform: skewY(45deg);
  top: 22px;
  left: 4px;
  background: #ff9500;
}

.cube-right {
  transform: skewY(-45deg);
  top: 22px;
  left: 32px;
  background: #e68600;
}

/* Dispatch Model Icon */
.icon-dispatch {
  width: 100%;
  height: 100%;
  position: relative;
}

.dispatch-grid {
  position: absolute;
  width: 32px;
  height: 32px;
  border: 3px solid #007aff;
  top: 16px;
  left: 16px;
}

.dispatch-bar {
  position: absolute;
  bottom: 0;
  width: 6px;
  background: #34c759;
}

.dispatch-bar-1 {
  left: 3px;
  height: 18px;
}

.dispatch-bar-2 {
  left: 13px;
  height: 26px;
  background: #007aff;
}

.dispatch-bar-3 {
  left: 23px;
  height: 10px;
}

/* Content Links */
.content-wrapper a:not(.model-card):not(.region-card):not(.pagination-link) {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: all 0.15s ease;
}

.content-wrapper a:not(.model-card):not(.region-card):not(.pagination-link):hover {
  border-bottom-color: var(--accent-primary);
}

/* External link indicator (optional) */
.content-wrapper a[href^=http]:not([href*="modoenergy.com"])::after {
  content: " ↗";
  font-size: 0.8em;
  opacity: 0.6;
}

.model-card-title {
  margin-bottom: 12px;
  color: var(--text-primary);
  transition: color 0.25s ease, font-weight 0.25s ease;
}

/* Hover effect for all titles in white model cards (not region cards) */
.model-card:hover .model-card-title,
.model-card:hover h3,
.model-card:hover h4 {
  color: #4B2BB5;
}

/* Ensure titles in model cards have transition */
.model-card h3,
.model-card h4 {
  transition: color 0.25s ease, font-weight 0.25s ease;
}

/* Dark mode: bold on hover instead of color change */
[data-theme=dark] .model-card:hover .model-card-title,
[data-theme=dark] .model-card:hover h3,
[data-theme=dark] .model-card:hover h4 {
  color: var(--text-primary);
  font-weight: 600;
}

.model-card-description {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.model-card-detail {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.7;
}

/* Lists */
ul, ol {
  margin: 16px 0;
  padding-left: 24px;
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

li {
  margin: 8px 0;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Nested lists */
ul ul, ol ol, ul ol, ol ul {
  margin: 4px 0;
  padding-left: 20px;
}

ul ul {
  list-style-type: circle;
}

ul ul ul {
  list-style-type: square;
}

/* List spacing for better readability */
li p {
  margin: 4px 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: var(--bg-primary);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-primary);
}

thead {
  background: var(--bg-tertiary);
}

th {
  padding: 16px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-primary);
  position: relative;
}

th:not(:last-child) {
  border-right: 1px solid var(--border-primary);
}

td {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-tertiary);
  vertical-align: top;
  line-height: 1.5;
}

td:not(:last-child) {
  border-right: 1px solid var(--border-tertiary);
}

/* Zebra striping for better readability */
tbody tr:nth-child(even) {
  background: var(--search-bg);
}

tbody tr:hover {
  background: var(--code-bg);
  transition: background-color 0.15s ease;
}

/* Last row styling */
tbody tr:last-child td {
  border-bottom: none;
}

/* Table links */
table a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

table a:hover {
  text-decoration: underline;
}

/* Responsive table wrapper */
.table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.table-wrapper table {
  margin: 0;
  box-shadow: none;
  border-radius: 0;
}

/* Small tables (2-3 columns) */
table.small-table {
  max-width: 600px;
}

/* Large tables with many columns */
@media (max-width: 768px) {
  table {
    font-size: 13px;
  }
  th, td {
    padding: 12px 16px;
  }
  .table-wrapper {
    border-radius: 6px;
  }
}
/* Table captions */
caption {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
}

/* Code in tables */
table code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--code-text);
  border: 1px solid var(--border-primary);
}

/* Images and GIFs - only apply to content images, not card images */
.main-content .content-wrapper > img,
.main-content .content-wrapper > p img,
.main-content .content-wrapper > div:not(.regions-grid):not(.models-grid) img:not(.region-card-image) {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 32px 0;
  background: var(--bg-primary);
  display: block;
}

img.content-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 32px 0;
  background: var(--bg-primary);
  display: block;
}

/* Size variations for images */
img.content-image.small {
  max-width: 400px;
  margin: 24px auto;
}

img.content-image.medium {
  max-width: 600px;
  margin: 32px auto;
}

img.content-image.large {
  max-width: 800px;
  margin: 32px auto;
}

img.content-image.full-width {
  max-width: 100%;
  margin: 32px 0;
}

/* Special styling for animated content */
img.content-image.animation {
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
}

/* Responsive image adjustments */
@media (max-width: 768px) {
  img.content-image {
    margin: 24px 0;
    border-radius: 6px;
  }
  img.content-image.small,
  img.content-image.medium,
  img.content-image.large {
    max-width: 100%;
    margin: 24px 0;
  }
}
/* Figure captions for images */
.main-content figure {
  margin: 32px auto;
  text-align: center;
  max-width: 100%;
}

.main-content figure img {
  margin: 0 auto 12px auto;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

figure {
  margin: 32px auto;
  text-align: center;
  max-width: 100%;
}

figure img {
  margin: 0 auto 12px auto;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

figcaption {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 8px;
}

/* Lead paragraph / subtitle styling */
.lead, .subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 4px;
  font-weight: 400;
}

/* Horizontal rule styling - dividers after lead paragraph */
.lead + hr,
.lead + p + hr,
.lead ~ hr:first-of-type {
  border: none;
  height: 1px;
  background: var(--border-primary);
  margin: 0 0 20px 0;
  padding: 0;
}

/* First content after divider should have top padding */
hr + * {
  margin-top: 20px;
}

/* Ensure proper spacing for first paragraph after divider */
hr + p:first-of-type {
  margin-top: 20px;
}

/* Callout / Note boxes */
blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 8px 8px 0;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
}

blockquote p {
  margin: 0;
}

blockquote p + p {
  margin-top: 12px;
}

blockquote strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Info callout variant */
.callout-info {
  background: rgba(9, 105, 218, 0.08);
  border-left-color: var(--accent-primary);
}

[data-theme=dark] blockquote {
  background: var(--bg-hover);
}

/* Centered figure with caption */
figure.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 32px auto;
  max-width: 100%;
}

figure.centered img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

figure.centered figcaption {
  text-align: center;
  margin-top: 12px;
  max-width: 90%;
}

/* At a glance / Key points styling */
.at-a-glance {
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 24px 28px;
  margin: 24px 0;
  border: 1px solid var(--border-tertiary);
}

.at-a-glance h3,
.at-a-glance h4 {
  margin-top: 0;
  margin-bottom: 16px;
  font-weight: 600;
}

.at-a-glance ul {
  margin: 0;
}

.at-a-glance li {
  margin: 6px 0;
}

[data-theme=dark] .at-a-glance {
  background: var(--bg-hover);
}

/* Interactive chart note */
.chart-note {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  margin: 8px 0 16px 0;
  text-align: center;
}

/* Section divider styling */
.section-divider {
  border: none;
  height: 1px;
  background: var(--border-primary);
  margin: 40px 0;
}

/* Math equation styling */
.math-block {
  display: block;
  text-align: center;
  margin: 24px 0;
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  overflow-x: auto;
}

/* Definition list styling */
dl {
  margin: 16px 0;
}

dt {
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 16px;
}

dd {
  margin-left: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.6;
}

/* Compact list for "at a glance" items */
ul.compact {
  margin: 8px 0;
}

ul.compact li {
  margin: 4px 0;
}

/* Emoji icon styling for lists */
li strong:first-child {
  color: var(--text-primary);
}

/* Table improvements - ensure headers are bold */
table th {
  font-weight: 600 !important;
}

/* Overview summary table styling */
table.summary-table {
  max-width: 100%;
}

table.summary-table th {
  background: var(--accent-primary);
  color: white;
}

[data-theme=dark] table.summary-table th {
  background: var(--accent-primary);
}

/* Iframe chart container - centered with better spacing */
.entry iframe,
.main-content iframe,
article iframe,
iframe {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 24px !important;
  margin-bottom: 24px !important;
  border-radius: 8px;
  background: var(--bg-primary);
  width: 100% !important;
  max-width: 900px !important;
}

/* Large iframes (maps, complex charts) should stay full width */
.entry iframe[height="800"],
.entry iframe[height="820"],
.entry iframe[height="1050"],
iframe[height="800"],
iframe[height="820"],
iframe[height="1050"] {
  max-width: 100% !important;
}

/* Centered iframe wrapper */
.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 24px 0;
}

.chart-container iframe {
  margin: 0;
}

/* Contents Navigation */
.contents-nav {
  position: fixed;
  top: 96px;
  right: 120px;
  z-index: 50;
  transition: all 0.3s ease;
  width: 0;
  height: 0;
  overflow: visible;
}

.contents-nav-minimized {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
}

.contents-nav-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  background: transparent;
}

.contents-nav-line {
  width: 20px;
  height: 1.5px;
  background: var(--border-secondary);
  border-radius: 1px;
  transition: background-color 0.2s ease;
}

.contents-nav:hover .contents-nav-line {
  background: var(--accent-primary);
}

.contents-nav-line.active {
  background: var(--accent-primary) !important;
}

.contents-nav-expanded {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--bg-primary);
  min-width: 260px;
  max-width: 420px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 12px 8px 16px 16px;
}

.contents-nav-header {
  display: none;
}

.contents-nav-list {
  padding: 0;
}

.contents-nav-item {
  display: block;
  padding: 4px 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.5;
  transition: all 0.15s ease;
}

.contents-nav-item:hover {
  color: var(--accent-primary);
  background: var(--bg-hover-active);
  border-radius: 4px;
  padding: 4px 8px;
}

.contents-nav-item.active {
  color: var(--accent-primary);
  font-weight: 600;
}

/* Indentation for different heading levels */
.contents-nav-item.level-1 {
  margin-left: 0;
  font-size: 14px;
  font-weight: 600;
}

.contents-nav-item.level-1:hover {
  margin-left: -8px;
}

.contents-nav-item.level-2 {
  margin-left: 8px;
  font-weight: 500;
}

.contents-nav-item.level-2:hover {
  margin-left: 0px;
}

.contents-nav-item.level-3 {
  margin-left: 16px;
  font-size: 12px;
}

.contents-nav-item.level-3:hover {
  margin-left: 8px;
}

.contents-nav-item.level-4 {
  margin-left: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

.contents-nav-item.level-4:hover {
  margin-left: 16px;
}

.contents-nav-item.level-5 {
  margin-left: 32px;
  font-size: 12px;
  color: var(--text-muted);
}

.contents-nav-item.level-5:hover {
  margin-left: 24px;
}

.contents-nav-item.level-6 {
  margin-left: 80px;
  font-size: 12px;
  color: var(--text-muted);
}

.contents-nav-item.level-6:hover {
  margin-left: 72px;
}

/* Responsive */
@media (max-width: 1024px) {
  .main-content {
    padding: 32px 40px;
  }
  .contents-nav {
    top: 48px;
    right: 40px;
  }
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .main-content {
    margin-left: 0;
    padding: 24px 20px;
  }
  h1 {
    font-size: 32px;
  }
  .regions-grid, .models-grid {
    grid-template-columns: 1fr;
  }
  .contents-nav {
    top: 32px;
    right: 20px;
  }
  .contents-nav-expanded {
    max-width: 280px;
  }
}
/* Reduce spacing for last content before pagination */
.entry > *:last-child {
  margin-bottom: 0;
}

/* Reduce spacing for last hr before pagination */
.entry > hr:last-of-type {
  margin-bottom: 16px;
}

/* Page Pagination */
.page-pagination {
  margin-top: 32px;
  padding-top: 0px;
  border-top: 1px solid var(--border-primary);
}

.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
}

.pagination-link {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  background: transparent;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background-color 0.2s ease;
  min-width: 0;
  max-width: 300px;
}

.pagination-link:hover {
  background: var(--bg-hover);
}

.pagination-prev {
  text-align: left;
  align-self: flex-start;
}

.pagination-next {
  text-align: right;
  align-self: flex-end;
  margin-left: auto;
}

.pagination-direction {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: block;
}

.pagination-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: block;
}

/* Responsive pagination */
@media (max-width: 768px) {
  .pagination-container {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  .pagination-link {
    max-width: 100%;
    align-self: stretch;
  }
  .pagination-prev,
  .pagination-next {
    text-align: left;
    margin-left: 0;
  }
}
/* Expandable Sidebar Subsections */
.sidebar-item-parent {
  display: block;
}

.sidebar-item-expandable {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-item-arrow {
  font-size: 10px;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
  display: inline-block;
  min-width: 12px;
  cursor: pointer;
  padding: 2px;
  margin-left: -2px;
}

.sidebar-item-arrow:hover {
  color: var(--accent-primary);
}

.sidebar-item-title {
  flex: 1;
}

.sidebar-subsections {
  margin-left: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.sidebar-subitem {
  padding-left: 48px !important;
  font-size: 13px;
  position: relative;
}

.sidebar-subitem::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 50%;
  width: 4px;
  height: 1px;
  background: var(--border-secondary);
}

.sidebar-subitem:hover::before {
  background: var(--accent-primary);
}

.sidebar-subsubitem {
  padding-left: 68px !important;
  font-size: 12px;
  position: relative;
}

.sidebar-subsubitem::before {
  content: "";
  position: absolute;
  left: 48px;
  top: 50%;
  width: 3px;
  height: 1px;
  background: var(--border-secondary);
}

.sidebar-subsubitem:hover::before {
  background: var(--accent-primary);
}

/* Dark Mode Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  position: relative;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  transform: scale(1.05);
}

.theme-icon {
  width: 18px;
  height: 18px;
  transition: all 0.3s ease;
  position: absolute;
  opacity: 1;
}

.theme-toggle:hover .theme-icon {
  filter: drop-shadow(0 0 4px var(--accent-primary)) brightness(1.3) saturate(1.5);
}

.theme-toggle:active .theme-icon {
  transform: rotate(180deg);
}

/* Scrollbar Styling */
/* Light mode scrollbar (default) */
.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f3f4;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #c1c4c9;
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #a8abad;
}

/* Dark mode scrollbar */
[data-theme=dark] .sidebar::-webkit-scrollbar-track {
  background: #151921;
}

[data-theme=dark] .sidebar::-webkit-scrollbar-thumb {
  background: #3d4556;
  border-radius: 4px;
}

[data-theme=dark] .sidebar::-webkit-scrollbar-thumb:hover {
  background: #4d5566;
}

/* Firefox scrollbar */
.sidebar {
  scrollbar-width: thin;
  scrollbar-color: #c1c4c9 #f1f3f4;
}

[data-theme=dark] .sidebar {
  scrollbar-color: #3d4556 #151921;
}

/* Error Page (404) */
.error-page {
  text-align: center;
  padding: 80px 20px;
}

.error-code {
  font-size: 8em;
  margin: 0;
  color: #586069;
  font-weight: 600;
  line-height: 1;
}

.error-title {
  margin: 30px 0 20px;
  color: #1a1d23;
  font-size: 1.8em;
  font-weight: 500;
}

.error-message {
  font-size: 1.1em;
  color: #586069;
  margin: 0;
  line-height: 1.6;
}

/* Search Results Page */
.search-results-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.search-results-header {
  margin-bottom: 32px;
}

.search-results-header h1 {
  font-size: 32px;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.search-box-wrapper {
  margin-bottom: 20px;
}

.search-query-input {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  background: var(--search-bg);
  color: var(--text-primary);
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.search-query-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px var(--search-border-focus);
}

.search-query-input::placeholder {
  color: var(--text-tertiary);
}

/* Search Filters */
.search-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.filter-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-chip-version {
  background: var(--text-tertiary);
  color: white;
}

.filter-chip-category {
  background: var(--accent-primary);
  color: white;
  text-transform: uppercase;
}

.filter-chip-text {
  user-select: none;
}

.filter-chip-remove {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: all 0.15s ease;
  padding-bottom: 1px;
}

.filter-chip:hover {
  padding-right: 30px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.filter-chip:hover .filter-chip-remove {
  opacity: 1;
}

.filter-chip-remove:hover {
  background: rgba(0, 0, 0, 0.25);
  transform: translateY(-50%) scale(1.1);
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.add-filter-container {
  position: relative;
}

.add-filter-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.add-filter-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.clear-filters-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: white;
  background: var(--code-text);
  border: 1px solid var(--code-text);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.clear-filters-btn:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.filter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  min-width: 200px;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  padding: 8px 0;
}

.filter-dropdown-section {
  padding: 4px 0;
}

.filter-dropdown-section:not(:last-child) {
  border-bottom: 1px solid var(--border-tertiary);
}

.filter-dropdown-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 8px 16px 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-dropdown-options {
  display: flex;
  flex-direction: column;
}

.filter-option {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.filter-option:hover {
  background: var(--bg-hover-active);
  color: var(--accent-primary);
}

.filter-option-category {
  text-transform: uppercase;
}

.search-results-count {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  min-height: 21px;
}

.search-results-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-results-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
  font-size: 16px;
}

.search-result-item {
  display: block;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.search-result-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.search-result-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}

.search-result-version {
  display: inline-block;
  padding: 3px 10px;
  background: var(--text-tertiary);
  color: white;
  border-radius: 12px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.3px;
}

.search-result-category {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-primary);
  color: white;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}

.search-result-breadcrumb {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.search-result-breadcrumb::before {
  content: "›";
  margin: 0 6px;
  color: var(--border-secondary);
}

.search-result-item:hover .search-result-title {
  color: var(--accent-primary);
}

.search-result-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
  max-height: 150px;
  overflow: hidden;
  position: relative;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.search-result-excerpt * {
  max-width: 100% !important;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.search-result-excerpt mark {
  background: var(--content-match-bg);
  color: var(--content-match-text);
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 500;
}

/* Style excerpt content to match main content but scaled down */
.search-result-excerpt h1,
.search-result-excerpt h2,
.search-result-excerpt h3,
.search-result-excerpt h4 {
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.search-result-excerpt h1,
.search-result-excerpt h2 {
  font-size: 18px;
  margin: 12px 0 8px 0;
}

.search-result-excerpt h3,
.search-result-excerpt h4 {
  font-size: 16px;
  margin: 10px 0 6px 0;
}

.search-result-excerpt h1:first-child,
.search-result-excerpt h2:first-child,
.search-result-excerpt h3:first-child,
.search-result-excerpt h4:first-child,
.search-result-excerpt p:first-child {
  margin-top: 0;
}

.search-result-excerpt p {
  margin: 8px 0;
  line-height: 1.6;
}

.search-result-excerpt p:last-child {
  margin-bottom: 0;
}

.search-result-excerpt ul,
.search-result-excerpt ol {
  margin: 8px 0;
  padding-left: 24px;
}

.search-result-excerpt li {
  margin: 4px 0;
  line-height: 1.6;
}

.search-result-excerpt strong {
  font-weight: 600;
}

.search-result-excerpt code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Mono", Monaco, Inconsolata, "Roboto Mono", Consolas, "Courier New", monospace;
  color: var(--code-text);
  border: 1px solid var(--border-primary);
}

.search-result-url {
  font-size: 13px;
  color: var(--text-tertiary);
  font-family: "Courier New", monospace;
}

/* Pagination Controls */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  padding: 20px;
}

.pagination-btn {
  min-width: 40px;
  height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.pagination-numbers {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pagination-number {
  min-width: 40px;
}

.pagination-ellipsis {
  padding: 8px 4px;
  color: var(--text-tertiary);
  font-size: 14px;
}

.pagination-first,
.pagination-last,
.pagination-prev,
.pagination-next {
  font-size: 18px;
  font-weight: 600;
}

/* Responsive adjustments for search page */
@media (max-width: 768px) {
  .search-results-page {
    padding: 24px 16px;
  }
  .search-results-header h1 {
    font-size: 24px;
    margin-bottom: 16px;
  }
  .search-query-input {
    font-size: 14px;
    padding: 12px 16px;
  }
  .search-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .active-filters {
    order: 2;
    margin-top: 8px;
  }
  .add-filter-container {
    order: 1;
  }
  .search-result-item {
    padding: 16px;
  }
  .search-result-title {
    font-size: 16px;
  }
  .search-result-excerpt {
    font-size: 13px;
  }
  .pagination-controls {
    gap: 4px;
    padding: 16px 0;
  }
  .pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 6px 8px;
    font-size: 13px;
  }
  .pagination-first,
  .pagination-last {
    display: none; /* Hide first/last buttons on mobile */
  }
}

/*# sourceMappingURL=main.css.map */