/* Traven Editor Skin - Modern (Teal & Slate)
 * Theme-owned dual-duty SoT for PenCMS theme `modern`.
 * Self-hosted fonts (no Google Fonts CDN).
 */

@font-face {
  font-family: 'Saira Condensed';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/saira-condensed-800.woff2') format('woff2');
}
@font-face {
  font-family: 'Saira Condensed';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/saira-condensed-900.woff2') format('woff2');
}
@font-face {
  font-family: 'Epunda Slab';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/epunda-slab-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Epunda Slab';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/epunda-slab-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Epunda Slab';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/epunda-slab-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Epunda Slab';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/epunda-slab-700-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-700.woff2') format('woff2');
}

:root {
  --traven-font-display: "Saira Condensed", sans-serif;
  --traven-font-body: "Epunda Slab", Georgia, serif;
  --traven-font-mono: "JetBrains Mono", monospace;

  /* Chrome tokens (teal/slate) — shortcode rules remain hard-coded below */
  --traven-bg: #ffffff;
  --traven-text: #18181b;
  --traven-muted: #71717a;
  --traven-border: #d4d4d8;
  --traven-border-light: #e4e4e7;
  --traven-caret: #115e59;
  --traven-h-color: #09090b;
  --traven-code-bg: #f4f4f5;
  --traven-code-border: #e4e4e7;
  --traven-widget-bg: #ffffff;
  --traven-widget-border: #e4e4e7;
  --traven-widget-shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
  --traven-widget-hover-shadow: 0 4px 16px rgba(17, 94, 89, 0.1);
}

html.cm-wysiwym-dark {
  --traven-bg: #0b0f19;
  --traven-text: #f4f4f5;
  --traven-muted: #a1a1aa;
  --traven-border: #3f3f46;
  --traven-border-light: #27272a;
  --traven-caret: #2dd4bf;
  --traven-h-color: #fafafa;
  --traven-code-bg: #121826;
  --traven-code-border: #27272a;
  --traven-widget-bg: #121826;
  --traven-widget-border: #27272a;
  --traven-widget-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --traven-widget-hover-shadow: 0 4px 16px rgba(45, 212, 191, 0.12);
}

/* Main editor layout and Epunda Slab body typography */
.cm-editor {
  font-family: 'Epunda Slab', Georgia, serif !important;
  font-size: 18px !important;
  line-height: 1.35 !important;
  background-color: #ffffff !important;
  color: #18181b !important;
}

.cm-editor:focus,
.cm-editor.cm-focused {
  outline: none !important;
}

.cm-scroller {
  font-family: inherit !important;
  line-height: inherit !important;
  padding: 12px 0 !important;
}

.cm-content {
  padding: 0 24px !important;
}

/* Gutters & Line numbers - JetBrains Mono, borderless, clean layout */
.cm-gutters {
  background-color: transparent !important;
  border-right: none !important;
  color: #a1a1aa !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.82em !important;
  opacity: 0.7;
}

.cm-gutterElement {
  padding: 0 16px 0 8px !important;
}

/* Active line highlighting (Zinc tint) */
.cm-activeLine {
  background-color: rgba(244, 244, 245, 0.75) !important;
}

.cm-activeLineGutter {
  background-color: transparent !important;
  color: #115e59 !important; /* Premium Teal */
  font-weight: 700;
  opacity: 1;
}

/* Selection highlight - sleek translucent teal tint */
.cm-selectionBackground, 
.cm-native-selection {
  background-color: rgba(15, 118, 110, 0.15) !important;
}

.cm-editor.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground {
  background-color: rgba(15, 118, 110, 0.25) !important;
}

/* Token hiding with smooth transition properties */
.cm-token-hidden {
  font-size: 0 !important;
  opacity: 0 !important;
  display: inline-block;
  width: 0;
  overflow: hidden;
  transition: opacity 0.12s cubic-bezier(0.4, 0, 0.2, 1), 
              font-size 0.12s cubic-bezier(0.4, 0, 0.2, 1), 
              width 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Inline Styles */
.cm-wysiwym-bold {
  font-weight: 700;
  color: #09090b;
}

.cm-wysiwym-italic {
  font-style: italic;
  color: #27272a;
}

.cm-wysiwym-strikethrough {
  text-decoration: line-through;
  color: #a1a1aa;
}

/* Highlight text - Inverted colors (no underscore) */
.cm-wysiwym-highlight {
  background-color: #18181b !important;
  color: #ffffff !important;
  font-weight: bold !important;
  border-radius: 4px;
  padding: 1px 4px;
  border-bottom: none !important;
}

/* Inline code pill styling - JetBrains Mono and light zinc border */
.cm-wysiwym-inline-code {
  font-family: 'JetBrains Mono', monospace !important;
  background-color: #f4f4f5;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 500;
  border: 1px solid #e4e4e7;
}

/* Headings style - Saira Condensed Display typography */
.cm-editor .cm-wysiwym-h1, 
.cm-editor .cm-wysiwym-h2, 
.cm-editor .cm-wysiwym-h3, 
.cm-editor .cm-wysiwym-h4, 
.cm-editor .cm-wysiwym-h5, 
.cm-editor .cm-wysiwym-h6 {
  font-family: 'Saira Condensed', sans-serif !important;
  color: #09090b !important;
  letter-spacing: -0.01em !important;
  text-decoration: none;
}

/* Disable underlines on heading text spans from CodeMirror highlight style */
.cm-editor .cmt-heading,
.cm-editor .tok-heading,
.cm-editor .cm-wysiwym-h1 span,
.cm-editor .cm-wysiwym-h2 span,
.cm-editor .cm-wysiwym-h3 span,
.cm-editor .cm-wysiwym-h4 span,
.cm-editor .cm-wysiwym-h5 span,
.cm-editor .cm-wysiwym-h6 span {
  text-decoration: none;
}

.cm-editor .cm-wysiwym-h1 {
  font-size: 2.2em;
  font-weight: 900; /* Requested 900 weight */
  line-height: 1.0 !important;
  padding-top: 18px !important;
  padding-bottom: 8px !important;
  margin: 0 !important;
}

.cm-editor .cm-wysiwym-h2 {
  font-size: 1.7em;
  font-weight: 800; /* Requested 800 weight */
  line-height: 1.05 !important;
  padding-top: 15px !important;
  padding-bottom: 6px !important;
  margin: 0 !important;
}

.cm-editor .cm-wysiwym-h3 {
  font-size: 1.35em;
  font-weight: 800; /* Requested 800 weight */
  line-height: 1.1 !important;
  padding-top: 12px !important;
  padding-bottom: 6px !important;
  margin: 0 !important;
}

.cm-editor .cm-wysiwym-h4 {
  font-size: 1.15em;
  font-weight: 800;
  line-height: 1.2 !important;
  padding-top: 10px !important;
  padding-bottom: 4px !important;
  margin: 0 !important;
}

.cm-editor .cm-wysiwym-h5 {
  font-size: 1.0em;
  font-weight: 800;
  line-height: 1.25 !important;
  padding-top: 8px !important;
  padding-bottom: 4px !important;
  margin: 0 !important;
}

.cm-editor .cm-wysiwym-h6 {
  font-size: 0.9em;
  font-weight: 800;
  line-height: 1.25 !important;
  padding-top: 8px !important;
  padding-bottom: 2px !important;
  margin: 0 !important;
}

/* Blockquotes - Teal vertical side marker pipe */
.cm-editor .cm-wysiwym-blockquote {
  border-left: 4px solid #0f766e;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
  padding-left: 18px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  position: relative;
}

/* First line of a blockquote block gets padding-top */
.cm-editor .cm-wysiwym-blockquote {
  padding-top: 10px !important;
}

/* Subsequent lines of a blockquote block should not have top padding */
.cm-editor .cm-wysiwym-blockquote + .cm-wysiwym-blockquote {
  padding-top: 2px !important;
}

/* Last line of a blockquote block gets padding-bottom */
.cm-editor .cm-wysiwym-blockquote:not(:has(+ .cm-wysiwym-blockquote)) {
  padding-bottom: 10px !important;
}

.cm-editor .cm-wysiwym-blockquote,
.cm-editor .cm-wysiwym-blockquote * {
  font-style: italic;
  color: #4b5563; /* Cool gray */
  line-height: 1.35 !important;
  font-size: 0.95em !important;
  font-family: 'Epunda Slab', Georgia, serif !important;
}

/* GitHub Alerts styling in editor */
.cm-editor .cm-wysiwym-alert,
.cm-editor .cm-wysiwym-alert * {
  font-style: normal !important;
}
.cm-editor .cm-wysiwym-alert-note {
  border-left-color: #3b82f6 !important;
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
}
.cm-editor .cm-wysiwym-alert-note * {
  color: #1d4ed8 !important;
}
.cm-editor .cm-wysiwym-alert-tip {
  border-left-color: #22c55e !important;
  background-color: #f0fdf4 !important;
  color: #15803d !important;
}
.cm-editor .cm-wysiwym-alert-tip * {
  color: #15803d !important;
}
.cm-editor .cm-wysiwym-alert-important {
  border-left-color: #8b5cf6 !important;
  background-color: #f5f3ff !important;
  color: #6d28d9 !important;
}
.cm-editor .cm-wysiwym-alert-important * {
  color: #6d28d9 !important;
}
.cm-editor .cm-wysiwym-alert-warning {
  border-left-color: #f59e0b !important;
  background-color: #fffbeb !important;
  color: #b45309 !important;
}
.cm-editor .cm-wysiwym-alert-warning * {
  color: #b45309 !important;
}
.cm-editor .cm-wysiwym-alert-caution {
  border-left-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  color: #b91c1c !important;
}
.cm-editor .cm-wysiwym-alert-caution * {
  color: #b91c1c !important;
}

/* Reduce blank line spacing immediately before and after blockquotes */
.cm-editor .cm-wysiwym-blockquote:not(:has(+ .cm-wysiwym-blockquote)) + .cm-line:has(br:only-child),
.cm-editor .cm-line:has(br:only-child):has(+ .cm-wysiwym-blockquote) {
  height: 0.4em !important;
  min-height: 0.4em !important;
}

/* Empty Line Collapse Before and After Headings to match HTML Preview spacing */
.cm-editor .cm-line:has(br:only-child):has(+ .cm-wysiwym-h1),
.cm-editor .cm-line:has(br:only-child):has(+ .cm-wysiwym-h2),
.cm-editor .cm-line:has(br:only-child):has(+ .cm-wysiwym-h3),
.cm-editor .cm-line:has(br:only-child):has(+ .cm-wysiwym-h4),
.cm-editor .cm-line:has(br:only-child):has(+ .cm-wysiwym-h5),
.cm-editor .cm-line:has(br:only-child):has(+ .cm-wysiwym-h6),
.cm-editor .cm-wysiwym-h1 + .cm-line:has(br:only-child),
.cm-editor .cm-wysiwym-h2 + .cm-line:has(br:only-child),
.cm-editor .cm-wysiwym-h3 + .cm-line:has(br:only-child),
.cm-editor .cm-wysiwym-h4 + .cm-line:has(br:only-child),
.cm-editor .cm-wysiwym-h5 + .cm-line:has(br:only-child),
.cm-editor .cm-wysiwym-h6 + .cm-line:has(br:only-child) {
  height: 0px !important;
  min-height: 0px !important;
  padding: 0 !important;
}

/* YAML Frontmatter blocks styled with monospace JetBrains Mono */
.cm-wysiwym-frontmatter {
  background-color: #fafafa !important;
  border-left: 4px solid #71717a !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.82em !important;
  padding: 4px 0 4px 16px !important;
  margin: 0 !important;
  opacity: 0.85;
}

.cm-wysiwym-frontmatter,
.cm-wysiwym-frontmatter span {
  color: #71717a !important;
  font-family: inherit !important;
  font-size: inherit !important;
}

.cm-wysiwym-frontmatter-active {
  background-color: #f4f4f5 !important;
  border-left: 4px solid #115e59 !important; /* Active Teal frontmatter */
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.82em !important;
  padding: 4px 0 4px 16px !important;
  margin: 0 !important;
  opacity: 0.9;
}

.cm-wysiwym-frontmatter-active,
.cm-wysiwym-frontmatter-active span {
  color: #27272a !important;
  font-family: inherit !important;
  font-size: inherit !important;
}

/* Horizontal Rules - Modern dashed border rule */
.cm-wysiwym-hr-widget {
  border: 0;
  border-top: 2px dashed #cbd5e1;
  margin: 0 !important;
  padding: 12px 0 !important;
  display: block;
  width: 100%;
}

/* Image container styling */
.cm-wysiwym-image-widget-container,
.cm-wysiwym-image-shortcode-container {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  margin: 0 !important;
  padding: 12px 0;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  background-color: #ffffff;
  transition: box-shadow 0.2s ease;
}

.cm-wysiwym-image-widget-container:hover,
.cm-wysiwym-image-shortcode-container:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.cm-wysiwym-image-preview {
  display: block;
  max-width: 100%;
  max-height: none;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  padding: 10px;
}

.cm-wysiwym-image-caption,
.cm-wysiwym-image-shortcode-container .shortcode-meta {
  font-family: inherit !important;
  font-size: 0.85em;
  color: #71717a;
  padding: 8px 16px;
  border-top: 1px solid #f4f4f5;
  background-color: #fafafa;
  font-weight: 500;
}

.cm-wysiwym-image-shortcode-container .shortcode-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.cm-wysiwym-image-shortcode-container .meta-badge {
  background-color: #e4e4e7;
  color: #27272a;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.82em;
  text-transform: uppercase;
}

.cm-wysiwym-image-shortcode-container .meta-badge.tag-name {
  background-color: #e0e7ff;
  color: #3730a3;
}

.cm-wysiwym-image-shortcode-container.align-left {
  margin: 0 auto 0 0 !important;
}
.cm-wysiwym-image-shortcode-container.align-right {
  margin: 0 0 0 auto !important;
}
.cm-wysiwym-image-shortcode-container.align-center {
  margin: 0 auto !important;
}
.cm-wysiwym-image-shortcode-container.align-fullbleed {
  width: 100% !important;
  margin: 0 !important;
}

.cm-wysiwym-image-shortcode-container.size-small {
  width: 150px;
}
.cm-wysiwym-image-shortcode-container.size-medium {
  width: 300px;
}
.cm-wysiwym-image-shortcode-container.size-large {
  width: 600px;
}

/* Legacy Plain Markdown Image Widget Styling */
.cm-editor .cm-wysiwym-image-widget-container {
  width: 300px !important;
  margin: 0 auto !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.cm-editor .cm-wysiwym-image-widget-container .cm-wysiwym-image-preview {
  padding: 0 !important;
}

.cm-editor .cm-wysiwym-image-widget-container:hover {
  box-shadow: none !important;
}

.cm-editor .cm-wysiwym-image-widget-container .cm-wysiwym-image-caption {
  border-top: none !important;
  background-color: transparent !important;
  text-align: center !important;
}

.cm-wysiwym-image-shortcode-container img {
  display: block;
  max-width: 100%;
  max-height: none;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  padding: 6px;
}

.cm-wysiwym-image-shortcode-container.align-left img {
  max-height: 100px;
  margin-left: 0;
  margin-right: auto;
}

.cm-wysiwym-image-shortcode-container.align-right img {
  max-height: 100px;
  margin-right: 0;
  margin-left: auto;
}

/* Image Shortcode Styling Adjustments */
.cm-wysiwym-image-shortcode-container {
  position: relative;
  background-color: transparent !important;
  box-shadow: none !important;
  border-style: dashed !important;
}

.cm-wysiwym-image-shortcode-container:hover {
  box-shadow: none !important;
}

.cm-wysiwym-image-shortcode-container .shortcode-meta {
  background-color: transparent !important;
}

/* Edit icon on hover */
.cm-wysiwym-image-shortcode-container .image-edit-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #64748b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  z-index: 10;
}

.cm-wysiwym-image-shortcode-container:hover .image-edit-icon {
  opacity: 1;
}

/* Center & Fullbleed images custom styling */
.cm-wysiwym-image-shortcode-container.align-center,
.cm-wysiwym-image-shortcode-container.align-fullbleed {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.cm-wysiwym-image-shortcode-container.align-center:hover,
.cm-wysiwym-image-shortcode-container.align-fullbleed:hover {
  box-shadow: none !important;
}

.cm-wysiwym-image-shortcode-container.align-center .shortcode-meta,
.cm-wysiwym-image-shortcode-container.align-fullbleed .shortcode-meta {
  border-top: none !important;
  justify-content: center;
}

.cm-wysiwym-image-shortcode-container.align-center .meta-caption,
.cm-wysiwym-image-shortcode-container.align-fullbleed .meta-caption {
  width: 100%;
  text-align: center;
}

.cm-wysiwym-image-shortcode-container.align-center img,
.cm-wysiwym-image-shortcode-container.align-fullbleed img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  padding: 0 !important;
}

/* Video shortcode container styling */
.cm-wysiwym-video-shortcode-container {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  margin: 0 !important;
  padding: 12px 0;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  background-color: #ffffff;
  position: relative;
}

.cm-wysiwym-video-shortcode-container .video-placeholder {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background-color: #f8fafc;
  border-radius: 8px;
  margin: 8px 16px;
  cursor: pointer;
  border: 1px solid #e4e4e7;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.cm-wysiwym-video-shortcode-container .video-placeholder:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.cm-wysiwym-video-shortcode-container .video-placeholder-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #e2e8f0;
  color: #115e59;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cm-wysiwym-video-shortcode-container .video-placeholder-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex-grow: 1;
}

.cm-wysiwym-video-shortcode-container .video-placeholder-platform {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 900;
  color: #115e59;
  font-size: 1.1em;
  text-transform: uppercase;
}

.cm-wysiwym-video-shortcode-container .video-placeholder-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8em;
  color: #71717a;
  word-break: break-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-wysiwym-video-shortcode-container .shortcode-meta {
  font-family: inherit !important;
  font-size: 0.85em;
  color: #71717a;
  padding: 8px 16px;
  background-color: transparent !important;
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Edit icon on hover */
.cm-wysiwym-video-shortcode-container .video-edit-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #64748b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  z-index: 10;
}

.cm-wysiwym-video-shortcode-container:hover .video-edit-icon {
  opacity: 1;
}

/* Layout Alignments */
.cm-wysiwym-video-shortcode-container.align-left {
  margin: 0 auto 0 0 !important;
}
.cm-wysiwym-video-shortcode-container.align-right {
  margin: 0 0 0 auto !important;
}
.cm-wysiwym-video-shortcode-container.align-center {
  margin: 0 auto !important;
}
.cm-wysiwym-video-shortcode-container.align-fullbleed {
  width: 100% !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

/* Sizes */
.cm-wysiwym-video-shortcode-container.size-small {
  width: 200px;
}
.cm-wysiwym-video-shortcode-container.size-medium {
  width: 350px;
}
.cm-wysiwym-video-shortcode-container.size-large {
  width: 500px;
}
.cm-wysiwym-video-shortcode-container.size-full {
  width: 100%;
}

/* Audio shortcode container styling */
.cm-wysiwym-audio-shortcode-container {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  margin: 0 !important;
  padding: 12px 0;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  background-color: #ffffff;
  position: relative;
}

.cm-wysiwym-audio-shortcode-container .audio-placeholder {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background-color: #f8fafc;
  border-radius: 8px;
  margin: 8px 16px;
  cursor: pointer;
  border: 1px solid #e4e4e7;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.cm-wysiwym-audio-shortcode-container .audio-placeholder:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.cm-wysiwym-audio-shortcode-container .audio-placeholder-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #e2e8f0;
  color: #115e59;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cm-wysiwym-audio-shortcode-container .audio-placeholder-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex-grow: 1;
}

.cm-wysiwym-audio-shortcode-container .audio-placeholder-platform {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 900;
  color: #115e59;
  font-size: 1.1em;
  text-transform: uppercase;
}

.cm-wysiwym-audio-shortcode-container .audio-placeholder-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8em;
  color: #71717a;
  word-break: break-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-wysiwym-audio-shortcode-container .shortcode-meta {
  font-family: inherit !important;
  font-size: 0.85em;
  color: #71717a;
  padding: 8px 16px;
  background-color: transparent !important;
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Edit icon on hover */
.cm-wysiwym-audio-shortcode-container .audio-edit-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #64748b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  z-index: 10;
}

.cm-wysiwym-audio-shortcode-container:hover .audio-edit-icon {
  opacity: 1;
}

/* Layout Alignments */
.cm-wysiwym-audio-shortcode-container.align-left {
  margin: 0 auto 0 0 !important;
}
.cm-wysiwym-audio-shortcode-container.align-right {
  margin: 0 0 0 auto !important;
}
.cm-wysiwym-audio-shortcode-container.align-center {
  margin: 0 auto !important;
}
.cm-wysiwym-audio-shortcode-container.align-fullbleed {
  width: 100% !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

/* Sizes */
.cm-wysiwym-audio-shortcode-container.size-small {
  width: 200px;
}
.cm-wysiwym-audio-shortcode-container.size-medium {
  width: 350px;
}
.cm-wysiwym-audio-shortcode-container.size-large {
  width: 500px;
}
.cm-wysiwym-audio-shortcode-container.size-full {
  width: 100%;
}

/* Optimistic uploading panel */
.cm-wysiwym-image-uploading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background-color: #f0fdf4;
  border: 1px dashed #22c55e;
  color: #15803d;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.85em !important;
  font-weight: 500;
  margin: 0 !important;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.05);
}

/* Links (inside markdown, when rendered optionally) */
.cm-wysiwym-link-anchor {
  color: #115e59; /* Teal Link */
  text-decoration: underline;
  cursor: pointer;
}

.cm-wysiwym-link-anchor * {
  color: inherit !important;
}

/* Block-level Code Blocks - JetBrains Mono */
.cm-editor .cm-wysiwym-codeblock-line {
  background-color: #f4f4f5;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.85em;
  padding-left: 24px !important;
  padding-right: 24px !important;
  line-height: 1.6 !important;
}

.cm-editor .cm-wysiwym-codeblock-line-first {
  padding-top: 14px !important;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  border-top: 1px solid #e4e4e7;
  border-left: 1px solid #e4e4e7;
  border-right: 1px solid #e4e4e7;
}

.cm-editor .cm-wysiwym-codeblock-line-last {
  padding-bottom: 14px !important;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  border-bottom: 1px solid #e4e4e7;
  border-left: 1px solid #e4e4e7;
  border-right: 1px solid #e4e4e7;
}

/* Intermediate lines borders to form a complete container */
.cm-editor .cm-wysiwym-codeblock-line:not(.cm-wysiwym-codeblock-line-first):not(.cm-wysiwym-codeblock-line-last) {
  border-left: 1px solid #e4e4e7;
  border-right: 1px solid #e4e4e7;
}

.cm-editor .cm-wysiwym-collapsed-fence {
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  overflow: hidden !important;
  visibility: hidden !important;
}

/* Caret color overrides for light theme */
.cm-editor .cm-cursor {
  border-left-color: #18181b !important; /* Zinc 900 caret */
}
.cm-editor .cm-fat-cursor {
  background-color: #18181b !important;
  opacity: 0.6 !important;
}

/* Syntax Highlighting for Light Theme */
.cm-editor .tok-markup,
.cm-editor .cmt-markup,
.cm-editor .tok-meta,
.cm-editor .cmt-meta,
.cm-editor .tok-punctuation,
.cm-editor .cmt-punctuation,
.cm-editor .tok-list,
.cm-editor .cmt-list {
  color: #18181b !important;
}

.cm-editor .tok-comment,
.cm-editor .cmt-comment {
  color: #71717a !important; /* Muted Zinc comment */
  font-style: italic;
}

.cm-editor .tok-keyword,
.cm-editor .cmt-keyword {
  color: #115e59 !important; /* Teal for keywords */
  font-weight: 600;
}

.cm-editor .tok-string,
.cm-editor .cmt-string {
  color: #115e59 !important; /* Teal for strings */
}

.cm-editor .tok-number,
.cm-editor .cmt-number {
  color: #ea580c !important; /* Orange for numbers */
}

/* Bullet list marker styling */
.cm-wysiwym-bullet {
  color: #115e59; /* Teal Bullets */
  font-weight: bold;
  margin-right: 0.35em;
  display: inline-block;
}

/* Table line styling (editing mode background tint) */
.cm-editor .cm-wysiwym-table-row {
  background-color: rgba(244, 244, 245, 0.45) !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.85em !important;
}

/* Table widget (rendered WYSIWYM table) */
.cm-wysiwym-table-widget {
  margin: 0 !important;
  padding: 12px 0;
}

.cm-wysiwym-table-widget table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  overflow: hidden;
}

.cm-wysiwym-table-widget th,
.cm-wysiwym-table-widget td {
  padding: 8px 12px;
  border: 1px solid #e4e4e7;
  text-align: left;
  cursor: text;
  height: 38px; /* Acts as min-height for table cells */
  box-sizing: border-box;
}

.cm-wysiwym-table-widget th {
  background-color: #f4f4f5;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  color: #18181b;
}

.cm-wysiwym-table-widget tr:nth-child(even) {
  background-color: #fafafa;
}


/* Scoped Dark Mode overrides */
.cm-editor.cm-wysiwym-dark {
  background-color: #0b0f19 !important; /* Premium Dark Slate Blue */
  color: #f4f4f5 !important; /* Soft white */
}

.cm-editor.cm-wysiwym-dark .cm-gutters {
  background-color: transparent !important;
  border-right: none !important;
  color: #52525b !important;
}

.cm-editor.cm-wysiwym-dark .cm-activeLine {
  background-color: rgba(30, 41, 59, 0.5) !important;
}

.cm-editor.cm-wysiwym-dark .cm-activeLineGutter {
  background-color: transparent !important;
  color: #2dd4bf !important; /* Soft Teal */
}

.cm-editor.cm-wysiwym-dark .cm-selectionBackground, 
.cm-editor.cm-wysiwym-dark .cm-native-selection {
  background-color: rgba(15, 118, 110, 0.3) !important;
}

.cm-editor.cm-wysiwym-dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground {
  background-color: rgba(15, 118, 110, 0.45) !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-bold {
  color: #ffffff !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-italic {
  color: #e4e4e7 !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-strikethrough {
  color: #71717a !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-highlight {
  background-color: #f4f4f5 !important;
  color: #0b0f19 !important;
  font-weight: bold !important;
  border-bottom: none !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-inline-code {
  background-color: #131924;
  color: #e4e4e7;
  border-color: #1e293b;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-h1, 
.cm-editor.cm-wysiwym-dark .cm-wysiwym-h2, 
.cm-editor.cm-wysiwym-dark .cm-wysiwym-h3, 
.cm-editor.cm-wysiwym-dark .cm-wysiwym-h4, 
.cm-editor.cm-wysiwym-dark .cm-wysiwym-h5, 
.cm-editor.cm-wysiwym-dark .cm-wysiwym-h6 {
  color: #ffffff !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-blockquote {
  border-left-color: #2dd4bf;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-blockquote,
.cm-editor.cm-wysiwym-dark .cm-wysiwym-blockquote * {
  color: #cbd5e1 !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-alert-note {
  border-left-color: rgba(59, 130, 246, 0.4) !important;
  background-color: rgba(59, 130, 246, 0.1) !important;
  color: #60a5fa !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-alert-note * {
  color: #60a5fa !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-alert-tip {
  border-left-color: rgba(34, 197, 94, 0.4) !important;
  background-color: rgba(34, 197, 94, 0.1) !important;
  color: #4ade80 !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-alert-tip * {
  color: #4ade80 !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-alert-important {
  border-left-color: rgba(139, 92, 246, 0.4) !important;
  background-color: rgba(139, 92, 246, 0.1) !important;
  color: #a78bfa !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-alert-important * {
  color: #a78bfa !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-alert-warning {
  border-left-color: rgba(245, 158, 11, 0.4) !important;
  background-color: rgba(245, 158, 11, 0.1) !important;
  color: #fbbf24 !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-alert-warning * {
  color: #fbbf24 !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-alert-caution {
  border-left-color: rgba(239, 68, 68, 0.4) !important;
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: #f87171 !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-alert-caution * {
  color: #f87171 !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-frontmatter {
  background-color: #131924 !important;
  border-left-color: #52525b !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-frontmatter,
.cm-editor.cm-wysiwym-dark .cm-wysiwym-frontmatter span {
  color: #a1a1aa !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-frontmatter-active {
  background-color: #131924 !important;
  border-left-color: #2dd4bf !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-frontmatter-active,
.cm-editor.cm-wysiwym-dark .cm-wysiwym-frontmatter-active span {
  color: #f4f4f5 !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-hr-widget {
  border-top-color: #1e293b !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-image-widget-container,
.cm-editor.cm-wysiwym-dark .cm-wysiwym-image-shortcode-container {
  border-color: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  background-color: #0b0f19;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-image-widget-container:hover,
.cm-editor.cm-wysiwym-dark .cm-wysiwym-image-shortcode-container:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-image-caption,
.cm-editor.cm-wysiwym-dark .cm-wysiwym-image-shortcode-container .shortcode-meta {
  color: #94a3b8;
  border-top-color: #1e293b;
  background-color: #131924;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-image-shortcode-container .meta-badge {
  background-color: #1e293b;
  color: #cbd5e1;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-image-shortcode-container .meta-badge.tag-name {
  background-color: #312e81;
  color: #c7d2fe;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-image-uploading {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

/* Video dark mode overrides */
.cm-editor.cm-wysiwym-dark .cm-wysiwym-video-shortcode-container {
  border-color: #1e293b;
  background-color: #0b0f19;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-video-shortcode-container .video-placeholder {
  background-color: #131924;
  border-color: #1e293b;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-video-shortcode-container .video-placeholder:hover {
  background-color: #1e293b;
  border-color: #334155;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-video-shortcode-container .video-placeholder-icon-wrap {
  background-color: #0b0f19;
  color: #2dd4bf;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-video-shortcode-container .video-placeholder-platform {
  color: #ffffff;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-video-shortcode-container .video-placeholder-url {
  color: #94a3b8;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-video-shortcode-container .video-edit-icon {
  background-color: rgba(19, 25, 36, 0.9) !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

/* Audio dark mode overrides */
.cm-editor.cm-wysiwym-dark .cm-wysiwym-audio-shortcode-container {
  border-color: #1e293b;
  background-color: #0b0f19;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-audio-shortcode-container .audio-placeholder {
  background-color: #131924;
  border-color: #1e293b;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-audio-shortcode-container .audio-placeholder:hover {
  background-color: #1e293b;
  border-color: #334155;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-audio-shortcode-container .audio-placeholder-icon-wrap {
  background-color: #0b0f19;
  color: #2dd4bf;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-audio-shortcode-container .audio-placeholder-platform {
  color: #ffffff;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-audio-shortcode-container .audio-placeholder-url {
  color: #94a3b8;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-audio-shortcode-container .audio-edit-icon {
  background-color: rgba(19, 25, 36, 0.9) !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-link-anchor {
  color: #2dd4bf;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-bullet {
  color: #2dd4bf !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-table-row {
  background-color: rgba(30, 41, 59, 0.45) !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-table-widget table {
  border-color: #1e293b;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-table-widget th,
.cm-editor.cm-wysiwym-dark .cm-wysiwym-table-widget td {
  border-color: #1e293b;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-table-widget th {
  background-color: #131924;
  color: #ffffff;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-table-widget tr:nth-child(even) {
  background-color: rgba(19, 25, 36, 0.3);
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-codeblock-line {
  background-color: #131924;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-codeblock-line-first,
.cm-editor.cm-wysiwym-dark .cm-wysiwym-codeblock-line-last,
.cm-editor.cm-wysiwym-dark .cm-wysiwym-codeblock-line:not(.cm-wysiwym-codeblock-line-first):not(.cm-wysiwym-codeblock-line-last) {
  border-color: #1e293b !important;
}

.cm-editor.cm-wysiwym-dark .cm-cursor {
  border-left-color: #2dd4bf !important;
}
.cm-editor.cm-wysiwym-dark .cm-fat-cursor {
  background-color: #2dd4bf !important;
}

/* Syntax Highlighting for Dark Mode */
.cm-editor.cm-wysiwym-dark .tok-markup,
.cm-editor.cm-wysiwym-dark .cmt-markup,
.cm-editor.cm-wysiwym-dark .tok-meta,
.cm-editor.cm-wysiwym-dark .cmt-meta,
.cm-editor.cm-wysiwym-dark .tok-punctuation,
.cm-editor.cm-wysiwym-dark .cmt-punctuation,
.cm-editor.cm-wysiwym-dark .tok-list,
.cm-editor.cm-wysiwym-dark .cmt-list {
  color: #ffffff !important;
}

.cm-editor.cm-wysiwym-dark .tok-comment,
.cm-editor.cm-wysiwym-dark .cmt-comment {
  color: #52525b !important;
  font-style: italic;
}

.cm-editor.cm-wysiwym-dark .tok-keyword,
.cm-editor.cm-wysiwym-dark .cmt-keyword {
  color: #2dd4bf !important;
}

.cm-editor.cm-wysiwym-dark .tok-string,
.cm-editor.cm-wysiwym-dark .cmt-string {
  color: #34d399 !important;
}

.cm-editor.cm-wysiwym-dark .tok-number,
.cm-editor.cm-wysiwym-dark .cmt-number,
.cm-editor.cm-wysiwym-dark .tok-boolean,
.cm-editor.cm-wysiwym-dark .cmt-boolean {
  color: #fb923c !important;
}

.cm-editor.cm-wysiwym-dark .tok-variableName,
.cm-editor.cm-wysiwym-dark .cmt-variableName {
  color: #f4f4f5 !important;
}

.cm-editor.cm-wysiwym-dark .tok-propertyName,
.cm-editor.cm-wysiwym-dark .cmt-propertyName {
  color: #2dd4bf !important;
}

.cm-editor.cm-wysiwym-dark .tok-operator,
.cm-editor.cm-wysiwym-dark .cmt-operator {
  color: #cbd5e1 !important;
}

.cm-editor.cm-wysiwym-dark .tok-url,
.cm-editor.cm-wysiwym-dark .cmt-url,
.cm-editor.cm-wysiwym-dark .tok-link,
.cm-editor.cm-wysiwym-dark .cmt-link {
  color: #2dd4bf !important;
}

/* Scrollbars overrides for dark mode */
.cm-editor.cm-wysiwym-dark ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.cm-editor.cm-wysiwym-dark ::-webkit-scrollbar-track {
  background: #0b0f19;
}
.cm-editor.cm-wysiwym-dark ::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 5px;
}
.cm-editor.cm-wysiwym-dark ::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* --- HTML Preview Styles (Modern Skin synchronization) --- */
.traven-preview {
  background-color: #ffffff;
  color: #18181b;
  font-family: 'Epunda Slab', Georgia, serif !important;
  font-size: 18px !important;
  line-height: 1.35;
}

.traven-preview h1, 
.traven-preview h2, 
.traven-preview h3, 
.traven-preview h4, 
.traven-preview h5, 
.traven-preview h6 {
  font-family: 'Saira Condensed', sans-serif !important;
  color: #09090b;
  letter-spacing: -0.01em;
  margin-top: 24px;
  margin-bottom: 12px;
  line-height: 1.05;
}

.traven-preview h1 { font-size: 2.2em; font-weight: 900; line-height: 1.0; }
.traven-preview h2 { font-size: 1.7em; font-weight: 800; line-height: 1.05; }
.traven-preview h3 { font-size: 1.35em; font-weight: 800; line-height: 1.1; }
.traven-preview h4 { font-size: 1.15em; font-weight: 800; line-height: 1.2; }
.traven-preview h5, .traven-preview h6 { font-size: 1em; font-weight: 800; line-height: 1.25; }

.traven-preview > h1:first-child { margin-top: 28px !important; }
.traven-preview > h2:first-child { margin-top: 22px !important; }
.traven-preview > h3:first-child { margin-top: 18px !important; }

.traven-preview p {
  margin-top: 0;
  margin-bottom: 16px;
  line-height: 1.35;
}

.traven-preview blockquote:not(.traven-component-pullquote) {
  border-left: 4px solid #0f766e;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
  padding-left: 18px !important;
  padding-right: 18px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  position: relative;
}

/* First line of a blockquote block gets padding-top */
.traven-preview blockquote:not(.traven-component-pullquote) {
  padding-top: 10px !important;
}

/* Subsequent consecutive blockquotes should not have top padding */
.traven-preview blockquote:not(.traven-component-pullquote) + blockquote:not(.traven-component-pullquote) {
  padding-top: 2px !important;
}

/* Last line of a blockquote block gets padding-bottom */
.traven-preview blockquote:not(.traven-component-pullquote):not(:has(+ blockquote:not(.traven-component-pullquote))) {
  padding-bottom: 10px !important;
}

.traven-preview blockquote:not(.traven-component-pullquote),
.traven-preview blockquote:not(.traven-component-pullquote) * {
  font-style: italic;
  color: #4b5563;
  line-height: 1.35 !important;
  font-size: 0.95em !important;
  font-family: 'Epunda Slab', Georgia, serif !important;
}

.traven-preview blockquote:not(.traven-component-pullquote) p:last-child {
  margin-bottom: 0 !important;
}

/* GitHub Alerts in Preview */
.traven-preview .traven-alert {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  padding-left: 18px !important;
  padding-right: 18px !important;
  margin-top: 0 !important;
  margin-bottom: 1.0em !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  border-left: 4px solid #0f766e;
  border-radius: 0 8px 8px 0;
}
.traven-preview .traven-alert,
.traven-preview .traven-alert * {
  font-style: normal !important;
  font-family: 'Epunda Slab', Georgia, serif !important;
  line-height: 1.35 !important;
  font-size: 0.95em !important;
}
.traven-preview .traven-alert p {
  margin-top: 0;
  margin-bottom: 1.0em;
}
.traven-preview .traven-alert p:last-child {
  margin-bottom: 0 !important;
}
.traven-preview .traven-alert-note {
  border-left-color: #3b82f6 !important;
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
}
.traven-preview .traven-alert-note * {
  color: #1d4ed8 !important;
}
.traven-preview .traven-alert-tip {
  border-left-color: #22c55e !important;
  background-color: #f0fdf4 !important;
  color: #15803d !important;
}
.traven-preview .traven-alert-tip * {
  color: #15803d !important;
}
.traven-preview .traven-alert-important {
  border-left-color: #8b5cf6 !important;
  background-color: #f5f3ff !important;
  color: #6d28d9 !important;
}
.traven-preview .traven-alert-important * {
  color: #6d28d9 !important;
}
.traven-preview .traven-alert-warning {
  border-left-color: #f59e0b !important;
  background-color: #fffbeb !important;
  color: #b45309 !important;
}
.traven-preview .traven-alert-warning * {
  color: #b45309 !important;
}
.traven-preview .traven-alert-caution {
  border-left-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  color: #b91c1c !important;
}
.traven-preview .traven-alert-caution * {
  color: #b91c1c !important;
}

/* Reduce spacing around blockquotes in HTML Preview to match editor */
.traven-preview p:has(+ blockquote:not(.traven-component-pullquote)),
.traven-preview ul:has(+ blockquote:not(.traven-component-pullquote)),
.traven-preview ol:has(+ blockquote:not(.traven-component-pullquote)),
.traven-preview pre:has(+ blockquote:not(.traven-component-pullquote)),
.traven-preview table:has(+ blockquote:not(.traven-component-pullquote)) {
  margin-bottom: 0.4em !important;
}

.traven-preview blockquote:not(.traven-component-pullquote) + p,
.traven-preview blockquote:not(.traven-component-pullquote) + ul,
.traven-preview blockquote:not(.traven-component-pullquote) + ol,
.traven-preview blockquote:not(.traven-component-pullquote) + pre,
.traven-preview blockquote:not(.traven-component-pullquote) + table {
  margin-top: 0.4em !important;
}

.traven-preview ul, 
.traven-preview ol {
  padding-left: 24px;
  margin-top: 0;
  margin-bottom: 16px;
}
.traven-preview li {
  margin-bottom: 4px;
}

.traven-preview code {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.85em;
  background-color: #f4f4f5;
  color: #0f172a;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid #e4e4e7;
}

.traven-preview pre {
  background-color: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 14px 20px;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.6;
}

.traven-preview pre code {
  background-color: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  font-size: 1em;
  color: inherit;
}

.traven-preview a {
  color: #115e59;
  text-decoration: underline;
}
.traven-preview a:hover {
  text-decoration: none;
}

/* Image shortcode compiled HTML styles in preview */
.traven-preview img.traven-image-shortcode,
.traven-preview figure.traven-image-figure {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px auto;
  display: block;
}

.traven-preview img.traven-image-shortcode.align-left,
.traven-preview figure.traven-image-figure.align-left {
  float: left;
  margin: 12px 16px 12px 0;
}

.traven-preview img.traven-image-shortcode.align-right,
.traven-preview figure.traven-image-figure.align-right {
  float: right;
  margin: 12px 0 12px 16px;
}

.traven-preview img.traven-image-shortcode.align-center,
.traven-preview figure.traven-image-figure.align-center {
  margin: 12px auto;
  display: block;
}

.traven-preview img.traven-image-shortcode.align-fullbleed,
.traven-preview figure.traven-image-figure.align-fullbleed {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
  border-radius: 0 !important;
  display: block !important;
  float: none !important;
  clear: both !important;
  height: auto !important;
}

.traven-preview img.traven-image-shortcode.size-small,
.traven-preview figure.traven-image-figure.size-small {
  width: 150px;
}

.traven-preview img.traven-image-shortcode.size-medium,
.traven-preview figure.traven-image-figure.size-medium {
  width: 300px;
}

.traven-preview img.traven-image-shortcode.size-large,
.traven-preview figure.traven-image-figure.size-large {
  width: 600px;
}

.traven-preview img.traven-image-shortcode.size-full,
.traven-preview figure.traven-image-figure.size-full {
  width: 100%;
}

.traven-preview figure.traven-image-figure img.traven-image-shortcode {
  width: 100%;
  max-width: 100%;
  margin: 0;
  display: block;
}

.traven-preview figure.traven-image-figure figcaption.traven-image-caption {
  font-family: inherit !important;
  font-size: 0.85em;
  color: #71717a;
  margin-top: 8px;
  text-align: center;
  line-height: 1.35;
}

/* Video preview styles */
.traven-preview .traven-video-container,
.traven-preview figure.traven-video-figure {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px auto;
  display: block;
}

.traven-preview .traven-video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background-color: #000000;
}

.traven-preview .traven-video-container iframe,
.traven-preview .traven-video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

.traven-preview .traven-video-container.align-left,
.traven-preview figure.traven-video-figure.align-left {
  float: left;
  margin: 12px 16px 12px 0;
}

.traven-preview .traven-video-container.align-right,
.traven-preview figure.traven-video-figure.align-right {
  float: right;
  margin: 12px 0 12px 16px;
}

.traven-preview .traven-video-container.align-center,
.traven-preview figure.traven-video-figure.align-center {
  margin: 12px auto;
  display: block;
}

.traven-preview .traven-video-container.align-fullbleed,
.traven-preview figure.traven-video-figure.align-fullbleed {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
  border-radius: 0 !important;
  display: block !important;
  float: none !important;
  clear: both !important;
  height: auto !important;
  padding-bottom: calc(100vw * 9 / 16) !important;
}

.traven-preview .traven-video-container.align-fullbleed iframe,
.traven-preview .traven-video-container.align-fullbleed video {
  border-radius: 0 !important;
}

.traven-preview .traven-video-container.size-small,
.traven-preview figure.traven-video-figure.size-small {
  width: 200px;
}

.traven-preview .traven-video-container.size-medium,
.traven-preview figure.traven-video-figure.size-medium {
  width: 350px;
}

.traven-preview .traven-video-container.size-large,
.traven-preview figure.traven-video-figure.size-large {
  width: 500px;
}

.traven-preview .traven-video-container.size-full,
.traven-preview figure.traven-video-figure.size-full {
  width: 100%;
}

.traven-preview figure.traven-video-figure .traven-video-container {
  margin: 0;
}

.traven-preview figure.traven-video-figure figcaption.traven-video-caption {
  font-family: inherit !important;
  font-size: 0.85em;
  color: #71717a;
  margin-top: 8px;
  text-align: center;
  line-height: 1.35;
}

/* Audio preview styles */
.traven-preview .traven-audio-container,
.traven-preview figure.traven-audio-figure {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px auto;
  display: block;
}

.traven-preview .traven-audio-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background-color: transparent;
}

.traven-preview .traven-audio-container audio {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
}

.traven-preview .traven-audio-container.align-left,
.traven-preview figure.traven-audio-figure.align-left {
  float: left;
  margin: 12px 16px 12px 0;
}

.traven-preview .traven-audio-container.align-right,
.traven-preview figure.traven-audio-figure.align-right {
  float: right;
  margin: 12px 0 12px 16px;
}

.traven-preview .traven-audio-container.align-center,
.traven-preview figure.traven-audio-figure.align-center {
  margin: 12px auto;
  display: block;
}

.traven-preview .traven-audio-container.align-fullbleed,
.traven-preview figure.traven-audio-figure.align-fullbleed {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
  border-radius: 0 !important;
  display: block !important;
  float: none !important;
  clear: both !important;
  height: auto !important;
}

.traven-preview .traven-audio-container.align-fullbleed audio {
  border-radius: 0 !important;
}

.traven-preview .traven-audio-container.size-small,
.traven-preview figure.traven-audio-figure.size-small {
  width: 200px;
}

.traven-preview .traven-audio-container.size-medium,
.traven-preview figure.traven-audio-figure.size-medium {
  width: 350px;
}

.traven-preview .traven-audio-container.size-large,
.traven-preview figure.traven-audio-figure.size-large {
  width: 500px;
}

.traven-preview .traven-audio-container.size-full,
.traven-preview figure.traven-audio-figure.size-full {
  width: 100%;
}

.traven-preview figure.traven-audio-figure .traven-audio-container {
  margin: 0;
}

.traven-preview figure.traven-audio-figure figcaption.traven-audio-caption {
  font-family: inherit !important;
  font-size: 0.85em;
  color: #71717a;
  margin-top: 8px;
  text-align: center;
  line-height: 1.35;
}

.traven-preview mark {
  background-color: #18181b !important;
  color: #ffffff !important;
  font-weight: bold !important;
  border-radius: 4px;
  padding: 1px 4px;
  border-bottom: none !important;
}
.traven-preview hr {
  border: none;
  border-top: 1px solid #e4e4e7;
  margin: 24px 0;
}
.traven-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9em;
}
.traven-preview th,
.traven-preview td {
  padding: 8px 12px;
  border: 1px solid #e4e4e7;
  text-align: left;
  height: 38px; /* Acts as min-height for table cells */
  box-sizing: border-box;
}
.traven-preview th {
  background-color: #f4f4f5;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  color: #18181b;
}
.traven-preview tr:nth-child(even) {
  background-color: #fafafa;
}

/* Dark mode overrides for skin preview */
.traven-preview.cm-wysiwym-dark {
  background-color: #0b0f19 !important;
  color: #f4f4f5 !important;
}
.traven-preview.cm-wysiwym-dark h1,
.traven-preview.cm-wysiwym-dark h2,
.traven-preview.cm-wysiwym-dark h3,
.traven-preview.cm-wysiwym-dark h4,
.traven-preview.cm-wysiwym-dark h5,
.traven-preview.cm-wysiwym-dark h6 {
  color: #ffffff;
}
.traven-preview.cm-wysiwym-dark blockquote {
  border-left-color: #2dd4bf;
  color: #cbd5e1;
}

.traven-preview.cm-wysiwym-dark .traven-alert-note {
  border-left-color: rgba(59, 130, 246, 0.4) !important;
  background-color: rgba(59, 130, 246, 0.1) !important;
  color: #60a5fa !important;
}
.traven-preview.cm-wysiwym-dark .traven-alert-note * {
  color: #60a5fa !important;
}
.traven-preview.cm-wysiwym-dark .traven-alert-tip {
  border-left-color: rgba(34, 197, 94, 0.4) !important;
  background-color: rgba(34, 197, 94, 0.1) !important;
  color: #4ade80 !important;
}
.traven-preview.cm-wysiwym-dark .traven-alert-tip * {
  color: #4ade80 !important;
}
.traven-preview.cm-wysiwym-dark .traven-alert-important {
  border-left-color: rgba(139, 92, 246, 0.4) !important;
  background-color: rgba(139, 92, 246, 0.1) !important;
  color: #a78bfa !important;
}
.traven-preview.cm-wysiwym-dark .traven-alert-important * {
  color: #a78bfa !important;
}
.traven-preview.cm-wysiwym-dark .traven-alert-warning {
  border-left-color: rgba(245, 158, 11, 0.4) !important;
  background-color: rgba(245, 158, 11, 0.1) !important;
  color: #fbbf24 !important;
}
.traven-preview.cm-wysiwym-dark .traven-alert-warning * {
  color: #fbbf24 !important;
}
.traven-preview.cm-wysiwym-dark .traven-alert-caution {
  border-left-color: rgba(239, 68, 68, 0.4) !important;
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: #f87171 !important;
}
.traven-preview.cm-wysiwym-dark .traven-alert-caution * {
  color: #f87171 !important;
}
.traven-preview.cm-wysiwym-dark code {
  background-color: #131924;
  border-color: #1e293b;
  color: #e4e4e7;
}
.traven-preview.cm-wysiwym-dark pre {
  background-color: #131924;
  border-color: #1e293b;
}
.traven-preview.cm-wysiwym-dark a {
  color: #2dd4bf;
}

.traven-preview.cm-wysiwym-dark mark {
  background-color: #f4f4f5 !important;
  color: #0b0f19 !important;
  font-weight: bold !important;
  border-bottom: none !important;
}
.traven-preview.cm-wysiwym-dark hr {
  border-top-color: #1e293b;
}

.traven-preview.cm-wysiwym-dark table th,
.traven-preview.cm-wysiwym-dark table td {
  border-color: #1e293b;
}
.traven-preview.cm-wysiwym-dark table th {
  background-color: #131924;
  color: #ffffff;
}
.traven-preview.cm-wysiwym-dark table tr:nth-child(even) {
  background-color: rgba(19, 25, 36, 0.2);
}

.traven-preview.cm-wysiwym-dark figure.traven-image-figure figcaption.traven-image-caption {
  color: #a1a1aa;
}

/* WYSIWYM Component Shortcodes */
.cm-wysiwym-component-shortcode {
  position: relative;
  margin: 0 !important;
  padding: 28px 16px !important;
  border-left: 4px solid #cbd5e1;
  background-color: #f8fafc;
  color: #334155;
}
.cm-wysiwym-component-shortcode .component-body p {
  margin: 8px 0;
  line-height: 1.6;
}
.cm-wysiwym-component-shortcode .component-body p:first-child {
  margin-top: 0;
}
.cm-wysiwym-component-shortcode .component-body p:last-child {
  margin-bottom: 0;
}
.cm-wysiwym-component-shortcode cite {
  display: block;
  margin-top: 8px;
  font-size: 0.93em;
  font-style: italic;
  color: #64748b;
}

.cm-wysiwym-component-shortcode.component-pullquote {
  border-left: none !important;
  border-top: 2px solid #0f766e !important;
  border-bottom: 2px solid #0f766e !important;
  padding: 24px 16px !important;
  margin: 0 auto !important;
  max-width: 80% !important;
  font-family: 'Saira Condensed', sans-serif !important;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.3em !important;
  text-align: center;
  color: #115e59;
  background-color: transparent !important;
  line-height: 0.95 !important;
}
.cm-wysiwym-component-shortcode.component-pullquote,
.cm-wysiwym-component-shortcode.component-pullquote * {
  line-height: 0.95 !important;
  font-style: normal !important;
  text-align: center !important;
  font-family: 'Saira Condensed', sans-serif !important;
  color: #115e59 !important;
}
.cm-wysiwym-component-shortcode.component-pullquote blockquote {
  margin: 0 !important;
  padding: 0 !important;
}

.cm-wysiwym-component-shortcode.component-blockquote {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}
.cm-wysiwym-component-shortcode.component-blockquote blockquote {
  border-left: 4px solid #0f766e !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  padding-left: 18px !important;
  padding-right: 18px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  position: relative;
  font-style: italic;
  color: #4b5563;
  font-size: 0.95em !important;
}
.cm-wysiwym-component-shortcode.component-blockquote blockquote,
.cm-wysiwym-component-shortcode.component-blockquote blockquote * {
  line-height: 1.35 !important;
  font-family: 'Epunda Slab', Georgia, serif !important;
}
.cm-wysiwym-component-shortcode.component-blockquote cite {
  display: block;
  margin-top: 4px;
  font-size: 0.9em;
  color: #71717a;
  font-style: normal;
  text-align: right;
}

/* Reduce blank line spacing immediately before and after blockquote components */
.cm-editor .cm-wysiwym-component-shortcode.component-blockquote + .cm-line:has(br:only-child),
.cm-editor .cm-line:has(br:only-child):has(+ .cm-wysiwym-component-shortcode.component-blockquote) {
  height: 0.4em !important;
  min-height: 0.4em !important;
}

.cm-wysiwym-component-shortcode.component-info {
  border: 1px solid #ccfbf1 !important;
  border-left: 4px solid #0f766e !important;
  border-radius: 8px !important;
  background-color: #f0fdfa !important;
  color: #115e59 !important;
  padding: 16px !important;
  margin: 0 !important;
}
.cm-wysiwym-component-shortcode.component-info,
.cm-wysiwym-component-shortcode.component-info * {
  font-family: 'Epunda Slab', Georgia, serif !important;
}
.cm-wysiwym-component-shortcode.component-info .component-body p {
  font-size: 16px !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}
.cm-wysiwym-component-shortcode.component-info .component-body p:not(:last-child) {
  margin-bottom: 8px !important;
}

.cm-wysiwym-component-shortcode.component-warning {
  border: 1px solid #fed7aa !important;
  border-left: 4px solid #ea580c !important;
  border-radius: 8px !important;
  background-color: #fff7ed !important;
  color: #7c2d12 !important;
  padding: 16px !important;
  margin: 0 !important;
}
.cm-wysiwym-component-shortcode.component-warning,
.cm-wysiwym-component-shortcode.component-warning * {
  font-family: 'Epunda Slab', Georgia, serif !important;
}
.cm-wysiwym-component-shortcode.component-warning .component-body p {
  font-size: 16px !important;
  line-height: 1.5 !important;
  font-weight: bold !important;
  margin: 0 !important;
}
.cm-wysiwym-component-shortcode.component-warning .component-body p:not(:last-child) {
  margin-bottom: 8px !important;
}

/* Edit icon on hover for Component Shortcodes */
.cm-wysiwym-component-shortcode .image-edit-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #64748b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  z-index: 10;
}
.cm-wysiwym-component-shortcode:hover .image-edit-icon {
  opacity: 1;
}

/* Fallback Preview Block Component Styles */
.traven-preview .traven-component-blockquote {
  border-left: 4px solid #0f766e !important;
  background-color: transparent !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  padding-left: 18px !important;
  padding-right: 18px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  position: relative;
  font-style: italic;
  color: #4b5563;
  font-size: 0.95em !important;
}
.traven-preview .traven-component-blockquote,
.traven-preview .traven-component-blockquote * {
  line-height: 1.35 !important;
  font-family: 'Epunda Slab', Georgia, serif !important;
}
.traven-preview .traven-component-blockquote p {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.traven-preview .traven-component-blockquote p:not(:last-of-type) {
  margin-bottom: 8px !important;
}
.traven-preview .traven-component-blockquote footer {
  margin-top: 4px;
  text-align: right;
}
.traven-preview .traven-component-blockquote cite {
  display: block;
  margin-top: 4px;
  font-size: 0.9em;
  color: #71717a;
  font-style: normal;
  text-align: right;
}

/* Reduce spacing around blockquote components in HTML Preview to match editor */
.traven-preview p:has(+ .traven-component-blockquote),
.traven-preview ul:has(+ .traven-component-blockquote),
.traven-preview ol:has(+ .traven-component-blockquote),
.traven-preview pre:has(+ .traven-component-blockquote),
.traven-preview table:has(+ .traven-component-blockquote) {
  margin-bottom: 0.4em !important;
}
.traven-preview .traven-component-blockquote + p,
.traven-preview .traven-component-blockquote + ul,
.traven-preview .traven-component-blockquote + ol,
.traven-preview .traven-component-blockquote + pre,
.traven-preview .traven-component-blockquote + table {
  margin-top: 0.4em !important;
}

.traven-preview .traven-component-pullquote {
  border-top: 2px solid #0f766e !important;
  border-bottom: 2px solid #0f766e !important;
  padding: 24px 0 !important;
  margin: 24px auto !important;
  max-width: 80% !important;
  font-family: 'Saira Condensed', sans-serif !important;
  font-weight: 800 !important;
  font-style: normal !important;
  text-transform: uppercase;
  text-align: center;
  color: #115e59;
  background-color: transparent !important;
  line-height: 0.95 !important;
  font-size: 1.3em !important;
}
.traven-preview .traven-component-pullquote,
.traven-preview .traven-component-pullquote * {
  line-height: 0.95 !important;
  font-style: normal !important;
  font-weight: 800 !important;
  text-align: center !important;
  font-family: 'Saira Condensed', sans-serif !important;
  color: #115e59 !important;
}
.traven-preview .traven-component-pullquote p {
  margin: 0 !important;
}

.traven-preview .traven-component {
  border: 1px solid #e4e4e7;
  background-color: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
}
.traven-preview .traven-component-info {
  border: 1px solid #ccfbf1 !important;
  border-left: 4px solid #0f766e !important;
  border-radius: 8px !important;
  background-color: #f0fdfa !important;
  color: #115e59 !important;
  padding: 16px !important;
  margin: 16px 0 !important;
}
.traven-preview .traven-component-info,
.traven-preview .traven-component-info * {
  font-family: 'Epunda Slab', Georgia, serif !important;
}
.traven-preview .traven-component-info p {
  font-size: 16px !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}
.traven-preview .traven-component-info p:not(:last-child) {
  margin-bottom: 8px !important;
}

.traven-preview .traven-component-warning {
  border: 1px solid #fed7aa !important;
  border-left: 4px solid #ea580c !important;
  border-radius: 8px !important;
  background-color: #fff7ed !important;
  color: #7c2d12 !important;
  padding: 16px !important;
  margin: 16px 0 !important;
}
.traven-preview .traven-component-warning,
.traven-preview .traven-component-warning * {
  font-family: 'Epunda Slab', Georgia, serif !important;
}
.traven-preview .traven-component-warning p {
  font-size: 16px !important;
  line-height: 1.5 !important;
  font-weight: bold !important;
  margin: 0 !important;
}
.traven-preview .traven-component-warning p:not(:last-child) {
  margin-bottom: 8px !important;
}

/* Dark Mode overrides for WYSIWYM Component Shortcodes */
.cm-editor.cm-wysiwym-dark .cm-wysiwym-component-shortcode {
  border-left-color: #2dd4bf !important;
  background-color: #131924 !important;
  color: #cbd5e1 !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-component-shortcode.component-blockquote blockquote {
  border-left-color: #2dd4bf !important;
  color: #cbd5e1 !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-component-shortcode.component-blockquote cite {
  color: #94a3b8 !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-component-shortcode.component-pullquote,
.cm-editor.cm-wysiwym-dark .cm-wysiwym-component-shortcode.component-pullquote * {
  border-top-color: #2dd4bf !important;
  border-bottom-color: #2dd4bf !important;
  color: #2dd4bf !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-component-shortcode.component-info {
  border-color: #115e59 !important;
  background-color: rgba(17, 94, 89, 0.18) !important;
  border-left-color: #2dd4bf !important;
  color: #ccfbf1 !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-component-shortcode.component-warning {
  border-color: #7c2d12 !important;
  background-color: rgba(154, 52, 18, 0.18) !important;
  border-left-color: #fb923c !important;
  color: #fed7aa !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-component-shortcode cite {
  color: #94a3b8 !important;
}
.cm-editor.cm-wysiwym-dark .cm-wysiwym-component-shortcode .image-edit-icon {
  background-color: rgba(19, 25, 36, 0.9) !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

/* Dark Mode overrides for Preview Component Shortcodes */
.traven-preview.cm-wysiwym-dark .traven-component-blockquote {
  border-left-color: #2dd4bf !important;
  color: #cbd5e1 !important;
}
.traven-preview.cm-wysiwym-dark .traven-component-blockquote cite {
  color: #94a3b8 !important;
}
.traven-preview.cm-wysiwym-dark .traven-component-pullquote,
.traven-preview.cm-wysiwym-dark .traven-component-pullquote * {
  border-top-color: #2dd4bf !important;
  border-bottom-color: #2dd4bf !important;
  color: #2dd4bf !important;
}
.traven-preview.cm-wysiwym-dark .traven-component-info {
  border-color: #115e59 !important;
  background-color: rgba(17, 94, 89, 0.18) !important;
  color: #ccfbf1 !important;
  border-left-color: #2dd4bf !important;
}
.traven-preview.cm-wysiwym-dark .traven-component-warning {
  border-color: #7c2d12 !important;
  background-color: rgba(154, 52, 18, 0.18) !important;
  color: #fed7aa !important;
  border-left-color: #fb923c !important;
}
.traven-preview.cm-wysiwym-dark .traven-component {
  border-color: #1e293b !important;
  background-color: #131924 !important;
}

/* --- Figure Shortcode WYSIWYM Styles --- */
.cm-wysiwym-figure-shortcode {
  position: relative;
  display: block;
  padding: 16px;
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  box-sizing: border-box;
}

.cm-wysiwym-figure-shortcode .component-body {
  margin: 0;
  padding: 0;
  width: 100%;
}

.cm-wysiwym-figure-shortcode .component-body p {
  margin: 0 0 10px 0;
  line-height: 1.6;
}

.cm-wysiwym-figure-shortcode .component-body p:last-child {
  margin-bottom: 0;
}

.cm-wysiwym-figure-shortcode .figure-caption {
  font-family: inherit !important;
  font-size: 0.85em;
  color: #71717a;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e4e4e7;
  text-align: center;
  font-weight: 500;
}

/* Edit icon overlay */
.cm-wysiwym-figure-shortcode .figure-edit-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  z-index: 10;
  cursor: pointer;
}

.cm-wysiwym-figure-shortcode:hover .figure-edit-icon {
  opacity: 1;
  pointer-events: auto;
}

/* Layout Alignments (Editor) */
.cm-wysiwym-figure-shortcode.align-left {
  margin: 0 auto 0 0 !important;
}
.cm-wysiwym-figure-shortcode.align-right {
  margin: 0 0 0 auto !important;
}
.cm-wysiwym-figure-shortcode.align-center {
  margin: 0 auto !important;
}
.cm-wysiwym-figure-shortcode.align-fullbleed {
  width: 100% !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

/* Sizes (Editor) */
.cm-wysiwym-figure-shortcode.size-small {
  width: 250px;
}
.cm-wysiwym-figure-shortcode.size-medium {
  width: 450px;
}
.cm-wysiwym-figure-shortcode.size-large {
  width: 650px;
}
.cm-wysiwym-figure-shortcode.size-full {
  width: 100%;
}

/* Dark Mode WYSIWYM overrides */
.cm-editor.cm-wysiwym-dark .cm-wysiwym-figure-shortcode {
  background-color: #131924;
  border-color: #1e293b;
  color: #cbd5e1;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-figure-shortcode .figure-caption {
  border-top-color: #1e293b;
  color: #94a3b8;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-figure-shortcode .figure-edit-icon {
  background-color: rgba(19, 25, 36, 0.9) !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

/* --- Figure Shortcode HTML Preview Styles --- */
.traven-preview .traven-figure {
  margin: 24px auto;
  padding: 16px;
  background-color: #f8fafc;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  box-sizing: border-box;
}

.traven-preview .traven-figure-caption {
  font-family: inherit !important;
  font-size: 0.85em;
  color: #71717a;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e4e4e7;
  text-align: center;
  font-weight: 500;
}

/* Layout Alignments (Preview) */
.traven-preview .traven-figure.align-left {
  margin: 12px auto 12px 0;
}
.traven-preview .traven-figure.align-left.size-small,
.traven-preview .traven-figure.align-left.size-medium {
  float: left;
  margin: 12px 16px 12px 0;
}
.traven-preview .traven-figure.align-right {
  margin: 12px 0 12px auto;
}
.traven-preview .traven-figure.align-right.size-small,
.traven-preview .traven-figure.align-right.size-medium {
  float: right;
  margin: 12px 0 12px 16px;
}
.traven-preview .traven-figure.align-center {
  margin: 24px auto;
}
.traven-preview .traven-figure.align-fullbleed {
  width: 100% !important;
  max-width: 100% !important;
  margin: 24px 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
}

/* Sizes (Preview) */
.traven-preview .traven-figure.size-small {
  width: 250px;
}
.traven-preview .traven-figure.size-medium {
  width: 450px;
}
.traven-preview .traven-figure.size-large {
  width: 650px;
}
.traven-preview .traven-figure.size-full {
  width: 100%;
}

/* Preview Dark Mode overrides */
.traven-preview.cm-wysiwym-dark .traven-figure {
  background-color: #131924 !important;
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

.traven-preview.cm-wysiwym-dark .traven-figure-caption {
  border-top-color: #1e293b !important;
  color: #94a3b8 !important;
}

/* LaTeX Math Fallback Styles */
.cm-wysiwym-inline-math-widget {
  font-family: 'JetBrains Mono', monospace !important;
  background-color: transparent !important;
  color: #18181b !important;
  padding: 2px 4px !important;
  border-radius: 3px !important;
  font-size: 0.9em !important;
}

.cm-wysiwym-block-math-widget {
  font-family: 'JetBrains Mono', monospace !important;
  background-color: transparent !important;
  color: #18181b !important;
  margin: 12px auto !important;
  text-align: center !important;
  padding: 8px 12px !important;
  border-radius: 6px !important;
  font-size: 0.9em !important;
}

.katex-display-fallback {
  text-align: center;
  margin: 12px auto;
  font-family: 'JetBrains Mono', monospace;
  padding: 8px 12px;
  background-color: #f4f4f5;
  border-radius: 6px;
  color: #18181b;
  font-size: 0.9em;
}

.katex-inline-fallback {
  font-family: 'JetBrains Mono', monospace;
  background-color: #f4f4f5;
  padding: 2px 4px;
  border-radius: 3px;
  color: #18181b;
  font-size: 0.9em;
}

/* Dark mode math overrides */
.cm-editor.cm-wysiwym-dark .cm-wysiwym-inline-math-widget {
  background-color: transparent !important;
  color: #e4e4e7 !important;
}

.cm-editor.cm-wysiwym-dark .cm-wysiwym-block-math-widget {
  background-color: transparent !important;
  color: #e4e4e7 !important;
}

.traven-preview.cm-wysiwym-dark .katex-display-fallback {
  background-color: #131924;
  color: #e4e4e7;
}

.traven-preview.cm-wysiwym-dark .katex-inline-fallback {
  background-color: #131924;
  color: #e4e4e7;
}

/* Component Headers (both preview and editor) */
.traven-component-header,
.cm-wysiwym-component-shortcode .component-header {
  font-family: var(--traven-sans-font, sans-serif);
  font-weight: 700;
  font-size: 0.85em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  user-select: none;
}

/* Collapsible (Details/Summary) Styling */
summary.traven-component-header,
summary.component-header {
  cursor: pointer;
  outline: none;
  list-style: none;
}

summary.traven-component-header::-webkit-details-marker,
summary.component-header::-webkit-details-marker {
  display: none;
}

/* Custom expand/collapse indicator arrow */
summary.traven-component-header::after,
summary.component-header::after {
  content: "▼";
  font-size: 0.75em;
  margin-left: 8px;
  transition: transform 0.2s ease;
  opacity: 0.7;
  display: inline-block;
}

details[open] summary.traven-component-header::after,
details[open] summary.component-header::after {
  transform: rotate(-180deg);
}

/* Remove bottom margin on headers when the collapsible box is closed to center the title vertically */
details:not([open]) .traven-component-header,
details:not([open]) .component-header {
  margin-bottom: 0 !important;
}


/* Ensure shortcode containers cascade the body typeface to their child elements */
.cm-wysiwym-image-shortcode-container,
.cm-wysiwym-video-shortcode-container,
.cm-wysiwym-audio-shortcode-container,
.cm-wysiwym-figure-shortcode,
.traven-preview figure.traven-image-figure,
.traven-preview figure.traven-video-figure,
.traven-preview figure.traven-audio-figure,
.traven-preview .traven-figure {
  font-family: inherit !important;
}

/* Task List styling in HTML Preview */
.traven-preview .task-list-item {
  list-style-type: none;
}
.traven-preview .task-list-item > input[type="checkbox"] {
  margin-left: -1.4em;
  margin-right: 0.4em;
}

/* --- Legacy PenCMS figure helpers (until PHP matches Traven) --- */
.traven-preview .gallery-single,
.traven-preview .figure-full {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  clear: both;
}
.traven-preview .gallery-single .caption,
.traven-preview .figure-full .caption {
  font-family: var(--traven-font-display);
  font-size: 0.85rem;
  color: #71717a;
  text-align: center;
  margin-top: 0.5rem;
  line-height: 1.4;
}
.traven-preview.cm-wysiwym-dark .gallery-single .caption,
.traven-preview.cm-wysiwym-dark .figure-full .caption {
  color: #a1a1aa;
}
