/* Site layout helpers for LayoutRenderer */
.lords-layout .theme-rightSidebar,
.lords-layout .theme-leftSidebar {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 8px;
  align-items: start;
}

.lords-layout .theme-leftSidebar {
  grid-template-columns: 250px 1fr;
}

.lords-layout .theme-bothSidebars {
  display: grid;
  grid-template-columns: 250px 1fr 330px;
  gap: 8px;
  align-items: start;
}

.lords-layout .theme-noSidebar {
  display: block;
}

.lords-layout .theme-rightSidebar .main-area,
.lords-layout .theme-leftSidebar .main-area,
.lords-layout .theme-bothSidebars .main-area {
  min-width: 0;
}

.lords-layout .theme-rightSidebar .rail-area,
.lords-layout .theme-leftSidebar .rail-area,
.lords-layout .theme-bothSidebars .rail-area {
  position: sticky;
  height: fit-content;
  display: grid;
  gap: 12px;
}

@media (max-width: 1024px) {
  .lords-layout .theme-rightSidebar,
  .lords-layout .theme-leftSidebar,
  .lords-layout .theme-bothSidebars {
    grid-template-columns: 1fr;
  }
  .lords-layout .theme-rightSidebar .rail-area,
  .lords-layout .theme-leftSidebar .rail-area,
  .lords-layout .theme-bothSidebars .rail-area {
    position: static;
  }
}

/* Lightweight "prose" styles for CMS content */
.prose {
  color: #0f172a;
  line-height: 1.75;
  max-width: 65ch;
}
/* Allow opting out of the default 65ch width */
.prose.max-w-none {
  max-width: none;
}
.prose.prose-sm {
  font-size: 0.95rem;
}
.prose h1 {
  font-size: 1.875rem;
  line-height: 1.2;
  margin: 1.2em 0 0.6em;
  font-weight: 700;
}
.prose h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 1.1em 0 0.5em;
  font-weight: 600;
}
.prose h3 {
  font-size: 1.25rem;
  line-height: 1.4;
  margin: 1em 0 0.5em;
  font-weight: 600;
}
.prose p {
  margin: 0.75em 0;
}
.prose ul {
  margin: 0.75em 0 0.75em 1.25em;
  list-style: disc;
}
.prose ol {
  margin: 0.75em 0 0.75em 1.25em;
  list-style: decimal;
}
.prose li {
  margin: 0.25em 0;
}
.prose a {
  color: #2563eb;
  text-decoration: underline;
}
.prose blockquote {
  border-left: 4px solid #cbd5e1;
  margin: 1em 0;
  padding: 0.5em 0.75em;
  color: #475569;
  background: #f8fafc;
}
.prose hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 1.5em 0;
}

/* Inline code */
.prose :not(pre) > code {
  background: #e2e8f0;
  color: #0f172a;
  padding: 0.15em 0.35em;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

/* Code blocks */
.prose pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.9em 1em;
  border-radius: 8px;
  overflow: auto;
}
.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 0.9em;
  display: block;
}
.prose code[class^="language-"],
.prose code[class*=" language-"] {
  background: transparent;
}

/* Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95em;
}
.prose th,
.prose td {
  border: 1px solid #e2e8f0;
  padding: 0.5em 0.6em;
  text-align: left;
}
.prose thead th {
  background: #f1f5f9;
}

/* Images */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* Inverted (dark) prose variant */
.dark .prose.prose-invert {
  color: #e2e8f0;
}
.dark .prose.prose-invert a {
  color: #93c5fd;
}
.dark .prose.prose-invert blockquote {
  border-left-color: #475569;
  background: #0b1220;
  color: #cbd5e1;
}
.dark .prose.prose-invert hr {
  border-top-color: #334155;
}
.dark .prose.prose-invert :not(pre) > code {
  background: #1f2937;
  color: #e5e7eb;
}
.dark .prose.prose-invert pre {
  background: #0b1220;
  color: #e5e7eb;
}

/* Map Lexical (exported) theme classes to our prose styles */
.prose .editor-paragraph,
.editor-paragraph {
  margin: 0.75em 0;
}
.prose .editor-quote,
.editor-quote {
  border-left: 4px solid #cbd5e1;
  margin: 1em 0;
  padding: 0.5em 0.75em;
  color: #475569;
  background: #f8fafc;
}
.prose .editor-h1,
.editor-h1 {
  font-size: 1.875rem;
  line-height: 1.2;
  margin: 1.2em 0 0.6em;
  font-weight: 700;
}
.prose .editor-h2,
.editor-h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 1.1em 0 0.5em;
  font-weight: 600;
}
.prose .editor-h3,
.editor-h3 {
  font-size: 1.25rem;
  line-height: 1.4;
  margin: 1em 0 0.5em;
  font-weight: 600;
}
.prose .editor-ul,
.editor-ul {
  margin: 0.75em 0 0.75em 1.25em;
  list-style: disc;
}
.prose .editor-ol,
.editor-ol {
  margin: 0.75em 0 0.75em 1.25em;
  list-style: decimal;
}
.prose .editor-li,
.editor-li {
  margin: 0.25em 0;
}
.prose .editor-link,
.editor-link {
  color: #2563eb;
  text-decoration: underline;
}
.prose .editor-code,
.editor-code {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.9em 1em;
  border-radius: 8px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.prose .editor-text-bold,
.editor-text-bold {
  font-weight: 700;
}
.prose .editor-text-italic,
.editor-text-italic {
  font-style: italic;
}
.prose .editor-text-underline,
.editor-text-underline {
  text-decoration: underline;
}
.prose .editor-text-strikethrough,
.editor-text-strikethrough {
  text-decoration: line-through;
}
.prose .editor-text-code,
.editor-text-code {
  background: #e2e8f0;
  color: #0f172a;
  padding: 0.15em 0.35em;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

.dark .prose.prose-invert .editor-quote,
.dark .editor-quote {
  border-left-color: #475569;
  background: #0b1220;
  color: #cbd5e1;
}
.dark .prose.prose-invert .editor-link,
.dark .editor-link {
  color: #93c5fd;
}
.dark .prose.prose-invert .editor-code,
.dark .editor-code {
  background: #0b1220;
  color: #e5e7eb;
}
.dark .prose.prose-invert .editor-text-code,
.dark .editor-text-code {
  background: #1f2937;
  color: #e5e7eb;
}
