/* Campaign API Documentation Styles
 *
 * Matches Campaign Cookbook's real design system (see UPSTREAM_CHANGES.md
 * "Design system, pass 1"/"pass 2"), not a generic docs-site template: the
 * same self-hosted Cinzel/EB Garamond fonts, the same warm "aged leather"
 * dark palette (--premium-*), and the same light-parchment card treatment
 * for read-aloud text that the reading pane itself uses - so a campaign
 * author reading these docs is looking at the same visual language they'll
 * see in the app, not a disconnected W3Schools-style green-and-white theme
 * (what this file replaced).
 */

@import url('../../data/fonts/fonts.css');

:root {
  /* Same palette/token names as renderer/dm-toolkit/dm-reading-pane.css's
     :root - kept in sync deliberately, not just visually similar, so a
     future palette change only has to be made in one place's intent even
     though these are two separate files (a docs site has no build step to
     literally share a CSS file with the packaged app). */
  --premium-gold: #c9a24b;
  --premium-dark: #1c1611;
  --premium-darker: #120e0a;
  --premium-accent: #a8622e;
  --premium-bg: #241c15;
  --premium-card: #2f251b;
  --premium-border: #4a3c2c;
  --premium-text: #e8e1d3;
  --premium-text-dim: #a89a84;

  --parchment-bg: #ece3d0;
  --parchment-bg-alt: #e2d6b8;
  --parchment-ink: #2e2418;
  --parchment-ink-dim: #5c4d38;
  --parchment-border: #c2a876;

  --accent-danger: #b0413e;
  --accent-danger-bg: rgba(176, 65, 62, 0.15);
  --accent-success: #4a8b5c;
  --accent-success-bg: rgba(74, 139, 92, 0.15);
  --accent-info: #3d7a99;
  --accent-info-bg: rgba(61, 122, 153, 0.15);

  --font-display: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-body-serif: 'EB Garamond', Georgia, serif;
  --font-ui: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: var(--font-ui);
  line-height: 1.6;
  color: var(--premium-text);
  background-color: var(--premium-dark);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  height: 140px;
  width: 100%;
  background-color: var(--premium-darker);
  border-bottom: 1px solid var(--premium-border);
  color: var(--premium-text);
  padding: 20px 40px;
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.header h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--premium-gold);
}

.header p {
  font-size: 14px;
  margin-top: 8px;
  color: var(--premium-text-dim);
}

/* Navigation Sidebar */
.sidebar {
  position: fixed;
  top: 140px;
  left: 0;
  width: 240px;
  height: calc(100vh - 140px);
  background-color: var(--premium-darker);
  border-right: 1px solid var(--premium-border);
  overflow-y: auto;
  padding: 20px 0;
}

.sidebar h3 {
  padding: 10px 20px;
  font-size: 12px;
  color: var(--premium-text-dim);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1.5px;
  margin-top: 20px;
}

.sidebar h3:first-child {
  margin-top: 0;
}

.sidebar a {
  display: block;
  padding: 9px 20px;
  color: var(--premium-text);
  text-decoration: none;
  font-size: 14.5px;
  border-left: 3px solid transparent;
  transition: background-color 0.15s, border-color 0.15s;
}

.sidebar a:hover {
  background-color: rgba(201, 162, 75, 0.08);
  border-left-color: var(--premium-border);
}

.sidebar a.active {
  background-color: rgba(201, 162, 75, 0.14);
  border-left-color: var(--premium-gold);
  color: var(--premium-gold);
  font-weight: 600;
}

/* Main Content */
.main-content {
  margin-left: 240px;
  margin-top: 140px;
  padding: 40px;
  max-width: 1200px;
}

.content-wrapper {
  background-color: var(--premium-card);
  border: 1px solid var(--premium-border);
  padding: 40px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* Typography */
h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  color: var(--premium-gold);
  margin-bottom: 12px;
  text-wrap: balance;
}

h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--premium-text);
  margin-top: 40px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--premium-gold);
}

h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--premium-gold);
  margin-top: 30px;
  margin-bottom: 15px;
}

h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--premium-text);
  margin-top: 20px;
  margin-bottom: 10px;
}

p {
  margin-bottom: 15px;
  line-height: 1.8;
  color: var(--premium-text);
}

a {
  color: var(--premium-gold);
}

strong {
  color: var(--premium-text);
}

/* Code Blocks */
.code-block {
  background-color: var(--premium-darker);
  border: 1px solid var(--premium-border);
  border-left: 4px solid var(--premium-gold);
  padding: 20px;
  margin: 20px 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  color: var(--premium-text);
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.code-inline {
  background-color: var(--premium-darker);
  border: 1px solid var(--premium-border);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  color: var(--premium-gold);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14.5px;
}

table th {
  background-color: var(--premium-darker);
  color: var(--premium-gold);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  border: 1px solid var(--premium-border);
}

table td {
  padding: 12px;
  border: 1px solid var(--premium-border);
  color: var(--premium-text);
}

table tr:nth-child(even) td {
  background-color: rgba(255, 255, 255, 0.02);
}

table tr:hover td {
  background-color: rgba(201, 162, 75, 0.06);
}

table code {
  color: var(--premium-gold);
}

/* Notes and Alerts - semantic accents, same tokens as the app's own
   badges (dungeon difficulty, quest status, etc.) rather than arbitrary
   docs-site colors. */
.note {
  background-color: var(--accent-info-bg);
  border-left: 4px solid var(--accent-info);
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: var(--radius-md);
}

.note strong {
  color: #7fc4e8;
}

.tip {
  background-color: var(--accent-success-bg);
  border-left: 4px solid var(--accent-success);
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: var(--radius-md);
}

.tip strong {
  color: #8fd6a3;
}

.warning {
  background-color: var(--accent-danger-bg);
  border-left: 4px solid var(--accent-danger);
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: var(--radius-md);
}

.warning strong {
  color: #e69a97;
}

.success {
  background-color: var(--accent-success-bg);
  border-left: 4px solid var(--accent-success);
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: var(--radius-md);
}

.success strong {
  color: #8fd6a3;
}

/* Examples */
.example {
  background-color: var(--premium-bg);
  border: 1px solid var(--premium-border);
  padding: 20px;
  margin: 20px 0;
  border-radius: var(--radius-md);
}

.example h4 {
  margin-top: 0;
  font-family: var(--font-display);
  color: var(--premium-gold);
}

/* "Result:" text - what a resolved placeholder actually reads like in
   read-aloud prose. Given the real parchment-card treatment
   (dm-reading-pane.css's .opening-crawl/.read-aloud-box) rather than
   generic body text, since that's literally what it looks like at the
   table. */
.example p strong:first-child {
  color: var(--premium-text-dim);
}

.example blockquote,
.result-preview {
  font-family: var(--font-body-serif);
  font-style: italic;
  background: var(--parchment-bg);
  color: var(--parchment-ink);
  border: 1px solid var(--parchment-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 12px 0;
  font-size: 1.05em;
  line-height: 1.7;
}

/* Parameter List */
.param-list {
  list-style: none;
  margin: 20px 0;
}

.param-list li {
  padding: 15px;
  border: 1px solid var(--premium-border);
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background-color: var(--premium-bg);
}

.param-list .param-name {
  font-weight: 600;
  color: var(--premium-gold);
  font-family: 'Courier New', Courier, monospace;
}

.param-list .param-type {
  color: var(--premium-text-dim);
  font-size: 13px;
  margin-left: 10px;
}

.param-list .param-desc {
  margin-top: 8px;
  color: var(--premium-text-dim);
}

/* Navigation Buttons - same hover treatment as the app's own .btn-primary
   (dm-reading-pane.css): lift + gold glow, not a flat color darken. */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--premium-border);
}

.nav-button {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--premium-gold);
  color: var(--premium-darker);
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.nav-button:hover {
  background-color: #e0bf47;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 162, 75, 0.3);
}

.nav-button.disabled {
  background-color: var(--premium-border);
  color: var(--premium-text-dim);
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--premium-text-dim);
}

.breadcrumb a {
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Syntax Highlighting - kept dark/near-black (code reads as code
   regardless of page theme) but re-accented to the gold family instead of
   the old One-Dark blue/purple, so it doesn't clash with everything
   around it. */
.syntax {
  white-space: pre-wrap;
  background-color: var(--premium-darker);
  border: 1px solid var(--premium-border);
  color: #d8cdb8;
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 20px 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.5;
}

.syntax .string {
  color: #a8c98a;
}

.syntax .keyword {
  color: #c9a24b;
}

.syntax .number {
  color: #cf9f6b;
}

.syntax .comment {
  color: #8a7c68;
  font-style: italic;
}

/* Footer */
.footer {
  margin-left: 240px;
  padding: 40px;
  background-color: var(--premium-darker);
  border-top: 1px solid var(--premium-border);
  color: var(--premium-text-dim);
  text-align: center;
  margin-top: 40px;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 20px;
  }

  .content-wrapper {
    padding: 20px;
  }

  .footer {
    margin-left: 0;
  }
}

/* Try It Yourself Section */
.try-it {
  background-color: var(--premium-bg);
  border: 1px solid var(--premium-gold);
  padding: 20px;
  margin: 20px 0;
  border-radius: var(--radius-md);
}

.try-it h4 {
  margin-top: 0;
  font-family: var(--font-display);
  color: var(--premium-gold);
}

.try-it textarea {
  width: 100%;
  min-height: 150px;
  padding: 10px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  background: var(--premium-darker);
  color: var(--premium-text);
  border: 1px solid var(--premium-border);
  border-radius: var(--radius-md);
  margin-top: 10px;
}

.try-it button {
  margin-top: 10px;
  padding: 10px 20px;
  background-color: var(--premium-gold);
  color: var(--premium-darker);
  border: none;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.try-it button:hover {
  background-color: #e0bf47;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 162, 75, 0.3);
}
