/* Wagtail Rich Text Content Styles */

/* Preserve Wagtail styling by making sure it doesn't get overridden by Tailwind */
.wagtail-content {
    /* Ensure proper text styling */
    line-height: 1.5;
    font-size: inherit;
    color: inherit;
}

/* Preserve headings styling from Wagtail */
.wagtail-content h1,
.wagtail-content h2,
.wagtail-content h3,
.wagtail-content h4,
.wagtail-content h5,
.wagtail-content h6 {
    font-weight: bold;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    line-height: 1.2;
}

.wagtail-content h1 { font-size: 2em; }
.wagtail-content h2 { font-size: 1.75em; }
.wagtail-content h3 { font-size: 1.5em; }
.wagtail-content h4 { font-size: 1.25em; }
.wagtail-content h5 { font-size: 1.125em; }
.wagtail-content h6 { font-size: 1em; }

/* Paragraph spacing */
.wagtail-content p {
    margin-bottom: 1em;
}

/* Lists */
.wagtail-content ul,
.wagtail-content ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.wagtail-content ul {
    list-style-type: disc;
}

.wagtail-content ol {
    list-style-type: decimal;
}

.wagtail-content li {
    margin-bottom: 0.5em;
}

/* Links */
.wagtail-content a {
    color: #2563eb; /* Tailwind blue-600 */
}

.wagtail-content a:hover {
    color: #1d4ed8; /* Tailwind blue-700 */
}

/* Blockquotes */
.wagtail-content blockquote {
    border-left: 4px solid #e5e7eb; /* Tailwind gray-200 */
    padding-left: 1em;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 1em;
    font-style: italic;
    color: #6b7280; /* Tailwind gray-500 */
}

/* Tables */
.wagtail-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.wagtail-content th,
.wagtail-content td {
    border: 1px solid #e5e7eb; /* Tailwind gray-200 */
    padding: 0.5em;
}

.wagtail-content th {
    background-color: #f9fafb; /* Tailwind gray-50 */
    font-weight: bold;
}

/* Images */
.wagtail-content img {
    max-width: 100%;
    height: auto;
    margin-bottom: 1em;
}

/* Code blocks */
.wagtail-content pre,
.wagtail-content code {
    background-color: #f3f4f6; /* Tailwind gray-100 */
    border-radius: 0.25rem;
    padding: 0.125em 0.25em;
    font-family: monospace;
}

.wagtail-content pre {
    padding: 1em;
    overflow-x: auto;
    margin-bottom: 1em;
}

.wagtail-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

/* Horizontal rule */
.wagtail-content hr {
    border: 0;
    border-top: 1px solid #e5e7eb; /* Tailwind gray-200 */
    margin: 2em 0;
}

/* Ensure Wagtail's alignment classes work */
.wagtail-content .richtext-image.left {
    float: left;
    margin-right: 1em;
    margin-bottom: 1em;
}

.wagtail-content .richtext-image.right {
    float: right;
    margin-left: 1em;
    margin-bottom: 1em;
}

.wagtail-content .richtext-image.full-width {
    width: 100%;
    margin-bottom: 1em;
}