/* ==========================================================================
   Wisp Documentation - Modern Custom Theme
   ========================================================================== */

:root {
  --content-max-width: 100%;
  --wisp-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  --wisp-font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  
  --wisp-accent: #6366f1;
  --wisp-accent-hover: #4f46e5;
  --wisp-accent-subtle: rgba(99, 102, 241, 0.08);
  --wisp-card-bg: rgba(0, 0, 0, 0.02);
  --wisp-card-border: rgba(0, 0, 0, 0.08);
  --wisp-inline-code-bg: rgba(0, 0, 0, 0.05);
  --wisp-inline-code-border: rgba(0, 0, 0, 0.08);
  
  --wisp-callout-note: #3b82f6;
  --wisp-callout-tip: #10b981;
  --wisp-callout-warning: #f59e0b;
  --wisp-callout-caution: #ef4444;
}

/* Theme overrides for Dark / Navy */
.navy, .ayu, .coal {
  --wisp-accent: #818cf8;
  --wisp-accent-hover: #a5b4fc;
  --wisp-accent-subtle: rgba(129, 140, 248, 0.12);
  --wisp-card-bg: rgba(255, 255, 255, 0.03);
  --wisp-card-border: rgba(255, 255, 255, 0.08);
  --wisp-inline-code-bg: rgba(255, 255, 255, 0.08);
  --wisp-inline-code-border: rgba(255, 255, 255, 0.12);
}

/* --------------------------------------------------------------------------
   Typography & Content Layout
   -------------------------------------------------------------------------- */

body {
  font-family: var(--wisp-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.content main {
  max-width: none;
  margin-inline: 0;
  line-height: 1.75;
  font-size: 1.18rem;
}

.content h1,
.content h2,
.content h3,
.content h4 {
  letter-spacing: -0.02em;
  font-weight: 650;
  color: inherit;
}

.content h1 {
  font-size: 2.25rem;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--wisp-card-border);
  padding-bottom: 0.5rem;
}

.content h2 {
  font-size: 1.6rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.content h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.content p {
  margin-bottom: 1.25rem;
}

/* --------------------------------------------------------------------------
   Inline Code & Preformatted Blocks
   -------------------------------------------------------------------------- */

code {
  font-family: var(--wisp-font-mono) !important;
}

:not(pre) > code {
  font-size: 0.88em;
  padding: 0.2em 0.4em;
  border-radius: 5px;
  background-color: var(--wisp-inline-code-bg);
  border: 1px solid var(--wisp-inline-code-border);
  font-weight: 500;
}

pre {
  border-radius: 10px !important;
  border: 1px solid var(--wisp-card-border) !important;
  padding: 1rem 1.25rem !important;
  line-height: 1.55 !important;
  font-size: 0.92rem !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

pre code {
  font-size: inherit !important;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.75rem 0;
  border: 1px solid var(--wisp-card-border);
  border-radius: 8px;
  overflow: hidden;
}

.content table th {
  background-color: var(--wisp-card-bg);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--wisp-card-border);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.content table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--wisp-card-border);
  font-size: 0.96rem;
}

.content table tr:last-child td {
  border-bottom: none;
}

.content table tr:nth-child(even) {
  background-color: var(--wisp-card-bg);
}

/* --------------------------------------------------------------------------
   Blockquotes & GitHub-style Callouts ([!NOTE], [!TIP], etc.)
   -------------------------------------------------------------------------- */

.content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--wisp-accent);
  background-color: var(--wisp-card-bg);
  border-radius: 0 8px 8px 0;
  border-top: 1px solid var(--wisp-card-border);
  border-right: 1px solid var(--wisp-card-border);
  border-bottom: 1px solid var(--wisp-card-border);
}

.content blockquote p {
  margin: 0.4rem 0;
}

.content blockquote p:first-child {
  margin-top: 0;
}

.content blockquote p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Mermaid Diagrams
   -------------------------------------------------------------------------- */

.mermaid {
  display: flex;
  justify-content: center;
  background-color: var(--wisp-card-bg);
  border: 1px solid var(--wisp-card-border);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.75rem 0;
}

/* --------------------------------------------------------------------------
   Sidebar & Navigation Polish
   -------------------------------------------------------------------------- */

.sidebar .part-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-fg);
  opacity: 0.6;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.sidebar li.chapter a {
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.sidebar li.chapter a:hover {
  background-color: var(--wisp-accent-subtle);
  color: var(--wisp-accent);
}

.sidebar li.chapter a.active {
  background-color: var(--wisp-accent-subtle);
  color: var(--wisp-accent);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Header & Search Input
   -------------------------------------------------------------------------- */

#searchbar {
  border-radius: 8px;
  border: 1px solid var(--wisp-card-border);
  padding: 0.5rem 0.8rem;
  font-family: var(--wisp-font-sans);
}
