/*
 * Action Text content styles (for rendered rich text)
 * Lexxy editor styles are loaded from gem's lexxy.css
 * These styles apply to rendered .lexxy-content containers
 */

@layer components {
  /* Editor wrapper - increase minimum height */
  .lexxy-editor,
  lexxy-editor,
  .trix-content,
  trix-editor {
    min-height: 300px;
  }

  /* Base content container */
  .lexxy-content {
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .lexxy-content * {
    box-sizing: border-box;
  }

  /* Typography */
  .lexxy-content p {
    margin: 0 0 1rem;
  }

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

  .lexxy-content h1,
  .lexxy-content h2,
  .lexxy-content h3,
  .lexxy-content h4,
  .lexxy-content h5,
  .lexxy-content h6 {
    font-weight: 600;
    line-height: 1.3;
    margin: 1.5rem 0 0.75rem;
  }

  .lexxy-content h1:first-child,
  .lexxy-content h2:first-child,
  .lexxy-content h3:first-child {
    margin-top: 0;
  }

  .lexxy-content h1 { font-size: 1.75rem; }
  .lexxy-content h2 { font-size: 1.5rem; }
  .lexxy-content h3 { font-size: 1.25rem; }
  .lexxy-content h4 { font-size: 1.125rem; }

  /* Links */
  .lexxy-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .lexxy-content a:hover {
    text-decoration-thickness: 2px;
  }

  /* Lists */
  .lexxy-content ul,
  .lexxy-content ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
  }

  .lexxy-content li {
    margin-bottom: 0.25rem;
  }

  .lexxy-content li:last-child {
    margin-bottom: 0;
  }

  .lexxy-content ul {
    list-style: disc;
  }

  .lexxy-content ol {
    list-style: decimal;
  }

  .lexxy-content ul ul,
  .lexxy-content ol ol,
  .lexxy-content ul ol,
  .lexxy-content ol ul {
    margin-top: 0.25rem;
    margin-bottom: 0;
  }

  /* Blockquotes */
  .lexxy-content blockquote {
    border-left: 3px solid var(--color-border);
    margin: 1rem 0;
    padding: 0.5rem 0 0.5rem 1rem;
    color: var(--color-muted);
  }

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

  /* Code */
  .lexxy-content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--color-surface);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
  }

  .lexxy-content pre {
    background: var(--color-surface);
    border-radius: 8px;
    margin: 1rem 0;
    padding: 1rem;
    overflow-x: auto;
  }

  .lexxy-content pre code {
    background: none;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.5;
  }

  /* Images */
  .lexxy-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
  }

  /* Attachments */
  .lexxy-content .attachment {
    display: inline-block;
    position: relative;
    max-width: 100%;
  }

  .lexxy-content .attachment a {
    color: inherit;
    text-decoration: none;
  }

  .lexxy-content .attachment__caption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-muted);
    margin-top: 0.5rem;
  }

  .lexxy-content .attachment--preview {
    width: 100%;
    text-align: center;
  }

  .lexxy-content .attachment--file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
  }

  /* Horizontal rule */
  .lexxy-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1.5rem 0;
  }

  /* Tables */
  .lexxy-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
  }

  .lexxy-content th,
  .lexxy-content td {
    border: 1px solid var(--color-border);
    padding: 0.5rem 0.75rem;
    text-align: left;
  }

  .lexxy-content th {
    background: var(--color-surface);
    font-weight: 600;
  }

  /* Strong and emphasis */
  .lexxy-content strong {
    font-weight: 600;
  }

  .lexxy-content em {
    font-style: italic;
  }

  /* Strikethrough */
  .lexxy-content s,
  .lexxy-content del {
    text-decoration: line-through;
  }
}
